trqVue/public/CloudSign/pdf-2fded77233.viewer.js
2025-03-09 19:40:08 +08:00

73956 lines
3.4 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function (e, t) {
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define("pdfjs-dist/build/pdf", [], t) : "object" == typeof exports ? exports["pdfjs-dist/build/pdf"] = t() : e["pdfjs-dist/build/pdf"] = e.pdfjsDistBuildPdf = t()
}("undefined" != typeof self ? self : this, function () {
return function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {i: r, l: !1, exports: {}};
return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports
}
return n.m = e, n.c = t, n.d = function (e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: r})
}, n.n = function (e) {
var t = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return n.d(t, "a", t), t
}, n.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 98)
}([function (e, t, n) {
"use strict";
var r = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = r)
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.unreachable = t.warn = t.utf8StringToString = t.stringToUTF8String = t.stringToPDFString = t.stringToBytes = t.string32 = t.shadow = t.setVerbosityLevel = t.ReadableStream = t.removeNullCharacters = t.readUint32 = t.readUint16 = t.readInt8 = t.log2 = t.loadJpegStream = t.isEvalSupported = t.isLittleEndian = t.createValidAbsoluteUrl = t.isSameOrigin = t.isNodeJS = t.isSpace = t.isString = t.isNum = t.isEmptyObj = t.isBool = t.isArrayBuffer = t.info = t.getVerbosityLevel = t.getLookupTableFactory = t.deprecated = t.createObjectURL = t.createPromiseCapability = t.createBlob = t.bytesToString = t.assert = t.arraysToBytes = t.arrayByteLength = t.FormatError = t.XRefParseException = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.TextRenderingMode = t.StreamType = t.StatTimer = t.PasswordResponses = t.PasswordException = t.PageViewport = t.NotImplementedException = t.NativeImageDecoding = t.MissingPDFException = t.MissingDataException = t.MessageHandler = t.InvalidPDFException = t.AbortException = t.CMapCompressionType = t.ImageKind = t.FontType = t.AnnotationType = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationBorderStyleType = t.UNSUPPORTED_FEATURES = t.VERBOSITY_LEVELS = t.OPS = t.IDENTITY_MATRIX = t.FONT_IDENTITY_MATRIX = t.BaseException = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
n(99);
var i = n(140), a = {errors: 0, warnings: 1, infos: 5}, o = a.warnings;
function s(e) {
o >= a.warnings && console.log("Warning: " + e)
}
function l(e) {
throw new Error(e)
}
function c(e, t) {
e || l(t)
}
var u = function () {
function e(e, t) {
this.name = "PasswordException", this.message = e, this.code = t
}
return e.prototype = new Error, e.constructor = e, e
}(), d = function () {
function e(e, t) {
this.name = "UnknownErrorException", this.message = e, this.details = t
}
return e.prototype = new Error, e.constructor = e, e
}(), h = function () {
function e(e) {
this.name = "InvalidPDFException", this.message = e
}
return e.prototype = new Error, e.constructor = e, e
}(), p = function () {
function e(e) {
this.name = "MissingPDFException", this.message = e
}
return e.prototype = new Error, e.constructor = e, e
}(), f = function () {
function e(e, t) {
this.name = "UnexpectedResponseException", this.message = e, this.status = t
}
return e.prototype = new Error, e.constructor = e, e
}(), m = function () {
function e(e) {
this.message = e
}
return e.prototype = new Error, e.prototype.name = "NotImplementedException", e.constructor = e, e
}(), v = function () {
function e(e, t) {
this.begin = e, this.end = t, this.message = "Missing data [" + e + ", " + t + ")"
}
return e.prototype = new Error, e.prototype.name = "MissingDataException", e.constructor = e, e
}(), g = function () {
function e(e) {
this.message = e
}
return e.prototype = new Error, e.prototype.name = "XRefParseException", e.constructor = e, e
}(), y = function () {
function e(e) {
this.message = e
}
return e.prototype = new Error, e.prototype.name = "FormatError", e.constructor = e, e
}(), b = function () {
function e(e) {
this.name = "AbortException", this.message = e
}
return e.prototype = new Error, e.constructor = e, e
}(), w = /\x00/g;
function S(e) {
c("string" == typeof e, "Invalid argument for stringToBytes");
for (var t = e.length, n = new Uint8Array(t), r = 0; r < t; ++r) n[r] = 255 & e.charCodeAt(r);
return n
}
function _(e) {
return void 0 !== e.length ? e.length : (c(void 0 !== e.byteLength), e.byteLength)
}
var k = function () {
function e() {
}
var t = ["rgb(", 0, ",", 0, ",", 0, ")"];
e.makeCssRgb = function (e, n, r) {
return t[1] = e, t[3] = n, t[5] = r, t.join("")
}, e.transform = function (e, t) {
return [e[0] * t[0] + e[2] * t[1], e[1] * t[0] + e[3] * t[1], e[0] * t[2] + e[2] * t[3], e[1] * t[2] + e[3] * t[3], e[0] * t[4] + e[2] * t[5] + e[4], e[1] * t[4] + e[3] * t[5] + e[5]]
}, e.applyTransform = function (e, t) {
return [e[0] * t[0] + e[1] * t[2] + t[4], e[0] * t[1] + e[1] * t[3] + t[5]]
}, e.applyInverseTransform = function (e, t) {
var n = t[0] * t[3] - t[1] * t[2];
return [(e[0] * t[3] - e[1] * t[2] + t[2] * t[5] - t[4] * t[3]) / n, (-e[0] * t[1] + e[1] * t[0] + t[4] * t[1] - t[5] * t[0]) / n]
}, e.getAxialAlignedBoundingBox = function (t, n) {
var r = e.applyTransform(t, n), i = e.applyTransform(t.slice(2, 4), n), a = e.applyTransform([t[0], t[3]], n),
o = e.applyTransform([t[2], t[1]], n);
return [Math.min(r[0], i[0], a[0], o[0]), Math.min(r[1], i[1], a[1], o[1]), Math.max(r[0], i[0], a[0], o[0]), Math.max(r[1], i[1], a[1], o[1])]
}, e.inverseTransform = function (e) {
var t = e[0] * e[3] - e[1] * e[2];
return [e[3] / t, -e[1] / t, -e[2] / t, e[0] / t, (e[2] * e[5] - e[4] * e[3]) / t, (e[4] * e[1] - e[5] * e[0]) / t]
}, e.apply3dTransform = function (e, t) {
return [e[0] * t[0] + e[1] * t[1] + e[2] * t[2], e[3] * t[0] + e[4] * t[1] + e[5] * t[2], e[6] * t[0] + e[7] * t[1] + e[8] * t[2]]
}, e.singularValueDecompose2dScale = function (e) {
var t = [e[0], e[2], e[1], e[3]], n = e[0] * t[0] + e[1] * t[2], r = e[0] * t[1] + e[1] * t[3],
i = e[2] * t[0] + e[3] * t[2], a = e[2] * t[1] + e[3] * t[3], o = (n + a) / 2,
s = Math.sqrt((n + a) * (n + a) - 4 * (n * a - i * r)) / 2, l = o + s || 1, c = o - s || 1;
return [Math.sqrt(l), Math.sqrt(c)]
}, e.normalizeRect = function (e) {
var t = e.slice(0);
return e[0] > e[2] && (t[0] = e[2], t[2] = e[0]), e[1] > e[3] && (t[1] = e[3], t[3] = e[1]), t
}, e.intersect = function (t, n) {
function r(e, t) {
return e - t
}
var i = [t[0], t[2], n[0], n[2]].sort(r), a = [t[1], t[3], n[1], n[3]].sort(r), o = [];
return t = e.normalizeRect(t), n = e.normalizeRect(n), (i[0] === t[0] && i[1] === n[0] || i[0] === n[0] && i[1] === t[0]) && (o[0] = i[1], o[2] = i[2], (a[0] === t[1] && a[1] === n[1] || a[0] === n[1] && a[1] === t[1]) && (o[1] = a[1], o[3] = a[2], o))
};
var n = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"];
return e.toRoman = function (e, t) {
c(Number.isInteger(e) && e > 0, "The number should be a positive integer.");
for (var r, i = []; e >= 1e3;) e -= 1e3, i.push("M");
r = e / 100 | 0, e %= 100, i.push(n[r]), r = e / 10 | 0, e %= 10, i.push(n[10 + r]), i.push(n[20 + e]);
var a = i.join("");
return t ? a.toLowerCase() : a
}, e.appendToArray = function (e, t) {
Array.prototype.push.apply(e, t)
}, e.prependToArray = function (e, t) {
Array.prototype.unshift.apply(e, t)
}, e.extendObj = function (e, t) {
for (var n in t) e[n] = t[n]
}, e.getInheritableProperty = function (e, t, n) {
for (; e && !e.has(t);) e = e.get("Parent");
return e ? n ? e.getArray(t) : e.get(t) : null
}, e.inherit = function (e, t, n) {
for (var r in e.prototype = Object.create(t.prototype), e.prototype.constructor = e, n) e.prototype[r] = n[r]
}, e.loadScript = function (e, t) {
var n = document.createElement("script"), r = !1;
n.setAttribute("src", e), t && (n.onload = function () {
r || t(), r = !0
}), document.getElementsByTagName("head")[0].appendChild(n)
}, e
}(), x = function () {
function e(e, t, n, r, i, a) {
this.viewBox = e, this.scale = t, this.rotation = n, this.offsetX = r, this.offsetY = i;
var o, s, l, c, u, d, h, p, f = (e[2] + e[0]) / 2, m = (e[3] + e[1]) / 2;
switch (n = (n %= 360) < 0 ? n + 360 : n) {
case 180:
o = -1, s = 0, l = 0, c = 1;
break;
case 90:
o = 0, s = 1, l = 1, c = 0;
break;
case 270:
o = 0, s = -1, l = -1, c = 0;
break;
default:
o = 1, s = 0, l = 0, c = -1
}
a && (l = -l, c = -c), 0 === o ? (u = Math.abs(m - e[1]) * t + r, d = Math.abs(f - e[0]) * t + i, h = Math.abs(e[3] - e[1]) * t, p = Math.abs(e[2] - e[0]) * t) : (u = Math.abs(f - e[0]) * t + r, d = Math.abs(m - e[1]) * t + i, h = Math.abs(e[2] - e[0]) * t, p = Math.abs(e[3] - e[1]) * t), this.transform = [o * t, s * t, l * t, c * t, u - o * t * f - l * t * m, d - s * t * f - c * t * m], this.width = h, this.height = p, this.fontScale = t
}
return e.prototype = {
clone: function (t) {
var n = "scale" in (t = t || {}) ? t.scale : this.scale, r = "rotation" in t ? t.rotation : this.rotation;
return new e(this.viewBox.slice(), n, r, this.offsetX, this.offsetY, t.dontFlip)
}, convertToViewportPoint: function (e, t) {
return k.applyTransform([e, t], this.transform)
}, convertToViewportRectangle: function (e) {
var t = k.applyTransform([e[0], e[1]], this.transform), n = k.applyTransform([e[2], e[3]], this.transform);
return [t[0], t[1], n[0], n[1]]
}, convertToPdfPoint: function (e, t) {
return k.applyInverseTransform([e, t], this.transform)
}
}, e
}(),
P = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
function C() {
var e = {};
return e.promise = new Promise(function (t, n) {
e.resolve = t, e.reject = n
}), e
}
var A, T = function () {
function e(e, t, n) {
for (; e.length < n;) e += t;
return e
}
function t() {
this.started = Object.create(null), this.times = [], this.enabled = !0
}
return t.prototype = {
time: function (e) {
this.enabled && (e in this.started && s("Timer is already running for " + e), this.started[e] = Date.now())
}, timeEnd: function (e) {
this.enabled && (e in this.started || s("Timer has not been started for " + e), this.times.push({
name: e,
start: this.started[e],
end: Date.now()
}), delete this.started[e])
}, toString: function () {
var t, n, r = this.times, i = "", a = 0;
for (t = 0, n = r.length; t < n; ++t) {
var o = r[t].name;
o.length > a && (a = o.length)
}
for (t = 0, n = r.length; t < n; ++t) {
var s = r[t], l = s.end - s.start;
i += e(s.name, " ", a) + " " + l + "ms\n"
}
return i
}
}, t
}(), E = function (e, t) {
if ("undefined" != typeof Blob) return new Blob([e], {type: t});
throw new Error('The "Blob" constructor is not supported.')
}, D = (A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", function (e, t) {
if (!(arguments.length > 2 && void 0 !== arguments[2] && arguments[2]) && URL.createObjectURL) {
var n = E(e, t);
return URL.createObjectURL(n)
}
for (var r = "data:" + t + ";base64,", i = 0, a = e.length; i < a; i += 3) {
var o = 255 & e[i], s = 255 & e[i + 1], l = 255 & e[i + 2];
r += A[o >> 2] + A[(3 & o) << 4 | s >> 4] + A[i + 1 < a ? (15 & s) << 2 | l >> 6 : 64] + A[i + 2 < a ? 63 & l : 64]
}
return r
});
function I(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null;
return e ? new Promise(function (r, i) {
r(e.apply(n, t))
}) : Promise.resolve(void 0)
}
function L(e) {
if ("object" !== (void 0 === e ? "undefined" : r(e))) return e;
switch (e.name) {
case"AbortException":
return new b(e.message);
case"MissingPDFException":
return new p(e.message);
case"UnexpectedResponseException":
return new f(e.message, e.status);
default:
return new d(e.message, e.details)
}
}
function O(e, t, n) {
t ? e.resolve() : e.reject(n)
}
function M(e, t, n) {
var r = this;
this.sourceName = e, this.targetName = t, this.comObj = n, this.callbackId = 1, this.streamId = 1, this.postMessageTransfers = !0, this.streamSinks = Object.create(null), this.streamControllers = Object.create(null);
var i = this.callbacksCapabilities = Object.create(null), a = this.actionHandler = Object.create(null);
this._onComObjOnMessage = function (e) {
var t = e.data;
if (t.targetName === r.sourceName) if (t.stream) r._processStreamMessage(t); else if (t.isReply) {
var o = t.callbackId;
if (!(t.callbackId in i)) throw new Error("Cannot resolve callback " + o);
var s = i[o];
delete i[o], "error" in t ? s.reject(L(t.error)) : s.resolve(t.data)
} else {
if (!(t.action in a)) throw new Error("Unknown action from worker: " + t.action);
var l = a[t.action];
if (t.callbackId) {
var c = r.sourceName, u = t.sourceName;
Promise.resolve().then(function () {
return l[0].call(l[1], t.data)
}).then(function (e) {
n.postMessage({sourceName: c, targetName: u, isReply: !0, callbackId: t.callbackId, data: e})
}, function (e) {
n.postMessage({
sourceName: c, targetName: u, isReply: !0, callbackId: t.callbackId, error: function (e) {
return !(e instanceof Error) || e instanceof b || e instanceof p || e instanceof f || e instanceof d ? e : new d(e.message, e.toString())
}(e)
})
})
} else t.streamId ? r._createStreamSink(t) : l[0].call(l[1], t.data)
}
}, n.addEventListener("message", this._onComObjOnMessage)
}
M.prototype = {
on: function (e, t, n) {
var r = this.actionHandler;
if (r[e]) throw new Error('There is already an actionName called "' + e + '"');
r[e] = [t, n]
}, send: function (e, t, n) {
var r = {sourceName: this.sourceName, targetName: this.targetName, action: e, data: t};
this.postMessage(r, n)
}, sendWithPromise: function (e, t, n) {
var r = this.callbackId++,
i = {sourceName: this.sourceName, targetName: this.targetName, action: e, data: t, callbackId: r}, a = C();
this.callbacksCapabilities[r] = a;
try {
this.postMessage(i, n)
} catch (e) {
a.reject(e)
}
return a.promise
}, sendWithStream: function (e, t, n, r) {
var a = this, o = this.streamId++, s = this.sourceName, l = this.targetName;
return new i.ReadableStream({
start: function (n) {
var r = C();
return a.streamControllers[o] = {controller: n, startCall: r, isClosed: !1}, a.postMessage({
sourceName: s,
targetName: l,
action: e,
streamId: o,
data: t,
desiredSize: n.desiredSize
}), r.promise
}, pull: function (e) {
var t = C();
return a.streamControllers[o].pullCall = t, a.postMessage({
sourceName: s,
targetName: l,
stream: "pull",
streamId: o,
desiredSize: e.desiredSize
}), t.promise
}, cancel: function (e) {
var t = C();
return a.streamControllers[o].cancelCall = t, a.streamControllers[o].isClosed = !0, a.postMessage({
sourceName: s,
targetName: l,
stream: "cancel",
reason: e,
streamId: o
}), t.promise
}
}, n)
}, _createStreamSink: function (e) {
var t = this, n = this, r = this.actionHandler[e.action], i = e.streamId, a = e.desiredSize,
o = this.sourceName, s = e.sourceName, l = function (e) {
var n = e.stream, r = e.chunk, a = e.transfers, l = e.success, c = e.reason;
t.postMessage({sourceName: o, targetName: s, stream: n, streamId: i, chunk: r, success: l, reason: c}, a)
}, c = {
enqueue: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments[2];
if (!this.isCancelled) {
var r = this.desiredSize;
this.desiredSize -= t, r > 0 && this.desiredSize <= 0 && (this.sinkCapability = C(), this.ready = this.sinkCapability.promise), l({
stream: "enqueue",
chunk: e,
transfers: n
})
}
}, close: function () {
this.isCancelled || (this.isCancelled = !0, l({stream: "close"}), delete n.streamSinks[i])
}, error: function (e) {
this.isCancelled || (this.isCancelled = !0, l({stream: "error", reason: e}))
}, sinkCapability: C(), onPull: null, onCancel: null, isCancelled: !1, desiredSize: a, ready: null
};
c.sinkCapability.resolve(), c.ready = c.sinkCapability.promise, this.streamSinks[i] = c, I(r[0], [e.data, c], r[1]).then(function () {
l({stream: "start_complete", success: !0})
}, function (e) {
l({stream: "start_complete", success: !1, reason: e})
})
}, _processStreamMessage: function (e) {
var t = this, n = this.sourceName, r = e.sourceName, i = e.streamId, a = function (e) {
var a = e.stream, o = e.success, s = e.reason;
t.comObj.postMessage({sourceName: n, targetName: r, stream: a, success: o, streamId: i, reason: s})
}, o = function () {
Promise.all([t.streamControllers[e.streamId].startCall, t.streamControllers[e.streamId].pullCall, t.streamControllers[e.streamId].cancelCall].map(function (e) {
return e && (t = e.promise, Promise.resolve(t).catch(function () {
}));
var t
})).then(function () {
delete t.streamControllers[e.streamId]
})
};
switch (e.stream) {
case"start_complete":
O(this.streamControllers[e.streamId].startCall, e.success, L(e.reason));
break;
case"pull_complete":
O(this.streamControllers[e.streamId].pullCall, e.success, L(e.reason));
break;
case"pull":
if (!this.streamSinks[e.streamId]) {
a({stream: "pull_complete", success: !0});
break
}
this.streamSinks[e.streamId].desiredSize <= 0 && e.desiredSize > 0 && this.streamSinks[e.streamId].sinkCapability.resolve(), this.streamSinks[e.streamId].desiredSize = e.desiredSize, I(this.streamSinks[e.streamId].onPull).then(function () {
a({stream: "pull_complete", success: !0})
}, function (e) {
a({stream: "pull_complete", success: !1, reason: e})
});
break;
case"enqueue":
c(this.streamControllers[e.streamId], "enqueue should have stream controller"), this.streamControllers[e.streamId].isClosed || this.streamControllers[e.streamId].controller.enqueue(e.chunk);
break;
case"close":
if (c(this.streamControllers[e.streamId], "close should have stream controller"), this.streamControllers[e.streamId].isClosed) break;
this.streamControllers[e.streamId].isClosed = !0, this.streamControllers[e.streamId].controller.close(), o();
break;
case"error":
c(this.streamControllers[e.streamId], "error should have stream controller"), this.streamControllers[e.streamId].controller.error(L(e.reason)), o();
break;
case"cancel_complete":
O(this.streamControllers[e.streamId].cancelCall, e.success, L(e.reason)), o();
break;
case"cancel":
if (!this.streamSinks[e.streamId]) break;
I(this.streamSinks[e.streamId].onCancel, [L(e.reason)]).then(function () {
a({stream: "cancel_complete", success: !0})
}, function (e) {
a({stream: "cancel_complete", success: !1, reason: e})
}), this.streamSinks[e.streamId].sinkCapability.reject(L(e.reason)), this.streamSinks[e.streamId].isCancelled = !0, delete this.streamSinks[e.streamId];
break;
default:
throw new Error("Unexpected stream case")
}
}, postMessage: function (e, t) {
t && this.postMessageTransfers ? this.comObj.postMessage(e, t) : this.comObj.postMessage(e)
}, destroy: function () {
this.comObj.removeEventListener("message", this._onComObjOnMessage)
}
};
var N = function () {
function e(t, n) {
this.constructor === e && l("Cannot initialize BaseException."), this.message = t, this.name = n
}
return e.prototype = new Error, e.constructor = e, e
}();
t.BaseException = N, t.FONT_IDENTITY_MATRIX = [.001, 0, 0, .001, 0, 0], t.IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0], t.OPS = {
dependency: 1,
setLineWidth: 2,
setLineCap: 3,
setLineJoin: 4,
setMiterLimit: 5,
setDash: 6,
setRenderingIntent: 7,
setFlatness: 8,
setGState: 9,
save: 10,
restore: 11,
transform: 12,
moveTo: 13,
lineTo: 14,
curveTo: 15,
curveTo2: 16,
curveTo3: 17,
closePath: 18,
rectangle: 19,
stroke: 20,
closeStroke: 21,
fill: 22,
eoFill: 23,
fillStroke: 24,
eoFillStroke: 25,
closeFillStroke: 26,
closeEOFillStroke: 27,
endPath: 28,
clip: 29,
eoClip: 30,
beginText: 31,
endText: 32,
setCharSpacing: 33,
setWordSpacing: 34,
setHScale: 35,
setLeading: 36,
setFont: 37,
setTextRenderingMode: 38,
setTextRise: 39,
moveText: 40,
setLeadingMoveText: 41,
setTextMatrix: 42,
nextLine: 43,
showText: 44,
showSpacedText: 45,
nextLineShowText: 46,
nextLineSetSpacingShowText: 47,
setCharWidth: 48,
setCharWidthAndBounds: 49,
setStrokeColorSpace: 50,
setFillColorSpace: 51,
setStrokeColor: 52,
setStrokeColorN: 53,
setFillColor: 54,
setFillColorN: 55,
setStrokeGray: 56,
setFillGray: 57,
setStrokeRGBColor: 58,
setFillRGBColor: 59,
setStrokeCMYKColor: 60,
setFillCMYKColor: 61,
shadingFill: 62,
beginInlineImage: 63,
beginImageData: 64,
endInlineImage: 65,
paintXObject: 66,
markPoint: 67,
markPointProps: 68,
beginMarkedContent: 69,
beginMarkedContentProps: 70,
endMarkedContent: 71,
beginCompat: 72,
endCompat: 73,
paintFormXObjectBegin: 74,
paintFormXObjectEnd: 75,
beginGroup: 76,
endGroup: 77,
beginAnnotations: 78,
endAnnotations: 79,
beginAnnotation: 80,
endAnnotation: 81,
paintJpegXObject: 82,
paintImageMaskXObject: 83,
paintImageMaskXObjectGroup: 84,
paintImageXObject: 85,
paintInlineImageXObject: 86,
paintInlineImageXObjectGroup: 87,
paintImageXObjectRepeat: 88,
paintImageMaskXObjectRepeat: 89,
paintSolidColorImageMask: 90,
constructPath: 91
}, t.VERBOSITY_LEVELS = a, t.UNSUPPORTED_FEATURES = {
unknown: "unknown",
forms: "forms",
javaScript: "javaScript",
smask: "smask",
shadingPattern: "shadingPattern",
font: "font"
}, t.AnnotationBorderStyleType = {
SOLID: 1,
DASHED: 2,
BEVELED: 3,
INSET: 4,
UNDERLINE: 5
}, t.AnnotationFieldFlag = {
READONLY: 1,
REQUIRED: 2,
NOEXPORT: 4,
MULTILINE: 4096,
PASSWORD: 8192,
NOTOGGLETOOFF: 16384,
RADIO: 32768,
PUSHBUTTON: 65536,
COMBO: 131072,
EDIT: 262144,
SORT: 524288,
FILESELECT: 1048576,
MULTISELECT: 2097152,
DONOTSPELLCHECK: 4194304,
DONOTSCROLL: 8388608,
COMB: 16777216,
RICHTEXT: 33554432,
RADIOSINUNISON: 33554432,
COMMITONSELCHANGE: 67108864
}, t.AnnotationFlag = {
INVISIBLE: 1,
HIDDEN: 2,
PRINT: 4,
NOZOOM: 8,
NOROTATE: 16,
NOVIEW: 32,
READONLY: 64,
LOCKED: 128,
TOGGLENOVIEW: 256,
LOCKEDCONTENTS: 512
}, t.AnnotationType = {
TEXT: 1,
LINK: 2,
FREETEXT: 3,
LINE: 4,
SQUARE: 5,
CIRCLE: 6,
POLYGON: 7,
POLYLINE: 8,
HIGHLIGHT: 9,
UNDERLINE: 10,
SQUIGGLY: 11,
STRIKEOUT: 12,
STAMP: 13,
CARET: 14,
INK: 15,
POPUP: 16,
FILEATTACHMENT: 17,
SOUND: 18,
MOVIE: 19,
WIDGET: 20,
SCREEN: 21,
PRINTERMARK: 22,
TRAPNET: 23,
WATERMARK: 24,
THREED: 25,
REDACT: 26
}, t.FontType = {
UNKNOWN: 0,
TYPE1: 1,
TYPE1C: 2,
CIDFONTTYPE0: 3,
CIDFONTTYPE0C: 4,
TRUETYPE: 5,
CIDFONTTYPE2: 6,
TYPE3: 7,
OPENTYPE: 8,
TYPE0: 9,
MMTYPE1: 10
}, t.ImageKind = {GRAYSCALE_1BPP: 1, RGB_24BPP: 2, RGBA_32BPP: 3}, t.CMapCompressionType = {
NONE: 0,
BINARY: 1,
STREAM: 2
}, t.AbortException = b, t.InvalidPDFException = h, t.MessageHandler = M, t.MissingDataException = v, t.MissingPDFException = p, t.NativeImageDecoding = {
NONE: "none",
DECODE: "decode",
DISPLAY: "display"
}, t.NotImplementedException = m, t.PageViewport = x, t.PasswordException = u, t.PasswordResponses = {
NEED_PASSWORD: 1,
INCORRECT_PASSWORD: 2
}, t.StatTimer = T, t.StreamType = {
UNKNOWN: 0,
FLATE: 1,
LZW: 2,
DCT: 3,
JPX: 4,
JBIG: 5,
A85: 6,
AHX: 7,
CCF: 8,
RL: 9
}, t.TextRenderingMode = {
FILL: 0,
STROKE: 1,
FILL_STROKE: 2,
INVISIBLE: 3,
FILL_ADD_TO_PATH: 4,
STROKE_ADD_TO_PATH: 5,
FILL_STROKE_ADD_TO_PATH: 6,
ADD_TO_PATH: 7,
FILL_STROKE_MASK: 3,
ADD_TO_PATH_FLAG: 4
}, t.UnexpectedResponseException = f, t.UnknownErrorException = d, t.Util = k, t.XRefParseException = g, t.FormatError = y, t.arrayByteLength = _, t.arraysToBytes = function (e) {
if (1 === e.length && e[0] instanceof Uint8Array) return e[0];
var t, n, r, i = 0, a = e.length;
for (t = 0; t < a; t++) i += r = _(n = e[t]);
var o = 0, s = new Uint8Array(i);
for (t = 0; t < a; t++) (n = e[t]) instanceof Uint8Array || (n = "string" == typeof n ? S(n) : new Uint8Array(n)), r = n.byteLength, s.set(n, o), o += r;
return s
}, t.assert = c, t.bytesToString = function (e) {
c(null !== e && "object" === (void 0 === e ? "undefined" : r(e)) && void 0 !== e.length, "Invalid argument for bytesToString");
var t = e.length;
if (t < 8192) return String.fromCharCode.apply(null, e);
for (var n = [], i = 0; i < t; i += 8192) {
var a = Math.min(i + 8192, t), o = e.subarray(i, a);
n.push(String.fromCharCode.apply(null, o))
}
return n.join("")
}, t.createBlob = E, t.createPromiseCapability = C, t.createObjectURL = D, t.deprecated = function (e) {
console.log("Deprecated API usage: " + e)
}, t.getLookupTableFactory = function (e) {
var t;
return function () {
return e && (t = Object.create(null), e(t), e = null), t
}
}, t.getVerbosityLevel = function () {
return o
}, t.info = function (e) {
o >= a.infos && console.log("Info: " + e)
}, t.isArrayBuffer = function (e) {
return "object" === (void 0 === e ? "undefined" : r(e)) && null !== e && void 0 !== e.byteLength
}, t.isBool = function (e) {
return "boolean" == typeof e
}, t.isEmptyObj = function (e) {
for (var t in e) return !1;
return !0
}, t.isNum = function (e) {
return "number" == typeof e
}, t.isString = function (e) {
return "string" == typeof e
}, t.isSpace = function (e) {
return 32 === e || 9 === e || 13 === e || 10 === e
}, t.isNodeJS = function () {
return "object" === ("undefined" == typeof process ? "undefined" : r(process)) && process + "" == "[object process]"
}, t.isSameOrigin = function (e, t) {
try {
var n = new URL(e);
if (!n.origin || "null" === n.origin) return !1
} catch (e) {
return !1
}
var r = new URL(t, n);
return n.origin === r.origin
}, t.createValidAbsoluteUrl = function (e, t) {
if (!e) return null;
try {
var n = t ? new URL(e, t) : new URL(e);
if (function (e) {
if (!e) return !1;
switch (e.protocol) {
case"http:":
case"https:":
case"ftp:":
case"mailto:":
case"tel:":
return !0;
default:
return !1
}
}(n)) return n
} catch (e) {
}
return null
}, t.isLittleEndian = function () {
var e = new Uint8Array(4);
return e[0] = 1, 1 === new Uint32Array(e.buffer, 0, 1)[0]
}, t.isEvalSupported = function () {
try {
return new Function(""), !0
} catch (e) {
return !1
}
}, t.loadJpegStream = function (e, t, n) {
var r = new Image;
r.onload = function () {
n.resolve(e, r)
}, r.onerror = function () {
n.resolve(e, null), s("Error during JPEG image loading")
}, r.src = t
}, t.log2 = function (e) {
return e <= 0 ? 0 : Math.ceil(Math.log2(e))
}, t.readInt8 = function (e, t) {
return e[t] << 24 >> 24
}, t.readUint16 = function (e, t) {
return e[t] << 8 | e[t + 1]
}, t.readUint32 = function (e, t) {
return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0
}, t.removeNullCharacters = function (e) {
return "string" != typeof e ? (s("The argument for removeNullCharacters must be a string."), e) : e.replace(w, "")
}, t.ReadableStream = i.ReadableStream, t.setVerbosityLevel = function (e) {
o = e
}, t.shadow = function (e, t, n) {
return Object.defineProperty(e, t, {value: n, enumerable: !0, configurable: !0, writable: !1}), n
}, t.string32 = function (e) {
return String.fromCharCode(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e)
}, t.stringToBytes = S, t.stringToPDFString = function (e) {
var t, n = e.length, r = [];
if ("þ" === e[0] && "ÿ" === e[1]) for (t = 2; t < n; t += 2) r.push(String.fromCharCode(e.charCodeAt(t) << 8 | e.charCodeAt(t + 1))); else for (t = 0; t < n; ++t) {
var i = P[e.charCodeAt(t)];
r.push(i ? String.fromCharCode(i) : e.charAt(t))
}
return r.join("")
}, t.stringToUTF8String = function (e) {
return decodeURIComponent(escape(e))
}, t.utf8StringToString = function (e) {
return unescape(encodeURIComponent(e))
}, t.warn = s, t.unreachable = l
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function () {
var e = e || function (e, t) {
var n;
"undefined" != typeof window && window.crypto && (n = window.crypto), !n && "undefined" != typeof window && window.msCrypto && (n = window.msCrypto), !n && "undefined" != typeof global && global.crypto && (n = global.crypto);
var r = function () {
if (n) {
if ("function" == typeof n.getRandomValues) try {
return n.getRandomValues(new Uint32Array(1))[0]
} catch (e) {
}
if ("function" == typeof n.randomBytes) try {
return n.randomBytes(4).readInt32LE()
} catch (e) {
}
}
throw new Error("Native crypto module could not be used to get secure random number.")
}, i = Object.create || function () {
function e() {
}
return function (t) {
var n;
return e.prototype = t, n = new e, e.prototype = null, n
}
}(), a = {}, o = a.lib = {}, s = o.Base = {
extend: function (e) {
var t = i(this);
return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
t.$super.init.apply(this, arguments)
}), t.init.prototype = t, t.$super = this, t
}, create: function () {
var e = this.extend();
return e.init.apply(e, arguments), e
}, init: function () {
}, mixIn: function (e) {
for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]);
e.hasOwnProperty("toString") && (this.toString = e.toString)
}, clone: function () {
return this.init.prototype.extend(this)
}
}, l = o.WordArray = s.extend({
init: function (e, t) {
e = this.words = e || [], this.sigBytes = void 0 != t ? t : 4 * e.length
}, toString: function (e) {
return (e || u).stringify(this)
}, concat: function (e) {
var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes;
if (this.clamp(), r % 4) for (var a = 0; a < i; a++) {
var o = n[a >>> 2] >>> 24 - a % 4 * 8 & 255;
t[r + a >>> 2] |= o << 24 - (r + a) % 4 * 8
} else for (a = 0; a < i; a += 4) t[r + a >>> 2] = n[a >>> 2];
return this.sigBytes += i, this
}, clamp: function () {
var t = this.words, n = this.sigBytes;
t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4)
}, clone: function () {
var e = s.clone.call(this);
return e.words = this.words.slice(0), e
}, random: function (e) {
for (var t = [], n = 0; n < e; n += 4) t.push(r());
return new l.init(t, e)
}
}), c = a.enc = {}, u = c.Hex = {
stringify: function (e) {
for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) {
var a = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
r.push((a >>> 4).toString(16)), r.push((15 & a).toString(16))
}
return r.join("")
}, parse: function (e) {
for (var t = e.length, n = [], r = 0; r < t; r += 2) n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - r % 8 * 4;
return new l.init(n, t / 2)
}
}, d = c.Latin1 = {
stringify: function (e) {
for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) {
var a = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
r.push(String.fromCharCode(a))
}
return r.join("")
}, parse: function (e) {
for (var t = e.length, n = [], r = 0; r < t; r++) n[r >>> 2] |= (255 & e.charCodeAt(r)) << 24 - r % 4 * 8;
return new l.init(n, t)
}
}, h = c.Utf8 = {
stringify: function (e) {
try {
return decodeURIComponent(escape(d.stringify(e)))
} catch (e) {
throw new Error("Malformed UTF-8 data")
}
}, parse: function (e) {
return d.parse(unescape(encodeURIComponent(e)))
}
}, p = o.BufferedBlockAlgorithm = s.extend({
reset: function () {
this._data = new l.init, this._nDataBytes = 0
}, _append: function (e) {
"string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes
}, _process: function (t) {
var n, r = this._data, i = r.words, a = r.sigBytes, o = this.blockSize, s = a / (4 * o),
c = (s = t ? e.ceil(s) : e.max((0 | s) - this._minBufferSize, 0)) * o, u = e.min(4 * c, a);
if (c) {
for (var d = 0; d < c; d += o) this._doProcessBlock(i, d);
n = i.splice(0, c), r.sigBytes -= u
}
return new l.init(n, u)
}, clone: function () {
var e = s.clone.call(this);
return e._data = this._data.clone(), e
}, _minBufferSize: 0
}), f = (o.Hasher = p.extend({
cfg: s.extend(), init: function (e) {
this.cfg = this.cfg.extend(e), this.reset()
}, reset: function () {
p.reset.call(this), this._doReset()
}, update: function (e) {
return this._append(e), this._process(), this
}, finalize: function (e) {
return e && this._append(e), this._doFinalize()
}, blockSize: 16, _createHelper: function (e) {
return function (t, n) {
return new e.init(n).finalize(t)
}
}, _createHmacHelper: function (e) {
return function (t, n) {
return new f.HMAC.init(e, n).finalize(t)
}
}
}), a.algo = {});
return a
}(Math);
return e
}, "object" === s(t) ? e.exports = t = o() : (i = [], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
e.exports = function (e) {
return "object" === (void 0 === e ? "undefined" : r(e)) ? null !== e : "function" == typeof e
}
}, function (e, t, n) {
"use strict";
var r = n(44)("wks"), i = n(19), a = n(0).Symbol, o = "function" == typeof a;
(e.exports = function (e) {
return r[e] || (r[e] = o && a[e] || (o ? a : i)("Symbol." + e))
}).store = r
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.pxCovertToMM = t.mmCovertToPx = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
t.scrollToResizeScreen = function () {
if (window.navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
var e = void 0, t = void 0;
t = setInterval(function () {
e = document.documentElement.scrollTop || document.body.scrollTop, e -= 1, window.scrollTo(0, e), e += 1, window.scrollTo(0, e), clearInterval(t)
}, 100)
}
}, t.computeTextWdith = function (e, t, n) {
if (n) {
var r = document.createElement("canvas"), i = r.getContext("2d");
return i.font = t + "px " + n, i.measureText(e).width
}
return t * e.length
}, t.closeOverlay = function () {
var e = window.KGPdfViewerWebApp.PDFViewerApplication.overlayManager;
if (e._active.length) {
var t = [];
return e._active.forEach(function (n) {
t.push(e.close(n))
}), Promise.all(t)
}
return Promise.resolve()
}, t.createTextLayerElement = function (e, t, n, r, i, a, o) {
var s = document.createElement("div"), l = Math.sin((360 - a) * Math.PI / 180),
c = Math.cos((360 - a) * Math.PI / 180);
return s.innerText = e, s.style.left = t - r * l / 2 + "px", s.style.top = n - r * c / 2 + "px", s.style.fontSize = r * o + "px", s.style.fontFamily = i, s.style.transform = "rotate(" + a + "deg) translate(-50%, -50%)", s
}, t.renderTextLayerElements = function (e, t) {
var n = e.textLayer;
if (n) {
var r = n.textLayerDiv;
if (r) for (var i = r.querySelector("endOfContent"), a = 0; a < t.length; a++) r.insertBefore(t[a], i)
}
}, t.leftTopTransformToLeftBottom = function (e, t) {
return {x: e.x, y: t - e.y}
}, t.trim = function (e) {
return e.replace(/^\s*/, "").replace(/\s*$/, "")
}, t.unique = function (e) {
for (var t = 0; t < e.length; t++) for (var n = t + 1; n < e.length; n++) e[t] === e[n] && (e.splice(n, 1), n--);
return e
}, t.getDom = function (e, t, n) {
for (var r = [], i = document.getElementsByTagName(e), a = 0; a < i.length; a++) n === i[a].getAttribute(t) && r.push(i[a]);
return r
}, t.deepCopy = function e(t, n) {
var n = n || {};
for (var i in t) if ("object" == r(t[i])) {
var a = Array.isArray(t[i]);
n[i] = 1 == a ? [] : {}, e(t[i], n[i])
} else n[i] = t[i];
return n
}, t.deleteSessionItem = function (e) {
sessionStorage.removeItem(e)
}, t.getSessionItem = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = sessionStorage.getItem(e);
if (n) return t ? s.default.decrypt(n, c).toString(a.default) : n;
return null
}, t.setSessionItem = function (e, t) {
arguments.length > 2 && void 0 !== arguments[2] && arguments[2] ? sessionStorage.setItem(e, s.default.encrypt(t, c).toString()) : sessionStorage.setItem(e, t)
}, t.deleteCookieAndStorage = function (e) {
o.default.remove(e), localStorage.removeItem(e)
}, t.getCookieOrStorage = function (e) {
var t = o.default.get(e), n = localStorage.getItem(e);
return t || (n || "")
}, t.setCookieOrStorage = function (e, t, n) {
o.default.set(e, t, n), o.default.get(e) || localStorage.setItem(e, t)
}, t.randomString = function (e) {
e = e || 32;
for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", n = "", r = 0; r < e; r++) n += t.charAt(Math.floor(Math.random() * t.length));
return n
}, t.functionalJudgment = function (e) {
var t = window.KGPdfViewerWebApp, n = t.textToSeal, r = t.prepareStamp, i = t.readOnly, a = t.fileType,
o = t.additionText, s = t.pagingSeal, l = t.sealOrigin, c = t.certOrigin, u = t.multipleStamp, d = t.useCaptcha,
h = t.disableSignaturePad, p = t.fjrs, f = t.mobile, m = t.download, v = t.watermark, g = t.showPrintBtn,
y = t.verifyChainInfo, b = t.annotation, w = t.stampType, S = t.sealType, _ = t.scanStamp, k = t.openLocalFile,
x = t.secretSeal, P = t.indicateSeal, C = t.useTextWidget, A = t.isUrlDoc, T = t.sealPreLocation,
E = t.globalAnnotation, D = t.iWebAuth, I = t.isUkey, L = t.stampSystemOrigin, O = t.unifySealPlatformV2,
M = t.fingerPrint;
switch (e) {
case"stamp":
return A || !n && !r && !i;
case"prepareStamp":
return r && !i;
case"additionText":
return o && !r && "PDF" === a;
case"captcha":
return d && !r;
case"pagingSeal":
return s;
case"openLocalFile":
return k && window.FormData;
case"stampConfirm":
return u && !r;
case"signature":
return !(A || !(0 === l && 0 === c && ("PT" === S && 0 === w || "GM" === S && 2 === w || "OFD" === a) || 1 === l && 1 === c && ("GM" === S && 2 === w || "OFD" === a) || -1 === c) || d || i || n || h || null != p || r || _);
case"download":
return m && !i;
case"fjrs":
return !i && !r && null != p;
case"scanStamp":
return !i && !r && _ && 1 === L && !O;
case"textToSeal":
return n && !r && !i && 0 === f;
case"watermark":
return v && !i;
case"print":
return g || n && 0 === f && !i;
case"blockChain":
return y;
case"certValidity":
return 2 == w && "GB" == S && "1" == l && "1" == c;
case"annotation":
return b;
case"secretSeal":
return x && "1" == l && "1" == c;
case"indicateSeal":
return P;
case"textConfirm":
return C;
case"sealPreLocation":
return null != T;
case"docSignConfirm":
return !!E;
case"iWebAuth":
return D.scan || D.uKey;
case"isUkey":
return I;
case"unifySealPlatformV2":
return O;
case"fingerPrint":
return !!M;
default:
return !1
}
}, t.convertRGB = function (e) {
for (var t = "", n = 0; n < 3; n++) {
var r = parseInt(e[n]), i = "0123456789ABCDEF", a = "", o = r % 16;
a = i.substr(o, 1), t += i.substr(o = (r - o) / 16, 1) + a
}
return t
}, t.convertHex = function (e) {
function t(e, t, n, r) {
return parseInt(e.slice(t, n), r)
}
e = function (e) {
var t = [], n = e;
if (3 == e.length) {
for (var r = 0; r < 3; r++) t[r] = e.slice(r, r + 1) + e.slice(r, r + 1);
n = t.join("")
}
return n
}(e);
for (var n = [], r = 0; r < 3; r++) n[r] = t(e, 2 * r, 2 * r + 2, 16);
return n
}, t.hexToRgb = function (e) {
var t = e.toLowerCase();
if (/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) {
if (4 === t.length) {
for (var n = "#", r = 1; r < 4; r += 1) n += t.slice(r, r + 1).concat(t.slice(r, r + 1));
t = n
}
for (var i = [], r = 1; r < 7; r += 2) i.push(parseInt("0x" + t.slice(r, r + 2)));
return {rgb: "rgb(" + i.join(",") + ")", rgbArr: i}
}
return t
}, t.IsFontExist = function (e) {
if ("" == e) return "";
var t = document.createElement("span"), n = "测试文字";
t.style.fontSize = "72px", t.innerHTML = n;
var r = document.getElementsByTagName("body")[0];
r.appendChild(t), t.style.fontFamily = n;
var i = t.offsetWidth, a = t.offsetHeight;
t.style.fontFamily = e + "," + n;
var o = t.offsetWidth != i || t.offsetHeight != a;
return r.removeChild(t), !!o
}, t.toTransparentImg = function (e) {
var t = [255, 255, 255, 255], n = null, r = t[0], i = t[1], a = t[2], o = t[3], s = void 0, l = void 0,
c = void 0, u = void 0, d = document.createElement("canvas"), h = d.getContext("2d"), p = e.width, f = e.height;
d.width = p, d.height = f, h.drawImage(e, 0, 0), n = h.getImageData(0, 0, p, f);
for (var m = 0; m < n.data.length; m += 4) {
s = n.data[m], l = n.data[m + 1], c = n.data[m + 2], u = n.data[m + 3];
var v = Math.sqrt(Math.pow(s - r, 2) + Math.pow(l - i, 2) + Math.pow(c - a, 2) + Math.pow(u - o, 2));
v <= 60 && (n.data[m] = 0, n.data[m + 1] = 0, n.data[m + 2] = 0, n.data[m + 3] = 0)
}
return h.putImageData(n, 0, 0), d.toDataURL("image/png")
}, t.externalSign = function (e, t, n, r) {
if (null == window.KGPdfViewerWebApp.externalSign || "function" != typeof window.KGPdfViewerWebApp.externalSign) r("外部签名接口未定义"); else {
for (var o = [], s = function (t) {
var n = e[t].needSigMessage;
0 == window.KGPdfViewerWebApp.stampType && (n = i.default.stringify(a.default.parse(n))), o.push(new Promise(function (e) {
return window.KGPdfViewerWebApp.externalSign(n, e)
}))
}, l = 0; l < e.length; l++) s(l);
Promise.all(o).then(function (n) {
for (var r = [], i = void 0, a = 0; a < n.length; a++) {
var o = n[a], s = o.cert, l = o.signedData, c = o.message;
if (!s || !l) {
i = {message: c || "外部接口签名失败"};
break
}
0 == window.KGPdfViewerWebApp.stampType ? e[a].certSignMsg = l : e[a].sigedData = l;
var u = {cert: s, signedData: [e[a]]};
r.push(t(u))
}
return i ? Promise.reject(i) : Promise.all(r)
}).then(function () {
n && n()
}).catch(function (e) {
r(e.message || "外部接口签名失败")
})
}
}, t.mergerConfig = function (e, t) {
for (var n in t) !0 === t.hasOwnProperty(n) && (e[n] = t[n]);
return e
}, t.flatten = function (e) {
var t = {};
return function e(n, r) {
if (Object(r) !== r) n && (t[n] = r); else if (Array.isArray(r)) {
for (var i = 0, a = r.length; i < a; i++) e(n + "[" + i + "]", r[i]);
0 === r.length && n && (t[n] = [])
} else {
var o = !0;
for (var s in r) o = !1, e((n ? n + "." : n) + s, r[s]);
o && n && (t[n] = {})
}
}("", e), t
}, t.titleCase = function (e) {
return e.slice(0, 1).toUpperCase() + e.slice(1)
}, t.isMobile = function () {
var e = navigator.userAgent.toLowerCase(), t = "ipad" == e.match(/ipad/i), n = "iphone" == e.match(/iphone/i),
r = "ipod" == e.match(/ipd/i), i = "android" == e.match(/android/i), a = "blackberry" == e.match(/blackberry/i),
o = "symbianos" == e.match(/symbianos/i);
return !!(t || n || r || i || a || o)
}, t.parseCilentSealImgData = function (e) {
var t = e.substring(0, 65), n = e.substring(65);
return i.default.stringify(i.default.parse(n, t))
}, t.closest = function (e, t) {
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
Element.prototype.closest || (Element.prototype.closest = function (e) {
var t = this;
if (!document.documentElement.contains(t)) return null;
do {
if (!t.matches) return null;
if (t.matches(e)) return t;
t = t.parentNode
} while (null !== t);
return null
});
return e.closest(t)
}, t._deepClone = function e(t) {
var n = void 0;
if ("object" === (void 0 === t ? "undefined" : r(t))) for (var i in n = Array.isArray(t) ? [] : {}, t) t.hasOwnProperty(i) && ("object" !== r(t[i]) ? n[i] = t[i] : n[i] = e(t[i])); else n = t;
return n
}, t.sortClass = function (e, t) {
return n = e, r = function (e) {
var n = e;
return t.forEach(function (e) {
n = n[e]
}), n
}, i = {}, n.forEach(function (e) {
var t = JSON.stringify(r(e));
i[t] = i[t] || [], i[t].push(e)
}), Object.keys(i).map(function (e) {
return i[e]
});
var n, r, i
}, t.removePrototype = function (e) {
var t = Object.create(null);
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
return t
}, t.transformData = function (e) {
var t = window.KGPdfViewerWebApp, n = t.aesEncrypt, r = t.postEncrypt, i = void 0 !== r && r, a = void 0,
o = Object.create(null);
a = i ? n(JSON.stringify(e)) : e;
return o.isEncrypt = i, o.data = a, o
}, t.getXYPoint = function (e, t) {
var n = void 0, r = void 0, i = void 0, a = void 0, o = u(e, t);
switch (o) {
case"left-top":
i = e.left / t.width, a = e.top / t.height, n = t.width * a, r = t.height * i;
break;
case"right-top":
i = (t.width - e.left - e.width) / t.width, a = e.top / t.height, n = t.width * a, r = (t.height - e.width) * (1 - i);
break;
case"left-bottom":
i = e.left / t.width, a = (t.height - e.top - e.height) / t.height, n = (t.width - e.height) * (1 - a), r = t.height * i;
break;
case"right-bottom":
i = (t.width - e.left - e.width) / t.width, a = (t.height - e.top - e.height) / t.height, n = (t.width - e.height) * (1 - a), r = (t.height - e.width) * (1 - i)
}
return {XYType: o, r_top: n, r_left: r, xsacle: i, ysacle: a}
}, t.getXYPoint_diffentSize = function (e) {
var t = e.tempSeal, n = e.hRatio, r = e.wRatio, i = void 0, a = void 0;
switch (t.XYType) {
case"left-top":
i = t.top * n, a = t.left * r;
break;
case"right-top":
i = t.top * n, a = t.left * r + t.width * r - t.width;
break;
case"left-bottom":
i = t.top * n + t.height * n - t.height, a = t.left * r;
break;
case"right-bottom":
i = t.top * n + t.height * n - t.height, a = t.left * r + t.width * r - t.width
}
return {d_top: i, d_left: a}
}, t.isIE = function () {
return navigator.userAgent.indexOf("Trident") >= 0
}, t.pxConversionMm = function (e) {
return e / d()[0] * 25.4
}, t.mmConversionPx = function (e) {
return e / 25.4 * d()[0]
}, t.proxyFunction = function (e, t, n) {
Function.prototype.before || (Function.prototype.before = function (e) {
var t = this;
return function () {
var n = e.apply(this, arguments);
return n && t.apply(this, arguments)
}
});
Function.prototype.after || (Function.prototype.after = function (e) {
var t = this;
return function () {
return t.apply(this, arguments), e.apply(this, arguments)
}
});
return t[e](n)
}, t.download = function (e, t) {
(function (e) {
return new Promise(function (t) {
var n = new XMLHttpRequest;
n.open("GET", e, !0), n.responseType = "blob", n.onload = function () {
200 === n.status && t(n.response)
}, n.send()
})
})(e + "?docType=0&action=download&documentId=" + t + "&t=" + (new Date).getTime()).then(function (e) {
!function (e) {
if (window.navigator.msSaveBlob) return window.navigator.msSaveBlob(e, decodeURIComponent(t));
var n = document.createElement("a");
n.href = window.URL.createObjectURL(e), n.download = decodeURIComponent(t), (document.body || document.documentElement).appendChild(n), n.click(), n.parentNode.removeChild(n)
}(e)
})
}, t.limitQueueFn = function (e, t, n) {
var r = 0, i = 0, a = new Array(e.length).fill(0);
return new Promise(function (o, s) {
for (var l = 0; l < t; l++) c();
function c() {
new Promise(function (t, i) {
var a = e[r];
r++, t(n(a))
}).then(function (t) {
a[i] = t, i++, r < e.length ? c() : o(a)
})
}
})
};
var i = l(n(15)), a = l(n(32)), o = l(n(149)), s = l(n(88));
function l(e) {
return e && e.__esModule ? e : {default: e}
}
var c = "+97]4Up@<ZS3(#V0y55-Z-e0";
t.mmCovertToPx = function (e) {
return Math.round(e / (1 / (720 / 254)))
}, t.pxCovertToMM = function (e) {
return Math.round(e * (1 / (720 / 254)))
};
var u = function (e, t) {
var n = "";
return n += e.left + e.width / 2 < t.width / 2 ? "left" : "right", n += "-", n += e.top + e.height / 2 < t.height / 2 ? "top" : "bottom"
};
function d() {
var e = new Array;
if (window.screen.deviceXDPI) e[0] = window.screen.deviceXDPI, e[1] = window.screen.deviceYDPI; else {
var t = document.createElement("DIV");
t.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden", document.body.appendChild(t), e[0] = parseInt(t.offsetWidth), e[1] = parseInt(t.offsetHeight), t.parentNode.removeChild(t)
}
return e
}
}, function (e, t, n) {
"use strict";
var r = e.exports = {version: "2.6.11"};
"number" == typeof __e && (__e = r)
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(6), a = n(9), o = n(18), s = n(12), l = function e(t, n, l) {
var c, u, d, h, p = t & e.F, f = t & e.G, m = t & e.P, v = t & e.B,
g = f ? r : t & e.S ? r[n] || (r[n] = {}) : (r[n] || {}).prototype, y = f ? i : i[n] || (i[n] = {}),
b = y.prototype || (y.prototype = {});
for (c in f && (l = n), l) d = ((u = !p && g && void 0 !== g[c]) ? g : l)[c], h = v && u ? s(d, r) : m && "function" == typeof d ? s(Function.call, d) : d, g && o(g, c, d, t & e.U), y[c] != d && a(y, c, h), m && b[c] != d && (b[c] = d)
};
r.core = i, l.F = 1, l.G = 2, l.S = 4, l.P = 8, l.B = 16, l.W = 32, l.U = 64, l.R = 128, e.exports = l
}, function (e, t, n) {
"use strict";
e.exports = !n(16)(function () {
return 7 != Object.defineProperty({}, "a", {
get: function () {
return 7
}
}).a
})
}, function (e, t, n) {
"use strict";
var r = n(17), i = n(33);
e.exports = n(8) ? function (e, t, n) {
return r.f(e, t, i(1, n))
} : function (e, t, n) {
return e[t] = n, e
}
}, function (e, t, n) {
"use strict";
var r = n(3);
e.exports = function (e) {
if (!r(e)) throw TypeError(e + " is not an object!");
return e
}
}, function (e, t, n) {
"use strict";
var r = {}.hasOwnProperty;
e.exports = function (e, t) {
return r.call(e, t)
}
}, function (e, t, n) {
"use strict";
var r = n(27);
e.exports = function (e, t, n) {
if (r(e), void 0 === t) return e;
switch (n) {
case 1:
return function (n) {
return e.call(t, n)
};
case 2:
return function (n, r) {
return e.call(t, n, r)
};
case 3:
return function (n, r, i) {
return e.call(t, n, r, i)
}
}
return function () {
return e.apply(t, arguments)
}
}
}, function (e, t, n) {
"use strict";
var r = n(20), i = Math.min;
e.exports = function (e) {
return e > 0 ? i(r(e), 9007199254740991) : 0
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.DOMSVGFactory = t.DOMCMapReaderFactory = t.DOMCanvasFactory = t.DEFAULT_LINK_REL = t.getDefaultSetting = t.LinkTarget = t.getFilenameFromUrl = t.isValidUrl = t.isExternalLinkTargetSet = t.addLinkAttributes = t.RenderingCancelledException = t.CustomStyle = void 0;
var r, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(1), o = n(25), s = (r = o) && r.__esModule ? r : {default: r};
function l(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var c = "noopener noreferrer nofollow", u = "http://www.w3.org/2000/svg", d = function () {
function e() {
l(this, e)
}
return i(e, [{
key: "create", value: function (e, t) {
if (e <= 0 || t <= 0) throw new Error("invalid canvas size");
var n = document.createElement("canvas"), r = n.getContext("2d");
return n.width = e, n.height = t, {canvas: n, context: r}
}
}, {
key: "reset", value: function (e, t, n) {
if (!e.canvas) throw new Error("canvas is not specified");
if (t <= 0 || n <= 0) throw new Error("invalid canvas size");
e.canvas.width = t, e.canvas.height = n
}
}, {
key: "destroy", value: function (e) {
if (!e.canvas) throw new Error("canvas is not specified");
e.canvas.width = 0, e.canvas.height = 0, e.canvas = null, e.context = null
}
}]), e
}(), h = function () {
function e(t) {
var n = t.baseUrl, r = void 0 === n ? null : n, i = t.isCompressed, a = void 0 !== i && i;
l(this, e), this.baseUrl = r, this.isCompressed = a
}
return i(e, [{
key: "fetch", value: function (e) {
var t = this, n = e.name;
return this.baseUrl ? n ? new Promise(function (e, r) {
var i = t.baseUrl + n + (t.isCompressed ? ".bcmap" : ""), o = new XMLHttpRequest;
o.open("GET", i, !0), t.isCompressed && (o.responseType = "arraybuffer"), o.onreadystatechange = function () {
if (o.readyState === XMLHttpRequest.DONE) {
if (200 === o.status || 0 === o.status) {
var n = void 0;
if (t.isCompressed && o.response ? n = new Uint8Array(o.response) : !t.isCompressed && o.responseText && (n = (0, a.stringToBytes)(o.responseText)), n) return void e({
cMapData: n,
compressionType: t.isCompressed ? a.CMapCompressionType.BINARY : a.CMapCompressionType.NONE
})
}
r(new Error("Unable to load " + (t.isCompressed ? "binary " : "") + "CMap at: " + i))
}
}, o.send(null)
}) : Promise.reject(new Error("CMap name must be specified.")) : Promise.reject(new Error('CMap baseUrl must be specified, see "PDFJS.cMapUrl" (and also "PDFJS.cMapPacked").'))
}
}]), e
}(), p = function () {
function e() {
l(this, e)
}
return i(e, [{
key: "create", value: function (e, t) {
(0, a.assert)(e > 0 && t > 0, "Invalid SVG dimensions");
var n = document.createElementNS(u, "svg:svg");
return n.setAttribute("version", "1.1"), n.setAttribute("width", e + "px"), n.setAttribute("height", t + "px"), n.setAttribute("preserveAspectRatio", "none"), n.setAttribute("viewBox", "0 0 " + e + " " + t), n
}
}, {
key: "createElement", value: function (e) {
return (0, a.assert)("string" == typeof e, "Invalid SVG element type"), document.createElementNS(u, e)
}
}]), e
}(), f = function () {
var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null);
function n() {
}
return n.getProp = function (n, r) {
if (1 === arguments.length && "string" == typeof t[n]) return t[n];
var i, a, o = (r = r || document.documentElement).style;
if ("string" == typeof o[n]) return t[n] = n;
a = n.charAt(0).toUpperCase() + n.slice(1);
for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof o[i = e[s] + a]) return t[n] = i;
return t[n] = "undefined"
}, n.setProp = function (e, t, n) {
var r = this.getProp(e);
"undefined" !== r && (t.style[r] = n)
}, n
}(), m = function () {
function e(e, t) {
this.message = e, this.type = t
}
return e.prototype = new Error, e.prototype.name = "RenderingCancelledException", e.constructor = e, e
}(), v = {NONE: 0, SELF: 1, BLANK: 2, PARENT: 3, TOP: 4}, g = ["", "_self", "_blank", "_parent", "_top"];
function y(e) {
var t = s.default.PDFJS;
switch (e) {
case"pdfBug":
return !!t && t.pdfBug;
case"disableAutoFetch":
return !!t && t.disableAutoFetch;
case"disableStream":
return !!t && t.disableStream;
case"disableRange":
return !!t && t.disableRange;
case"disableFontFace":
return !!t && t.disableFontFace;
case"disableCreateObjectURL":
return !!t && t.disableCreateObjectURL;
case"disableWebGL":
return !t || t.disableWebGL;
case"cMapUrl":
return t ? t.cMapUrl : null;
case"cMapPacked":
return !!t && t.cMapPacked;
case"postMessageTransfers":
return !t || t.postMessageTransfers;
case"workerPort":
return t ? t.workerPort : null;
case"workerSrc":
return t ? t.workerSrc : null;
case"disableWorker":
return !!t && t.disableWorker;
case"maxImageSize":
return t ? t.maxImageSize : -1;
case"imageResourcesPath":
return t ? t.imageResourcesPath : "";
case"isEvalSupported":
return !t || t.isEvalSupported;
case"externalLinkTarget":
if (!t) return v.NONE;
switch (t.externalLinkTarget) {
case v.NONE:
case v.SELF:
case v.BLANK:
case v.PARENT:
case v.TOP:
return t.externalLinkTarget
}
return (0, a.warn)("PDFJS.externalLinkTarget is invalid: " + t.externalLinkTarget), t.externalLinkTarget = v.NONE, v.NONE;
case"externalLinkRel":
return t ? t.externalLinkRel : c;
case"enableStats":
return !(!t || !t.enableStats);
case"pdfjsNext":
return !(!t || !t.pdfjsNext);
default:
throw new Error("Unknown default setting: " + e)
}
}
t.CustomStyle = f, t.RenderingCancelledException = m, t.addLinkAttributes = function (e, t) {
var n = t && t.url;
if (e.href = e.title = n ? (0, a.removeNullCharacters)(n) : "", n) {
var r = t.target;
void 0 === r && (r = y("externalLinkTarget")), e.target = g[r];
var i = t.rel;
void 0 === i && (i = y("externalLinkRel")), e.rel = i
}
}, t.isExternalLinkTargetSet = function () {
switch (y("externalLinkTarget")) {
case v.NONE:
return !1;
case v.SELF:
case v.BLANK:
case v.PARENT:
case v.TOP:
return !0
}
}, t.isValidUrl = function (e, t) {
(0, a.deprecated)("isValidUrl(), please use createValidAbsoluteUrl() instead.");
var n = t ? "http://example.com" : null;
return null !== (0, a.createValidAbsoluteUrl)(e, n)
}, t.getFilenameFromUrl = function (e) {
var t = e.indexOf("#"), n = e.indexOf("?"), r = Math.min(t > 0 ? t : e.length, n > 0 ? n : e.length);
return e.substring(e.lastIndexOf("/", r) + 1, r)
}, t.LinkTarget = v, t.getDefaultSetting = y, t.DEFAULT_LINK_REL = c, t.DOMCanvasFactory = d, t.DOMCMapReaderFactory = h, t.DOMSVGFactory = p
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return function () {
var t = e, n = t.lib.WordArray;
t.enc.Base64 = {
stringify: function (e) {
var t = e.words, n = e.sigBytes, r = this._map;
e.clamp();
for (var i = [], a = 0; a < n; a += 3) for (var o = (t[a >>> 2] >>> 24 - a % 4 * 8 & 255) << 16 | (t[a + 1 >>> 2] >>> 24 - (a + 1) % 4 * 8 & 255) << 8 | t[a + 2 >>> 2] >>> 24 - (a + 2) % 4 * 8 & 255, s = 0; s < 4 && a + .75 * s < n; s++) i.push(r.charAt(o >>> 6 * (3 - s) & 63));
var l = r.charAt(64);
if (l) for (; i.length % 4;) i.push(l);
return i.join("")
}, parse: function (e, t) {
for (var r = e.length, i = (t = t || this._map, []), a = 0; a < t.length; a++) i[t.charCodeAt(a)] = a;
var o = t.charAt(64);
if (o) {
var s = e.indexOf(o);
-1 !== s && (r = s)
}
return function (e, t, r) {
for (var i = [], a = 0, o = 0; o < t; o++) if (o % 4) {
var s = r[e.charCodeAt(o - 1)] << o % 4 * 2, l = r[e.charCodeAt(o)] >>> 6 - o % 4 * 2, c = s | l;
i[a >>> 2] |= c << 24 - a % 4 * 8, a++
}
return n.create(i, a)
}(e, r, i)
}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}
}(), e.enc.Base64
}, "object" === s(t) ? e.exports = t = o(n(2)) : (i = [n(2)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
try {
return !!e()
} catch (e) {
return !0
}
}
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(62), a = n(43), o = Object.defineProperty;
t.f = n(8) ? Object.defineProperty : function (e, t, n) {
if (r(e), t = a(t, !0), r(n), i) try {
return o(e, t, n)
} catch (e) {
}
if ("get" in n || "set" in n) throw TypeError("Accessors not supported!");
return "value" in n && (e[t] = n.value), e
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(9), a = n(11), o = n(19)("src"), s = n(103), l = ("" + s).split("toString");
n(6).inspectSource = function (e) {
return s.call(e)
}, (e.exports = function (e, t, n, s) {
var c = "function" == typeof n;
c && (a(n, "name") || i(n, "name", t)), e[t] !== n && (c && (a(n, o) || i(n, o, e[t] ? "" + e[t] : l.join(String(t)))), e === r ? e[t] = n : s ? e[t] ? e[t] = n : i(e, t, n) : (delete e[t], i(e, t, n)))
})(Function.prototype, "toString", function () {
return "function" == typeof this && this[o] || s.call(this)
})
}, function (e, t, n) {
"use strict";
var r = 0, i = Math.random();
e.exports = function (e) {
return "Symbol(".concat(void 0 === e ? "" : e, ")_", (++r + i).toString(36))
}
}, function (e, t, n) {
"use strict";
var r = Math.ceil, i = Math.floor;
e.exports = function (e) {
return isNaN(e = +e) ? 0 : (e > 0 ? i : r)(e)
}
}, function (e, t, n) {
"use strict";
var r = n(46);
e.exports = function (e) {
return Object(r(e))
}
}, function (e, t, n) {
"use strict";
e.exports = {}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFRenderingQueue = t.RenderingStates = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(24), a = n(165), o = n(5);
var s = {INITIAL: 0, RUNNING: 1, PAUSED: 2, FINISHED: 3}, l = function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.pdfViewer = null, this.pdfThumbnailViewer = null, this.onIdle = null, this.highestPriorityPage = null, this.idleTimeout = null, this.printing = !1, this.isThumbnailViewEnabled = !1
}
return r(e, [{
key: "setViewer", value: function (e) {
this.pdfViewer = e
}
}, {
key: "setThumbnailViewer", value: function (e) {
this.pdfThumbnailViewer = e
}
}, {
key: "isHighestPriority", value: function (e) {
return this.highestPriorityPage === e.renderingId
}
}, {
key: "renderHighestPriority", value: function (e) {
this.idleTimeout && (clearTimeout(this.idleTimeout), this.idleTimeout = null), this.pdfViewer.forceRendering(e) || this.pdfThumbnailViewer && this.isThumbnailViewEnabled && this.pdfThumbnailViewer.forceRendering() || this.printing || this.onIdle && (this.idleTimeout = setTimeout(this.onIdle.bind(this), 3e4))
}
}, {
key: "getHighestPriority", value: function (e, t, n) {
var r = e.views, i = r.length;
if (0 === i) return !1;
for (var a = 0; a < i; ++a) {
var o = r[a].view;
if (!this.isViewFinished(o)) return o
}
if (n) {
var s = e.last.id;
if (t[s] && !this.isViewFinished(t[s])) return t[s]
} else {
var l = e.first.id - 2;
if (t[l] && !this.isViewFinished(t[l])) return t[l]
}
return null
}
}, {
key: "isViewFinished", value: function (e) {
return e.renderingState === s.FINISHED
}
}, {
key: "renderView", value: function (e) {
var t = this;
switch (e.renderingState) {
case s.FINISHED:
return !1;
case s.PAUSED:
this.highestPriorityPage = e.renderingId, e.resume();
break;
case s.RUNNING:
this.highestPriorityPage = e.renderingId;
break;
case s.INITIAL:
this.highestPriorityPage = e.renderingId;
var n = function () {
if (t.renderHighestPriority(), null != e.canvas) {
var n = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth), r = e.pdfPage.newStamps;
for (var s in r) {
var l = (I = r[s]).querySelector("img"), c = I.style.width, u = I.style.height,
d = c.substring(0, c.length - 2) * n, h = u.substring(0, u.length - 2) * n, p = I.style.left,
f = I.style.top, m = p.substring(0, p.length - 2) * n, v = f.substring(0, f.length - 2) * n;
(L = e.canvas.getContext("2d")).globalCompositeOperation = "multiply", "multiply" !== L.globalCompositeOperation && (L.globalAlpha = .75), L.drawImage(l, m, v, d, h)
}
for (var g = e.pdfPage.textToSeals, y = 0; y < g.length; y++) {
var b = g[y].section, w = b.querySelector("img"), S = (0, i.getNumbOfPx)(b.style.width) * n,
_ = (0, i.getNumbOfPx)(b.style.height) * n, k = ((0, i.getNumbOfPx)(b.style.left) + 1) * n,
x = ((0, i.getNumbOfPx)(b.style.top) + 1) * n, P = e.canvas.getContext("2d");
P.globalCompositeOperation = "multiply", "multiply" !== P.globalCompositeOperation && (P.globalAlpha = .75), P.drawImage(w, k, x, S, _)
}
var C = e.pdfPage.newWatermark;
for (var A in C) {
var T = C[A];
(0, a.renderWaterMark)(T, e.canvas, n, e.canvas.width, e.canvas.height, null, !0).then(function (t) {
(0, o.renderTextLayerElements)(e, t)
})
}
var E = e.pdfPage.newDocSigns;
for (var D in E) {
var I, L;
l = (I = E[D]).querySelector("img"), c = I.style.width, u = I.style.height, d = c.substring(0, c.length - 2) * n, h = u.substring(0, u.length - 2) * n, p = I.style.left, f = I.style.top, m = p.substring(0, p.length - 2) * n, v = f.substring(0, f.length - 2) * n;
(L = e.canvas.getContext("2d")).globalCompositeOperation = "source-over", (L = e.canvas.getContext("2d")).drawImage(l, m, v, d, h)
}
}
e.deleteStampCallback && (e.deleteStampCallback(), e.deleteStampCallback = null), e.reRenderWait && (e.destroy(), e.renderingState = 0, e.renderingQueue.renderView(e), e.reRenderWait = !1)
};
e.draw().then(n, n)
}
return !0
}
}]), e
}();
t.RenderingStates = s, t.PDFRenderingQueue = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.convertScreenToViewportPoint = t.getNumbOfPx = t.getPath = t.CustomStyle = t.PDFStamp = void 0;
var r, i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, a = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), o = n(23), s = n(148), l = n(154), c = n(41), u = n(56), d = n(95),
h = (r = d) && r.__esModule ? r : {default: r}, p = n(94), f = n(5), m = n(164);
var v = function () {
var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null);
function n() {
}
return n.getProp = function (n, r) {
if (1 === arguments.length && "string" == typeof t[n]) return t[n];
var i, a, o = (r = r || document.documentElement).style;
if ("string" == typeof o[n]) return t[n] = n;
a = n.charAt(0).toUpperCase() + n.slice(1);
for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof o[i = e[s] + a]) return t[n] = i;
return t[n] = "undefined"
}, n.setProp = function (e, t, n) {
var r = this.getProp(e);
"undefined" !== r && (t.style[r] = n)
}, n
}();
function g(e) {
var t = e.path;
if (!t) {
t = [];
var n = e.target;
for (t.push(n); n.parentNode;) n = n.parentNode, t.push(n)
}
return t
}
function y(e) {
return parseFloat(e.substring(0, e.length - 2))
}
function b(e, t) {
for (var n = g(e), r = 0; r < n.length; r++) {
var i = n[r], a = i.id, o = i.className;
if (a && o) if (-1 != a.indexOf("pageContainer") && "page" === o) {
for (var s = n[r++]; "viewerContainer" != s.id;) s = n[r++];
var l = a.substring(13), c = window.hightMap.get(l);
if (!c) {
c = 0;
for (var u = 1; u < l; u++) {
c += document.getElementById("pageContainer" + u).clientHeight + 12
}
window.hightMap.set(l, c)
}
var d = e.clientY, h = e.clientX;
if (null == d) {
var p = e.touches[0];
h = p.clientX, d = p.clientY
}
var f = s.scrollTop + (d - 48) - (c + 10), m = s.scrollLeft + h, v = y(i.style.width), b = s.clientWidth;
return {node: i, pageNumber: l, pageX: b >= v ? m - (b - v) / 2 : m, pageY: f}
}
}
return null
}
window.hightMap = {
set: function (e, t) {
this[e] = t
}, get: function (e) {
return this[e]
}, contains: function (e) {
return null != this[e]
}, remove: function (e) {
delete this[e]
}, removeAll: function () {
for (var e in this) "function" != typeof this[e] && delete this[e]
}
};
var w = function () {
function e(e, t, n) {
if (this.isStamp = !1, this.toolbarButton = e, this.secondaryToolbarButton = t, this.app = n, this.sidebar = n.pdfSidebar, this.fileType = window.KGPdfViewerWebApp.fileType, this.seal = null, this.capability = null, this.touchstartEvent = null, this.pdfStampSeal = new s.PDFStampSeal(l.KGPdfViewerWebApp), this.stampMobileTip = document.getElementById("stamp-mobile-tip"), this.stampMobieCancel = document.getElementById("stamp-mobile-cancel"), this.isContinuityStampCheck = !1, this.continuityRange = null, this.isStampOfQfz = !1, this.tempSeals = [], this.stampSealType = "default", this.renderSignatureSeals = this.renderSignatureSeals.bind(this), this.selectSign = null, this.removeSignBtn = document.getElementById("docSignRemove"), this.selectSealData = null, !window.KGPdfViewerWebApp.chainStamp) {
var r = this;
this.continuityStampModal = new m.KG_ModalFactory(this.app, this.app.overlayManager, {
overlayName: "KG_CustomModalOverlay",
message: "印章改变位置,拖动在指定位置",
width: 320,
buttons: [{
content: "当前签章", callback: function () {
delete r.selectSealData.lastSelected
}, type: "primary"
}, {
content: "全局签章", callback: function () {
var e = void 0, t = void 0, n = r.selectSealData, i = n.lastSelected, a = i.index, o = i.scale,
s = i.tempStampSections, l = n.extraPosition[a], c = l.left, u = l.top, h = l.xsacle, p = l.ysacle,
m = l.XYType;
n.top = u, n.left = c, n.xsacle = h, n.ysacle = p, n.XYType = m, s.map(function (r) {
var i = Object.values(r)[0], a = i.isRotate, s = i.isDiffentSize, l = i.ratio, h = i.page;
if (a) {
var p = (0, f.getXYPoint)(n, {width: h.height / o, height: h.width / o}), m = p.r_left, v = p.r_top;
e = v, t = m
} else e = u, t = c;
if (s) {
var g = (0, f.getXYPoint_diffentSize)({wRatio: l.wRatio, hRatio: l.hRatio, tempSeal: n}),
y = g.d_top, b = g.d_left;
e = y, t = b
}
(0, d.setSectionStyle)(i, o, t, e)
}), delete n.lastSelected, n.extraPosition = Object.create(null)
}
}]
})
}
this.initStampPosition(), this.init()
}
return e.prototype = {
init: function () {
var e = this, t = this;
function n(e, n) {
e.preventDefault(), e.stopPropagation(), t.app.secondaryToolbar.close();
var r = window.KGPdfViewerWebApp.getSelectSealPrompt();
if ((t.tempSeals.length || t.isStamp) && null !== r.seals && r.seals.length > 0) {
t.isStamp = !1, t.app.KGStampConfirm.hide(), r.open();
for (var i = 1; i < t.app.pagesCount; i++) {
var a = t.app.pdfViewer.getPageView(i - 1).pdfPage.tempStamps;
for (var o in a) if (a.hasOwnProperty(o)) {
var s = a[o].querySelector(".deleteTempStampSection");
s && (s.style.display = "none");
var l = a[o].querySelector(".scaleTempStampSection");
l && (l.style.display = "none")
}
}
document.body.style.cursor = "default", document.onmousemove = null
} else t.stamp(n)
}
window.KGPdfViewerWebApp.elecSigModeCheckFile().then(function (t) {
t.status || e.app.KGAlertPrompt.open(t.message);
var r = window.KGPdfViewerWebApp.btnPositionConfig, i = r.toolbar, a = void 0 === i ? [] : i, o = r.sidebar,
s = void 0 === o ? [] : o;
if ((0, f.functionalJudgment)("secretSeal")) {
var l = e.app.appConfig.KG_SecretSeal, c = l.button, u = l.secondaryButton;
a.indexOf("stamp") > -1 && (c.removeAttribute("hidden"), t.status ? c.onclick = function (e) {
return n(e, "secret")
} : c.setAttribute("disabled", !0)), s.indexOf("stamp") > -1 && (u.removeAttribute("hidden"), t.status ? u.onclick = function (e) {
return n(e, "secret")
} : u.setAttribute("disabled", !0))
} else a.indexOf("stamp") > -1 && !window.KGPdfViewerWebApp.isUrlDoc && !window.KGPdfViewerWebApp.scanStamp && !window.KGPdfViewerWebApp.unifySealPlatformV2 && (e.toolbarButton.removeAttribute("hidden"), t.status ? e.toolbarButton.onclick = n : e.toolbarButton.setAttribute("disabled", !0)), s.indexOf("stamp") > -1 && !window.KGPdfViewerWebApp.isUrlDoc && !window.KGPdfViewerWebApp.scanStamp && !window.KGPdfViewerWebApp.unifySealPlatformV2 && (e.secondaryToolbarButton.removeAttribute("hidden"), t.status ? e.secondaryToolbarButton.onclick = n : e.secondaryToolbarButton.setAttribute("disabled", !0)), 2 == window.KGPdfViewerWebApp.stampSystemOrigin && (e.secondaryToolbarButton.removeAttribute("hidden"), t.status ? e.secondaryToolbarButton.onclick = n : e.secondaryToolbarButton.setAttribute("disabled", !0), document.getElementById("secondaryKgSignature").setAttribute("hidden", !0));
"0" === window.KGPdfViewerWebApp.mobile.toString() ? (document.oncontextmenu = e.onDocumentContextmenu.bind(e), document.addEventListener("click", e.onDocumentClick.bind(e))) : (document.ontouchstart = e.onDocumentTouchStart.bind(e), document.ontouchmove = e.onDocumentTouchMove.bind(e), document.ontouchend = e.onDocumentTouchEnd.bind(e))
})
}, onDocumentClick: function (e) {
0 === e.button && ((0, u.removeStampMenu)(), this.documentClick(e)), this.editDocSign(e)
}, onDocumentContextmenu: function (e) {
if (this.isStamp) if (e && (e.preventDefault(), e.stopPropagation()), this.tempSeals.length) {
this.app.KGStampConfirm.show(), this.tempSeals.forEach(function (e) {
e.eventRegister()
});
for (var t = 1; t <= this.app.pagesCount; t++) {
var n = this.app.pdfViewer.getPageView(t - 1).pdfPage.tempStamps;
for (var r in n) if (n.hasOwnProperty(r)) {
var i = n[r].querySelector(".deleteTempStampSection");
i && (i.style.display = "block");
var a = n[r].querySelector(".scaleTempStampSection");
a && (a.style.display = "block")
}
}
} else this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData();
this.cancelStamp()
}, onDocumentTouchStart: function (e) {
this.isStamp && (this.touchstartEvent = e), this.editDocSign(e)
}, onDocumentTouchMove: function () {
this.touchstartEvent = null
}, onDocumentTouchEnd: function (e) {
null != this.touchstartEvent ? this.documentClick(this.touchstartEvent) : "rightMenu" !== e.target.parentNode.id && (0, u.removeStampMenu)()
}, addStamp: function (e, t) {
var n = (0, f.deepCopy)(e);
n.sealdata.forEach(function (e, t) {
delete e.qfzSeal
}), t && t.removeAttribute("class"), this.cancelStamp(), this.capability.resolve(n)
}, setSealData: function (e) {
this.seal = e.seal, this.isContinuityStampCheck = e.isContinuityStampCheck, this.isStampOfQfz = e.isStampOfQfz, this.continuityRange = e.continuityRange, this.getSealObjectCallback(e)
}, getSealObjectCallback: function (e) {
var t = this;
this.seal = e.seal, this.isContinuityStampCheck = e.isContinuityStampCheck, this.continuityRange = e.continuityRange, this.isStampOfQfz = e.isStampOfQfz, this.capability = this.pdfStampSeal.createAddSealPromise();
var n = this.app.KG_SealPreLocation;
!n || n.hasStamp ? (this.app.KGStampConfirm && this.app.KGStampConfirm.hide(), this.tempSeals.length && this.tempSeals.forEach(function (e) {
e.eventUnregister()
}), ("stamp" === this.stampPosition.mode || e.isContinuityStampCheck || e.isStampOfQfz) && ("1" === window.KGPdfViewerWebApp.mobile.toString() ? (this.stampMobileTip.style.display = "block", this.stampMobieCancel.addEventListener("click", function (e) {
t.stampMobileTip.style.display = "none", t.tempSeals.length && t.app.KGStampConfirm.show(), t.cancelStamp()
}), this.isStamp = !0, document.ontouchstart = this.app.pdfStamp.onDocumentTouchStart.bind(this), document.ontouchmove = this.app.pdfStamp.onDocumentTouchMove.bind(this), document.ontouchend = this.app.pdfStamp.onDocumentTouchEnd.bind(this)) : (document.body.style.cursor = "move", this.stopMoveStamp || (document.onmousemove = function (e) {
t.isStamp = !0, t.movestamp(e, t)
})))) : n.isStamp || (n.deletePreSeal(), this.isStamp = !0, n.isStamp = !0, this.movestamp(void 0, this), this.documentClick())
}, documentClick: function (e) {
var t = this;
if (this.isStamp) {
var n = void 0;
if (e) n = b(e, this.sidebar); else {
var r = this.app, i = r.KG_SealPreLocation, a = r.pdfViewer;
if (i) {
var o = i.seal.page;
n = {node: a.getPageView(o - 1).div, pageNumber: o}
}
}
if (n) {
window.KGPdfViewerWebApp.allowFollow && window.KGPdfViewerWebApp.multipleStamp || (this.isStamp = !1, document.body.style.cursor = "default", document.onmousemove = null);
var s = n, l = s.node, u = s.pageNumber;
"1" === window.KGPdfViewerWebApp.mobile.toString() && (this.stampMobileTip.style.display = "none", this.movestamp(e, this));
var p = document.getElementById(l.id + "stamp");
if (p) {
var m = this.app.pdfViewer, v = this.seal;
if (v.left = y(p.style.left), v.top = y(p.style.top), v.width = y(p.style.width), v.height = y(p.style.height), this.isContinuityStampCheck) {
v.isContinuityStampCheck = !0, v.page = this.continuityRange;
var g = (T = m.getPageView(u - 1)).viewport.scale, w = (T.width, T.height / g), S = T.div,
_ = parseInt(getComputedStyle(S).width), k = parseInt(getComputedStyle(S).height),
x = (0, f.getXYPoint)(v, {width: _ / g, height: k / g}), P = x.XYType, C = x.xsacle, A = x.ysacle;
x.r_left, x.r_top;
v.XYType = P, v.xsacle = C, v.ysacle = A, v.actionPageInfo = (0, f.removePrototype)({
width: _,
height: k,
direction: k > _ ? "vertical" : "horizontal"
})
} else if (this.isStampOfQfz) {
var T;
w = (T = m.getPageView(u - 1)).height / T.viewport.scale;
v.bottom = w - v.top - v.height, v.isStampOfQfz = !0, v.pageAttr.bottom = v.bottom;
var E = v.top + v.height;
v.pageAttr.top = E, v.qfzSeal.forEach(function (e) {
e.top = v.top, e.width *= v.height / e.height, e.height = v.height
}), delete v.isContinuityStampCheck, delete v.xsacle, delete v.ysacle, delete v.left, delete v.top, delete v.bottom
} else v.page = u, v.hasOwnProperty("isContinuityStampCheck") && delete v.isContinuityStampCheck, v.hasOwnProperty("xsacle") && delete v.xsacle, v.hasOwnProperty("ysacle") && delete v.ysacle;
var D = (0, c.createCapability)();
if (window.KGPdfViewerWebApp.multipleStamp) v.isStampOfQfz || (v.currentPage = u), this.tempSeals.push(new h.default(p, v)), this.tempSeals.length && (this.app.KGStampConfirm.show(), this.app.KGStampConfirm.sealDatas = this.tempSeals.map(function (e) {
return e.sealData
}), this.app.KGStampConfirm.capability = D, window.KGPdfViewerWebApp.allowFollow && "1" !== window.KGPdfViewerWebApp.mobile.toString() || this.onDocumentContextmenu()); else {
if (v.isStampOfQfz) {
for (var I = 0; I < v.qfzSeal.length; I++) {
var L = v.qfzSeal[I];
L.sealdata = [], L.sealdata[0] = {
left: L.left,
width: L.width,
imgdata: L.imgdata
}, delete L.left, delete L.width, delete L.imgdata;
var O = p.cloneNode(!0);
O.setAttribute("id", p.id + "-" + L.page);
var M = m.getPageView(L.page - 1), N = M.viewport, R = M.annotationLayer, W = N.scale,
V = M.width / W;
O.style.width = L.sealdata[0].width + "px", O.style.height = L.height + "px", L.sealdata[0].left = V - L.sealdata[0].width, (0, d.setSectionStyle)(O, W, L.sealdata[0].left, L.top), O.querySelector("img").src = L.sealdata[0].imgdata, L.section = O, Object.defineProperty(L, "section", {enumerable: !1}), R && (R.div || (R.div = document.createElement("div"), R.div.className = "annotationLayer", M.div.appendChild(R.div)), R.div.appendChild(O))
}
p.parentNode.removeChild(p)
}
!0 === window.KGPdfViewerWebApp.useCaptcha ? (this.app.KGCaptcha.okCallback = function (e) {
t.addStamp({sealdata: [v], capability: D, captcha: e})
}, this.app.KGCaptcha.cancelCallback = function () {
t.isStamp = !0, t.cancelStamp()
}, this.app.KGCaptcha.open(v.phone)) : this.addStamp({sealdata: [v], capability: D})
}
D.promise.then(this.renderSignatureSeals)
}
}
}
}, renderSignatureSeals: function (e) {
var t = this, n = e.status, r = e.message, i = e.successPassBackParameter, a = this.app.pdfViewer;
if (this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData(), n) {
if (window.KGPdfViewerWebApp.multipleStamp) {
var o = this.tempSeals.concat();
if ("OFD" === self.fileType && window.KGPdfViewerWebApp.multipleStamp && "1" === window.KGPdfViewerWebApp.sealOrigin.toString() && (o = o.filter(function (e) {
return e.ofdStampSuccess
})), !o || !o.length) return;
if ("OFD" === window.KGPdfViewerWebApp.fileType || 2 == window.KGPdfViewerWebApp.stampType) (0, f.sortClass)(o, ["sealData", "esid"]).forEach(function (e) {
var n = void 0;
e.forEach(function (e, r) {
if (0 === r && (n = e.section.getAttribute("data-annotation-id")), e.sealData.isStampOfQfz) {
var i = e.section.getAttribute("data-annotation-id");
t.app.appConfig.viewerContainer.querySelectorAll('section[data-annotation-id="' + i + '"]').forEach(function (e) {
e.setAttribute("data-annotation-id", n)
})
} else e.section.setAttribute("data-annotation-id", n)
})
});
var s = o[0].section.getAttribute("data-annotation-id");
o.forEach(function (e, n) {
e.section.removeAttribute("class");
var r = function (e) {
e.removeAttribute("class");
var t = e.querySelector(".deleteTempStampSection");
t && e.removeChild(t);
var n = e.querySelector(".scaleTempStampSection");
n && e.removeChild(n)
};
if (r(e.section), e.sealData.isContinuityStampCheck) for (var i = e.sealData.page.split("-"), o = parseInt(i[0]), l = parseInt(i[1]), c = e.sealData._tempStampkey, u = o; u <= l; u++) {
for (var d = a.getPageView(u - 1), h = d.pdfPage.tempStamps, p = null, f = Object.keys(h), m = 0; m <= f.length; m++) {
var v = f[m];
if (-1 != v.indexOf(c)) {
p = h[v].cloneNode(!0);
break
}
}
if (!p) return;
r(p), p.id = n + "-" + s + "-" + u;
var g = e.section.getAttribute("data-annotation-id");
if (p.setAttribute("data-annotation-id", g), 1 === window.KGPdfViewerWebApp.stampType) 0 == window.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert && p.setAttribute("data-annotation-id", s);
t.updatePageView(d, p)
} else if (e.sealData.isStampOfQfz) for (var y = 0; y < e.sealData.qfzSeal.length; y++) {
var b = e.sealData.qfzSeal[y], w = e.section.id + "-" + b.page, S = a.getPageView(b.page - 1),
_ = S.pdfPage.tempStamps[w];
_.removeAttribute("class");
var k = _.querySelector(".deleteTempStampSection");
k && _.removeChild(k);
var x = _.querySelector(".scaleTempStampSection");
x && _.removeChild(x), _.id = n + "-" + s + "-" + y + "-" + b.page, t.updatePageView(S, _)
} else {
var P = a.getPageView(Number(e.sealData.page) - 1), C = e.section.cloneNode(!0);
if (C.id = n + "-" + s, 1 === window.KGPdfViewerWebApp.stampType) 0 == window.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert && C.setAttribute("data-annotation-id", s);
t.updateUI(P, C);
var A = P.annotationLayer;
A && (A.div || (A.div = document.createElement("div"), A.div.className = "annotationLayer", P.div.appendChild(A.div)), A.div.appendChild(C))
}
}), this.clearTempSeals(!1)
} else {
section.className = "";
var l = section.getAttribute("data-annotation-id");
if (self.isContinuityStampCheck) {
var c = self.continuityRange.split("-"), u = parseInt(c[0]), d = parseInt(c[1]),
h = section.cloneNode(!0);
section.parentNode.removeChild(section);
for (var p = u; p <= d; p++) {
var m = h.cloneNode(!0);
m.setAttribute("id", p + "-" + l);
var g = a.getPageView(p - 1), y = g.width / g.viewport.scale * xsacle,
b = g.height / g.viewport.scale * ysacle;
m.style.left = y + "px", m.style.top = b + "px", v.setProp("transformOrigin", m, -1 * y + "px " + -1 * b + "px"), self.updatePageView(g, m)
}
} else if (self.isStampOfQfz) for (var w = 0; w < sealdata.qfzSeal.length; w++) {
var S = sealdata.qfzSeal[w], _ = a.getPageView(S.page - 1);
S.section.removeAttribute("class"), S.section.id = S.page + "-" + l, this.updatePageView(_, S.section)
} else {
var k = a.getPageView(pageNumber - 1);
section.id = l, self.updateUI(k, section), window.KGPdfViewerWebApp.isUrlDoc && (i || (i = {}), i.section = section)
}
}
var x = this.app.KG_SealPreLocation;
x && !x.hasStamp && (x.hasStamp = !0, window.KGPdfViewerWebApp.multipleStamp = x.previewMultipleStampConfig), window.KGPdfViewerWebApp.stampSuccess && (!window.KGPdfViewerWebApp.fjrs || window.KGPdfViewerWebApp.fjrs && !window.KGPdfViewerWebApp.isServer) && window.KGPdfViewerWebApp.stampSuccess(i)
} else {
this.removeStampNode(), window.hightMap.removeAll(), window.KGPdfViewerWebApp.multipleStamp && (this.cancelStamp(), this.clearTempSeals(!0)), null != window.KGPdfViewerWebApp.externalStampSeal && window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(r || "调用外部接口加盖签章失败!")
}
}, updatePageView: function (e, t) {
var n = t, r = e.pdfPage, i = e.annotationLayer;
if (i) if (2 !== e.renderingState) {
if (1 === e.renderingState) return e.reRenderWait = !0, void (r.newStamps[n.id] = n);
i.div || (i.div = document.createElement("div"), i.div.className = "annotationLayer", e.div.appendChild(i.div)), i.div.appendChild(n), this.updateUI(e, n)
} else r.newStamps[n.id] = n; else r.newStamps[n.id] = n
}, updateUI: function (e, t) {
var n = e.pdfPage, r = t.style.width, i = t.style.height, a = y(t.style.left), s = y(t.style.top), l = y(r),
c = y(i), d = t.querySelector("img");
d.style.display = "none";
var h = (0, u.createSealNode)(n, e, t, r, i);
if (t.appendChild(h), n.newStamps[t.id] = t, void 0 !== e.canvas) {
var p = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth), f = a * p, m = s * p,
v = e.canvas.getContext("2d");
v.globalCompositeOperation = "multiply", "multiply" !== v.globalCompositeOperation && (v.globalAlpha = .85);
var g = this;
d.onload = function () {
v.drawImage(d, f, m, l * p, c * p);
var t = g.app.pdfThumbnailViewer.getThumbnail(n.pageIndex);
t.renderingState = o.RenderingStates.INITIAL, t.setImage(e)
}, d.src = d.src
}
}, stamp: function (e) {
var t = this;
this.pdfStampSeal.getSealObjet(e).then(function (e) {
var n = e.isStampOfQfz, r = e.isContinuityStampCheck;
if (n || r) return t.stampDefault(e);
var i = t.stampPosition, a = i.page, o = i.pos, s = i.text;
switch (i.mode) {
case"stamp":
t.stampDefault(e);
break;
case"stampOfXY":
t.stampOfXY(a, o.x, o.y, e.seal);
break;
case"stampOfText":
t.stampOfText(a, s, e.seal)
}
})
}, SCSJTT_getFirstSealFromServer: function (e, t) {
this.pdfStampSeal.SCSJTT_getFirstSealFromServer(e, t)
}, movestamp: function (e, t) {
if (!t.stopMoveStamp) {
var n = void 0, r = this.app, i = r.KG_SealPreLocation, a = r.pdfViewer;
if (e) n = b(e, this.sidebar); else if (i) {
var o = i.seal, s = o.page, l = o.left, c = o.top, u = o.width, d = o.height;
n = {
node: a.getPageView(s - 1).div,
pageNumber: s,
pageX: (l + u / 2) * a.currentScale * 96 / 72,
pageY: (c + d / 2) * a.currentScale * 96 / 72
}
}
if (n) {
var h = n, f = h.node, m = h.pageNumber, g = h.pageX, y = h.pageY;
f.style.overflow = "hidden";
var w = t.app.pdfViewer.getPageView(m - 1), S = w.annotationLayer;
S.div || (S.div = document.createElement("div"), S.div.className = "annotationLayer", f.appendChild(S.div));
var _ = w.viewport.scale;
if (g > 0 && y > 0 || i) {
var k = document.getElementById(f.id + "stamp"), x = g / _ - t.seal.width / 2,
P = y / _ - t.seal.height / 2, C = (new Date).getTime();
k ? (k.setAttribute("data-annotation-id", C), k.style.transform = "matrix(" + _ + ", 0, 0, " + _ + ", 0, 0)", k.style.left = x + "px", k.style.top = P + "px", v.setProp("transform", k, "matrix(" + _ + ", 0, 0, " + _ + ", 0, 0)"), v.setProp("transformOrigin", k, -1 * x + "px " + -1 * P + "px")) : (this.removeStampNode(), (k = this._createSection(this.seal, f.id + "stamp", C, "stamp", x, P, _)).querySelector("img").addEventListener("mousedown", p.eventPreventDefault), S.div.appendChild(k))
} else this.removeStampNode()
} else this.removeStampNode()
}
}, _createSection: function (e, t, n, r, i, a, o) {
var s = document.createElement("section");
s.setAttribute("data-annotation-id", n), s.id = t, s.className = r, s.style.width = e.width + "px", s.style.height = e.height + "px";
var l = document.createElement("img");
return l.src = e.imgdata, l.style.width = "100%", l.style.height = "100%", l.style.opacity = "0.8", s.appendChild(l), s.style.transform = "matrix(" + o + ", 0, 0, " + o + ", 0, 0)", s.style.left = i + "px", s.style.top = a + "px", v.setProp("transform", s, "matrix(" + o + ", 0, 0, " + o + ", 0, 0)"), v.setProp("transformOrigin", s, -1 * i + "px " + -1 * a + "px"), s
}, cancelStamp: function () {
this.stopMoveStamp = !1, this.stampSealType = "default", this.isStamp && (this.isStamp = !1, document.body.style.cursor = "default", document.onmousemove = null, this.removeStampNode(), window.hightMap.removeAll())
}, clearTempSeals: function () {
for (var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = this.app, n = t.pagesCount, r = t.pdfViewer, i = 1; i <= n; i++) {
var a = r.getPageView(i - 1), o = a.pdfPage.tempStamps, s = a.annotationLayer;
for (var l in o) if (o.hasOwnProperty(l)) {
if (s && s.div && document.getElementById(o[l].id)) {
var c = !1;
if (3 === l.split("-").length) o[l].getAttribute("class") || (c = !0);
(!c || c && e) && s.div.removeChild(o[l])
}
delete o[l]
}
}
this.tempSeals = []
}, removeStampNode: function () {
var e = document.getElementsByClassName("stamp");
0 !== e.length && e[0].parentNode.removeChild(e[0])
}, checkPageNum: function (e) {
var t = window.KGPdfViewerWebApp.getNumPages();
if (e || (e = "0-" + t), -1 !== e.indexOf(",")) return {
pages: e, chunk_pages: e.split(",").map(function (e) {
var t = e.split("-"), n = a(t, 2), r = n[0], i = n[1];
return [r, void 0 === i ? r : i].map(Number)
})
};
if (1 == e.length) {
if (e > t) return {pages: e, begin: e, end: e};
e = e + "-" + e
}
if (!/^\d+-\d+$/.test(e)) return {error: "页码格式不正确!"};
var n = e.split("-"), r = parseInt(n[0]), i = parseInt(n[1]);
if (r > i) {
var o = r;
r = i, i = o
}
return r < 1 && (r = 1), r > t && (r = t), i > t && (i = t), {pages: r + "-" + i, begin: r, end: i}
}, stampDefault: function (e) {
var t = this, n = {capability: this.pdfStampSeal.createAddSealPromise()};
for (var r in e) n[r] = e[r];
l.KGPdfViewerWebApp.selectedSeal ? l.KGPdfViewerWebApp.selectedSeal(e.seal).then(function (e) {
e && t.getSealObjectCallback(n)
}) : this.getSealObjectCallback(n)
}, stampOfXY: function (e, t, n, r, o) {
var s = this, l = this.checkPageNum(e), u = l.begin, d = l.end, h = l.chunk_pages, p = l.pages, f = l.error;
if (f) return this.app.KGAlertPrompt.open(f);
var m = this;
this.stopMoveStamp = !0, (r ? Promise.resolve({seal: r}) : this.pdfStampSeal.getSealObjet()).then(function (e) {
var r = e.seal, l = m.pdfStampSeal.createAddSealPromise(), f = null;
Array.isArray(r) ? f = r : ((f = r).left = t, f.top = n, f.page = p, f.isStampOfXY = !0);
var v = (0, c.createCapability)(), g = {sealdata: Array.isArray(r) ? f : [f], capability: v};
l.resolve(g), v.promise.then(function (e) {
var s = this;
if (e.status) if (o && o(), Array.isArray(r)) for (var l = function (e) {
var t = r[e], n = m.checkPageNum(t.page), i = n.begin, o = n.end, l = n.chunk_pages,
c = (n.pages, n.error);
if (c) return {v: s.app.KGAlertPrompt.open(c)};
var u = (new Date).getTime(), d = m.app.pdfViewer.getPageView(0), h = d.viewport.scale,
p = m._createSection(t, "", u, "", t.left, t.top, h), f = function (e, t) {
for (var n = window.KGPdfViewerWebApp.getNumPages(), r = e; r <= t; r++) {
if (r > n) return;
d = m.app.pdfViewer.getPageView(r - 1);
var i = p.cloneNode(!0);
i.id = (new Date).getTime() + "-" + b + 1, m.updatePageView(d, i)
}
};
l ? l.map(function (e) {
var t = a(e, 2), n = t[0], r = t[1];
f(n, r)
}) : f(i, o)
}, c = 0; c < r.length; c++) {
var p = l(c);
if ("object" === (void 0 === p ? "undefined" : i(p))) return p.v
} else {
var f = (new Date).getTime(), v = m.app.pdfViewer.getPageView(0), g = v.viewport.scale,
y = m._createSection(r, "", f, "", t, n, g), b = 0, w = function (e, t) {
for (var n = window.KGPdfViewerWebApp.getNumPages(), r = e; r <= t; r++) {
if (r > n) return;
v = m.app.pdfViewer.getPageView(r - 1);
var i = y.cloneNode(!0);
i.id = (new Date).getTime() + "-" + b++, m.updatePageView(v, i)
}
};
h ? h.map(function (e) {
var t = a(e, 2), n = t[0], r = t[1];
w(n, r)
}) : w(u, d)
}
}).finally(function () {
s.onDocumentContextmenu()
})
})
}, stampOfText: function (e, t, n, r) {
var i = this, a = this.checkPageNum(e), o = a.pages, s = a.error;
if (s) return this.app.KGAlertPrompt.open(s);
var l = this;
this.stopMoveStamp = !0, (n ? Promise.resolve({seal: n}) : this.pdfStampSeal.getSealObjet()).then(function (e) {
var n = e.seal, a = l.pdfStampSeal.createAddSealPromise(), s = null;
Array.isArray(n) ? s = n : ((s = n).page = o, s.isStampOfText = !0, s.text = t);
var u = (0, c.createCapability)(), d = {sealdata: Array.isArray(n) ? s : [s], capability: u};
a.resolve(d), u.promise.then(function (e) {
if (e.status) if (r && r(), Array.isArray(n)) for (var t = 0; t < n.length; t++) {
var i = n[t], a = l.checkPageNum(i.page), o = (a.begin, a.end, a.chunk_pages, a.pages, a.error);
if (o) return this.app.KGAlertPrompt.open(o);
for (var c = (new Date).getTime(), u = e.textPositions, d = 0; d < u.length; d++) {
var h = u[d], p = h.page, f = h.x - i.width / 2 + i.offsetX, m = h.y - i.height / 2 + i.offsetY,
v = l.app.pdfViewer.getPageView(p - 1), g = v.viewport.scale, y = (new Date).getTime() + "-" + d,
b = l._createSection(i, y, c, "", f, m, g);
l.updatePageView(v, b)
}
var w = e.successPassBackParameter;
window.KGPdfViewerWebApp.stampSuccess && window.KGPdfViewerWebApp.stampSuccess(w)
} else {
for (var S = (new Date).getTime(), _ = e.textPositions, k = 0; k < _.length; k++) {
var x = _[k], P = x.page, C = x.x - s.width / 2, A = x.y - s.height / 2,
T = l.app.pdfViewer.getPageView(P - 1), E = T.viewport.scale, D = (new Date).getTime() + "-" + k,
I = l._createSection(s, D, S, "", C, A, E);
l.updatePageView(T, I)
}
var L = e.successPassBackParameter;
window.KGPdfViewerWebApp.stampSuccess && window.KGPdfViewerWebApp.stampSuccess(L)
}
}).finally(function () {
i.onDocumentContextmenu()
})
})
}, editDocSign: function (e) {
var t, n, r, i = (0, f.closest)(e.target, "section");
if (i) {
var a = i.classList[0];
if (-1 == ["lineAnnotation", "circleAnnotation", "squareAnnotation"].indexOf(a)) return;
var o = window.KGPdfViewerWebApp, s = o.PDFViewerApplication, l = o.globalAnnotation,
c = o.deleteDocSignOnCanvas, u = (0, f.closest)(e.target, ".page"), d = Number(u.dataset.pageNumber),
h = s.pdfViewer.getPageView(d - 1);
if (this.selectSign == i) return;
var p = i.getAttribute("data-author") || "";
if ((l.author || "") != p) return s.KGAlertPrompt.open("您没有权限操作该批注!");
var m = (t = Array.prototype.slice.call(document.getElementsByClassName("lineAnnotation")), n = Array.prototype.slice.call(document.getElementsByClassName("circleAnnotation")), r = Array.prototype.slice.call(document.getElementsByClassName("squareAnnotation")), t.concat(n).concat(r));
m.map(function (e) {
e.style["pointer-events"] = "none"
}), i.style["pointer-events"] = "all";
var v = e.target;
"svg:svg" != v.tagName && "svg" != v.tagName || (v = v.firstChild);
var g = h.viewport.scale, y = parseInt(i.style.top);
d > 1 && (y += (u.offsetTop - 12) / g), c(i, h), this.app.KG_DocSign.editDocSign({
top: y,
left: parseInt(i.style.left),
editData: {
scale: g,
pageNumber: d,
pdfPageView: h,
shape: v.tagName,
section: i.cloneNode(!0),
element: v.cloneNode(!0),
strokeWidth: parseInt(v.getAttribute("stroke-width"))
}
}), m.map(function (e) {
e.style["pointer-events"] = "all"
})
}
}, initStampPosition: function () {
this.stampPosition = {mode: "stamp"};
var e = window.KGPdfViewerWebApp, t = e.stampPosition, n = e.fileType;
t && "PDF" == n && (this.stampPosition = Object.assign({}, t), this.stampPosition.pos && (this.stampPosition.mode = "stampOfXY"), !this.stampPosition.pos && this.stampPosition.text && (this.stampPosition.mode = "stampOfText"))
}
}, e
}();
t.PDFStamp = w, t.CustomStyle = v, t.getPath = g, t.getNumbOfPx = y, t.convertScreenToViewportPoint = b
}, function (e, t, n) {
"use strict";
e.exports = "undefined" != typeof window && window.Math === Math ? window : "undefined" != typeof global && global.Math === Math ? global : "undefined" != typeof self && self.Math === Math ? self : {}
}, function (e, t, n) {
"use strict";
e.exports = !1
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
if ("function" != typeof e) throw TypeError(e + " is not a function!");
return e
}
}, function (e, t, n) {
"use strict";
var r = n(18);
e.exports = function (e, t, n) {
for (var i in t) r(e, i, t[i], n);
return e
}
}, function (e, t, n) {
"use strict";
e.exports = function (e, t, n, r) {
if (!(e instanceof t) || void 0 !== r && r in e) throw TypeError(n + ": incorrect invocation!");
return e
}
}, function (e, t, n) {
"use strict";
var r = {}.toString;
e.exports = function (e) {
return r.call(e).slice(8, -1)
}
}, function (e, t, n) {
"use strict";
var r = n(17).f, i = n(11), a = n(4)("toStringTag");
e.exports = function (e, t, n) {
e && !i(e = n ? e : e.prototype, a) && r(e, a, {configurable: !0, value: t})
}
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return e.enc.Utf8
}, "object" === s(t) ? e.exports = t = o(n(2)) : (i = [n(2)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
e.exports = function (e, t) {
return {enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t}
}
}, function (e, t, n) {
"use strict";
var r = n(45), i = n(46);
e.exports = function (e) {
return r(i(e))
}
}, function (e, t, n) {
"use strict";
var r = n(20), i = Math.max, a = Math.min;
e.exports = function (e, t) {
return (e = r(e)) < 0 ? i(e + t, 0) : a(e, t)
}
}, function (e, t, n) {
"use strict";
var r = n(30), i = n(4)("toStringTag"), a = "Arguments" == r(function () {
return arguments
}());
e.exports = function (e) {
var t, n, o;
return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (n = function (e, t) {
try {
return e[t]
} catch (e) {
}
}(t = Object(e), i)) ? n : a ? r(t) : "Object" == (o = r(t)) && "function" == typeof t.callee ? "Arguments" : o
}
}, function (e, t, n) {
"use strict";
var r = n(12), i = n(122), a = n(69), o = n(10), s = n(13), l = n(73), c = {}, u = {},
d = e.exports = function (e, t, n, d, h) {
var p, f, m, v, g = h ? function () {
return e
} : l(e), y = r(n, d, t ? 2 : 1), b = 0;
if ("function" != typeof g) throw TypeError(e + " is not iterable!");
if (a(g)) {
for (p = s(e.length); p > b; b++) if ((v = t ? y(o(f = e[b])[0], f[1]) : y(e[b])) === c || v === u) return v
} else for (m = g.call(e); !(f = m.next()).done;) if ((v = i(m, y, f.value, t)) === c || v === u) return v
};
d.BREAK = c, d.RETURN = u
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
var t, n, r, i, a, o, s;
return n = (t = e).lib, r = n.Base, i = n.WordArray, a = t.algo, o = a.MD5, s = a.EvpKDF = r.extend({
cfg: r.extend({
keySize: 4,
hasher: o,
iterations: 1
}), init: function (e) {
this.cfg = this.cfg.extend(e)
}, compute: function (e, t) {
for (var n, r = this.cfg, a = r.hasher.create(), o = i.create(), s = o.words, l = r.keySize, c = r.iterations; s.length < l;) {
n && a.update(n), n = a.update(e).finalize(t), a.reset();
for (var u = 1; u < c; u++) n = a.finalize(n), a.reset();
o.concat(n)
}
return o.sigBytes = 4 * l, o
}
}), t.EvpKDF = function (e, t, n) {
return s.create(n).compute(e, t)
}, e.EvpKDF
}, "object" === s(t) ? e.exports = t = o(n(2), n(90), n(91)) : (i = [n(2), n(90), n(91)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.getOfdSealsByTG = t.WebKGVerify = t.getCertByScanStamp = t.pdfSM2RegionSign = t.deleteOfdSeal = t.ofdSign = t.getOfdSeals = t.getCert = t.getKeySN = t.KG_OFD = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(40), o = n(5), s = u(n(15)), l = u(n(32)), c = n(59);
function u(e) {
return e && e.__esModule ? e : {default: e}
}
var d = function () {
function e() {
var t = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.kg = new a.KG("ISIGNATURESERVER.iSignatureServerCtrl.1", "2015DB05-ABB5-4924-A66FA88D7919C782");
var n = (0, a.createCapability)();
this.promise = n.promise;
var r = window.KGPdfViewerWebApp.appCode;
this.kg.init().then(function () {
t.kg.invoke("SetParamByName", "APPCODE", r).then(n.resolve)
})
}
return i(e, [{
key: "WebOpenKey", value: function (e) {
var t = this;
return this.kg.invoke("WebOpenKey", e).then(function (e) {
return e && "none" !== e && "0" !== e.toString() ? Promise.resolve(e) : t.WebGetLastErrorMsg("开启密钥盘失败")
})
}
}, {
key: "WebCloseKey", value: function (e) {
return this.kg.invoke("WebCloseKey", e)
}
}, {
key: "WebGetKeyCount", value: function () {
var e = this;
return this.kg.invoke("WebGetKeyCount", "").then(function (t) {
return isNaN(Number(t)) || 1 !== Number(t) ? Number(t) > 1 ? Promise.reject({message: "插入了太多的密钥盘"}) : -1 === Number(t) ? e.WebGetLastErrorMsg("授权已过期") : Promise.reject({message: "没有插入密钥盘"}) : Promise.resolve()
})
}
}, {
key: "WebKeyIsNotAdmin", value: function (e) {
var t = this;
return this.kg.invoke("WebKeyIsAdmin", e).then(function (e) {
return "false" === e || !1 === e ? Promise.resolve() : t.WebGetLastErrorMsg("没有检测到用户密钥盘")
})
}
}, {
key: "WebSign", value: function (e, t) {
var n = this;
return this.kg.invoke("WebSign", e, t).then(function (e) {
return e ? Promise.resolve(e) : n.WebGetLastErrorMsg("数据签名失败")
})
}
}, {
key: "WebVerifyPin", value: function (e, t) {
var n = this;
return this.kg.invoke("WebVerifyPin", e, t).then(function (e) {
return e && "0" === e ? Promise.resolve() : (window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), n.WebGetLastErrorMsg("密钥盘密码错误"))
})
}
}, {
key: "WebSetAlgoFlag", value: function () {
var e = this, t = window.KGPdfViewerWebApp.algorithmType.key;
if (null != t) {
var n = "sm2" === t.toLowerCase(), r = "rsa" === t.toLowerCase(), i = n ? 0 : r ? 1 : null;
return null != i ? this.kg.invoke("WebSetAlgoFlag", i).then(function (t) {
return t ? Promise.resolve() : e.WebGetLastErrorMsg("获取证书失败")
}) : Promise.resolve()
}
return Promise.resolve()
}
}, {
key: "WebGetSignCertByContainerName", value: function (e) {
var t = this, n = window.KGPdfViewerWebApp.adaptContainer;
return this.kg.invoke("WebGetCertByContainerName", e, 0, "").then(function (e) {
if (e.result) {
if (e.data = e.data.filter(function (e) {
return 2 == e.certAlgo && 0 == e.certExpiration
}), 0 === e.data.length) return Promise.reject({message: "没有有效的证书"});
for (var i = [], a = function (t) {
if (0 !== (i = e.data.filter(function (e) {
return e.containername === n[t]
})).length) return {v: Promise.resolve(i[0].cert)}
}, o = 0; o < n.length; o++) {
var s = a(o);
if ("object" === (void 0 === s ? "undefined" : r(s))) return s.v
}
return Promise.resolve(e.data[0].cert)
}
return t.WebGetLastErrorMsg()
})
}
}, {
key: "WebGetFirstCert", value: function (e) {
var t = this;
return this.kg.invoke("WebGetCertData", e, 0).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取证书失败")
})
}
}, {
key: "WebGetCertData", value: function (e) {
return 0 !== window.KGPdfViewerWebApp.adaptContainer.length ? this.WebGetSignCertByContainerName(e) : this.WebGetFirstCert(e)
}
}, {
key: "WebGetSealCount", value: function (e) {
var t = this;
return this.kg.invoke("WebGetSealCount", e).then(function (e) {
return !isNaN(Number(e)) && Number(e) >= 1 ? Promise.resolve(Number(e)) : t.WebGetLastErrorMsg("密钥盘中不存在印章")
})
}
}, {
key: "WebGetSealCount_TG", value: function (e) {
return this.kg.invoke("WebGetSealCount", e).then(function (e) {
return !isNaN(Number(e)) && Number(e) >= 1 ? Promise.resolve(Number(e)) : Promise.reject({
seals: [],
status: !1
})
})
}
}, {
key: "WebGetSealData", value: function (e) {
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return this.kg.invoke("WebGetSealData", e, n).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取印章失败(印章索引:" + n + "")
})
}
}, {
key: "WebGetKeySerialNumber", value: function (e) {
var t = this;
return this.kg.invoke("WebGetKeySerialNumber", e).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取密钥盘序列号失败")
})
}
}, {
key: "WebGetKeyUnit", value: function (e) {
var t = this;
return this.kg.invoke("WebGetKeyUnit", e).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取用章单位失败")
})
}
}, {
key: "WebGetLastErrorMsg", value: function (e) {
return this.kg.invoke("WebGetLastErrorMsg").then(function (t) {
return t && "none" !== t ? Promise.reject({
message: t.value || t,
defaultMsg: e
}) : Promise.reject({message: e, defaultMsg: e})
})
}
}, {
key: "WebKGVerify", value: function (e, t, n) {
var r = this;
return this.kg.invoke("WebKGVerify", e, t, n).then(function (e) {
var t = "true" == e;
return t ? Promise.resolve(t) : r.WebGetLastErrorMsg("程序异常")
})
}
}]), e
}();
t.KG_OFD = d, t.getKeySN = function () {
var e = new d;
return e.promise.then(function () {
return e.WebGetKeyCount()
}).then(function () {
return e.WebOpenKey(0)
}).then(function (t) {
return e.WebGetKeySerialNumber(t)
})
}, t.getCert = function (e, t, n, r) {
var i = new d, a = void 0;
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(a)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return t(e)
}).then(function (e) {
n && n(e)
}).catch(function (e) {
var t = e.message;
return r(t), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}, t.getOfdSeals = function (e, t, n, r) {
var i = new d, a = void 0, o = void 0, s = void 0, l = void 0;
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(e)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebGetKeySerialNumber(a)
}).then(function (e) {
return o = e, (0, c.verifyKeySn)(e)
}).then(function () {
return i.WebGetKeyUnit(a)
}).then(function (e) {
return s = e, i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return l = e, i.WebGetSealCount(a)
}).then(function (e) {
for (var t = [], n = 0; n < e; n++) t.push(i.WebGetSealData(a, n));
return Promise.all(t)
}).then(function (e) {
if (!e || 0 === e.length) return i.WebGetLastErrorMsg("获取印章失败");
var n = {
action: "handleCilentSeal",
keySN: o,
unitName: s,
stampType: window.KGPdfViewerWebApp.stampType,
seals: e
};
return window.KGPdfViewerWebApp.cilentSeals = e, t && t(n)
}).then(function (e) {
var t = e.data;
n && n(t, l, o)
}).catch(function (e) {
return e && r && r({message: e.message, defaultMsg: e.defaultMsg}), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}, t.ofdSign = function (e, t, n, r, i, a) {
var o = new d, s = void 0, l = void 0;
o.promise.then(function () {
return o.WebGetKeyCount()
}).then(function () {
return o.WebOpenKey(0)
}).then(function (e) {
return s = e, o.WebKeyIsNotAdmin(e)
}).then(function () {
return o.WebVerifyPin(s, e)
}).then(function () {
return 1 == window.KGPdfViewerWebApp.sealOrigin ? o.WebGetKeySerialNumber(s).then(function (e) {
return t !== e ? Promise.reject({message: "密钥盘已更换"}) : Promise.resolve()
}) : Promise.resolve()
}).then(function () {
return o.WebSetAlgoFlag()
}).then(function () {
return o.WebGetCertData(s)
}).then(function (e) {
l = e;
for (var t = [], r = 0; r < n.length; r++) t.push(o.WebSign(s, n[r].toSignData));
return Promise.all(t)
}).then(function (e) {
for (var t = [], i = 0; i < e.length; i++) {
var a = {
signedData: e[i],
cert: l,
sealType: n[i].sealType,
toSignData: n[i].toSignData,
signDirPath: n[i].signDirPath
};
t.push(r(a))
}
return Promise.all(t)
}).catch(function (e) {
var t = e.message;
return a && a(t), Promise.resolve()
}).then(function () {
return null != s ? o.WebCloseKey(s) : Promise.resolve()
}).then(function () {
i && i()
})
}, t.deleteOfdSeal = function (e, t, n) {
var r = new d, i = void 0, a = (0, o.randomString)();
r.promise.then(function () {
return r.WebGetKeyCount()
}).then(function () {
return r.WebOpenKey(0)
}).then(function (e) {
return i = e, r.WebKeyIsNotAdmin(e)
}).then(function () {
return r.WebVerifyPin(i, e)
}).then(function () {
return r.WebGetKeySerialNumber(i)
}).then(function (e) {
return (0, c.verifyKeySn)(e)
}).then(function () {
return r.WebSetAlgoFlag()
}).then(function () {
var e = s.default.stringify(l.default.parse(a));
return r.WebSign(i, e)
}).then(function (e) {
return t(a, e)
}).catch(function (e) {
return e && n && n(e.message || e.defaultMsg || e), Promise.resolve()
}).then(function () {
if (null != i) return r.WebCloseKey(i)
})
}, t.pdfSM2RegionSign = function (e, t, n, r, i, a) {
var o = new d, s = void 0, l = void 0;
o.promise.then(function () {
return o.WebGetKeyCount()
}).then(function () {
return o.WebOpenKey(0)
}).then(function (e) {
return s = e, o.WebKeyIsNotAdmin(e)
}).then(function () {
return o.WebVerifyPin(s, e)
}).then(function () {
return 1 == window.KGPdfViewerWebApp.sealOrigin ? o.WebGetKeySerialNumber(s).then(function (e) {
return t !== e ? Promise.reject({message: "密钥盘已更换"}) : Promise.resolve()
}) : Promise.resolve()
}).then(function () {
return o.WebSetAlgoFlag()
}).then(function () {
return o.WebGetCertData(s)
}).then(function (e) {
l = e;
for (var t = [], r = 0; r < n.length; r++) t.push(o.WebSign(s, n[r].needSigMessage));
return Promise.all(t)
}).then(function (e) {
for (var t = [], i = 0; i < n.length; i++) {
n[i].sigedData = e[i];
var a = {cert: l, signedData: [n[i]]};
t.push(r(a))
}
return Promise.all(t)
}).catch(function (e) {
var t = e.message;
return a && a(t), Promise.resolve()
}).then(function () {
return null != s ? o.WebCloseKey(s) : Promise.resolve()
}).then(function () {
i && i()
})
}, t.getCertByScanStamp = function (e, t, n, r) {
var i = new d, a = void 0, o = {token: t};
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(a)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return o.cert = e, i.WebSign(a, t)
}).then(function (e) {
o.signData = e, n(o)
}).catch(function (e) {
var t = e.message;
return r(t), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}, t.WebKGVerify = function (e, t, n, r, i) {
var a = new d, o = void 0;
return a.promise.then(function () {
return a.WebGetKeyCount()
}).then(function () {
return a.WebOpenKey(0)
}).then(function (e) {
return o = e, a.WebKeyIsNotAdmin(e)
}).then(function () {
return a.WebVerifyPin(o, n)
}).then(function () {
return a.WebKGVerify(e, t, o)
}).then(function (e) {
r && r(e)
}).catch(function (e) {
var t = e.message;
return i && i(t), Promise.resolve()
}).then(function () {
if (null != o) return a.WebCloseKey(o)
})
}, t.getOfdSealsByTG = function (e, t, n, r) {
var i = new d, a = void 0, o = void 0, s = void 0, l = void 0;
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(e)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebGetKeySerialNumber(a)
}).then(function (e) {
return o = e, (0, c.verifyKeySn)(e)
}).then(function () {
return i.WebGetKeyUnit(a)
}).then(function (e) {
return s = e, i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return l = e, i.WebGetSealCount_TG(a)
}).then(function (e) {
for (var t = [], n = 0; n < e; n++) t.push(i.WebGetSealData(a, n));
return Promise.all(t)
}).then(function (e) {
if (!e || 0 === e.length) return i.WebGetLastErrorMsg("获取印章失败");
var n = {
action: "handleCilentSeal",
keySN: o,
unitName: s,
stampType: window.KGPdfViewerWebApp.stampType,
seals: e
};
return window.KGPdfViewerWebApp.cilentSeals = e, t && t(n)
}).then(function (e) {
var t = e.data;
n && n(t, l, o)
}).catch(function (e) {
return e && r && r({message: e.message, defaultMsg: e.defaultMsg, status: e.status}), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}
}, function (module, exports, __w_pdfjs_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {value: !0});
var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, _timeout = 6e4;
window.kgAlert = function (e) {
window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e)
}, window.kgAlert || (window.kgAlert = function (e) {
window.alert(e)
});
var createCapability = function () {
var e = {};
return e.promise = new Promise(function (t, n) {
e.resolve = t, e.reject = n
}), e
};
function createCORSRequest(e, t, n) {
var r = new XMLHttpRequest;
return "withCredentials" in r ? r.open(e, t, !0) : "undefined" != typeof XDomainRequest && (r = new XDomainRequest).open(e, t), r
}
var defaultOptions = {
url: "", method: "post", data: "", async: !0, callback: function (e) {
}, error: function () {
}
}, xhr = {
init: function (e) {
e.method = e.method || defaultOptions.method, e.async = e.async || defaultOptions.async, e.callback = e.callback || defaultOptions.callback, e.data = e.data || defaultOptions.data
}, ajax: function (e) {
this.init(e);
var t = new XMLHttpRequest;
"withCredentials" in xhr ? t.open(e.method, e.url, e.async) : "undefined" != typeof XDomainRequest ? (t = new XDomainRequest).open(e.method, e.url, e.async) : t.open(e.method, e.url, e.async), t.onload = function (e) {
}, t.ontimeout = function (e) {
}, t.onerror = function (e) {
}, xhr.send(e.data)
}, post: function () {
}, get: function (e) {
this.init(e)
}
}, KG = function (e, t) {
this.url = "https:" === window.location.protocol ? "https://local.kinggrid.com:9582" : "http://127.0.0.1:9581", this.progid = e, this.inter = t, this.caller = 0, this.time = _timeout
};
KG.prototype = {
init: function init() {
var disableTips = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], self = this,
capability = createCapability(), val = JSON.stringify({
GetInterface: {progid: this.progid, interface: this.inter},
usercode: window.KGPdfViewerWebApp.clientCode
}), xhr = createCORSRequest("POST", this.url + "/GetInterface", this);
return xhr.timeout = _timeout, window.KGPdfViewerWebApp.hasClientServer = !1, xhr.onload = function (e) {
if (window.KGPdfViewerWebApp.hasClientServer = !0, null == this.status || 200 === this.status || 304 === this.status || disableTips) {
var obj = eval("(" + this.responseText + ")");
"0" === obj.value.toString() || "none" === obj.value && !disableTips ? window.kgAlert(self.progid + "控件初始化失败!") : (self.caller = obj.value, capability.resolve())
} else window.kgAlert("签章客户端服务异常status = " + this.status)
}, xhr.ontimeout = function () {
disableTips || (window.kgAlert("签章客户端服务请求超时!"), window.KGPdfViewerWebApp.getTipPrompt().close())
}, xhr.onerror = function () {
disableTips || (window.kgAlert("签章客户端未安装或未启动!"), window.KGPdfViewerWebApp.getTipPrompt().close())
}, xhr.send("value=" + val), capability.promise
}, invoke: function invoke(method) {
var capability = createCapability(), self = this, params = [];
if (arguments.length >= 2) for (var i = 1; i < arguments.length; i++) {
var typeVal = _typeof(arguments[i]), value = null != arguments[i] ? arguments[i].toString() : "null",
data = null;
data = "boolean" === typeVal ? {type: "BOOL", value: value} : "number" === typeVal ? {
type: "LONG",
value: value
} : {type: "BSTR", value: value}, params.push(data)
}
var val = JSON.stringify({
MethodCall: {caller: this.caller, function: method, params: params},
usercode: window.KGPdfViewerWebApp.clientCode
}), xhr = createCORSRequest("POST", this.url + "/MethodCall", this);
return xhr.timeout = self.time, xhr.onload = function (e) {
if (self.time = _timeout, void 0 == this.status || 200 == this.status || 304 == this.status) {
var obj = eval("(" + this.responseText + ")");
capability.resolve(obj.value)
} else window.kgAlert("签章客户端服务异常status = " + this.status)
}, xhr.ontimeout = function (e) {
self.time = _timeout, window.kgAlert("签章客户端服务请求超时!"), window.KGPdfViewerWebApp.getTipPrompt().close()
}, xhr.onerror = function (e) {
window.kgAlert("签章客户端未安装或未启动!"), window.KGPdfViewerWebApp.getTipPrompt().close()
}, xhr.send("value=" + val), capability.promise
}, get: function get(property) {
var capability = createCapability(), self = this, val = JSON.stringify({
PropertyCall: {caller: this.caller, property: property},
usercode: window.KGPdfViewerWebApp.clientCode
}), xhr = createCORSRequest("POST", this.url + "/PropCall", this);
return xhr.timeout = self.time, xhr.onload = function (e) {
if (void 0 == this.status || 200 == this.status || 304 == this.status) {
var obj = eval("(" + this.responseText + ")");
capability.resolve(obj.value)
} else window.kgAlert("签章客户端服务异常status = " + this.status)
}, xhr.ontimeout = function (e) {
window.kgAlert("签章客户端服务请求超时!")
}, xhr.onerror = function (e) {
window.kgAlert("签章客户端未安装或未启动!")
}, xhr.send("value=" + val), capability.promise
}, put: function put(property, value) {
var self = this, typeVal = void 0 === value ? "undefined" : _typeof(value),
_value = void 0 != value ? value.toString() : "null", data = null;
data = "boolean" === typeVal ? {type: "BOOL", value: _value} : "number" === typeVal ? {
type: "LONG",
value: _value
} : {type: "BSTR", value: _value};
var val = JSON.stringify({
PropertyCallPut: {caller: self.caller, property: property, params: [data]},
usercode: window.KGPdfViewerWebApp.clientCode
}), capability = createCapability(), xhr = createCORSRequest("POST", this.url + "/PropCall", this);
return xhr.timeout = self.time, xhr.onload = function (e) {
if (200 == this.status && 304 == this.status) {
var obj = eval("(" + this.responseText + ")");
capability.resolve(obj.value)
} else window.kgAlert("签章客户端服务异常status=" + this.status)
}, xhr.ontimeout = function (e) {
window.kgAlert("签章客户端服务请求超时!")
}, xhr.onerror = function (e) {
window.kgAlert("签章客户端未安装或未启动!")
}, xhr.send("value=" + val), capability.promise
}, setUrl: function (e) {
this.url = e
}
}, exports.createCapability = createCapability, exports.KG = KG
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.cryptAPISig = t.cryptAPICtrl = t.iWebAssistError = t.iWebAssist = t.createCapability = void 0;
var r = n(40), i = n(93), a = n(153);
t.createCapability = r.createCapability, t.iWebAssist = i.iWebAssist, t.iWebAssistError = i.iWebAssistError, t.cryptAPICtrl = a.cryptAPICtrl, t.cryptAPISig = a.cryptAPISig
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(0).document, a = r(i) && r(i.createElement);
e.exports = function (e) {
return a ? i.createElement(e) : {}
}
}, function (e, t, n) {
"use strict";
var r = n(3);
e.exports = function (e, t) {
if (!r(e)) return e;
var n, i;
if (t && "function" == typeof (n = e.toString) && !r(i = n.call(e))) return i;
if ("function" == typeof (n = e.valueOf) && !r(i = n.call(e))) return i;
if (!t && "function" == typeof (n = e.toString) && !r(i = n.call(e))) return i;
throw TypeError("Can't convert object to primitive value")
}
}, function (e, t, n) {
"use strict";
var r = n(6), i = n(0), a = i["__core-js_shared__"] || (i["__core-js_shared__"] = {});
(e.exports = function (e, t) {
return a[e] || (a[e] = void 0 !== t ? t : {})
})("versions", []).push({
version: r.version,
mode: n(26) ? "pure" : "global",
copyright: "© 2019 Denis Pushkarev (zloirock.ru)"
})
}, function (e, t, n) {
"use strict";
var r = n(30);
e.exports = Object("z").propertyIsEnumerable(0) ? Object : function (e) {
return "String" == r(e) ? e.split("") : Object(e)
}
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
if (void 0 == e) throw TypeError("Can't call method on " + e);
return e
}
}, function (e, t, n) {
"use strict";
var r = n(44)("keys"), i = n(19);
e.exports = function (e) {
return r[e] || (r[e] = i(e))
}
}, function (e, t, n) {
"use strict";
e.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")
}, function (e, t, n) {
"use strict";
var r = n(66), i = n(48);
e.exports = Object.keys || function (e) {
return r(e, i)
}
}, function (e, t, n) {
"use strict";
var r = n(12), i = n(45), a = n(21), o = n(13), s = n(106);
e.exports = function (e, t) {
var n = 1 == e, l = 2 == e, c = 3 == e, u = 4 == e, d = 6 == e, h = 5 == e || d, p = t || s;
return function (t, s, f) {
for (var m, v, g = a(t), y = i(g), b = r(s, f, 3), w = o(y.length), S = 0, _ = n ? p(t, w) : l ? p(t, 0) : void 0; w > S; S++) if ((h || S in y) && (v = b(m = y[S], S, g), e)) if (n) _[S] = v; else if (v) switch (e) {
case 3:
return !0;
case 5:
return m;
case 6:
return S;
case 2:
_.push(m)
} else if (u) return !1;
return d ? -1 : c || u ? u : _
}
}
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(27), a = n(4)("species");
e.exports = function (e, t) {
var n, o = r(e).constructor;
return void 0 === o || void 0 == (n = r(o)[a]) ? t : i(n)
}
}, function (e, t, n) {
"use strict";
var r = n(4)("iterator"), i = !1;
try {
var a = [7][r]();
a.return = function () {
i = !0
}, Array.from(a, function () {
throw 2
})
} catch (e) {
}
e.exports = function (e, t) {
if (!t && !i) return !1;
var n = !1;
try {
var a = [7], o = a[r]();
o.next = function () {
return {done: n = !0}
}, a[r] = function () {
return o
}, e(a)
} catch (e) {
}
return n
}
}, function (e, t, n) {
"use strict";
var r = n(27);
e.exports.f = function (e) {
return new function (e) {
var t, n;
this.promise = new e(function (e, r) {
if (void 0 !== t || void 0 !== n) throw TypeError("Bad Promise constructor");
t = e, n = r
}), this.resolve = r(t), this.reject = r(n)
}(e)
}
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(19)("meta"), a = n(3), o = n(11), s = n(17).f, l = 0, c = Object.isExtensible || function () {
return !0
}, u = !n(16)(function () {
return c(Object.preventExtensions({}))
}), d = function (e) {
s(e, i, {value: {i: "O" + ++l, w: {}}})
}, h = e.exports = {
KEY: i, NEED: !1, fastKey: function (e, t) {
if (!a(e)) return "symbol" == (void 0 === e ? "undefined" : r(e)) ? e : ("string" == typeof e ? "S" : "P") + e;
if (!o(e, i)) {
if (!c(e)) return "F";
if (!t) return "E";
d(e)
}
return e[i].i
}, getWeak: function (e, t) {
if (!o(e, i)) {
if (!c(e)) return !0;
if (!t) return !1;
d(e)
}
return e[i].w
}, onFreeze: function (e) {
return u && h.NEED && c(e) && !o(e, i) && d(e), e
}
}
}, function (e, t, n) {
"use strict";
var r = n(3);
e.exports = function (e, t) {
if (!r(e) || e._t !== t) throw TypeError("Incompatible receiver, " + t + " required!");
return e
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.deleteOneSeal = t.removeStampMenu = t.createSealNode = void 0;
var r = n(23), i = n(58), a = n(39), o = n(24), s = n(41), l = n(59), c = n(5);
var u = null;
function d(e, t, n, r, d, m) {
var v = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6],
g = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, y = (0, o.getNumbOfPx)(n.style.left),
b = (0, o.getNumbOfPx)(n.style.top), w = (0, o.getNumbOfPx)(n.style.width),
S = (0, o.getNumbOfPx)(n.style.height);
function _(r) {
r.preventDefault(), r.stopPropagation();
var s = t.pdfViewer.app, d = (e.pageIndex, t.viewport.scale),
p = (0, o.convertScreenToViewportPoint)(r, s.pdfSidebar), m = p.pageX / d, v = p.pageY / d,
y = window.KGPdfViewerWebApp.PDFViewerApplication, b = y.KG_FJRS, w = y.KG_ScanStamp, S = y.KG_UkeyStamp,
_ = y.KG_ScanStamp_V2;
if (_) _.delete(function () {
return f(t, s, e, n, m, v, "")
}); else if (!0 === window.KGPdfViewerWebApp.useCaptcha) (0, l.getPhone)().then(function (r) {
s.KGCaptcha.okCallback = function (r) {
f(t, s, e, n, m, v, r)
}, s.KGCaptcha.open(r)
}); else if (b && b.delKeySN && "1" === b.bSignByCalibrary) b.deleteScanStamp(function () {
f(t, s, e, n, m, v, "")
}); else if (!(w || S && "1" == window.KGPdfViewerWebApp.stampModel) || window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isScanStamp) {
var k = window.KGPdfViewerWebApp.getPasswordPrompt();
k.setUpdateCallback(function (r) {
var o = window.KGPdfViewerWebApp, l = o.certOrigin, d = o.sealOrigin, p = o.fileType, y = o.isSM,
b = o.stampModel, w = function () {
f(t, s, e, n, m, v, r)
};
if (1 == l && "OFD" === p) {
var S = function (i, a) {
return f(t, s, e, n, m, v, r, i, a)
}, _ = function (e) {
return (0, c.closeOverlay)().then(function () {
return g.open(e)
})
};
if (!0 === window.KGPdfViewerWebApp.useNFSSystem) (0, i.deleteNFSSeal)(r, S, _); else new Promise(function (e) {
if (y) {
var t = void 0;
(0, a.WebKGVerify)(u, "", r, function (e) {
t = e
}, _).then(function () {
return e(t)
})
} else e(!0)
}).then(function (e) {
return e && (0, a.deleteOfdSeal)(r, S, _)
})
} else window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? "0" === window.KGPdfViewerWebApp._stampOrigin ? f(t, s, e, n, m, v, r) : h({
password: r,
deleteSealCallback: w
}) : 1 == l || 1 == d || "2" == b ? h({password: r, deleteSealCallback: w}) : f(t, s, e, n, m, v, r)
}), k.open(!1, "delete")
} else "1" == window.KGPdfViewerWebApp.stampModel ? S.delete(function () {
f(t, s, e, n, m, v, "")
}) : w.getQrCodeImage("delete", function () {
f(t, s, e, n, m, v, "")
})
}
var k = m.querySelector(".delSealNode");
function x(r) {
if (r.preventDefault(), r.stopPropagation(), !window.KGPdfViewerWebApp.isUrlDoc) {
var i = window.KGPdfViewerWebApp.PDFViewerApplication, l = i.KG_SealPreLocation;
if (!(i.KG_IWebAuth || l && n.dataset.annotationId == l.annotId)) {
var u = t.pdfViewer.app, d = t.viewport.scale, h = (0, o.convertScreenToViewportPoint)(r, u.pdfSidebar),
p = h.pageX, f = h.pageY, m = p / d, _ = f / d;
if (v) {
if (!(m >= y && m <= y + w && _ >= b && _ <= b + S)) return
} else {
var k = t.getPagePoint(p, f), x = k[0], P = k[1], C = t.viewport.viewBox;
if (P = Math.abs(C[3] - C[1]) - P, !(x >= y && x <= y + w && P >= b && P <= b + S)) return
}
var A = window.KGPdfViewerWebApp.getTipPrompt();
switch (t.pdfViewer.app.l10n._lang) {
case"zh-TW":
A.open("正在驗證印章...");
break;
case"en-US":
A.open("Verifying seal...");
break;
default:
A.open("正在验证印章...")
}
new Promise(function (t) {
null != window.KGPdfViewerWebApp.externalVerifySeal ? window.KGPdfViewerWebApp.externalVerifySeal(t, window.KGPdfViewerWebApp.documentId, e.pageIndex + 1, m, _) : window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? window.KGPdfViewerWebApp.hasClientServer ? window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "1") : window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "2") : window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t)
}).then(function (t) {
if (t.status) {
var n = window.KGPdfViewerWebApp.PDFViewerApplication.KG_VerifySealPrompt, i = t.seal.cert;
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs) {
if (window.KGPdfViewerWebApp.hasClientServer) {
var o = new s.iWebAssist({cilentType: "0"});
return Promise.all([o.promise]).then(function () {
return window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS ? i.bSignByCalibrary ? o.setParamByName("FJRSISPHONE", "1") : o.setParamByName("FJRSISPHONE", "0") : Promise.resolve()
}).then(function () {
return o.verifySignMessage(i.newHash, i.sigData)
}).then(function (r) {
r.result ? (i.sigEffectiveness = !0, A.close().then(function () {
return n.open(t)
})) : new Promise(function (t) {
window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "2")
}).then(function (e) {
i.sigEffectiveness = e.seal && e.seal.cert && e.seal.cert.sigEffectiveness, A.close().then(function () {
return n.open(e)
})
})
})
}
return i.sigEffectiveness = t.seal && t.seal.cert && t.seal.cert.sigEffectiveness, void A.close().then(function () {
return n.open(t)
})
}
if (!("OFD" !== window.KGPdfViewerWebApp.fileType || t.seal.effectiveness && t.seal.cert.sigEffectiveness || null != window.KGPdfViewerWebApp.externalVerifySeal)) {
var l = void 0;
switch (r.target.nodeName.toUpperCase()) {
case"DIV":
l = r.target;
break;
case"SVG":
l = r.target.parentNode;
break;
case"SECTION":
l = r.target.firstChild
}
if (l && !window.KGPdfViewerWebApp.stampMask) {
var u = "width:" + (w - 2) + "px;height:" + (S - 2) + "px";
l.innerHTML = '<svg viewBox="0 0 10 10" style="opacity:0.9;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1" stroke="#FF0000"><line x1="2" y1="2" x2="8" y2="8"/><line x1="2" y1="8" x2="8" y2="2"/></svg>'
}
}
if (i && i.newHash && null == window.KGPdfViewerWebApp.externalVerifySeal) {
var d = new s.iWebAssist({cilentType: "0"});
return Promise.all([d.promise]).then(function () {
return window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS ? i.bSignByCalibrary ? d.setParamByName("FJRSISPHONE", "1") : d.setParamByName("FJRSISPHONE", "0") : Promise.resolve()
}).then(function () {
return d.verifySignMessage(i.newHash, i.sigData)
}).then(function (e) {
if (e.result) i.sigEffectiveness = !0; else {
if ("-8" != e.errcode) return "-1" == e.errcode ? void g.open("未安装签名组件") : void g.open(e.errmsg || "签名验证失败errcode=" + e.errcode);
i.sigEffectiveness = !1
}
A.close().then(function () {
return n.open(t)
})
})
}
var h = !0;
new Promise(function (e) {
var n = window.KGPdfViewerWebApp, r = n.isSM, i = n.fileType;
if (r && "OFD" == i) {
var o = function (e) {
return (0, c.closeOverlay)().then(function () {
h = !1, g.open(e)
})
}, s = function (e) {
t.seal.effectiveness = e, t.seal.cert.sigEffectiveness = e, l.remember()
}, l = window.KGPdfViewerWebApp.getPasswordPrompt();
l.open(), l.setUpdateCallback(function (n) {
var r = t.seal.sm, i = r.dataHashBase64, l = r.sesSignatureBase64;
(0, a.WebKGVerify)(l, i, n, s, o).then(function () {
e(t)
})
})
} else e(t)
}).then(function (e) {
h && A.close().then(function () {
return n.open(e)
})
})
} else A.close().then(function () {
return g.open(t.message)
})
})
}
}
}
function P(r) {
if (r.preventDefault(), r.stopPropagation(), !window.KGPdfViewerWebApp.isUrlDoc) {
var i = window.KGPdfViewerWebApp.PDFViewerApplication, a = i.KG_SealPreLocation;
if (!(i.KG_IWebAuth || a && n.dataset.annotationId == a.annotId)) {
var s = document.getElementById("rightMenu");
s && s.parentNode.removeChild(s);
var l = t.pdfViewer.app, c = t.viewport.scale, d = (0, o.convertScreenToViewportPoint)(r, l.pdfSidebar),
h = d.pageX, f = d.pageY, m = h / c, g = f / c;
if (v) {
if (!(m >= y && m <= y + w && g >= b && g <= b + S)) return
} else {
var k = t.getPagePoint(h, f), P = k[0], C = k[1], A = t.viewport.viewBox;
if (C = Math.abs(A[3] - A[1]) - C, !(P >= y && P <= y + w && C >= b && C <= b + S)) return
}
var T = l.KG_FJRS;
T && (T.delKeySN = null), window.KGPdfViewerWebApp.checkLastone(e.pageIndex + 1, m, g).then(function (e) {
if (e) {
var n = document.createElement("div");
n.id = "rightMenu", n.style.position = "absolute", n.style["background-color"] = "white", n.style.border = "1px solid #999", n.style.zIndex = "200", t.viewport.width < parseFloat(h) + 94 && (h -= 94), t.viewport.height < parseFloat(f) + 70 && (f -= 70), n.style.top = f + "px", n.style.left = h + "px";
var i = '<span class="menuVerifySeal" data-l10n-id="menuVerifySeal">签章验证</span>';
e.status && 2 != window.KGPdfViewerWebApp.stampSystemOrigin ? (n.innerHTML = i + '<span class="menuDeleteSeal" data-l10n-id="menuDeleteSeal">删除签章</span>', window.KGPdfViewerWebApp._stampOrigin = e.stampOrigin, T && e.keySN && (T.delKeySN = e.keySN, T.bSignByCalibrary = e.bSignByCalibrary), window.KGPdfViewerWebApp.scanStamp && (l.KG_ScanStamp.esid = e.esid, l.KG_ScanStamp.sealType = e.sealType), window.KGPdfViewerWebApp.isUkey && (l.KG_UkeyStamp.esid = e.esid), e.stampModel ? window.KGPdfViewerWebApp.stampModel = e.stampModel : window.KGPdfViewerWebApp.stampModel = null, u = window.KGPdfViewerWebApp.isSM ? e.sesSignatureBase64 : null) : n.innerHTML = i, t.div.appendChild(n), t.pdfViewer.app.l10n.translate(n);
var a = n.querySelector(".menuVerifySeal"), o = n.querySelector(".menuDeleteSeal");
a.addEventListener("click", function (e) {
e.preventDefault(), e.stopPropagation(), x(r), p()
}), a.oncontextmenu = null, o && o.addEventListener("click", function (e) {
e.preventDefault(), e.stopPropagation(), _(r), p()
})
}
})
}
}
}
if (n.onmouseout = function (e) {
k && (k.style.display = "none"), m.style.border = "1px dashed transparent"
}, n.onmouseover = function (e) {
m.style.border = "1px dashed black", k && (k.style.display = "block")
}, "0" === window.KGPdfViewerWebApp.mobile.toString()) {
if (n.addEventListener("click", x), k && k.addEventListener("click", _), window.KGPdfViewerWebApp.readOnly) return;
n.oncontextmenu = P
} else n.addEventListener("touchstart", function (e) {
e.preventDefault(), e.stopPropagation(), window.touchstartEvent = e, window.KGPdfViewerWebApp.readOnly || (window.kgTimer = setTimeout(function () {
window.kgTimer = 0, P(e)
}, 500))
}), n.addEventListener("touchend", function (e) {
if (e.preventDefault(), e.stopPropagation(), 0 != window.kgTimer) return clearTimeout(window.kgTimer), x(window.touchstartEvent), !1
})
}
function h(e) {
var t = e.password, n = e.deleteSealCallback, r = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
i = new s.iWebAssist({cilentType: "0"});
Promise.all([i.promise]).then(function () {
return i.getKeyOtherInfo()
}).then(function (e) {
if (!e.result) {
var a = s.iWebAssistError.getKeyOtherInfo, o = e.errmsg || a[e.errcode] || "未知异常";
return window.KGPdfViewerWebApp.getTipPrompt().close(), void r.open(o)
}
var l = e.Res, c = l.substring(1, l.length - 1);
i.verifyPin(t, c).then(function (e) {
if (e.result) window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN = c : window.KGPdfViewerWebApp.userId = c, n && n(); else {
var t = {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败"
}[e.errcode] || e.errmsg || "未知异常";
r.open(t)
}
})
})
}
function p() {
var e = document.getElementById("rightMenu");
e && e.parentNode.removeChild(e)
}
function f(e, t, n, i, a, o, s, l, u) {
var d = n.pageIndex;
window.KGPdfViewerWebApp.deleteSeal(d + 1, a, o, s, l, u).then(function (a) {
return (0, c.closeOverlay)().then(function () {
if (a.data.status) {
if (window.KGPdfViewerWebApp.deleteSealSuccess && window.KGPdfViewerWebApp.deleteSealSuccess(), !1 === window.KGPdfViewerWebApp.useCaptcha) window.KGPdfViewerWebApp.getPasswordPrompt().remember("delete");
if ("OFD" === window.KGPdfViewerWebApp.fileType) !function (e, t) {
function n(t) {
t.renderingState !== r.RenderingStates.RUNNING && t.renderingState !== r.RenderingStates.PAUSED ? (t.deleteStampCallback = function () {
var n = t.div.querySelector(".canvasWrapper");
n && t.div.removeChild(n);
var i = e.pdfThumbnailViewer.getThumbnail(t.pdfPage.pageIndex);
i.renderingState = r.RenderingStates.INITIAL, i.setImage(t)
}, t.renderingState = r.RenderingStates.INITIAL, t.renderingQueue.renderView(t)) : t.reRenderWait = !0
}
var i = e.pdfViewer, a = e.pagesCount, o = t.getAttribute("data-annotation-id"),
s = t.getAttribute("data-goldGridSeal-id");
if (s) for (var l = 0; l < a; l++) {
var c = i.getPageView(l), u = c.pdfPage, d = c.annotationLayer;
if (null == u.delOFDSeal && (u.delOFDSeal = {}), u.reloadOperatorList = !0, null != d && d.div) {
var h = d.div.querySelectorAll("section[data-goldGridSeal-id]");
if (h.length) for (var p = 0; p < h.length; p++) {
var f = h[p];
f.getAttribute("data-goldGridSeal-id") === s && (u.delOFDSeal[s] = !0, d.div.removeChild(f), n(c))
}
} else u.delOFDSeal[s] = !0
} else for (var m = 0; m < a; m++) {
var v = i.getPageView(m), g = v.pdfPage, y = g.newStamps, b = v.annotationLayer;
for (var w in y) if (y.hasOwnProperty(w)) {
var S = y[w], _ = S.getAttribute("data-annotation-id");
_ === o && (delete y[w], null != b && b.div && (b.div.removeChild(S), n(v)))
}
}
}(t, i); else {
var o = a.data.delSeals;
if (o) {
var s = e.pdfViewer, l = i.getAttribute("data-annotation-id");
i.id ? v(o, s, l) : v(o, s)
} else m(e, t, n, i)
}
} else {
var c = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt;
"密码错误" === a.data.message && window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), c.open(a.data.message)
}
})
})
}
function m(e, t, n, r, i) {
var a = !0;
if (void 0 != i && (a = i), n.newStamps[r.id]) delete n.newStamps[r.id]; else {
n.delAnnotions || (n.delAnnotions = {});
var o = r.getAttribute("data-annotation-id");
n.delAnnotions[o] = !0, n.reloadOperatorList = !0
}
var s = e.div;
s.querySelector(".annotationLayer").removeChild(r), a && (2 != e.renderingState ? 1 != e.renderingState ? (e.deleteStampCallback = function () {
var r = s.querySelector(".canvasWrapper"), i = s.querySelector(".textLayer");
r && s.removeChild(r), i && s.removeChild(i);
var a = t.pdfThumbnailViewer.getThumbnail(n.pageIndex);
a.renderingState = 0, a.setImage(e)
}, e.renderingState = 0, e.renderingQueue.renderView(e)) : e.reRenderWait = !0 : n.reloadOperatorList && (e.reRenderWait = !0))
}
function v(e, t, n) {
var r = t.app;
if (n) for (var i in e) {
var a = i, o = t.getPageView(a), s = o.pdfPage, l = o.div.querySelector(".annotationLayer");
if (l && 0 != l.children.length) {
for (var c = [], u = l.children, d = 0; d < u.length; d++) {
var h = u[d];
h.getAttribute("data-annotation-id") == n && c.push(h)
}
for (var p = 0; p < c.length; p++) {
var f = c[p];
p + 1 == c.length ? m(o, r, o.pdfPage, f) : m(o, r, o.pdfPage, f, !1)
}
} else {
var v = s.newStamps;
for (var g in v) {
v[g].getAttribute("data-annotation-id") == n && delete v[g]
}
}
} else for (var i in e) {
var y = i, b = e[i], w = t.getPageView(y), S = w.pdfPage, _ = w.div.querySelector(".annotationLayer");
if (_) for (var k = 0; k < b.length; k++) for (var x = _.children, P = 0; P < x.length; P++) {
var C = x[P], A = C.getAttribute("data-annotation-id");
b[k] == A && (k + 1 == b.length ? m(w, r, w.pdfPage, C) : m(w, r, w.pdfPage, C, !1))
} else {
S.delAnnotions || (S.delAnnotions = {});
for (var T = 0; T < b.length; T++) {
var E = b[T];
S.delAnnotions[E] = !0
}
S.reloadOperatorList = !0;
var D = r.pdfThumbnailViewer.getThumbnail(S.pageIndex);
D.renderingState = 0, D.setImage(w)
}
}
}
t.createSealNode = function (e, t, n, r, i, a) {
n.style["border-width"] = "0";
var s = document.createElement("div"), l = (0, o.getNumbOfPx)(r) - 2, c = (0, o.getNumbOfPx)(i) - 2;
s.style.width = l + "px", s.style.height = c + "px", s.style.border = "1px dashed transparent", s.style.cursor = "pointer";
var u = "width:" + l + "px;height:" + c + "px";
if (a) {
var h = a.data.id, p = null, f = new Promise(function (e) {
p = e
}), m = window.KGPdfViewerWebApp.PDFViewerApplication.KG_IWebAuth;
"PDF" !== window.KGPdfViewerWebApp.fileType || m ? p({
status: !0,
effectiveness: !0
}) : null != window.KGPdfViewerWebApp.externalVerifyOnLoad ? window.KGPdfViewerWebApp.externalVerifyOnLoad(p, window.KGPdfViewerWebApp.documentId, e.pageIndex + 1, h) : window.KGPdfViewerWebApp.verifySealOnLoad(e.pageIndex + 1, h, p), f.then(function (a) {
if (a.status) {
var o = null;
o = a.effectiveness || window.KGPdfViewerWebApp.stampMask ? '<svg viewBox="0 0 1 1" style="opacity:0.0;background-color:white;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1"></svg>' : '<svg viewBox="0 0 10 10" style="opacity:0.9;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1" stroke="#FF0000"><line x1="2" y1="2" x2="8" y2="8"/><line x1="2" y1="8" x2="8" y2="2"/></svg>', "1" === window.KGPdfViewerWebApp.mobile.toString() ? s.innerHTML = o : s.innerHTML = o + "", d(e, t, n, r, i, s, !1)
} else console.log("seal is not exist id = " + h)
})
} else {
var v = '<svg viewBox="0 0 1 1" style="opacity:0.0;background-color:white;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1"></svg>';
"1" === window.KGPdfViewerWebApp.mobile.toString() ? s.innerHTML = v : s.innerHTML = v + "", d(e, t, n, r, i, s)
}
return s
}, t.removeStampMenu = p, t.deleteOneSeal = m
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.axios = t.myaxios = void 0;
var r = n(5), i = n(151), a = i.axios.create({
withCredentials: !0,
headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}
}), o = {
post: function (e, t) {
var n = {};
return n.promise = new Promise(function (e, t) {
n.resolve = e, n.reject = t
}), a.post(e, (0, r.transformData)(t)).then(function (e) {
n.resolve(e)
}).catch(function (e) {
(0, r.closeOverlay)().then(function () {
var t = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt;
null != e.response ? t.open("请求异常,状态码:" + e.response.status) : t.open("网络连接异常:" + e.message)
}), n.reject()
}), n.promise
}
};
t.myaxios = o, t.axios = i.axios
}, function (e, t, n) {
"use strict";
function r(e) {
return new Promise(function (t, n) {
var r = document.getElementById("SMObj"), i = r.WebGetKeyCount();
if (isNaN(Number(i)) || 1 !== Number(i)) Number(i) > 1 ? n({message: "插入了太多的密钥盘"}) : -1 === Number(i) ? n({message: o(r, "授权已过期")}) : n({message: o(r, "没有插入密钥盘")}); else {
var a = r.WebOpenKey(0);
if (a && "none" !== a && "0" !== a.toString()) {
var s = r.WebKeyIsAdmin(a);
if ("false" === s || !1 === s) {
var l = r.WebVerifyPin(a, e);
if (l && "-1" !== l.toString()) t({
SMObj: r,
keyHandle: a
}); else window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), n({
message: o(r, "密钥盘密码错误,请输入正确的密码"),
defaultMsg: "密钥盘密码错误"
})
} else n({message: "没有检测到用户密钥盘"})
} else n({message: o(r, "开启密钥盘失败")})
}
})
}
function i(e, t) {
e.WebCloseKey(t)
}
function a(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
return new Promise(function (r, i) {
var a = e.WebGetSealData(t, n);
a && "none" !== a ? r(a) : i({message: o(e, "获取印章失败(印章索引:" + n + "")})
})
}
function o(e, t) {
var n = e.WebGetLastErrorMsg();
return n && "none" !== n ? n : t
}
function s(e, t, n) {
return new Promise(function (r, i) {
var a = e.WebSign(t, n);
a && "-1" !== a.toString() ? r(a) : i({message: o(e, "数据签名失败")})
})
}
Object.defineProperty(t, "__esModule", {value: !0}), t.closeNFSKey = i, t.getNFSSeals = function (e, t, n, s) {
var l = void 0, c = void 0, u = void 0, d = void 0, h = void 0;
return r(e).then(function (e) {
var t = e.SMObj, n = e.keyHandle;
return d = t, h = n, new Promise(function (e, t) {
var n = d.WebGetSealCount(h);
!isNaN(Number(n)) && Number(n) >= 1 ? e(n) : t({message: o(d, "密钥盘中不存在印章")})
})
}).then(function (e) {
for (var t = [], n = 0; n < e; n++) t.push(a(d, h, n));
return Promise.all(t)
}).then(function (e) {
if (!e || 0 === e.length) return Promise.reject({message: o(d, "获取印章失败")});
l = d.WebGetKeySerialNumber(h), c = d.WebGetCertData(h), u = d.WebGetKeyUnit(h);
var n = {action: "handleCilentSeal", keySN: l, unitName: u, seals: e};
return t && t(n)
}).then(function (e) {
var t = e.data;
n && n(t, c, l)
}).catch(function (e) {
var t = e.message, n = e.defaultMsg;
return s && s({message: t, defaultMsg: n}), Promise.resolve()
}).then(function () {
return null != h && i(d, h), Promise.resolve()
})
}, t.NFSSign = function (e, t, n, a, o, l) {
var c = void 0, u = void 0, d = void 0;
return r(e).then(function (e) {
var r = e.SMObj, i = e.keyHandle;
u = i;
var a = (c = r).WebGetKeySerialNumber(u);
if (t !== a) return Promise.reject({message: "密钥盘已更换"});
d = c.WebGetCertData(u);
for (var o = [], l = 0; l < n.length; l++) o.push(s(c, u, n[l].toSignData));
return Promise.all(o)
}).then(function (e) {
for (var t = [], r = 0; r < e.length; r++) {
var i = {
signedData: e[r],
cert: d,
sealType: n[r].sealType,
toSignData: n[r].toSignData,
signDirPath: n[r].signDirPath
};
t.push(a(i))
}
return Promise.all(t)
}).then(function () {
o && o()
}).catch(function (e) {
var t = e.message;
return l && l(t), Promise.resolve()
}).then(function () {
null != u && i(c, u)
})
}, t.deleteNFSSeal = function (e, t, n) {
var a = void 0, o = void 0;
return r(e).then(function (e) {
var t = e.SMObj, n = e.keyHandle;
a = t, o = n
}).then(function () {
return t && t()
}).catch(function (e) {
var t = e.message;
return n && n(t), Promise.resolve()
}).then(function () {
null != o && i(a, o)
})
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.getPhone = t.verifyKeySn = t.sendCaptcha = t.getFontList = void 0;
var r = n(57), i = n(5), a = [{en: "Network Error", zh: "网络错误"}];
function o(e) {
window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e)
}
var s = r.axios.create({headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}});
s.interceptors.response.use(function (e) {
return e.data && !1 === e.data.status ? ((0, i.closeOverlay)().then(function () {
o(e.data.message || "程序异常,请联系管理员!")
}), Promise.reject()) : e.data
}, function (e) {
if (e.message) {
var t = a.filter(function (t) {
return e.message.indexOf(t.en) > -1
})[0];
o(t ? t.zh : e.message)
} else o("程序异常,请联系管理员!");
return Promise.reject(e)
}), t.getFontList = function () {
return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "getFonts",
documentId: window.KGPdfViewerWebApp.documentId,
docType: window.KGPdfViewerWebApp.docType
}))
}, t.sendCaptcha = function () {
return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "sendCaptcha",
keySN: window.KGPdfViewerWebApp.userId
}))
}, t.verifyKeySn = function (e) {
var t = window.KGPdfViewerWebApp, n = t.userCode, r = t.isCa3, a = t.mobile, o = t.fileType;
return n && r && "OFD" === o.toUpperCase() && 0 == a ? s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "verifyKeySn",
keySN: e,
userCode: n
})) : Promise.resolve()
}, t.getPhone = function () {
return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "getPhone",
keySN: window.KGPdfViewerWebApp.userId
})).then(function (e) {
return e.phone
})
}
}, function (e, t, n) {
"use strict";
(function (e) {
var r, i, a, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
a = function () {
var t, r;
function i() {
return t.apply(null, arguments)
}
function a(e) {
return e instanceof Array || "[object Array]" === Object.prototype.toString.call(e)
}
function s(e) {
return null != e && "[object Object]" === Object.prototype.toString.call(e)
}
function l(e) {
return void 0 === e
}
function c(e) {
return "number" == typeof e || "[object Number]" === Object.prototype.toString.call(e)
}
function u(e) {
return e instanceof Date || "[object Date]" === Object.prototype.toString.call(e)
}
function d(e, t) {
var n, r = [];
for (n = 0; n < e.length; ++n) r.push(t(e[n], n));
return r
}
function h(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}
function p(e, t) {
for (var n in t) h(t, n) && (e[n] = t[n]);
return h(t, "toString") && (e.toString = t.toString), h(t, "valueOf") && (e.valueOf = t.valueOf), e
}
function f(e, t, n, r) {
return It(e, t, n, r, !0).utc()
}
function m(e) {
return null == e._pf && (e._pf = {
empty: !1,
unusedTokens: [],
unusedInput: [],
overflow: -2,
charsLeftOver: 0,
nullInput: !1,
invalidMonth: null,
invalidFormat: !1,
userInvalidated: !1,
iso: !1,
parsedDateParts: [],
meridiem: null,
rfc2822: !1,
weekdayMismatch: !1
}), e._pf
}
function v(e) {
if (null == e._isValid) {
var t = m(e), n = r.call(t.parsedDateParts, function (e) {
return null != e
}),
i = !isNaN(e._d.getTime()) && t.overflow < 0 && !t.empty && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n);
if (e._strict && (i = i && 0 === t.charsLeftOver && 0 === t.unusedTokens.length && void 0 === t.bigHour), null != Object.isFrozen && Object.isFrozen(e)) return i;
e._isValid = i
}
return e._isValid
}
function g(e) {
var t = f(NaN);
return null != e ? p(m(t), e) : m(t).userInvalidated = !0, t
}
r = Array.prototype.some ? Array.prototype.some : function (e) {
for (var t = Object(this), n = t.length >>> 0, r = 0; r < n; r++) if (r in t && e.call(this, t[r], r, t)) return !0;
return !1
};
var y = i.momentProperties = [];
function b(e, t) {
var n, r, i;
if (l(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), l(t._i) || (e._i = t._i), l(t._f) || (e._f = t._f), l(t._l) || (e._l = t._l), l(t._strict) || (e._strict = t._strict), l(t._tzm) || (e._tzm = t._tzm), l(t._isUTC) || (e._isUTC = t._isUTC), l(t._offset) || (e._offset = t._offset), l(t._pf) || (e._pf = m(t)), l(t._locale) || (e._locale = t._locale), y.length > 0) for (n = 0; n < y.length; n++) l(i = t[r = y[n]]) || (e[r] = i);
return e
}
var w = !1;
function S(e) {
b(this, e), this._d = new Date(null != e._d ? e._d.getTime() : NaN), this.isValid() || (this._d = new Date(NaN)), !1 === w && (w = !0, i.updateOffset(this), w = !1)
}
function _(e) {
return e instanceof S || null != e && null != e._isAMomentObject
}
function k(e) {
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e)
}
function x(e) {
var t = +e, n = 0;
return 0 !== t && isFinite(t) && (n = k(t)), n
}
function P(e, t, n) {
var r, i = Math.min(e.length, t.length), a = Math.abs(e.length - t.length), o = 0;
for (r = 0; r < i; r++) (n && e[r] !== t[r] || !n && x(e[r]) !== x(t[r])) && o++;
return o + a
}
function C(e) {
!1 === i.suppressDeprecationWarnings && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + e)
}
function A(e, t) {
var n = !0;
return p(function () {
if (null != i.deprecationHandler && i.deprecationHandler(null, e), n) {
for (var r, a = [], s = 0; s < arguments.length; s++) {
if (r = "", "object" === o(arguments[s])) {
for (var l in r += "\n[" + s + "] ", arguments[0]) r += l + ": " + arguments[0][l] + ", ";
r = r.slice(0, -2)
} else r = arguments[s];
a.push(r)
}
C(e + "\nArguments: " + Array.prototype.slice.call(a).join("") + "\n" + (new Error).stack), n = !1
}
return t.apply(this, arguments)
}, t)
}
var T, E = {};
function D(e, t) {
null != i.deprecationHandler && i.deprecationHandler(e, t), E[e] || (C(t), E[e] = !0)
}
function I(e) {
return e instanceof Function || "[object Function]" === Object.prototype.toString.call(e)
}
function L(e, t) {
var n, r = p({}, e);
for (n in t) h(t, n) && (s(e[n]) && s(t[n]) ? (r[n] = {}, p(r[n], e[n]), p(r[n], t[n])) : null != t[n] ? r[n] = t[n] : delete r[n]);
for (n in e) h(e, n) && !h(t, n) && s(e[n]) && (r[n] = p({}, r[n]));
return r
}
function O(e) {
null != e && this.set(e)
}
i.suppressDeprecationWarnings = !1, i.deprecationHandler = null, T = Object.keys ? Object.keys : function (e) {
var t, n = [];
for (t in e) h(e, t) && n.push(t);
return n
};
var M = {};
function N(e, t) {
var n = e.toLowerCase();
M[n] = M[n + "s"] = M[t] = e
}
function R(e) {
return "string" == typeof e ? M[e] || M[e.toLowerCase()] : void 0
}
function W(e) {
var t, n, r = {};
for (n in e) h(e, n) && (t = R(n)) && (r[t] = e[n]);
return r
}
var V = {};
function F(e, t) {
V[e] = t
}
function G(e, t, n) {
var r = "" + Math.abs(e), i = t - r.length;
return (e >= 0 ? n ? "+" : "" : "-") + Math.pow(10, Math.max(0, i)).toString().substr(1) + r
}
var B = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
K = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, j = {}, z = {};
function U(e, t, n, r) {
var i = r;
"string" == typeof r && (i = function () {
return this[r]()
}), e && (z[e] = i), t && (z[t[0]] = function () {
return G(i.apply(this, arguments), t[1], t[2])
}), n && (z[n] = function () {
return this.localeData().ordinal(i.apply(this, arguments), e)
})
}
function q(e, t) {
return e.isValid() ? (t = H(t, e.localeData()), j[t] = j[t] || function (e) {
var t, n, r, i = e.match(B);
for (t = 0, n = i.length; t < n; t++) z[i[t]] ? i[t] = z[i[t]] : i[t] = (r = i[t]).match(/\[[\s\S]/) ? r.replace(/^\[|\]$/g, "") : r.replace(/\\/g, "");
return function (t) {
var r, a = "";
for (r = 0; r < n; r++) a += I(i[r]) ? i[r].call(t, e) : i[r];
return a
}
}(t), j[t](e)) : e.localeData().invalidDate()
}
function H(e, t) {
var n = 5;
function r(e) {
return t.longDateFormat(e) || e
}
for (K.lastIndex = 0; n >= 0 && K.test(e);) e = e.replace(K, r), K.lastIndex = 0, n -= 1;
return e
}
var Y = /\d/, X = /\d\d/, J = /\d{3}/, Q = /\d{4}/, $ = /[+-]?\d{6}/, Z = /\d\d?/, ee = /\d\d\d\d?/,
te = /\d\d\d\d\d\d?/, ne = /\d{1,3}/, re = /\d{1,4}/, ie = /[+-]?\d{1,6}/, ae = /\d+/, oe = /[+-]?\d+/,
se = /Z|[+-]\d\d:?\d\d/gi, le = /Z|[+-]\d\d(?::?\d\d)?/gi,
ce = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
ue = {};
function de(e, t, n) {
ue[e] = I(t) ? t : function (e, r) {
return e && n ? n : t
}
}
function he(e, t) {
return h(ue, e) ? ue[e](t._strict, t._locale) : new RegExp(pe(e.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (e, t, n, r, i) {
return t || n || r || i
})))
}
function pe(e) {
return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
}
var fe = {};
function me(e, t) {
var n, r = t;
for ("string" == typeof e && (e = [e]), c(t) && (r = function (e, n) {
n[t] = x(e)
}), n = 0; n < e.length; n++) fe[e[n]] = r
}
function ve(e, t) {
me(e, function (e, n, r, i) {
r._w = r._w || {}, t(e, r._w, r, i)
})
}
function ge(e, t, n) {
null != t && h(fe, e) && fe[e](t, n._a, n, e)
}
var ye = 0, be = 1, we = 2, Se = 3, _e = 4, ke = 5, xe = 6, Pe = 7, Ce = 8;
function Ae(e) {
return Te(e) ? 366 : 365
}
function Te(e) {
return e % 4 == 0 && e % 100 != 0 || e % 400 == 0
}
U("Y", 0, 0, function () {
var e = this.year();
return e <= 9999 ? "" + e : "+" + e
}), U(0, ["YY", 2], 0, function () {
return this.year() % 100
}), U(0, ["YYYY", 4], 0, "year"), U(0, ["YYYYY", 5], 0, "year"), U(0, ["YYYYYY", 6, !0], 0, "year"), N("year", "y"), F("year", 1), de("Y", oe), de("YY", Z, X), de("YYYY", re, Q), de("YYYYY", ie, $), de("YYYYYY", ie, $), me(["YYYYY", "YYYYYY"], ye), me("YYYY", function (e, t) {
t[ye] = 2 === e.length ? i.parseTwoDigitYear(e) : x(e)
}), me("YY", function (e, t) {
t[ye] = i.parseTwoDigitYear(e)
}), me("Y", function (e, t) {
t[ye] = parseInt(e, 10)
}), i.parseTwoDigitYear = function (e) {
return x(e) + (x(e) > 68 ? 1900 : 2e3)
};
var Ee, De = Ie("FullYear", !0);
function Ie(e, t) {
return function (n) {
return null != n ? (Oe(this, e, n), i.updateOffset(this, t), this) : Le(this, e)
}
}
function Le(e, t) {
return e.isValid() ? e._d["get" + (e._isUTC ? "UTC" : "") + t]() : NaN
}
function Oe(e, t, n) {
e.isValid() && !isNaN(n) && ("FullYear" === t && Te(e.year()) && 1 === e.month() && 29 === e.date() ? e._d["set" + (e._isUTC ? "UTC" : "") + t](n, e.month(), Me(n, e.month())) : e._d["set" + (e._isUTC ? "UTC" : "") + t](n))
}
function Me(e, t) {
if (isNaN(e) || isNaN(t)) return NaN;
var n, r = (t % (n = 12) + n) % n;
return e += (t - r) / 12, 1 === r ? Te(e) ? 29 : 28 : 31 - r % 7 % 2
}
Ee = Array.prototype.indexOf ? Array.prototype.indexOf : function (e) {
var t;
for (t = 0; t < this.length; ++t) if (this[t] === e) return t;
return -1
}, U("M", ["MM", 2], "Mo", function () {
return this.month() + 1
}), U("MMM", 0, 0, function (e) {
return this.localeData().monthsShort(this, e)
}), U("MMMM", 0, 0, function (e) {
return this.localeData().months(this, e)
}), N("month", "M"), F("month", 8), de("M", Z), de("MM", Z, X), de("MMM", function (e, t) {
return t.monthsShortRegex(e)
}), de("MMMM", function (e, t) {
return t.monthsRegex(e)
}), me(["M", "MM"], function (e, t) {
t[be] = x(e) - 1
}), me(["MMM", "MMMM"], function (e, t, n, r) {
var i = n._locale.monthsParse(e, r, n._strict);
null != i ? t[be] = i : m(n).invalidMonth = e
});
var Ne = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
Re = "January_February_March_April_May_June_July_August_September_October_November_December".split("_");
var We = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");
function Ve(e, t) {
var n;
if (!e.isValid()) return e;
if ("string" == typeof t) if (/^\d+$/.test(t)) t = x(t); else if (!c(t = e.localeData().monthsParse(t))) return e;
return n = Math.min(e.date(), Me(e.year(), t)), e._d["set" + (e._isUTC ? "UTC" : "") + "Month"](t, n), e
}
function Fe(e) {
return null != e ? (Ve(this, e), i.updateOffset(this, !0), this) : Le(this, "Month")
}
var Ge = ce;
var Be = ce;
function Ke() {
function e(e, t) {
return t.length - e.length
}
var t, n, r = [], i = [], a = [];
for (t = 0; t < 12; t++) n = f([2e3, t]), r.push(this.monthsShort(n, "")), i.push(this.months(n, "")), a.push(this.months(n, "")), a.push(this.monthsShort(n, ""));
for (r.sort(e), i.sort(e), a.sort(e), t = 0; t < 12; t++) r[t] = pe(r[t]), i[t] = pe(i[t]);
for (t = 0; t < 24; t++) a[t] = pe(a[t]);
this._monthsRegex = new RegExp("^(" + a.join("|") + ")", "i"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = new RegExp("^(" + i.join("|") + ")", "i"), this._monthsShortStrictRegex = new RegExp("^(" + r.join("|") + ")", "i")
}
function je(e) {
var t;
if (e < 100 && e >= 0) {
var n = Array.prototype.slice.call(arguments);
n[0] = e + 400, t = new Date(Date.UTC.apply(null, n)), isFinite(t.getUTCFullYear()) && t.setUTCFullYear(e)
} else t = new Date(Date.UTC.apply(null, arguments));
return t
}
function ze(e, t, n) {
var r = 7 + t - n;
return -((7 + je(e, 0, r).getUTCDay() - t) % 7) + r - 1
}
function Ue(e, t, n, r, i) {
var a, o, s = 1 + 7 * (t - 1) + (7 + n - r) % 7 + ze(e, r, i);
return s <= 0 ? o = Ae(a = e - 1) + s : s > Ae(e) ? (a = e + 1, o = s - Ae(e)) : (a = e, o = s), {
year: a,
dayOfYear: o
}
}
function qe(e, t, n) {
var r, i, a = ze(e.year(), t, n), o = Math.floor((e.dayOfYear() - a - 1) / 7) + 1;
return o < 1 ? r = o + He(i = e.year() - 1, t, n) : o > He(e.year(), t, n) ? (r = o - He(e.year(), t, n), i = e.year() + 1) : (i = e.year(), r = o), {
week: r,
year: i
}
}
function He(e, t, n) {
var r = ze(e, t, n), i = ze(e + 1, t, n);
return (Ae(e) - r + i) / 7
}
U("w", ["ww", 2], "wo", "week"), U("W", ["WW", 2], "Wo", "isoWeek"), N("week", "w"), N("isoWeek", "W"), F("week", 5), F("isoWeek", 5), de("w", Z), de("ww", Z, X), de("W", Z), de("WW", Z, X), ve(["w", "ww", "W", "WW"], function (e, t, n, r) {
t[r.substr(0, 1)] = x(e)
});
function Ye(e, t) {
return e.slice(t, 7).concat(e.slice(0, t))
}
U("d", 0, "do", "day"), U("dd", 0, 0, function (e) {
return this.localeData().weekdaysMin(this, e)
}), U("ddd", 0, 0, function (e) {
return this.localeData().weekdaysShort(this, e)
}), U("dddd", 0, 0, function (e) {
return this.localeData().weekdays(this, e)
}), U("e", 0, 0, "weekday"), U("E", 0, 0, "isoWeekday"), N("day", "d"), N("weekday", "e"), N("isoWeekday", "E"), F("day", 11), F("weekday", 11), F("isoWeekday", 11), de("d", Z), de("e", Z), de("E", Z), de("dd", function (e, t) {
return t.weekdaysMinRegex(e)
}), de("ddd", function (e, t) {
return t.weekdaysShortRegex(e)
}), de("dddd", function (e, t) {
return t.weekdaysRegex(e)
}), ve(["dd", "ddd", "dddd"], function (e, t, n, r) {
var i = n._locale.weekdaysParse(e, r, n._strict);
null != i ? t.d = i : m(n).invalidWeekday = e
}), ve(["d", "e", "E"], function (e, t, n, r) {
t[r] = x(e)
});
var Xe = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");
var Je = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");
var Qe = "Su_Mo_Tu_We_Th_Fr_Sa".split("_");
var $e = ce;
var Ze = ce;
var et = ce;
function tt() {
function e(e, t) {
return t.length - e.length
}
var t, n, r, i, a, o = [], s = [], l = [], c = [];
for (t = 0; t < 7; t++) n = f([2e3, 1]).day(t), r = this.weekdaysMin(n, ""), i = this.weekdaysShort(n, ""), a = this.weekdays(n, ""), o.push(r), s.push(i), l.push(a), c.push(r), c.push(i), c.push(a);
for (o.sort(e), s.sort(e), l.sort(e), c.sort(e), t = 0; t < 7; t++) s[t] = pe(s[t]), l[t] = pe(l[t]), c[t] = pe(c[t]);
this._weekdaysRegex = new RegExp("^(" + c.join("|") + ")", "i"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = new RegExp("^(" + l.join("|") + ")", "i"), this._weekdaysShortStrictRegex = new RegExp("^(" + s.join("|") + ")", "i"), this._weekdaysMinStrictRegex = new RegExp("^(" + o.join("|") + ")", "i")
}
function nt() {
return this.hours() % 12 || 12
}
function rt(e, t) {
U(e, 0, 0, function () {
return this.localeData().meridiem(this.hours(), this.minutes(), t)
})
}
function it(e, t) {
return t._meridiemParse
}
U("H", ["HH", 2], 0, "hour"), U("h", ["hh", 2], 0, nt), U("k", ["kk", 2], 0, function () {
return this.hours() || 24
}), U("hmm", 0, 0, function () {
return "" + nt.apply(this) + G(this.minutes(), 2)
}), U("hmmss", 0, 0, function () {
return "" + nt.apply(this) + G(this.minutes(), 2) + G(this.seconds(), 2)
}), U("Hmm", 0, 0, function () {
return "" + this.hours() + G(this.minutes(), 2)
}), U("Hmmss", 0, 0, function () {
return "" + this.hours() + G(this.minutes(), 2) + G(this.seconds(), 2)
}), rt("a", !0), rt("A", !1), N("hour", "h"), F("hour", 13), de("a", it), de("A", it), de("H", Z), de("h", Z), de("k", Z), de("HH", Z, X), de("hh", Z, X), de("kk", Z, X), de("hmm", ee), de("hmmss", te), de("Hmm", ee), de("Hmmss", te), me(["H", "HH"], Se), me(["k", "kk"], function (e, t, n) {
var r = x(e);
t[Se] = 24 === r ? 0 : r
}), me(["a", "A"], function (e, t, n) {
n._isPm = n._locale.isPM(e), n._meridiem = e
}), me(["h", "hh"], function (e, t, n) {
t[Se] = x(e), m(n).bigHour = !0
}), me("hmm", function (e, t, n) {
var r = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r)), m(n).bigHour = !0
}), me("hmmss", function (e, t, n) {
var r = e.length - 4, i = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r, 2)), t[ke] = x(e.substr(i)), m(n).bigHour = !0
}), me("Hmm", function (e, t, n) {
var r = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r))
}), me("Hmmss", function (e, t, n) {
var r = e.length - 4, i = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r, 2)), t[ke] = x(e.substr(i))
});
var at, ot = Ie("Hours", !0), st = {
calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[Last] dddd [at] LT",
sameElse: "L"
},
longDateFormat: {
LTS: "h:mm:ss A",
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D, YYYY",
LLL: "MMMM D, YYYY h:mm A",
LLLL: "dddd, MMMM D, YYYY h:mm A"
},
invalidDate: "Invalid date",
ordinal: "%d",
dayOfMonthOrdinalParse: /\d{1,2}/,
relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
ss: "%d seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years"
},
months: Re,
monthsShort: We,
week: {dow: 0, doy: 6},
weekdays: Xe,
weekdaysMin: Qe,
weekdaysShort: Je,
meridiemParse: /[ap]\.?m?\.?/i
}, lt = {}, ct = {};
function ut(e) {
return e ? e.toLowerCase().replace("_", "-") : e
}
function dt(t) {
var r = null;
if (!lt[t] && void 0 !== e && e && e.exports) try {
r = at._abbr;
n(157), ht(r)
} catch (e) {
}
return lt[t]
}
function ht(e, t) {
var n;
return e && ((n = l(t) ? ft(e) : pt(e, t)) ? at = n : "undefined" != typeof console && console.warn && console.warn("Locale " + e + " not found. Did you forget to load it?")), at._abbr
}
function pt(e, t) {
if (null !== t) {
var n, r = st;
if (t.abbr = e, null != lt[e]) D("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."), r = lt[e]._config; else if (null != t.parentLocale) if (null != lt[t.parentLocale]) r = lt[t.parentLocale]._config; else {
if (null == (n = dt(t.parentLocale))) return ct[t.parentLocale] || (ct[t.parentLocale] = []), ct[t.parentLocale].push({
name: e,
config: t
}), null;
r = n._config
}
return lt[e] = new O(L(r, t)), ct[e] && ct[e].forEach(function (e) {
pt(e.name, e.config)
}), ht(e), lt[e]
}
return delete lt[e], null
}
function ft(e) {
var t;
if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return at;
if (!a(e)) {
if (t = dt(e)) return t;
e = [e]
}
return function (e) {
for (var t, n, r, i, a = 0; a < e.length;) {
for (t = (i = ut(e[a]).split("-")).length, n = (n = ut(e[a + 1])) ? n.split("-") : null; t > 0;) {
if (r = dt(i.slice(0, t).join("-"))) return r;
if (n && n.length >= t && P(i, n, !0) >= t - 1) break;
t--
}
a++
}
return at
}(e)
}
function mt(e) {
var t, n = e._a;
return n && -2 === m(e).overflow && (t = n[be] < 0 || n[be] > 11 ? be : n[we] < 1 || n[we] > Me(n[ye], n[be]) ? we : n[Se] < 0 || n[Se] > 24 || 24 === n[Se] && (0 !== n[_e] || 0 !== n[ke] || 0 !== n[xe]) ? Se : n[_e] < 0 || n[_e] > 59 ? _e : n[ke] < 0 || n[ke] > 59 ? ke : n[xe] < 0 || n[xe] > 999 ? xe : -1, m(e)._overflowDayOfYear && (t < ye || t > we) && (t = we), m(e)._overflowWeeks && -1 === t && (t = Pe), m(e)._overflowWeekday && -1 === t && (t = Ce), m(e).overflow = t), e
}
function vt(e, t, n) {
return null != e ? e : null != t ? t : n
}
function gt(e) {
var t, n, r, a, o, s = [];
if (!e._d) {
for (r = function (e) {
var t = new Date(i.now());
return e._useUTC ? [t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()] : [t.getFullYear(), t.getMonth(), t.getDate()]
}(e), e._w && null == e._a[we] && null == e._a[be] && function (e) {
var t, n, r, i, a, o, s, l;
if (null != (t = e._w).GG || null != t.W || null != t.E) a = 1, o = 4, n = vt(t.GG, e._a[ye], qe(Lt(), 1, 4).year), r = vt(t.W, 1), ((i = vt(t.E, 1)) < 1 || i > 7) && (l = !0); else {
a = e._locale._week.dow, o = e._locale._week.doy;
var c = qe(Lt(), a, o);
n = vt(t.gg, e._a[ye], c.year), r = vt(t.w, c.week), null != t.d ? ((i = t.d) < 0 || i > 6) && (l = !0) : null != t.e ? (i = t.e + a, (t.e < 0 || t.e > 6) && (l = !0)) : i = a
}
r < 1 || r > He(n, a, o) ? m(e)._overflowWeeks = !0 : null != l ? m(e)._overflowWeekday = !0 : (s = Ue(n, r, i, a, o), e._a[ye] = s.year, e._dayOfYear = s.dayOfYear)
}(e), null != e._dayOfYear && (o = vt(e._a[ye], r[ye]), (e._dayOfYear > Ae(o) || 0 === e._dayOfYear) && (m(e)._overflowDayOfYear = !0), n = je(o, 0, e._dayOfYear), e._a[be] = n.getUTCMonth(), e._a[we] = n.getUTCDate()), t = 0; t < 3 && null == e._a[t]; ++t) e._a[t] = s[t] = r[t];
for (; t < 7; t++) e._a[t] = s[t] = null == e._a[t] ? 2 === t ? 1 : 0 : e._a[t];
24 === e._a[Se] && 0 === e._a[_e] && 0 === e._a[ke] && 0 === e._a[xe] && (e._nextDay = !0, e._a[Se] = 0), e._d = (e._useUTC ? je : function (e, t, n, r, i, a, o) {
var s;
return e < 100 && e >= 0 ? (s = new Date(e + 400, t, n, r, i, a, o), isFinite(s.getFullYear()) && s.setFullYear(e)) : s = new Date(e, t, n, r, i, a, o), s
}).apply(null, s), a = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), null != e._tzm && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[Se] = 24), e._w && void 0 !== e._w.d && e._w.d !== a && (m(e).weekdayMismatch = !0)
}
}
var yt = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
bt = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
wt = /Z|[+-]\d\d(?::?\d\d)?/,
St = [["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/], ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/], ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/], ["GGGG-[W]WW", /\d{4}-W\d\d/, !1], ["YYYY-DDD", /\d{4}-\d{3}/], ["YYYY-MM", /\d{4}-\d\d/, !1], ["YYYYYYMMDD", /[+-]\d{10}/], ["YYYYMMDD", /\d{8}/], ["GGGG[W]WWE", /\d{4}W\d{3}/], ["GGGG[W]WW", /\d{4}W\d{2}/, !1], ["YYYYDDD", /\d{7}/]],
_t = [["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/], ["HH:mm:ss", /\d\d:\d\d:\d\d/], ["HH:mm", /\d\d:\d\d/], ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/], ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/], ["HHmmss", /\d\d\d\d\d\d/], ["HHmm", /\d\d\d\d/], ["HH", /\d\d/]],
kt = /^\/?Date\((\-?\d+)/i;
function xt(e) {
var t, n, r, i, a, o, s = e._i, l = yt.exec(s) || bt.exec(s);
if (l) {
for (m(e).iso = !0, t = 0, n = St.length; t < n; t++) if (St[t][1].exec(l[1])) {
i = St[t][0], r = !1 !== St[t][2];
break
}
if (null == i) return void (e._isValid = !1);
if (l[3]) {
for (t = 0, n = _t.length; t < n; t++) if (_t[t][1].exec(l[3])) {
a = (l[2] || " ") + _t[t][0];
break
}
if (null == a) return void (e._isValid = !1)
}
if (!r && null != a) return void (e._isValid = !1);
if (l[4]) {
if (!wt.exec(l[4])) return void (e._isValid = !1);
o = "Z"
}
e._f = i + (a || "") + (o || ""), Et(e)
} else e._isValid = !1
}
var Pt = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
function Ct(e, t, n, r, i, a) {
var o = [function (e) {
var t = parseInt(e, 10);
if (t <= 49) return 2e3 + t;
if (t <= 999) return 1900 + t;
return t
}(e), We.indexOf(t), parseInt(n, 10), parseInt(r, 10), parseInt(i, 10)];
return a && o.push(parseInt(a, 10)), o
}
var At = {
UT: 0,
GMT: 0,
EDT: -240,
EST: -300,
CDT: -300,
CST: -360,
MDT: -360,
MST: -420,
PDT: -420,
PST: -480
};
function Tt(e) {
var t = Pt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, ""));
if (t) {
var n = Ct(t[4], t[3], t[2], t[5], t[6], t[7]);
if (!function (e, t, n) {
return !e || Je.indexOf(e) === new Date(t[0], t[1], t[2]).getDay() || (m(n).weekdayMismatch = !0, n._isValid = !1, !1)
}(t[1], n, e)) return;
e._a = n, e._tzm = function (e, t, n) {
if (e) return At[e];
if (t) return 0;
var r = parseInt(n, 10), i = r % 100;
return (r - i) / 100 * 60 + i
}(t[8], t[9], t[10]), e._d = je.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), m(e).rfc2822 = !0
} else e._isValid = !1
}
function Et(e) {
if (e._f !== i.ISO_8601) if (e._f !== i.RFC_2822) {
e._a = [], m(e).empty = !0;
var t, n, r, a, o, s = "" + e._i, l = s.length, c = 0;
for (r = H(e._f, e._locale).match(B) || [], t = 0; t < r.length; t++) a = r[t], (n = (s.match(he(a, e)) || [])[0]) && ((o = s.substr(0, s.indexOf(n))).length > 0 && m(e).unusedInput.push(o), s = s.slice(s.indexOf(n) + n.length), c += n.length), z[a] ? (n ? m(e).empty = !1 : m(e).unusedTokens.push(a), ge(a, n, e)) : e._strict && !n && m(e).unusedTokens.push(a);
m(e).charsLeftOver = l - c, s.length > 0 && m(e).unusedInput.push(s), e._a[Se] <= 12 && !0 === m(e).bigHour && e._a[Se] > 0 && (m(e).bigHour = void 0), m(e).parsedDateParts = e._a.slice(0), m(e).meridiem = e._meridiem, e._a[Se] = function (e, t, n) {
var r;
if (null == n) return t;
return null != e.meridiemHour ? e.meridiemHour(t, n) : null != e.isPM ? ((r = e.isPM(n)) && t < 12 && (t += 12), r || 12 !== t || (t = 0), t) : t
}(e._locale, e._a[Se], e._meridiem), gt(e), mt(e)
} else Tt(e); else xt(e)
}
function Dt(e) {
var t = e._i, n = e._f;
return e._locale = e._locale || ft(e._l), null === t || void 0 === n && "" === t ? g({nullInput: !0}) : ("string" == typeof t && (e._i = t = e._locale.preparse(t)), _(t) ? new S(mt(t)) : (u(t) ? e._d = t : a(n) ? function (e) {
var t, n, r, i, a;
if (0 === e._f.length) return m(e).invalidFormat = !0, void (e._d = new Date(NaN));
for (i = 0; i < e._f.length; i++) a = 0, t = b({}, e), null != e._useUTC && (t._useUTC = e._useUTC), t._f = e._f[i], Et(t), v(t) && (a += m(t).charsLeftOver, a += 10 * m(t).unusedTokens.length, m(t).score = a, (null == r || a < r) && (r = a, n = t));
p(e, n || t)
}(e) : n ? Et(e) : function (e) {
var t = e._i;
l(t) ? e._d = new Date(i.now()) : u(t) ? e._d = new Date(t.valueOf()) : "string" == typeof t ? function (e) {
var t = kt.exec(e._i);
null === t ? (xt(e), !1 === e._isValid && (delete e._isValid, Tt(e), !1 === e._isValid && (delete e._isValid, i.createFromInputFallback(e)))) : e._d = new Date(+t[1])
}(e) : a(t) ? (e._a = d(t.slice(0), function (e) {
return parseInt(e, 10)
}), gt(e)) : s(t) ? function (e) {
if (!e._d) {
var t = W(e._i);
e._a = d([t.year, t.month, t.day || t.date, t.hour, t.minute, t.second, t.millisecond], function (e) {
return e && parseInt(e, 10)
}), gt(e)
}
}(e) : c(t) ? e._d = new Date(t) : i.createFromInputFallback(e)
}(e), v(e) || (e._d = null), e))
}
function It(e, t, n, r, i) {
var o, l = {};
return !0 !== n && !1 !== n || (r = n, n = void 0), (s(e) && function (e) {
if (Object.getOwnPropertyNames) return 0 === Object.getOwnPropertyNames(e).length;
var t;
for (t in e) if (e.hasOwnProperty(t)) return !1;
return !0
}(e) || a(e) && 0 === e.length) && (e = void 0), l._isAMomentObject = !0, l._useUTC = l._isUTC = i, l._l = n, l._i = e, l._f = t, l._strict = r, (o = new S(mt(Dt(l))))._nextDay && (o.add(1, "d"), o._nextDay = void 0), o
}
function Lt(e, t, n, r) {
return It(e, t, n, r, !1)
}
i.createFromInputFallback = A("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function (e) {
e._d = new Date(e._i + (e._useUTC ? " UTC" : ""))
}), i.ISO_8601 = function () {
}, i.RFC_2822 = function () {
};
var Ot = A("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function () {
var e = Lt.apply(null, arguments);
return this.isValid() && e.isValid() ? e < this ? this : e : g()
}),
Mt = A("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function () {
var e = Lt.apply(null, arguments);
return this.isValid() && e.isValid() ? e > this ? this : e : g()
});
function Nt(e, t) {
var n, r;
if (1 === t.length && a(t[0]) && (t = t[0]), !t.length) return Lt();
for (n = t[0], r = 1; r < t.length; ++r) t[r].isValid() && !t[r][e](n) || (n = t[r]);
return n
}
var Rt = ["year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond"];
function Wt(e) {
var t = W(e), n = t.year || 0, r = t.quarter || 0, i = t.month || 0, a = t.week || t.isoWeek || 0,
o = t.day || 0, s = t.hour || 0, l = t.minute || 0, c = t.second || 0, u = t.millisecond || 0;
this._isValid = function (e) {
for (var t in e) if (-1 === Ee.call(Rt, t) || null != e[t] && isNaN(e[t])) return !1;
for (var n = !1, r = 0; r < Rt.length; ++r) if (e[Rt[r]]) {
if (n) return !1;
parseFloat(e[Rt[r]]) !== x(e[Rt[r]]) && (n = !0)
}
return !0
}(t), this._milliseconds = +u + 1e3 * c + 6e4 * l + 1e3 * s * 60 * 60, this._days = +o + 7 * a, this._months = +i + 3 * r + 12 * n, this._data = {}, this._locale = ft(), this._bubble()
}
function Vt(e) {
return e instanceof Wt
}
function Ft(e) {
return e < 0 ? -1 * Math.round(-1 * e) : Math.round(e)
}
function Gt(e, t) {
U(e, 0, 0, function () {
var e = this.utcOffset(), n = "+";
return e < 0 && (e = -e, n = "-"), n + G(~~(e / 60), 2) + t + G(~~e % 60, 2)
})
}
Gt("Z", ":"), Gt("ZZ", ""), de("Z", le), de("ZZ", le), me(["Z", "ZZ"], function (e, t, n) {
n._useUTC = !0, n._tzm = Kt(le, e)
});
var Bt = /([\+\-]|\d\d)/gi;
function Kt(e, t) {
var n = (t || "").match(e);
if (null === n) return null;
var r = ((n[n.length - 1] || []) + "").match(Bt) || ["-", 0, 0], i = 60 * r[1] + x(r[2]);
return 0 === i ? 0 : "+" === r[0] ? i : -i
}
function jt(e, t) {
var n, r;
return t._isUTC ? (n = t.clone(), r = (_(e) || u(e) ? e.valueOf() : Lt(e).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + r), i.updateOffset(n, !1), n) : Lt(e).local()
}
function zt(e) {
return 15 * -Math.round(e._d.getTimezoneOffset() / 15)
}
function Ut() {
return !!this.isValid() && (this._isUTC && 0 === this._offset)
}
i.updateOffset = function () {
};
var qt = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,
Ht = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
function Yt(e, t) {
var n, r, i, a = e, s = null;
return Vt(e) ? a = {
ms: e._milliseconds,
d: e._days,
M: e._months
} : c(e) ? (a = {}, t ? a[t] = e : a.milliseconds = e) : (s = qt.exec(e)) ? (n = "-" === s[1] ? -1 : 1, a = {
y: 0,
d: x(s[we]) * n,
h: x(s[Se]) * n,
m: x(s[_e]) * n,
s: x(s[ke]) * n,
ms: x(Ft(1e3 * s[xe])) * n
}) : (s = Ht.exec(e)) ? (n = "-" === s[1] ? -1 : 1, a = {
y: Xt(s[2], n),
M: Xt(s[3], n),
w: Xt(s[4], n),
d: Xt(s[5], n),
h: Xt(s[6], n),
m: Xt(s[7], n),
s: Xt(s[8], n)
}) : null == a ? a = {} : "object" === (void 0 === a ? "undefined" : o(a)) && ("from" in a || "to" in a) && (i = function (e, t) {
var n;
if (!e.isValid() || !t.isValid()) return {milliseconds: 0, months: 0};
t = jt(t, e), e.isBefore(t) ? n = Jt(e, t) : ((n = Jt(t, e)).milliseconds = -n.milliseconds, n.months = -n.months);
return n
}(Lt(a.from), Lt(a.to)), (a = {}).ms = i.milliseconds, a.M = i.months), r = new Wt(a), Vt(e) && h(e, "_locale") && (r._locale = e._locale), r
}
function Xt(e, t) {
var n = e && parseFloat(e.replace(",", "."));
return (isNaN(n) ? 0 : n) * t
}
function Jt(e, t) {
var n = {};
return n.months = t.month() - e.month() + 12 * (t.year() - e.year()), e.clone().add(n.months, "M").isAfter(t) && --n.months, n.milliseconds = +t - +e.clone().add(n.months, "M"), n
}
function Qt(e, t) {
return function (n, r) {
var i;
return null === r || isNaN(+r) || (D(t, "moment()." + t + "(period, number) is deprecated. Please use moment()." + t + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."), i = n, n = r, r = i), $t(this, Yt(n = "string" == typeof n ? +n : n, r), e), this
}
}
function $t(e, t, n, r) {
var a = t._milliseconds, o = Ft(t._days), s = Ft(t._months);
e.isValid() && (r = null == r || r, s && Ve(e, Le(e, "Month") + s * n), o && Oe(e, "Date", Le(e, "Date") + o * n), a && e._d.setTime(e._d.valueOf() + a * n), r && i.updateOffset(e, o || s))
}
Yt.fn = Wt.prototype, Yt.invalid = function () {
return Yt(NaN)
};
var Zt = Qt(1, "add"), en = Qt(-1, "subtract");
function tn(e, t) {
var n = 12 * (t.year() - e.year()) + (t.month() - e.month()), r = e.clone().add(n, "months");
return -(n + (t - r < 0 ? (t - r) / (r - e.clone().add(n - 1, "months")) : (t - r) / (e.clone().add(n + 1, "months") - r))) || 0
}
function nn(e) {
var t;
return void 0 === e ? this._locale._abbr : (null != (t = ft(e)) && (this._locale = t), this)
}
i.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ", i.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
var rn = A("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function (e) {
return void 0 === e ? this.localeData() : this.locale(e)
});
function an() {
return this._locale
}
var on = 1e3, sn = 60 * on, ln = 60 * sn, cn = 3506328 * ln;
function un(e, t) {
return (e % t + t) % t
}
function dn(e, t, n) {
return e < 100 && e >= 0 ? new Date(e + 400, t, n) - cn : new Date(e, t, n).valueOf()
}
function hn(e, t, n) {
return e < 100 && e >= 0 ? Date.UTC(e + 400, t, n) - cn : Date.UTC(e, t, n)
}
function pn(e, t) {
U(0, [e, e.length], 0, t)
}
function fn(e, t, n, r, i) {
var a;
return null == e ? qe(this, r, i).year : (t > (a = He(e, r, i)) && (t = a), function (e, t, n, r, i) {
var a = Ue(e, t, n, r, i), o = je(a.year, 0, a.dayOfYear);
return this.year(o.getUTCFullYear()), this.month(o.getUTCMonth()), this.date(o.getUTCDate()), this
}.call(this, e, t, n, r, i))
}
U(0, ["gg", 2], 0, function () {
return this.weekYear() % 100
}), U(0, ["GG", 2], 0, function () {
return this.isoWeekYear() % 100
}), pn("gggg", "weekYear"), pn("ggggg", "weekYear"), pn("GGGG", "isoWeekYear"), pn("GGGGG", "isoWeekYear"), N("weekYear", "gg"), N("isoWeekYear", "GG"), F("weekYear", 1), F("isoWeekYear", 1), de("G", oe), de("g", oe), de("GG", Z, X), de("gg", Z, X), de("GGGG", re, Q), de("gggg", re, Q), de("GGGGG", ie, $), de("ggggg", ie, $), ve(["gggg", "ggggg", "GGGG", "GGGGG"], function (e, t, n, r) {
t[r.substr(0, 2)] = x(e)
}), ve(["gg", "GG"], function (e, t, n, r) {
t[r] = i.parseTwoDigitYear(e)
}), U("Q", 0, "Qo", "quarter"), N("quarter", "Q"), F("quarter", 7), de("Q", Y), me("Q", function (e, t) {
t[be] = 3 * (x(e) - 1)
}), U("D", ["DD", 2], "Do", "date"), N("date", "D"), F("date", 9), de("D", Z), de("DD", Z, X), de("Do", function (e, t) {
return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient
}), me(["D", "DD"], we), me("Do", function (e, t) {
t[we] = x(e.match(Z)[0])
});
var mn = Ie("Date", !0);
U("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), N("dayOfYear", "DDD"), F("dayOfYear", 4), de("DDD", ne), de("DDDD", J), me(["DDD", "DDDD"], function (e, t, n) {
n._dayOfYear = x(e)
}), U("m", ["mm", 2], 0, "minute"), N("minute", "m"), F("minute", 14), de("m", Z), de("mm", Z, X), me(["m", "mm"], _e);
var vn = Ie("Minutes", !1);
U("s", ["ss", 2], 0, "second"), N("second", "s"), F("second", 15), de("s", Z), de("ss", Z, X), me(["s", "ss"], ke);
var gn, yn = Ie("Seconds", !1);
for (U("S", 0, 0, function () {
return ~~(this.millisecond() / 100)
}), U(0, ["SS", 2], 0, function () {
return ~~(this.millisecond() / 10)
}), U(0, ["SSS", 3], 0, "millisecond"), U(0, ["SSSS", 4], 0, function () {
return 10 * this.millisecond()
}), U(0, ["SSSSS", 5], 0, function () {
return 100 * this.millisecond()
}), U(0, ["SSSSSS", 6], 0, function () {
return 1e3 * this.millisecond()
}), U(0, ["SSSSSSS", 7], 0, function () {
return 1e4 * this.millisecond()
}), U(0, ["SSSSSSSS", 8], 0, function () {
return 1e5 * this.millisecond()
}), U(0, ["SSSSSSSSS", 9], 0, function () {
return 1e6 * this.millisecond()
}), N("millisecond", "ms"), F("millisecond", 16), de("S", ne, Y), de("SS", ne, X), de("SSS", ne, J), gn = "SSSS"; gn.length <= 9; gn += "S") de(gn, ae);
function bn(e, t) {
t[xe] = x(1e3 * ("0." + e))
}
for (gn = "S"; gn.length <= 9; gn += "S") me(gn, bn);
var wn = Ie("Milliseconds", !1);
U("z", 0, 0, "zoneAbbr"), U("zz", 0, 0, "zoneName");
var Sn = S.prototype;
function _n(e) {
return e
}
Sn.add = Zt, Sn.calendar = function (e, t) {
var n = e || Lt(), r = jt(n, this).startOf("day"), a = i.calendarFormat(this, r) || "sameElse",
o = t && (I(t[a]) ? t[a].call(this, n) : t[a]);
return this.format(o || this.localeData().calendar(a, this, Lt(n)))
}, Sn.clone = function () {
return new S(this)
}, Sn.diff = function (e, t, n) {
var r, i, a;
if (!this.isValid()) return NaN;
if (!(r = jt(e, this)).isValid()) return NaN;
switch (i = 6e4 * (r.utcOffset() - this.utcOffset()), t = R(t)) {
case"year":
a = tn(this, r) / 12;
break;
case"month":
a = tn(this, r);
break;
case"quarter":
a = tn(this, r) / 3;
break;
case"second":
a = (this - r) / 1e3;
break;
case"minute":
a = (this - r) / 6e4;
break;
case"hour":
a = (this - r) / 36e5;
break;
case"day":
a = (this - r - i) / 864e5;
break;
case"week":
a = (this - r - i) / 6048e5;
break;
default:
a = this - r
}
return n ? a : k(a)
}, Sn.endOf = function (e) {
var t;
if (void 0 === (e = R(e)) || "millisecond" === e || !this.isValid()) return this;
var n = this._isUTC ? hn : dn;
switch (e) {
case"year":
t = n(this.year() + 1, 0, 1) - 1;
break;
case"quarter":
t = n(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
break;
case"month":
t = n(this.year(), this.month() + 1, 1) - 1;
break;
case"week":
t = n(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
break;
case"isoWeek":
t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
break;
case"day":
case"date":
t = n(this.year(), this.month(), this.date() + 1) - 1;
break;
case"hour":
t = this._d.valueOf(), t += ln - un(t + (this._isUTC ? 0 : this.utcOffset() * sn), ln) - 1;
break;
case"minute":
t = this._d.valueOf(), t += sn - un(t, sn) - 1;
break;
case"second":
t = this._d.valueOf(), t += on - un(t, on) - 1
}
return this._d.setTime(t), i.updateOffset(this, !0), this
}, Sn.format = function (e) {
e || (e = this.isUtc() ? i.defaultFormatUtc : i.defaultFormat);
var t = q(this, e);
return this.localeData().postformat(t)
}, Sn.from = function (e, t) {
return this.isValid() && (_(e) && e.isValid() || Lt(e).isValid()) ? Yt({
to: this,
from: e
}).locale(this.locale()).humanize(!t) : this.localeData().invalidDate()
}, Sn.fromNow = function (e) {
return this.from(Lt(), e)
}, Sn.to = function (e, t) {
return this.isValid() && (_(e) && e.isValid() || Lt(e).isValid()) ? Yt({
from: this,
to: e
}).locale(this.locale()).humanize(!t) : this.localeData().invalidDate()
}, Sn.toNow = function (e) {
return this.to(Lt(), e)
}, Sn.get = function (e) {
return I(this[e = R(e)]) ? this[e]() : this
}, Sn.invalidAt = function () {
return m(this).overflow
}, Sn.isAfter = function (e, t) {
var n = _(e) ? e : Lt(e);
return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() > n.valueOf() : n.valueOf() < this.clone().startOf(t).valueOf())
}, Sn.isBefore = function (e, t) {
var n = _(e) ? e : Lt(e);
return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() < n.valueOf() : this.clone().endOf(t).valueOf() < n.valueOf())
}, Sn.isBetween = function (e, t, n, r) {
var i = _(e) ? e : Lt(e), a = _(t) ? t : Lt(t);
return !!(this.isValid() && i.isValid() && a.isValid()) && ("(" === (r = r || "()")[0] ? this.isAfter(i, n) : !this.isBefore(i, n)) && (")" === r[1] ? this.isBefore(a, n) : !this.isAfter(a, n))
}, Sn.isSame = function (e, t) {
var n, r = _(e) ? e : Lt(e);
return !(!this.isValid() || !r.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() === r.valueOf() : (n = r.valueOf(), this.clone().startOf(t).valueOf() <= n && n <= this.clone().endOf(t).valueOf()))
}, Sn.isSameOrAfter = function (e, t) {
return this.isSame(e, t) || this.isAfter(e, t)
}, Sn.isSameOrBefore = function (e, t) {
return this.isSame(e, t) || this.isBefore(e, t)
}, Sn.isValid = function () {
return v(this)
}, Sn.lang = rn, Sn.locale = nn, Sn.localeData = an, Sn.max = Mt, Sn.min = Ot, Sn.parsingFlags = function () {
return p({}, m(this))
}, Sn.set = function (e, t) {
if ("object" === (void 0 === e ? "undefined" : o(e))) for (var n = function (e) {
var t = [];
for (var n in e) t.push({unit: n, priority: V[n]});
return t.sort(function (e, t) {
return e.priority - t.priority
}), t
}(e = W(e)), r = 0; r < n.length; r++) this[n[r].unit](e[n[r].unit]); else if (I(this[e = R(e)])) return this[e](t);
return this
}, Sn.startOf = function (e) {
var t;
if (void 0 === (e = R(e)) || "millisecond" === e || !this.isValid()) return this;
var n = this._isUTC ? hn : dn;
switch (e) {
case"year":
t = n(this.year(), 0, 1);
break;
case"quarter":
t = n(this.year(), this.month() - this.month() % 3, 1);
break;
case"month":
t = n(this.year(), this.month(), 1);
break;
case"week":
t = n(this.year(), this.month(), this.date() - this.weekday());
break;
case"isoWeek":
t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
break;
case"day":
case"date":
t = n(this.year(), this.month(), this.date());
break;
case"hour":
t = this._d.valueOf(), t -= un(t + (this._isUTC ? 0 : this.utcOffset() * sn), ln);
break;
case"minute":
t = this._d.valueOf(), t -= un(t, sn);
break;
case"second":
t = this._d.valueOf(), t -= un(t, on)
}
return this._d.setTime(t), i.updateOffset(this, !0), this
}, Sn.subtract = en, Sn.toArray = function () {
var e = this;
return [e.year(), e.month(), e.date(), e.hour(), e.minute(), e.second(), e.millisecond()]
}, Sn.toObject = function () {
var e = this;
return {
years: e.year(),
months: e.month(),
date: e.date(),
hours: e.hours(),
minutes: e.minutes(),
seconds: e.seconds(),
milliseconds: e.milliseconds()
}
}, Sn.toDate = function () {
return new Date(this.valueOf())
}, Sn.toISOString = function (e) {
if (!this.isValid()) return null;
var t = !0 !== e, n = t ? this.clone().utc() : this;
return n.year() < 0 || n.year() > 9999 ? q(n, t ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ") : I(Date.prototype.toISOString) ? t ? this.toDate().toISOString() : new Date(this.valueOf() + 60 * this.utcOffset() * 1e3).toISOString().replace("Z", q(n, "Z")) : q(n, t ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ")
}, Sn.inspect = function () {
if (!this.isValid()) return "moment.invalid(/* " + this._i + " */)";
var e = "moment", t = "";
this.isLocal() || (e = 0 === this.utcOffset() ? "moment.utc" : "moment.parseZone", t = "Z");
var n = "[" + e + '("]', r = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY", i = t + '[")]';
return this.format(n + r + "-MM-DD[T]HH:mm:ss.SSS" + i)
}, Sn.toJSON = function () {
return this.isValid() ? this.toISOString() : null
}, Sn.toString = function () {
return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
}, Sn.unix = function () {
return Math.floor(this.valueOf() / 1e3)
}, Sn.valueOf = function () {
return this._d.valueOf() - 6e4 * (this._offset || 0)
}, Sn.creationData = function () {
return {input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict}
}, Sn.year = De, Sn.isLeapYear = function () {
return Te(this.year())
}, Sn.weekYear = function (e) {
return fn.call(this, e, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy)
}, Sn.isoWeekYear = function (e) {
return fn.call(this, e, this.isoWeek(), this.isoWeekday(), 1, 4)
}, Sn.quarter = Sn.quarters = function (e) {
return null == e ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (e - 1) + this.month() % 3)
}, Sn.month = Fe, Sn.daysInMonth = function () {
return Me(this.year(), this.month())
}, Sn.week = Sn.weeks = function (e) {
var t = this.localeData().week(this);
return null == e ? t : this.add(7 * (e - t), "d")
}, Sn.isoWeek = Sn.isoWeeks = function (e) {
var t = qe(this, 1, 4).week;
return null == e ? t : this.add(7 * (e - t), "d")
}, Sn.weeksInYear = function () {
var e = this.localeData()._week;
return He(this.year(), e.dow, e.doy)
}, Sn.isoWeeksInYear = function () {
return He(this.year(), 1, 4)
}, Sn.date = mn, Sn.day = Sn.days = function (e) {
if (!this.isValid()) return null != e ? this : NaN;
var t = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
return null != e ? (e = function (e, t) {
return "string" != typeof e ? e : isNaN(e) ? "number" == typeof (e = t.weekdaysParse(e)) ? e : null : parseInt(e, 10)
}(e, this.localeData()), this.add(e - t, "d")) : t
}, Sn.weekday = function (e) {
if (!this.isValid()) return null != e ? this : NaN;
var t = (this.day() + 7 - this.localeData()._week.dow) % 7;
return null == e ? t : this.add(e - t, "d")
}, Sn.isoWeekday = function (e) {
if (!this.isValid()) return null != e ? this : NaN;
if (null != e) {
var t = function (e, t) {
return "string" == typeof e ? t.weekdaysParse(e) % 7 || 7 : isNaN(e) ? null : e
}(e, this.localeData());
return this.day(this.day() % 7 ? t : t - 7)
}
return this.day() || 7
}, Sn.dayOfYear = function (e) {
var t = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1;
return null == e ? t : this.add(e - t, "d")
}, Sn.hour = Sn.hours = ot, Sn.minute = Sn.minutes = vn, Sn.second = Sn.seconds = yn, Sn.millisecond = Sn.milliseconds = wn, Sn.utcOffset = function (e, t, n) {
var r, a = this._offset || 0;
if (!this.isValid()) return null != e ? this : NaN;
if (null != e) {
if ("string" == typeof e) {
if (null === (e = Kt(le, e))) return this
} else Math.abs(e) < 16 && !n && (e *= 60);
return !this._isUTC && t && (r = zt(this)), this._offset = e, this._isUTC = !0, null != r && this.add(r, "m"), a !== e && (!t || this._changeInProgress ? $t(this, Yt(e - a, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, i.updateOffset(this, !0), this._changeInProgress = null)), this
}
return this._isUTC ? a : zt(this)
}, Sn.utc = function (e) {
return this.utcOffset(0, e)
}, Sn.local = function (e) {
return this._isUTC && (this.utcOffset(0, e), this._isUTC = !1, e && this.subtract(zt(this), "m")), this
}, Sn.parseZone = function () {
if (null != this._tzm) this.utcOffset(this._tzm, !1, !0); else if ("string" == typeof this._i) {
var e = Kt(se, this._i);
null != e ? this.utcOffset(e) : this.utcOffset(0, !0)
}
return this
}, Sn.hasAlignedHourOffset = function (e) {
return !!this.isValid() && (e = e ? Lt(e).utcOffset() : 0, (this.utcOffset() - e) % 60 == 0)
}, Sn.isDST = function () {
return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset()
}, Sn.isLocal = function () {
return !!this.isValid() && !this._isUTC
}, Sn.isUtcOffset = function () {
return !!this.isValid() && this._isUTC
}, Sn.isUtc = Ut, Sn.isUTC = Ut, Sn.zoneAbbr = function () {
return this._isUTC ? "UTC" : ""
}, Sn.zoneName = function () {
return this._isUTC ? "Coordinated Universal Time" : ""
}, Sn.dates = A("dates accessor is deprecated. Use date instead.", mn), Sn.months = A("months accessor is deprecated. Use month instead", Fe), Sn.years = A("years accessor is deprecated. Use year instead", De), Sn.zone = A("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", function (e, t) {
return null != e ? ("string" != typeof e && (e = -e), this.utcOffset(e, t), this) : -this.utcOffset()
}), Sn.isDSTShifted = A("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", function () {
if (!l(this._isDSTShifted)) return this._isDSTShifted;
var e = {};
if (b(e, this), (e = Dt(e))._a) {
var t = e._isUTC ? f(e._a) : Lt(e._a);
this._isDSTShifted = this.isValid() && P(e._a, t.toArray()) > 0
} else this._isDSTShifted = !1;
return this._isDSTShifted
});
var kn = O.prototype;
function xn(e, t, n, r) {
var i = ft(), a = f().set(r, t);
return i[n](a, e)
}
function Pn(e, t, n) {
if (c(e) && (t = e, e = void 0), e = e || "", null != t) return xn(e, t, n, "month");
var r, i = [];
for (r = 0; r < 12; r++) i[r] = xn(e, r, n, "month");
return i
}
function Cn(e, t, n, r) {
"boolean" == typeof e ? (c(t) && (n = t, t = void 0), t = t || "") : (n = t = e, e = !1, c(t) && (n = t, t = void 0), t = t || "");
var i, a = ft(), o = e ? a._week.dow : 0;
if (null != n) return xn(t, (n + o) % 7, r, "day");
var s = [];
for (i = 0; i < 7; i++) s[i] = xn(t, (i + o) % 7, r, "day");
return s
}
kn.calendar = function (e, t, n) {
var r = this._calendar[e] || this._calendar.sameElse;
return I(r) ? r.call(t, n) : r
}, kn.longDateFormat = function (e) {
var t = this._longDateFormat[e], n = this._longDateFormat[e.toUpperCase()];
return t || !n ? t : (this._longDateFormat[e] = n.replace(/MMMM|MM|DD|dddd/g, function (e) {
return e.slice(1)
}), this._longDateFormat[e])
}, kn.invalidDate = function () {
return this._invalidDate
}, kn.ordinal = function (e) {
return this._ordinal.replace("%d", e)
}, kn.preparse = _n, kn.postformat = _n, kn.relativeTime = function (e, t, n, r) {
var i = this._relativeTime[n];
return I(i) ? i(e, t, n, r) : i.replace(/%d/i, e)
}, kn.pastFuture = function (e, t) {
var n = this._relativeTime[e > 0 ? "future" : "past"];
return I(n) ? n(t) : n.replace(/%s/i, t)
}, kn.set = function (e) {
var t, n;
for (n in e) I(t = e[n]) ? this[n] = t : this["_" + n] = t;
this._config = e, this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source)
}, kn.months = function (e, t) {
return e ? a(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || Ne).test(t) ? "format" : "standalone"][e.month()] : a(this._months) ? this._months : this._months.standalone
}, kn.monthsShort = function (e, t) {
return e ? a(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[Ne.test(t) ? "format" : "standalone"][e.month()] : a(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone
}, kn.monthsParse = function (e, t, n) {
var r, i, a;
if (this._monthsParseExact) return function (e, t, n) {
var r, i, a, o = e.toLocaleLowerCase();
if (!this._monthsParse) for (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = [], r = 0; r < 12; ++r) a = f([2e3, r]), this._shortMonthsParse[r] = this.monthsShort(a, "").toLocaleLowerCase(), this._longMonthsParse[r] = this.months(a, "").toLocaleLowerCase();
return n ? "MMM" === t ? -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : null : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : null : "MMM" === t ? -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : null : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : null
}.call(this, e, t, n);
for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), r = 0; r < 12; r++) {
if (i = f([2e3, r]), n && !this._longMonthsParse[r] && (this._longMonthsParse[r] = new RegExp("^" + this.months(i, "").replace(".", "") + "$", "i"), this._shortMonthsParse[r] = new RegExp("^" + this.monthsShort(i, "").replace(".", "") + "$", "i")), n || this._monthsParse[r] || (a = "^" + this.months(i, "") + "|^" + this.monthsShort(i, ""), this._monthsParse[r] = new RegExp(a.replace(".", ""), "i")), n && "MMMM" === t && this._longMonthsParse[r].test(e)) return r;
if (n && "MMM" === t && this._shortMonthsParse[r].test(e)) return r;
if (!n && this._monthsParse[r].test(e)) return r
}
}, kn.monthsRegex = function (e) {
return this._monthsParseExact ? (h(this, "_monthsRegex") || Ke.call(this), e ? this._monthsStrictRegex : this._monthsRegex) : (h(this, "_monthsRegex") || (this._monthsRegex = Be), this._monthsStrictRegex && e ? this._monthsStrictRegex : this._monthsRegex)
}, kn.monthsShortRegex = function (e) {
return this._monthsParseExact ? (h(this, "_monthsRegex") || Ke.call(this), e ? this._monthsShortStrictRegex : this._monthsShortRegex) : (h(this, "_monthsShortRegex") || (this._monthsShortRegex = Ge), this._monthsShortStrictRegex && e ? this._monthsShortStrictRegex : this._monthsShortRegex)
}, kn.week = function (e) {
return qe(e, this._week.dow, this._week.doy).week
}, kn.firstDayOfYear = function () {
return this._week.doy
}, kn.firstDayOfWeek = function () {
return this._week.dow
}, kn.weekdays = function (e, t) {
var n = a(this._weekdays) ? this._weekdays : this._weekdays[e && !0 !== e && this._weekdays.isFormat.test(t) ? "format" : "standalone"];
return !0 === e ? Ye(n, this._week.dow) : e ? n[e.day()] : n
}, kn.weekdaysMin = function (e) {
return !0 === e ? Ye(this._weekdaysMin, this._week.dow) : e ? this._weekdaysMin[e.day()] : this._weekdaysMin
}, kn.weekdaysShort = function (e) {
return !0 === e ? Ye(this._weekdaysShort, this._week.dow) : e ? this._weekdaysShort[e.day()] : this._weekdaysShort
}, kn.weekdaysParse = function (e, t, n) {
var r, i, a;
if (this._weekdaysParseExact) return function (e, t, n) {
var r, i, a, o = e.toLocaleLowerCase();
if (!this._weekdaysParse) for (this._weekdaysParse = [], this._shortWeekdaysParse = [], this._minWeekdaysParse = [], r = 0; r < 7; ++r) a = f([2e3, 1]).day(r), this._minWeekdaysParse[r] = this.weekdaysMin(a, "").toLocaleLowerCase(), this._shortWeekdaysParse[r] = this.weekdaysShort(a, "").toLocaleLowerCase(), this._weekdaysParse[r] = this.weekdays(a, "").toLocaleLowerCase();
return n ? "dddd" === t ? -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : null : "ddd" === t ? -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : null : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : "dddd" === t ? -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : "ddd" === t ? -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : null
}.call(this, e, t, n);
for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), r = 0; r < 7; r++) {
if (i = f([2e3, 1]).day(r), n && !this._fullWeekdaysParse[r] && (this._fullWeekdaysParse[r] = new RegExp("^" + this.weekdays(i, "").replace(".", "\\.?") + "$", "i"), this._shortWeekdaysParse[r] = new RegExp("^" + this.weekdaysShort(i, "").replace(".", "\\.?") + "$", "i"), this._minWeekdaysParse[r] = new RegExp("^" + this.weekdaysMin(i, "").replace(".", "\\.?") + "$", "i")), this._weekdaysParse[r] || (a = "^" + this.weekdays(i, "") + "|^" + this.weekdaysShort(i, "") + "|^" + this.weekdaysMin(i, ""), this._weekdaysParse[r] = new RegExp(a.replace(".", ""), "i")), n && "dddd" === t && this._fullWeekdaysParse[r].test(e)) return r;
if (n && "ddd" === t && this._shortWeekdaysParse[r].test(e)) return r;
if (n && "dd" === t && this._minWeekdaysParse[r].test(e)) return r;
if (!n && this._weekdaysParse[r].test(e)) return r
}
}, kn.weekdaysRegex = function (e) {
return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysStrictRegex : this._weekdaysRegex) : (h(this, "_weekdaysRegex") || (this._weekdaysRegex = $e), this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex)
}, kn.weekdaysShortRegex = function (e) {
return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (h(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = Ze), this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex)
}, kn.weekdaysMinRegex = function (e) {
return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (h(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = et), this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex)
}, kn.isPM = function (e) {
return "p" === (e + "").toLowerCase().charAt(0)
}, kn.meridiem = function (e, t, n) {
return e > 11 ? n ? "pm" : "PM" : n ? "am" : "AM"
}, ht("en", {
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (e) {
var t = e % 10;
return e + (1 === x(e % 100 / 10) ? "th" : 1 === t ? "st" : 2 === t ? "nd" : 3 === t ? "rd" : "th")
}
}), i.lang = A("moment.lang is deprecated. Use moment.locale instead.", ht), i.langData = A("moment.langData is deprecated. Use moment.localeData instead.", ft);
var An = Math.abs;
function Tn(e, t, n, r) {
var i = Yt(t, n);
return e._milliseconds += r * i._milliseconds, e._days += r * i._days, e._months += r * i._months, e._bubble()
}
function En(e) {
return e < 0 ? Math.floor(e) : Math.ceil(e)
}
function Dn(e) {
return 4800 * e / 146097
}
function In(e) {
return 146097 * e / 4800
}
function Ln(e) {
return function () {
return this.as(e)
}
}
var On = Ln("ms"), Mn = Ln("s"), Nn = Ln("m"), Rn = Ln("h"), Wn = Ln("d"), Vn = Ln("w"), Fn = Ln("M"),
Gn = Ln("Q"), Bn = Ln("y");
function Kn(e) {
return function () {
return this.isValid() ? this._data[e] : NaN
}
}
var jn = Kn("milliseconds"), zn = Kn("seconds"), Un = Kn("minutes"), qn = Kn("hours"), Hn = Kn("days"),
Yn = Kn("months"), Xn = Kn("years");
var Jn = Math.round, Qn = {ss: 44, s: 45, m: 45, h: 22, d: 26, M: 11};
var $n = Math.abs;
function Zn(e) {
return (e > 0) - (e < 0) || +e
}
function er() {
if (!this.isValid()) return this.localeData().invalidDate();
var e, t, n = $n(this._milliseconds) / 1e3, r = $n(this._days), i = $n(this._months);
t = k((e = k(n / 60)) / 60), n %= 60, e %= 60;
var a = k(i / 12), o = i %= 12, s = r, l = t, c = e, u = n ? n.toFixed(3).replace(/\.?0+$/, "") : "",
d = this.asSeconds();
if (!d) return "P0D";
var h = d < 0 ? "-" : "", p = Zn(this._months) !== Zn(d) ? "-" : "", f = Zn(this._days) !== Zn(d) ? "-" : "",
m = Zn(this._milliseconds) !== Zn(d) ? "-" : "";
return h + "P" + (a ? p + a + "Y" : "") + (o ? p + o + "M" : "") + (s ? f + s + "D" : "") + (l || c || u ? "T" : "") + (l ? m + l + "H" : "") + (c ? m + c + "M" : "") + (u ? m + u + "S" : "")
}
var tr = Wt.prototype;
return tr.isValid = function () {
return this._isValid
}, tr.abs = function () {
var e = this._data;
return this._milliseconds = An(this._milliseconds), this._days = An(this._days), this._months = An(this._months), e.milliseconds = An(e.milliseconds), e.seconds = An(e.seconds), e.minutes = An(e.minutes), e.hours = An(e.hours), e.months = An(e.months), e.years = An(e.years), this
}, tr.add = function (e, t) {
return Tn(this, e, t, 1)
}, tr.subtract = function (e, t) {
return Tn(this, e, t, -1)
}, tr.as = function (e) {
if (!this.isValid()) return NaN;
var t, n, r = this._milliseconds;
if ("month" === (e = R(e)) || "quarter" === e || "year" === e) switch (t = this._days + r / 864e5, n = this._months + Dn(t), e) {
case"month":
return n;
case"quarter":
return n / 3;
case"year":
return n / 12
} else switch (t = this._days + Math.round(In(this._months)), e) {
case"week":
return t / 7 + r / 6048e5;
case"day":
return t + r / 864e5;
case"hour":
return 24 * t + r / 36e5;
case"minute":
return 1440 * t + r / 6e4;
case"second":
return 86400 * t + r / 1e3;
case"millisecond":
return Math.floor(864e5 * t) + r;
default:
throw new Error("Unknown unit " + e)
}
}, tr.asMilliseconds = On, tr.asSeconds = Mn, tr.asMinutes = Nn, tr.asHours = Rn, tr.asDays = Wn, tr.asWeeks = Vn, tr.asMonths = Fn, tr.asQuarters = Gn, tr.asYears = Bn, tr.valueOf = function () {
return this.isValid() ? this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * x(this._months / 12) : NaN
}, tr._bubble = function () {
var e, t, n, r, i, a = this._milliseconds, o = this._days, s = this._months, l = this._data;
return a >= 0 && o >= 0 && s >= 0 || a <= 0 && o <= 0 && s <= 0 || (a += 864e5 * En(In(s) + o), o = 0, s = 0), l.milliseconds = a % 1e3, e = k(a / 1e3), l.seconds = e % 60, t = k(e / 60), l.minutes = t % 60, n = k(t / 60), l.hours = n % 24, s += i = k(Dn(o += k(n / 24))), o -= En(In(i)), r = k(s / 12), s %= 12, l.days = o, l.months = s, l.years = r, this
}, tr.clone = function () {
return Yt(this)
}, tr.get = function (e) {
return e = R(e), this.isValid() ? this[e + "s"]() : NaN
}, tr.milliseconds = jn, tr.seconds = zn, tr.minutes = Un, tr.hours = qn, tr.days = Hn, tr.weeks = function () {
return k(this.days() / 7)
}, tr.months = Yn, tr.years = Xn, tr.humanize = function (e) {
if (!this.isValid()) return this.localeData().invalidDate();
var t = this.localeData(), n = function (e, t, n) {
var r = Yt(e).abs(), i = Jn(r.as("s")), a = Jn(r.as("m")), o = Jn(r.as("h")), s = Jn(r.as("d")),
l = Jn(r.as("M")), c = Jn(r.as("y")),
u = i <= Qn.ss && ["s", i] || i < Qn.s && ["ss", i] || a <= 1 && ["m"] || a < Qn.m && ["mm", a] || o <= 1 && ["h"] || o < Qn.h && ["hh", o] || s <= 1 && ["d"] || s < Qn.d && ["dd", s] || l <= 1 && ["M"] || l < Qn.M && ["MM", l] || c <= 1 && ["y"] || ["yy", c];
return u[2] = t, u[3] = +e > 0, u[4] = n, function (e, t, n, r, i) {
return i.relativeTime(t || 1, !!n, e, r)
}.apply(null, u)
}(this, !e, t);
return e && (n = t.pastFuture(+this, n)), t.postformat(n)
}, tr.toISOString = er, tr.toString = er, tr.toJSON = er, tr.locale = nn, tr.localeData = an, tr.toIsoString = A("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", er), tr.lang = rn, U("X", 0, 0, "unix"), U("x", 0, 0, "valueOf"), de("x", oe), de("X", /[+-]?\d+(\.\d{1,3})?/), me("X", function (e, t, n) {
n._d = new Date(1e3 * parseFloat(e, 10))
}), me("x", function (e, t, n) {
n._d = new Date(x(e))
}), i.version = "2.24.0", t = Lt, i.fn = Sn, i.min = function () {
return Nt("isBefore", [].slice.call(arguments, 0))
}, i.max = function () {
return Nt("isAfter", [].slice.call(arguments, 0))
}, i.now = function () {
return Date.now ? Date.now() : +new Date
}, i.utc = f, i.unix = function (e) {
return Lt(1e3 * e)
}, i.months = function (e, t) {
return Pn(e, t, "months")
}, i.isDate = u, i.locale = ht, i.invalid = g, i.duration = Yt, i.isMoment = _, i.weekdays = function (e, t, n) {
return Cn(e, t, n, "weekdays")
}, i.parseZone = function () {
return Lt.apply(null, arguments).parseZone()
}, i.localeData = ft, i.isDuration = Vt, i.monthsShort = function (e, t) {
return Pn(e, t, "monthsShort")
}, i.weekdaysMin = function (e, t, n) {
return Cn(e, t, n, "weekdaysMin")
}, i.defineLocale = pt, i.updateLocale = function (e, t) {
if (null != t) {
var n, r, i = st;
null != (r = dt(e)) && (i = r._config), (n = new O(t = L(i, t))).parentLocale = lt[e], lt[e] = n, ht(e)
} else null != lt[e] && (null != lt[e].parentLocale ? lt[e] = lt[e].parentLocale : null != lt[e] && delete lt[e]);
return lt[e]
}, i.locales = function () {
return T(lt)
}, i.weekdaysShort = function (e, t, n) {
return Cn(e, t, n, "weekdaysShort")
}, i.normalizeUnits = R, i.relativeTimeRounding = function (e) {
return void 0 === e ? Jn : "function" == typeof e && (Jn = e, !0)
}, i.relativeTimeThreshold = function (e, t) {
return void 0 !== Qn[e] && (void 0 === t ? Qn[e] : (Qn[e] = t, "s" === e && (Qn.ss = t - 1), !0))
}, i.calendarFormat = function (e, t) {
var n = e.diff(t, "days", !0);
return n < -6 ? "sameElse" : n < -1 ? "lastWeek" : n < 0 ? "lastDay" : n < 1 ? "sameDay" : n < 2 ? "nextDay" : n < 7 ? "nextWeek" : "sameElse"
}, i.prototype = Sn, i.HTML5_FMT = {
DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
DATE: "YYYY-MM-DD",
TIME: "HH:mm",
TIME_SECONDS: "HH:mm:ss",
TIME_MS: "HH:mm:ss.SSS",
WEEK: "GGGG-[W]WW",
MONTH: "YYYY-MM"
}, i
}, "object" === o(t) && void 0 !== e ? e.exports = a() : void 0 === (i = "function" == typeof (r = a) ? r.call(t, n, t, e) : r) || (e.exports = i)
}).call(t, n(156)(e))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.validateResponseStatus = t.validateRangeRequestCapabilities = t.createResponseStatusError = void 0;
var r = n(1);
t.createResponseStatusError = function (e, t) {
return 404 === e || 0 === e && /^file:/.test(t) ? new r.MissingPDFException('Missing PDF "' + t + '".') : new r.UnexpectedResponseException("Unexpected server response (" + e + ') while retrieving PDF "' + t + '".', e)
}, t.validateRangeRequestCapabilities = function (e) {
var t = e.getResponseHeader, n = e.isHttp, i = e.rangeChunkSize, a = e.disableRange;
(0, r.assert)(i > 0);
var o = {allowRangeRequests: !1, suggestedLength: void 0};
if (a || !n) return o;
if ("bytes" !== t("Accept-Ranges")) return o;
if ("identity" !== (t("Content-Encoding") || "identity")) return o;
var s = parseInt(t("Content-Length"), 10);
return Number.isInteger(s) ? (o.suggestedLength = s, s <= 2 * i ? o : (window.KGPdfViewerWebApp.getTipPrompt().open("加载中..."), o.allowRangeRequests = !0, o)) : o
}, t.validateResponseStatus = function (e) {
return 200 === e || 206 === e
}
}, function (e, t, n) {
"use strict";
e.exports = !n(8) && !n(16)(function () {
return 7 != Object.defineProperty(n(42)("div"), "a", {
get: function () {
return 7
}
}).a
})
}, function (e, t, n) {
"use strict";
for (var r, i = n(0), a = n(9), o = n(19), s = o("typed_array"), l = o("view"), c = !(!i.ArrayBuffer || !i.DataView), u = c, d = 0, h = "Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(","); d < 9;) (r = i[h[d++]]) ? (a(r.prototype, s, !0), a(r.prototype, l, !0)) : u = !1;
e.exports = {ABV: c, CONSTR: u, TYPED: s, VIEW: l}
}, function (e, t, n) {
"use strict";
var r = n(20), i = n(13);
e.exports = function (e) {
if (void 0 === e) return 0;
var t = r(e), n = i(t);
if (t !== n) throw RangeError("Wrong length!");
return n
}
}, function (e, t, n) {
"use strict";
var r = n(66), i = n(48).concat("length", "prototype");
t.f = Object.getOwnPropertyNames || function (e) {
return r(e, i)
}
}, function (e, t, n) {
"use strict";
var r = n(11), i = n(34), a = n(67)(!1), o = n(47)("IE_PROTO");
e.exports = function (e, t) {
var n, s = i(e), l = 0, c = [];
for (n in s) n != o && r(s, n) && c.push(n);
for (; t.length > l;) r(s, n = t[l++]) && (~a(c, n) || c.push(n));
return c
}
}, function (e, t, n) {
"use strict";
var r = n(34), i = n(13), a = n(35);
e.exports = function (e) {
return function (t, n, o) {
var s, l = r(t), c = i(l.length), u = a(o, c);
if (e && n != n) {
for (; c > u;) if ((s = l[u++]) != s) return !0
} else for (; c > u; u++) if ((e || u in l) && l[u] === n) return e || u || 0;
return !e && -1
}
}
}, function (e, t, n) {
"use strict";
var r = n(21), i = n(35), a = n(13);
e.exports = function (e) {
for (var t = r(this), n = a(t.length), o = arguments.length, s = i(o > 1 ? arguments[1] : void 0, n), l = o > 2 ? arguments[2] : void 0, c = void 0 === l ? n : i(l, n); c > s;) t[s++] = e;
return t
}
}, function (e, t, n) {
"use strict";
var r = n(22), i = n(4)("iterator"), a = Array.prototype;
e.exports = function (e) {
return void 0 !== e && (r.Array === e || a[i] === e)
}
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(105), a = n(48), o = n(47)("IE_PROTO"), s = function () {
}, l = function () {
var e, t = n(42)("iframe"), r = a.length;
for (t.style.display = "none", n(71).appendChild(t), t.src = "javascript:", (e = t.contentWindow.document).open(), e.write("<script>document.F=Object<\/script>"), e.close(), l = e.F; r--;) delete l.prototype[a[r]];
return l()
};
e.exports = Object.create || function (e, t) {
var n;
return null !== e ? (s.prototype = r(e), n = new s, s.prototype = null, n[o] = e) : n = l(), void 0 === t ? n : i(n, t)
}
}, function (e, t, n) {
"use strict";
var r = n(0).document;
e.exports = r && r.documentElement
}, function (e, t, n) {
"use strict";
var r = n(11), i = n(21), a = n(47)("IE_PROTO"), o = Object.prototype;
e.exports = Object.getPrototypeOf || function (e) {
return e = i(e), r(e, a) ? e[a] : "function" == typeof e.constructor && e instanceof e.constructor ? e.constructor.prototype : e instanceof Object ? o : null
}
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(4)("iterator"), a = n(22);
e.exports = n(6).getIteratorMethod = function (e) {
if (void 0 != e) return e[i] || e["@@iterator"] || a[r(e)]
}
}, function (e, t, n) {
"use strict";
var r = n(109), i = n(110), a = n(22), o = n(34);
e.exports = n(75)(Array, "Array", function (e, t) {
this._t = o(e), this._i = 0, this._k = t
}, function () {
var e = this._t, t = this._k, n = this._i++;
return !e || n >= e.length ? (this._t = void 0, i(1)) : i(0, "keys" == t ? n : "values" == t ? e[n] : [n, e[n]])
}, "values"), a.Arguments = a.Array, r("keys"), r("values"), r("entries")
}, function (e, t, n) {
"use strict";
var r = n(26), i = n(7), a = n(18), o = n(9), s = n(22), l = n(111), c = n(31), u = n(72), d = n(4)("iterator"),
h = !([].keys && "next" in [].keys()), p = function () {
return this
};
e.exports = function (e, t, n, f, m, v, g) {
l(n, t, f);
var y, b, w, S = function (e) {
if (!h && e in P) return P[e];
switch (e) {
case"keys":
case"values":
return function () {
return new n(this, e)
}
}
return function () {
return new n(this, e)
}
}, _ = t + " Iterator", k = "values" == m, x = !1, P = e.prototype, C = P[d] || P["@@iterator"] || m && P[m],
A = C || S(m), T = m ? k ? S("entries") : A : void 0, E = "Array" == t && P.entries || C;
if (E && (w = u(E.call(new e))) !== Object.prototype && w.next && (c(w, _, !0), r || "function" == typeof w[d] || o(w, d, p)), k && C && "values" !== C.name && (x = !0, A = function () {
return C.call(this)
}), r && !g || !h && !x && P[d] || o(P, d, A), s[t] = A, s[_] = p, m) if (y = {
values: k ? A : S("values"),
keys: v ? A : S("keys"),
entries: T
}, g) for (b in y) b in P || a(P, b, y[b]); else i(i.P + i.F * (h || x), t, y);
return y
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(17), a = n(8), o = n(4)("species");
e.exports = function (e) {
var t = r[e];
a && t && !t[o] && i.f(t, o, {
configurable: !0, get: function () {
return this
}
})
}
}, function (e, t, n) {
"use strict";
var r = n(78), i = n(33), a = n(34), o = n(43), s = n(11), l = n(62), c = Object.getOwnPropertyDescriptor;
t.f = n(8) ? c : function (e, t) {
if (e = a(e), t = o(t, !0), l) try {
return c(e, t)
} catch (e) {
}
if (s(e, t)) return i(!r.f.call(e, t), e[t])
}
}, function (e, t, n) {
"use strict";
t.f = {}.propertyIsEnumerable
}, function (e, t, n) {
"use strict";
var r = n(36), i = {};
i[n(4)("toStringTag")] = "z", i + "" != "[object z]" && n(18)(Object.prototype, "toString", function () {
return "[object " + r(this) + "]"
}, !0)
}, function (e, t, n) {
"use strict";
for (var r = n(74), i = n(49), a = n(18), o = n(0), s = n(9), l = n(22), c = n(4), u = c("iterator"), d = c("toStringTag"), h = l.Array, p = {
CSSRuleList: !0,
CSSStyleDeclaration: !1,
CSSValueList: !1,
ClientRectList: !1,
DOMRectList: !1,
DOMStringList: !1,
DOMTokenList: !0,
DataTransferItemList: !1,
FileList: !1,
HTMLAllCollection: !1,
HTMLCollection: !1,
HTMLFormElement: !1,
HTMLSelectElement: !1,
MediaList: !0,
MimeTypeArray: !1,
NamedNodeMap: !1,
NodeList: !0,
PaintRequestList: !1,
Plugin: !1,
PluginArray: !1,
SVGLengthList: !1,
SVGNumberList: !1,
SVGPathSegList: !1,
SVGPointList: !1,
SVGStringList: !1,
SVGTransformList: !1,
SourceBufferList: !1,
StyleSheetList: !0,
TextTrackCueList: !1,
TextTrackList: !1,
TouchList: !1
}, f = i(p), m = 0; m < f.length; m++) {
var v, g = f[m], y = p[g], b = o[g], w = b && b.prototype;
if (w && (w[u] || s(w, u, h), w[d] || s(w, d, g), l[g] = h, y)) for (v in r) w[v] || a(w, v, r[v], !0)
}
}, function (e, t, n) {
"use strict";
var r, i, a, o = n(12), s = n(123), l = n(71), c = n(42), u = n(0), d = u.process, h = u.setImmediate,
p = u.clearImmediate, f = u.MessageChannel, m = u.Dispatch, v = 0, g = {}, y = function () {
var e = +this;
if (g.hasOwnProperty(e)) {
var t = g[e];
delete g[e], t()
}
}, b = function (e) {
y.call(e.data)
};
h && p || (h = function (e) {
for (var t = [], n = 1; arguments.length > n;) t.push(arguments[n++]);
return g[++v] = function () {
s("function" == typeof e ? e : Function(e), t)
}, r(v), v
}, p = function (e) {
delete g[e]
}, "process" == n(30)(d) ? r = function (e) {
d.nextTick(o(y, e, 1))
} : m && m.now ? r = function (e) {
m.now(o(y, e, 1))
} : f ? (a = (i = new f).port2, i.port1.onmessage = b, r = o(a.postMessage, a, 1)) : u.addEventListener && "function" == typeof postMessage && !u.importScripts ? (r = function (e) {
u.postMessage(e + "", "*")
}, u.addEventListener("message", b, !1)) : r = "onreadystatechange" in c("script") ? function (e) {
l.appendChild(c("script")).onreadystatechange = function () {
l.removeChild(this), y.call(e)
}
} : function (e) {
setTimeout(o(y, e, 1), 0)
}), e.exports = {set: h, clear: p}
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
try {
return {e: !1, v: e()}
} catch (e) {
return {e: !0, v: e}
}
}
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(3), a = n(53);
e.exports = function (e, t) {
if (r(e), i(t) && t.constructor === e) return t;
var n = a.f(e);
return (0, n.resolve)(t), n.promise
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.build = t.version = t._UnsupportedManager = t.setPDFNetworkStreamClass = t.PDFPageProxy = t.PDFDocumentProxy = t.PDFWorker = t.PDFDataRangeTransport = t.LoopbackPort = t.getDocument = void 0;
var r, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, o = n(1), s = n(14), l = n(143), c = n(144), u = n(25), d = (r = u) && r.__esModule ? r : {default: r},
h = n(86), p = n(147);
var f, m = 65536, v = !1, g = !1,
y = "undefined" != typeof document && document.currentScript ? document.currentScript.src : null, b = null,
w = !1;
"undefined" == typeof window ? (v = !0, void 0 === require.ensure && (require.ensure = require("node-ensure")), w = !0) : "undefined" != typeof require && "function" == typeof require.ensure && (w = !0), "undefined" != typeof requirejs && requirejs.toUrl && (f = requirejs.toUrl("pdfjs-dist/build/pdf.worker.js"));
var S, _ = "undefined" != typeof requirejs && requirejs.load;
b = w ? function (e) {
require.ensure([], function () {
var t;
t = require("./pdf.worker.js"), e(t.WorkerMessageHandler)
})
} : _ ? function (e) {
requirejs(["pdfjs-dist/build/pdf.worker"], function (t) {
e(t.WorkerMessageHandler)
})
} : null;
var k, x = function () {
var e = 0;
function t() {
this._capability = (0, o.createPromiseCapability)(), this._transport = null, this._worker = null, this.docId = "d" + e++, this.destroyed = !1, this.onPassword = null, this.onProgress = null, this.onUnsupportedFeature = null
}
return t.prototype = {
get promise() {
return this._capability.promise
}, destroy: function () {
var e = this;
return this.destroyed = !0, (this._transport ? this._transport.destroy() : Promise.resolve()).then(function () {
e._transport = null, e._worker && (e._worker.destroy(), e._worker = null)
})
}, then: function (e, t) {
return this.promise.then.apply(this.promise, arguments)
}
}, t
}(), P = function () {
function e(e, t) {
this.length = e, this.initialData = t, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._readyCapability = (0, o.createPromiseCapability)()
}
return e.prototype = {
addRangeListener: function (e) {
this._rangeListeners.push(e)
}, addProgressListener: function (e) {
this._progressListeners.push(e)
}, addProgressiveReadListener: function (e) {
this._progressiveReadListeners.push(e)
}, onDataRange: function (e, t) {
for (var n = this._rangeListeners, r = 0, i = n.length; r < i; ++r) n[r](e, t)
}, onDataProgress: function (e) {
var t = this;
this._readyCapability.promise.then(function () {
for (var n = t._progressListeners, r = 0, i = n.length; r < i; ++r) n[r](e)
})
}, onDataProgressiveRead: function (e) {
var t = this;
this._readyCapability.promise.then(function () {
for (var n = t._progressiveReadListeners, r = 0, i = n.length; r < i; ++r) n[r](e)
})
}, transportReady: function () {
this._readyCapability.resolve()
}, requestDataRange: function (e, t) {
throw new Error("Abstract method PDFDataRangeTransport.requestDataRange")
}, abort: function () {
}
}, e
}(), C = function () {
function e(e, t, n) {
this.pdfInfo = e, this.transport = t, this.loadingTask = n
}
return e.prototype = {
get numPages() {
return this.pdfInfo.numPages
}, get fingerprint() {
return this.pdfInfo.fingerprint
}, getPage: function (e) {
return this.transport.getPage(e)
}, getPageIndex: function (e) {
return this.transport.getPageIndex(e)
}, getDestinations: function () {
return this.transport.getDestinations()
}, getDestination: function (e) {
return this.transport.getDestination(e)
}, getPageLabels: function () {
return this.transport.getPageLabels()
}, getPageMode: function () {
return this.transport.getPageMode()
}, getAttachments: function () {
return this.transport.getAttachments()
}, getJavaScript: function () {
return this.transport.getJavaScript()
}, getOutline: function () {
return this.transport.getOutline()
}, getMetadata: function () {
return this.transport.getMetadata()
}, getData: function () {
return this.transport.getData()
}, getDownloadInfo: function () {
return this.transport.downloadInfoCapability.promise
}, getStats: function () {
return this.transport.getStats()
}, cleanup: function () {
this.transport.startCleanup()
}, destroy: function () {
return this.loadingTask.destroy()
}
}, e
}(), A = function () {
function e(e, t, n) {
this.pageIndex = e, this.pageInfo = t, this.transport = n, this.stats = new o.StatTimer, this.stats.enabled = (0, s.getDefaultSetting)("enableStats"), this.commonObjs = n.commonObjs, this.objs = new I, this.cleanupAfterRender = !1, this.pendingCleanup = !1, this.intentStates = Object.create(null), this.destroyed = !1, this.newStamps = {}, this.tempStamps = {}, this.textToSeals = [], this.prepareStamps = {}, this.newWatermark = {}, this.newDocSigns = {}, this.needRestore = !1
}
return e.prototype = {
get pageNumber() {
return this.pageIndex + 1
}, get rotate() {
return this.pageInfo.rotate
}, get ref() {
return this.pageInfo.ref
}, get userUnit() {
return this.pageInfo.userUnit
}, get view() {
return this.pageInfo.view
}, getViewport: function (e, t) {
return arguments.length < 2 && (t = this.rotate), new o.PageViewport(this.view, e, t, 0, 0)
}, getAnnotations: function (e) {
var t = e && e.intent || null;
return this.annotationsPromise && this.annotationsIntent === t || (this.annotationsPromise = this.transport.getAnnotations(this.pageIndex, t), this.annotationsIntent = t), this.annotationsPromise
}, render: function (e) {
var t = this, n = this.stats;
n.time("Overall"), this.pendingCleanup = !1;
var r = "print" === e.intent ? "print" : "display", i = e.canvasFactory || new s.DOMCanvasFactory;
this.intentStates[r] || (this.intentStates[r] = Object.create(null));
var a = this.intentStates[r];
"print" == r && (this.reloadOperatorList = !0), a.displayReadyCapability && !this.reloadOperatorList || (this.reloadOperatorList = !1, a.receivingOperatorList = !0, a.displayReadyCapability = (0, o.createPromiseCapability)(), a.operatorList = {
fnArray: [],
argsArray: [],
lastChunk: !1
}, this.stats.time("Page Request"), this.transport.messageHandler.send("RenderPageRequest", {
pageIndex: this.pageNumber - 1,
intent: r,
delAnnotions: this.delAnnotions,
delOFDSeal: this.delOFDSeal,
needRestore: this.needRestore,
disableTextAnnotation: this.disableTextAnnotation,
disableDocSignAnnotation: this.disableDocSignAnnotation,
renderInteractiveForms: !0 === e.renderInteractiveForms
}), this.needRestore = !1);
var l = function (r) {
var i = a.renderTasks.indexOf(u);
i >= 0 && a.renderTasks.splice(i, 1), t.cleanupAfterRender && (t.pendingCleanup = !0), t._tryCleanup(), r ? u.capability.reject(r) : u.capability.resolve(), c(e), n.timeEnd("Rendering"), n.timeEnd("Overall")
}, c = function (n) {
var i = n.canvasContext;
if ("print" === r) {
var a = function (e, t, n) {
var r = e.querySelector("img"), a = e.style.width, o = e.style.height,
s = a.substring(0, a.length - 2) * t, l = o.substring(0, o.length - 2) * t, c = e.style.left,
u = e.style.top, d = c.substring(0, c.length - 2) * t, h = u.substring(0, u.length - 2) * t;
i.globalCompositeOperation = n, i.globalCompositeOperation !== n && (i.globalAlpha = .85), i.drawImage(r, d, h, s, l)
}, o = e.transform[0];
for (var s in t.newStamps) a(t.newStamps[s], o, "multiply");
for (var l in t.newDocSigns) a(t.newDocSigns[l], o, "source-over")
}
}, u = new O(l, e, this.objs, this.commonObjs, a.operatorList, this.pageNumber, i);
u.useRequestAnimationFrame = "print" !== r, a.renderTasks || (a.renderTasks = []), a.renderTasks.push(u);
var d = u.task;
return e.continueCallback && ((0, o.deprecated)("render is used with continueCallback parameter"), d.onContinue = e.continueCallback), a.displayReadyCapability.promise.then(function (e) {
t.pendingCleanup ? l() : (n.time("Rendering"), u.initializeGraphics(e), u.operatorListChanged())
}).catch(l), d
}, getOperatorList: function () {
this.intentStates.oplist || (this.intentStates.oplist = Object.create(null));
var e, t = this.intentStates.oplist;
return t.opListReadCapability || ((e = {}).operatorListChanged = function () {
if (t.operatorList.lastChunk) {
t.opListReadCapability.resolve(t.operatorList);
var n = t.renderTasks.indexOf(e);
n >= 0 && t.renderTasks.splice(n, 1)
}
}, t.receivingOperatorList = !0, t.opListReadCapability = (0, o.createPromiseCapability)(), t.renderTasks = [], t.renderTasks.push(e), t.operatorList = {
fnArray: [],
argsArray: [],
lastChunk: !1
}, this.transport.messageHandler.send("RenderPageRequest", {
pageIndex: this.pageIndex,
intent: "oplist"
})), t.opListReadCapability.promise
}, streamTextContent: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return this.transport.messageHandler.sendWithStream("GetTextContent", {
pageIndex: this.pageNumber - 1,
normalizeWhitespace: !0 === e.normalizeWhitespace,
combineTextItems: !0 !== e.disableCombineTextItems
}, {
highWaterMark: 100, size: function (e) {
return e.items.length
}
})
}, getTextContent: function (e) {
e = e || {};
var t = this.streamTextContent(e);
return new Promise(function (e, n) {
var r = t.getReader(), i = {items: [], styles: Object.create(null)};
!function t() {
r.read().then(function (n) {
var r = n.value;
n.done ? e(i) : (o.Util.extendObj(i.styles, r.styles), o.Util.appendToArray(i.items, r.items), t())
}, n)
}()
})
}, _destroy: function () {
this.destroyed = !0, this.transport.pageCache[this.pageIndex] = null;
var e = [];
return Object.keys(this.intentStates).forEach(function (t) {
"oplist" !== t && this.intentStates[t].renderTasks.forEach(function (t) {
var n = t.capability.promise.catch(function () {
});
e.push(n), t.cancel()
})
}, this), this.objs.clear(), this.annotationsPromise = null, this.pendingCleanup = !1, Promise.all(e)
}, destroy: function () {
(0, o.deprecated)("page destroy method, use cleanup() instead"), this.cleanup()
}, cleanup: function () {
this.pendingCleanup = !0, this._tryCleanup()
}, _tryCleanup: function () {
this.pendingCleanup && !Object.keys(this.intentStates).some(function (e) {
var t = this.intentStates[e];
return 0 !== t.renderTasks.length || t.receivingOperatorList
}, this) && (Object.keys(this.intentStates).forEach(function (e) {
delete this.intentStates[e]
}, this), this.objs.clear(), this.annotationsPromise = null, this.pendingCleanup = !1)
}, _startRenderPage: function (e, t) {
var n = this.intentStates[t];
n.displayReadyCapability && n.displayReadyCapability.resolve(e)
}, _renderPageChunk: function (e, t) {
var n, r, i = this.intentStates[t];
for (n = 0, r = e.length; n < r; n++) i.operatorList.fnArray.push(e.fnArray[n]), i.operatorList.argsArray.push(e.argsArray[n]);
for (i.operatorList.lastChunk = e.lastChunk, n = 0; n < i.renderTasks.length; n++) i.renderTasks[n].operatorListChanged();
e.lastChunk && (i.receivingOperatorList = !1, this._tryCleanup())
}
}, e
}(), T = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this._listeners = [], this._defer = t, this._deferred = Promise.resolve(void 0)
}
return i(e, [{
key: "postMessage", value: function (e, t) {
var n = this;
if (this._defer) {
var r = new WeakMap, i = {
data: function e(n) {
if ("object" !== (void 0 === n ? "undefined" : a(n)) || null === n) return n;
if (r.has(n)) return r.get(n);
var i, s;
if ((s = n.buffer) && (0, o.isArrayBuffer)(s)) {
var l = t && t.indexOf(s) >= 0;
return i = n === s ? n : l ? new n.constructor(s, n.byteOffset, n.byteLength) : new n.constructor(n), r.set(n, i), i
}
for (var c in i = Array.isArray(n) ? [] : {}, r.set(n, i), n) {
for (var u, d = n; !(u = Object.getOwnPropertyDescriptor(d, c));) d = Object.getPrototypeOf(d);
void 0 !== u.value && "function" != typeof u.value && (i[c] = e(u.value))
}
return i
}(e)
};
this._deferred.then(function () {
n._listeners.forEach(function (e) {
e.call(this, i)
}, n)
})
} else this._listeners.forEach(function (t) {
t.call(this, {data: e})
}, this)
}
}, {
key: "addEventListener", value: function (e, t) {
this._listeners.push(t)
}
}, {
key: "removeEventListener", value: function (e, t) {
var n = this._listeners.indexOf(t);
this._listeners.splice(n, 1)
}
}, {
key: "terminate", value: function () {
this._listeners = []
}
}]), e
}(), E = function () {
var e = 0;
function t() {
if (void 0 !== f) return f;
if ((0, s.getDefaultSetting)("workerSrc")) return (0, s.getDefaultSetting)("workerSrc");
if (y) return y.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2");
throw new Error("No PDFJS.workerSrc specified")
}
var n = void 0;
var r = new WeakMap;
function i(e, t) {
if (t && r.has(t)) throw new Error("Cannot use more than one PDFWorker per port");
if (this.name = e, this.destroyed = !1, this.postMessageTransfers = !0, this._readyCapability = (0, o.createPromiseCapability)(), this._port = null, this._webWorker = null, this._messageHandler = null, t) return r.set(t, this), void this._initializeFromPort(t);
this._initialize()
}
return i.prototype = {
get promise() {
return this._readyCapability.promise
}, get port() {
return this._port
}, get messageHandler() {
return this._messageHandler
}, _initializeFromPort: function (e) {
this._port = e, this._messageHandler = new o.MessageHandler("main", "worker", e), this._messageHandler.on("ready", function () {
}), this._readyCapability.resolve()
}, _initialize: function () {
var e, n, r = this;
if (!v && !(0, s.getDefaultSetting)("disableWorker") && "undefined" != typeof Worker) {
var i = t();
try {
(0, o.isSameOrigin)(window.location.href, i) || (e = new URL(i, window.location).href, n = "importScripts('" + e + "');", i = URL.createObjectURL(new Blob([n])));
var a = new Worker(i), l = new o.MessageHandler("main", "worker", a), c = function () {
a.removeEventListener("error", u), l.destroy(), a.terminate(), r.destroyed ? r._readyCapability.reject(new Error("Worker was destroyed")) : r._setupFakeWorker()
}, u = function () {
r._webWorker || c()
};
a.addEventListener("error", u), l.on("test", function (e) {
(a.removeEventListener("error", u), r.destroyed) ? c() : e && e.supportTypedArray ? (r._messageHandler = l, r._port = a, r._webWorker = a, e.supportTransfers || (r.postMessageTransfers = !1, g = !0), r._readyCapability.resolve(), l.send("configure", {verbosity: (0, o.getVerbosityLevel)()})) : (r._setupFakeWorker(), l.destroy(), a.terminate())
}), l.on("console_log", function (e) {
console.log.apply(console, e)
}), l.on("console_error", function (e) {
console.error.apply(console, e)
}), l.on("ready", function (e) {
if (a.removeEventListener("error", u), r.destroyed) c(); else try {
d()
} catch (e) {
r._setupFakeWorker()
}
});
var d = function () {
var e = (0, s.getDefaultSetting)("postMessageTransfers") && !g, t = new Uint8Array([e ? 255 : 0]);
try {
l.send("test", t, [t.buffer])
} catch (e) {
(0, o.info)("Cannot use postMessage transfers"), t[0] = 0, l.send("test", t)
}
};
return void d()
} catch (e) {
(0, o.info)("The worker has been disabled.")
}
}
this._setupFakeWorker()
}, _setupFakeWorker: function () {
var r = this;
v || (0, s.getDefaultSetting)("disableWorker") || ((0, o.warn)("Setting up fake worker."), v = !0), (n ? n.promise : (n = (0, o.createPromiseCapability)(), (b || function (e) {
o.Util.loadScript(t(), function () {
e(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler)
})
})(n.resolve), n.promise)).then(function (t) {
if (r.destroyed) r._readyCapability.reject(new Error("Worker was destroyed")); else {
var n = Uint8Array !== Float32Array, i = new T(n);
r._port = i;
var a = "fake" + e++, s = new o.MessageHandler(a + "_worker", a, i);
t.setup(s, i);
var l = new o.MessageHandler(a, a + "_worker", i);
r._messageHandler = l, r._readyCapability.resolve()
}
})
}, destroy: function () {
this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), r.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null)
}
}, i.fromPort = function (e) {
return r.has(e) ? r.get(e) : new i(null, e)
}, i
}(), D = function () {
function e(e, t, n, r) {
this.messageHandler = e, this.loadingTask = t, this.commonObjs = new I, this.fontLoader = new l.FontLoader(t.docId), this.CMapReaderFactory = new r({
baseUrl: (0, s.getDefaultSetting)("cMapUrl"),
isCompressed: (0, s.getDefaultSetting)("cMapPacked")
}), this.destroyed = !1, this.destroyCapability = null, this._passwordCapability = null, this._networkStream = n, this._fullReader = null, this._lastProgress = null, this.pageCache = [], this.pagePromises = [], this.downloadInfoCapability = (0, o.createPromiseCapability)(), this.setupMessageHandler()
}
return e.prototype = {
destroy: function () {
var e = this;
if (this.destroyCapability) return this.destroyCapability.promise;
this.destroyed = !0, this.destroyCapability = (0, o.createPromiseCapability)(), this._passwordCapability && this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));
var t = [];
this.pageCache.forEach(function (e) {
e && t.push(e._destroy())
}), this.pageCache = [], this.pagePromises = [];
var n = this.messageHandler.sendWithPromise("Terminate", null);
return t.push(n), Promise.all(t).then(function () {
e.fontLoader.clear(), e._networkStream && e._networkStream.cancelAllRequests(), e.messageHandler && (e.messageHandler.destroy(), e.messageHandler = null), e.destroyCapability.resolve()
}, this.destroyCapability.reject), this.destroyCapability.promise
}, setupMessageHandler: function () {
var e = this.messageHandler, t = this.loadingTask;
e.on("GetReader", function (e, t) {
var n = this;
(0, o.assert)(this._networkStream), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = function (e) {
n._lastProgress = {loaded: e.loaded, total: e.total}
}, t.onPull = function () {
n._fullReader.read().then(function (e) {
var n = e.value;
e.done ? t.close() : ((0, o.assert)((0, o.isArrayBuffer)(n)), t.enqueue(new Uint8Array(n), 1, [n]))
}).catch(function (e) {
t.error(e)
})
}, t.onCancel = function (e) {
n._fullReader.cancel(e)
}
}, this), e.on("ReaderHeadersReady", function (e) {
var t = this, n = (0, o.createPromiseCapability)(), r = this._fullReader;
return r.headersReady.then(function () {
if (!r.isStreamingSupported || !r.isRangeSupported) {
if (t._lastProgress) {
var e = t.loadingTask;
e.onProgress && e.onProgress(t._lastProgress)
}
r.onProgress = function (e) {
var n = t.loadingTask;
n.onProgress && n.onProgress({loaded: e.loaded, total: e.total})
}
}
n.resolve({
isStreamingSupported: r.isStreamingSupported,
isRangeSupported: r.isRangeSupported,
contentLength: r.contentLength
})
}, n.reject), n.promise
}, this), e.on("GetRangeReader", function (e, t) {
(0, o.assert)(this._networkStream);
var n = this._networkStream.getRangeReader(e.begin, e.end);
t.onPull = function () {
n.read().then(function (e) {
var n = e.value;
e.done ? t.close() : ((0, o.assert)((0, o.isArrayBuffer)(n)), t.enqueue(new Uint8Array(n), 1, [n]))
}).catch(function (e) {
t.error(e)
})
}, t.onCancel = function (e) {
n.cancel(e)
}
}, this), e.on("GetDoc", function (e) {
var t = e.pdfInfo;
this.numPages = e.pdfInfo.numPages;
var n = this.loadingTask, r = new C(t, this, n);
this.pdfDocument = r, n._capability.resolve(r)
}, this), e.on("PasswordRequest", function (e) {
var n = this;
if (this._passwordCapability = (0, o.createPromiseCapability)(), t.onPassword) {
t.onPassword(function (e) {
n._passwordCapability.resolve({password: e})
}, e.code)
} else this._passwordCapability.reject(new o.PasswordException(e.message, e.code));
return this._passwordCapability.promise
}, this), e.on("PasswordException", function (e) {
t._capability.reject(new o.PasswordException(e.message, e.code))
}, this), e.on("InvalidPDF", function (e) {
this.loadingTask._capability.reject(new o.InvalidPDFException(e.message))
}, this), e.on("MissingPDF", function (e) {
this.loadingTask._capability.reject(new o.MissingPDFException(e.message))
}, this), e.on("UnexpectedResponse", function (e) {
this.loadingTask._capability.reject(new o.UnexpectedResponseException(e.message, e.status))
}, this), e.on("UnknownError", function (e) {
this.loadingTask._capability.reject(new o.UnknownErrorException(e.message, e.details))
}, this), e.on("DataLoaded", function (e) {
this.downloadInfoCapability.resolve(e)
}, this), e.on("PDFManagerReady", function (e) {
}, this), e.on("StartRenderPage", function (e) {
if (!this.destroyed) {
var t = this.pageCache[e.pageIndex];
t.stats.timeEnd("Page Request"), t._startRenderPage(e.transparency, e.intent)
}
}, this), e.on("RenderPageChunk", function (e) {
this.destroyed || this.pageCache[e.pageIndex]._renderPageChunk(e.operatorList, e.intent)
}, this), e.on("commonobj", function (e) {
var t = this;
if (!this.destroyed) {
var n = e[0], r = e[1];
if (!this.commonObjs.hasData(n)) switch (r) {
case"Font":
var i = e[2];
if ("error" in i) {
var a = i.error;
(0, o.warn)("Error during font loading: " + a), this.commonObjs.resolve(n, a);
break
}
var c = null;
(0, s.getDefaultSetting)("pdfBug") && d.default.FontInspector && d.default.FontInspector.enabled && (c = {
registerFont: function (e, t) {
d.default.FontInspector.fontAdded(e, t)
}
});
var u = new l.FontFaceObject(i, {
isEvalSupported: (0, s.getDefaultSetting)("isEvalSupported"),
disableFontFace: (0, s.getDefaultSetting)("disableFontFace"),
fontRegistry: c
});
this.fontLoader.bind([u], function (e) {
t.commonObjs.resolve(n, u)
});
break;
case"FontPath":
this.commonObjs.resolve(n, e[2]);
break;
default:
throw new Error("Got unknown common object type " + r)
}
}
}, this), e.on("obj", function (e) {
if (!this.destroyed) {
var t, n = e[0], r = e[1], i = e[2], a = this.pageCache[r];
if (!a.objs.hasData(n)) switch (i) {
case"JpegStream":
t = e[3], (0, o.loadJpegStream)(n, t, a.objs);
break;
case"Image":
t = e[3], a.objs.resolve(n, t);
t && "data" in t && t.data.length > 8e6 && (a.cleanupAfterRender = !0);
break;
default:
throw new Error("Got unknown object type " + i)
}
}
}, this), e.on("DocProgress", function (e) {
if (!this.destroyed) {
var t = this.loadingTask;
t.onProgress && t.onProgress({loaded: e.loaded, total: e.total})
}
}, this), e.on("PageError", function (e) {
if (!this.destroyed) {
var t = this.pageCache[e.pageNum - 1].intentStates[e.intent];
if (!t.displayReadyCapability) throw new Error(e.error);
if (t.displayReadyCapability.reject(e.error), t.operatorList) {
t.operatorList.lastChunk = !0;
for (var n = 0; n < t.renderTasks.length; n++) t.renderTasks[n].operatorListChanged()
}
}
}, this), e.on("UnsupportedFeature", function (e) {
if (!this.destroyed) {
var t = e.featureId, n = this.loadingTask;
n.onUnsupportedFeature && n.onUnsupportedFeature(t), M.notify(t)
}
}, this), e.on("JpegDecode", function (e) {
if (this.destroyed) return Promise.reject(new Error("Worker was destroyed"));
if ("undefined" == typeof document) return Promise.reject(new Error('"document" is not defined.'));
var t = e[0], n = e[1];
return 3 !== n && 1 !== n ? Promise.reject(new Error("Only 3 components or 1 component can be returned")) : new Promise(function (e, r) {
var i = new Image;
i.onload = function () {
var t = i.width, r = i.height, a = t * r, o = 4 * a, s = new Uint8Array(a * n),
l = document.createElement("canvas");
l.width = t, l.height = r;
var c = l.getContext("2d");
c.drawImage(i, 0, 0);
var u, d, h = c.getImageData(0, 0, t, r).data;
if (3 === n) for (u = 0, d = 0; u < o; u += 4, d += 3) s[d] = h[u], s[d + 1] = h[u + 1], s[d + 2] = h[u + 2]; else if (1 === n) for (u = 0, d = 0; u < o; u += 4, d++) s[d] = h[u];
e({data: s, width: t, height: r})
}, i.onerror = function () {
r(new Error("JpegDecode failed to load image"))
}, i.src = t
})
}, this), e.on("FetchBuiltInCMap", function (e) {
return this.destroyed ? Promise.reject(new Error("Worker was destroyed")) : this.CMapReaderFactory.fetch({name: e.name})
}, this)
}, getData: function () {
return this.messageHandler.sendWithPromise("GetData", null)
}, getPage: function (e, t) {
var n = this;
if (!Number.isInteger(e) || e <= 0 || e > this.numPages) return Promise.reject(new Error("Invalid page request"));
var r = e - 1;
if (r in this.pagePromises) return this.pagePromises[r];
var i = this.messageHandler.sendWithPromise("GetPage", {pageIndex: r}).then(function (e) {
if (n.destroyed) throw new Error("Transport destroyed");
var t = new A(r, e, n);
return n.pageCache[r] = t, t
});
return this.pagePromises[r] = i, i
}, getPageIndex: function (e) {
return this.messageHandler.sendWithPromise("GetPageIndex", {ref: e}).catch(function (e) {
return Promise.reject(new Error(e))
})
}, getAnnotations: function (e, t) {
return this.messageHandler.sendWithPromise("GetAnnotations", {pageIndex: e, intent: t})
}, getDestinations: function () {
return this.messageHandler.sendWithPromise("GetDestinations", null)
}, getDestination: function (e) {
return this.messageHandler.sendWithPromise("GetDestination", {id: e})
}, getPageLabels: function () {
return this.messageHandler.sendWithPromise("GetPageLabels", null)
}, getPageMode: function () {
return this.messageHandler.sendWithPromise("GetPageMode", null)
}, getAttachments: function () {
return this.messageHandler.sendWithPromise("GetAttachments", null)
}, getJavaScript: function () {
return this.messageHandler.sendWithPromise("GetJavaScript", null)
}, getOutline: function () {
return this.messageHandler.sendWithPromise("GetOutline", null)
}, getMetadata: function () {
return this.messageHandler.sendWithPromise("GetMetadata", null).then(function (e) {
return {info: e[0], metadata: e[1] ? new h.Metadata(e[1]) : null}
})
}, getStats: function () {
return this.messageHandler.sendWithPromise("GetStats", null)
}, startCleanup: function () {
var e = this;
this.messageHandler.sendWithPromise("Cleanup", null).then(function () {
for (var t = 0, n = e.pageCache.length; t < n; t++) {
var r = e.pageCache[t];
r && r.cleanup()
}
e.commonObjs.clear(), e.fontLoader.clear()
})
}
}, e
}(), I = function () {
function e() {
this.objs = Object.create(null)
}
return e.prototype = {
ensureObj: function (e) {
if (this.objs[e]) return this.objs[e];
var t = {capability: (0, o.createPromiseCapability)(), data: null, resolved: !1};
return this.objs[e] = t, t
}, get: function (e, t) {
if (t) return this.ensureObj(e).capability.promise.then(t), null;
var n = this.objs[e];
if (!n || !n.resolved) throw new Error("Requesting object that isn't resolved yet " + e);
return n.data
}, resolve: function (e, t) {
var n = this.ensureObj(e);
n.resolved = !0, n.data = t, n.capability.resolve(t)
}, isResolved: function (e) {
var t = this.objs;
return !!t[e] && t[e].resolved
}, hasData: function (e) {
return this.isResolved(e)
}, getData: function (e) {
var t = this.objs;
return t[e] && t[e].resolved ? t[e].data : null
}, clear: function () {
this.objs = Object.create(null)
}
}, e
}(), L = function () {
function e(e) {
this._internalRenderTask = e, this.onContinue = null
}
return e.prototype = {
get promise() {
return this._internalRenderTask.capability.promise
}, cancel: function () {
this._internalRenderTask.cancel()
}, then: function (e, t) {
return this.promise.then.apply(this.promise, arguments)
}
}, e
}(), O = function () {
var e = new WeakMap;
function t(e, t, n, r, i, a, s) {
this.callback = e, this.params = t, this.objs = n, this.commonObjs = r, this.operatorListIdx = null, this.operatorList = i, this.pageNumber = a, this.canvasFactory = s, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this.useRequestAnimationFrame = !1, this.cancelled = !1, this.capability = (0, o.createPromiseCapability)(), this.task = new L(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = t.canvasContext.canvas
}
return t.prototype = {
initializeGraphics: function (t) {
if (this._canvas) {
if (e.has(this._canvas)) throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");
e.set(this._canvas, this)
}
if (!this.cancelled) {
(0, s.getDefaultSetting)("pdfBug") && d.default.StepperManager && d.default.StepperManager.enabled && (this.stepper = d.default.StepperManager.create(this.pageNumber - 1), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
var n = this.params;
this.gfx = new c.CanvasGraphics(n.canvasContext, this.commonObjs, this.objs, this.canvasFactory, n.imageLayer), this.gfx.beginDrawing({
transform: n.transform,
viewport: n.viewport,
transparency: t,
background: n.background
}), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback && this.graphicsReadyCallback()
}
}, cancel: function () {
this.running = !1, this.cancelled = !0, this._canvas && e.delete(this._canvas), (0, s.getDefaultSetting)("pdfjsNext") ? this.callback(new s.RenderingCancelledException("Rendering cancelled, page " + this.pageNumber, "canvas")) : this.callback("cancelled")
}, operatorListChanged: function () {
this.graphicsReady ? (this.stepper && this.stepper.updateOperatorList(this.operatorList), this.running || this._continue()) : this.graphicsReadyCallback || (this.graphicsReadyCallback = this._continueBound)
}, _continue: function () {
this.running = !0, this.cancelled || (this.task.onContinue ? this.task.onContinue(this._scheduleNextBound) : this._scheduleNext())
}, _scheduleNext: function () {
this.useRequestAnimationFrame && "undefined" != typeof window ? window.requestAnimationFrame(this._nextBound) : Promise.resolve(void 0).then(this._nextBound)
}, _next: function () {
this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), this._canvas && e.delete(this._canvas), this.callback())))
}
}, t
}(), M = (k = [], {
listen: function (e) {
(0, o.deprecated)("Global UnsupportedManager.listen is used: use PDFDocumentLoadingTask.onUnsupportedFeature instead"), k.push(e)
}, notify: function (e) {
for (var t = 0, n = k.length; t < n; t++) k[t](e)
}
});
t.version = "1.10.0", t.build = "d08dce4", t.getDocument = function (e, t, n, r) {
var i, l = new x;
if (arguments.length > 1 && (0, o.deprecated)("getDocument is called with pdfDataRangeTransport, passwordCallback or progressCallback argument"), t && (t instanceof P || ((t = Object.create(t)).length = e.length, t.initialData = e.initialData, t.abort || (t.abort = function () {
})), (e = Object.create(e)).range = t), l.onPassword = n || null, l.onProgress = r || null, "string" == typeof e) i = {url: e}; else if ((0, o.isArrayBuffer)(e)) i = {data: e}; else if (e instanceof P) i = {range: e}; else {
if ("object" !== (void 0 === e ? "undefined" : a(e))) throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");
if (!e.url && !e.data && !e.range) throw new Error("Invalid parameter object: need either .data, .range or .url");
i = e
}
var c = {}, u = null, d = null, h = s.DOMCMapReaderFactory;
for (var f in i) if ("url" !== f || "undefined" == typeof window) if ("range" !== f) if ("worker" !== f) if ("data" !== f || i[f] instanceof Uint8Array) "CMapReaderFactory" !== f ? c[f] = i[f] : h = i[f]; else {
var v = i[f];
if ("string" == typeof v) c[f] = (0, o.stringToBytes)(v); else if ("object" !== (void 0 === v ? "undefined" : a(v)) || null === v || isNaN(v.length)) {
if (!(0, o.isArrayBuffer)(v)) throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");
c[f] = new Uint8Array(v)
} else c[f] = new Uint8Array(v)
} else d = i[f]; else u = i[f]; else c[f] = new URL(i[f], window.location).href;
if (c.rangeChunkSize = c.rangeChunkSize || m, c.ignoreErrors = !0 !== c.stopAtErrors, void 0 !== c.disableNativeImageDecoder && (0, o.deprecated)("parameter disableNativeImageDecoder, use nativeImageDecoderSupport instead"), c.nativeImageDecoderSupport = c.nativeImageDecoderSupport || (!0 === c.disableNativeImageDecoder ? o.NativeImageDecoding.NONE : o.NativeImageDecoding.DECODE), c.nativeImageDecoderSupport !== o.NativeImageDecoding.DECODE && c.nativeImageDecoderSupport !== o.NativeImageDecoding.NONE && c.nativeImageDecoderSupport !== o.NativeImageDecoding.DISPLAY && ((0, o.warn)("Invalid parameter nativeImageDecoderSupport: need a state of enum {NativeImageDecoding}"), c.nativeImageDecoderSupport = o.NativeImageDecoding.DECODE), !d) {
var y = (0, s.getDefaultSetting)("workerPort");
d = y ? E.fromPort(y) : new E, l._worker = d
}
var b = l.docId;
return d.promise.then(function () {
if (l.destroyed) throw new Error("Loading aborted");
return function (e, t, n, r) {
return e.destroyed ? Promise.reject(new Error("Worker was destroyed")) : (t.disableAutoFetch = (0, s.getDefaultSetting)("disableAutoFetch"), t.disableStream = (0, s.getDefaultSetting)("disableStream"), t.chunkedViewerLoading = !!n, n && (t.length = n.length, t.initialData = n.initialData), e.messageHandler.sendWithPromise("GetDocRequest", {
docId: r,
apiVersion: "1.10.0",
source: {
data: t.data,
url: t.url,
password: t.password,
disableAutoFetch: t.disableAutoFetch,
rangeChunkSize: t.rangeChunkSize,
length: t.length
},
maxImageSize: (0, s.getDefaultSetting)("maxImageSize"),
disableFontFace: (0, s.getDefaultSetting)("disableFontFace"),
disableCreateObjectURL: (0, s.getDefaultSetting)("disableCreateObjectURL"),
postMessageTransfers: (0, s.getDefaultSetting)("postMessageTransfers") && !g,
docBaseUrl: t.docBaseUrl,
nativeImageDecoderSupport: t.nativeImageDecoderSupport,
ignoreErrors: t.ignoreErrors,
isEvalSupported: (0, s.getDefaultSetting)("isEvalSupported")
}).then(function (t) {
if (e.destroyed) throw new Error("Worker was destroyed");
return t
}))
}(d, c, u, b).then(function (e) {
if (l.destroyed) throw new Error("Loading aborted");
var t = void 0;
u ? t = new p.PDFDataTransportStream(c, u) : c.data || (t = new S({
source: c,
disableRange: (0, s.getDefaultSetting)("disableRange")
}));
var n = new o.MessageHandler(b, e, d.port);
n.postMessageTransfers = d.postMessageTransfers;
var r = new D(n, l, t, h);
l._transport = r, n.send("Ready", null)
})
}).catch(l._capability.reject), l
}, t.LoopbackPort = T, t.PDFDataRangeTransport = P, t.PDFWorker = E, t.PDFDocumentProxy = C, t.PDFPageProxy = A, t.setPDFNetworkStreamClass = function (e) {
S = e
}, t._UnsupportedManager = M, t.version = "1.10.0", t.build = "d08dce4"
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.WebGLUtils = void 0;
var r = n(14), i = n(1), a = function () {
function e(e, t, n) {
var r = e.createShader(n);
if (e.shaderSource(r, t), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
var i = e.getShaderInfoLog(r);
throw new Error("Error during shader compilation: " + i)
}
return r
}
function t(t, n) {
return e(t, n, t.VERTEX_SHADER)
}
function n(t, n) {
return e(t, n, t.FRAGMENT_SHADER)
}
function a(e, t) {
for (var n = e.createProgram(), r = 0, i = t.length; r < i; ++r) e.attachShader(n, t[r]);
if (e.linkProgram(n), !e.getProgramParameter(n, e.LINK_STATUS)) {
var a = e.getProgramInfoLog(n);
throw new Error("Error during program linking: " + a)
}
return n
}
function o(e, t, n) {
e.activeTexture(n);
var r = e.createTexture();
return e.bindTexture(e.TEXTURE_2D, r), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t), r
}
var s, l;
function c() {
s || (l = document.createElement("canvas"), s = l.getContext("webgl", {premultipliedalpha: !1}))
}
var u = " attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } ",
d = " precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",
h = null;
var p = " attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",
f = " precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",
m = null;
return {
get isEnabled() {
if ((0, r.getDefaultSetting)("disableWebGL")) return !1;
var e = !1;
try {
c(), e = !!s
} catch (e) {
}
return (0, i.shadow)(this, "isEnabled", e)
}, composeSMask: function (e, r, i) {
var p = e.width, f = e.height;
h || function () {
var e, r;
c(), e = l, l = null, r = s, s = null;
var i = a(r, [t(r, u), n(r, d)]);
r.useProgram(i);
var o = {};
o.gl = r, o.canvas = e, o.resolutionLocation = r.getUniformLocation(i, "u_resolution"), o.positionLocation = r.getAttribLocation(i, "a_position"), o.backdropLocation = r.getUniformLocation(i, "u_backdrop"), o.subtypeLocation = r.getUniformLocation(i, "u_subtype");
var p = r.getAttribLocation(i, "a_texCoord"), f = r.getUniformLocation(i, "u_image"),
m = r.getUniformLocation(i, "u_mask"), v = r.createBuffer();
r.bindBuffer(r.ARRAY_BUFFER, v), r.bufferData(r.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1]), r.STATIC_DRAW), r.enableVertexAttribArray(p), r.vertexAttribPointer(p, 2, r.FLOAT, !1, 0, 0), r.uniform1i(f, 0), r.uniform1i(m, 1), h = o
}();
var m = h, v = m.canvas, g = m.gl;
v.width = p, v.height = f, g.viewport(0, 0, g.drawingBufferWidth, g.drawingBufferHeight), g.uniform2f(m.resolutionLocation, p, f), i.backdrop ? g.uniform4f(m.resolutionLocation, i.backdrop[0], i.backdrop[1], i.backdrop[2], 1) : g.uniform4f(m.resolutionLocation, 0, 0, 0, 0), g.uniform1i(m.subtypeLocation, "Luminosity" === i.subtype ? 1 : 0);
var y = o(g, e, g.TEXTURE0), b = o(g, r, g.TEXTURE1), w = g.createBuffer();
return g.bindBuffer(g.ARRAY_BUFFER, w), g.bufferData(g.ARRAY_BUFFER, new Float32Array([0, 0, p, 0, 0, f, 0, f, p, 0, p, f]), g.STATIC_DRAW), g.enableVertexAttribArray(m.positionLocation), g.vertexAttribPointer(m.positionLocation, 2, g.FLOAT, !1, 0, 0), g.clearColor(0, 0, 0, 0), g.enable(g.BLEND), g.blendFunc(g.ONE, g.ONE_MINUS_SRC_ALPHA), g.clear(g.COLOR_BUFFER_BIT), g.drawArrays(g.TRIANGLES, 0, 6), g.flush(), g.deleteTexture(y), g.deleteTexture(b), g.deleteBuffer(w), v
}, drawFigures: function (e, r, i, o, u) {
m || function () {
var e, r;
c(), e = l, l = null, r = s, s = null;
var i = a(r, [t(r, p), n(r, f)]);
r.useProgram(i);
var o = {};
o.gl = r, o.canvas = e, o.resolutionLocation = r.getUniformLocation(i, "u_resolution"), o.scaleLocation = r.getUniformLocation(i, "u_scale"), o.offsetLocation = r.getUniformLocation(i, "u_offset"), o.positionLocation = r.getAttribLocation(i, "a_position"), o.colorLocation = r.getAttribLocation(i, "a_color"), m = o
}();
var d = m, h = d.canvas, v = d.gl;
h.width = e, h.height = r, v.viewport(0, 0, v.drawingBufferWidth, v.drawingBufferHeight), v.uniform2f(d.resolutionLocation, e, r);
var g, y, b, w = 0;
for (g = 0, y = o.length; g < y; g++) switch (o[g].type) {
case"lattice":
w += ((b = o[g].coords.length / o[g].verticesPerRow | 0) - 1) * (o[g].verticesPerRow - 1) * 6;
break;
case"triangles":
w += o[g].coords.length
}
var S = new Float32Array(2 * w), _ = new Uint8Array(3 * w), k = u.coords, x = u.colors, P = 0, C = 0;
for (g = 0, y = o.length; g < y; g++) {
var A = o[g], T = A.coords, E = A.colors;
switch (A.type) {
case"lattice":
var D = A.verticesPerRow;
b = T.length / D | 0;
for (var I = 1; I < b; I++) for (var L = I * D + 1, O = 1; O < D; O++, L++) S[P] = k[T[L - D - 1]], S[P + 1] = k[T[L - D - 1] + 1], S[P + 2] = k[T[L - D]], S[P + 3] = k[T[L - D] + 1], S[P + 4] = k[T[L - 1]], S[P + 5] = k[T[L - 1] + 1], _[C] = x[E[L - D - 1]], _[C + 1] = x[E[L - D - 1] + 1], _[C + 2] = x[E[L - D - 1] + 2], _[C + 3] = x[E[L - D]], _[C + 4] = x[E[L - D] + 1], _[C + 5] = x[E[L - D] + 2], _[C + 6] = x[E[L - 1]], _[C + 7] = x[E[L - 1] + 1], _[C + 8] = x[E[L - 1] + 2], S[P + 6] = S[P + 2], S[P + 7] = S[P + 3], S[P + 8] = S[P + 4], S[P + 9] = S[P + 5], S[P + 10] = k[T[L]], S[P + 11] = k[T[L] + 1], _[C + 9] = _[C + 3], _[C + 10] = _[C + 4], _[C + 11] = _[C + 5], _[C + 12] = _[C + 6], _[C + 13] = _[C + 7], _[C + 14] = _[C + 8], _[C + 15] = x[E[L]], _[C + 16] = x[E[L] + 1], _[C + 17] = x[E[L] + 2], P += 12, C += 18;
break;
case"triangles":
for (var M = 0, N = T.length; M < N; M++) S[P] = k[T[M]], S[P + 1] = k[T[M] + 1], _[C] = x[E[M]], _[C + 1] = x[E[M] + 1], _[C + 2] = x[E[M] + 2], P += 2, C += 3
}
}
i ? v.clearColor(i[0] / 255, i[1] / 255, i[2] / 255, 1) : v.clearColor(0, 0, 0, 0), v.clear(v.COLOR_BUFFER_BIT);
var R = v.createBuffer();
v.bindBuffer(v.ARRAY_BUFFER, R), v.bufferData(v.ARRAY_BUFFER, S, v.STATIC_DRAW), v.enableVertexAttribArray(d.positionLocation), v.vertexAttribPointer(d.positionLocation, 2, v.FLOAT, !1, 0, 0);
var W = v.createBuffer();
return v.bindBuffer(v.ARRAY_BUFFER, W), v.bufferData(v.ARRAY_BUFFER, _, v.STATIC_DRAW), v.enableVertexAttribArray(d.colorLocation), v.vertexAttribPointer(d.colorLocation, 3, v.UNSIGNED_BYTE, !1, 0, 0), v.uniform2f(d.scaleLocation, u.scaleX, u.scaleY), v.uniform2f(d.offsetLocation, u.offsetX, u.offsetY), v.drawArrays(v.TRIANGLES, 0, w), v.flush(), v.deleteBuffer(R), v.deleteBuffer(W), h
}, clear: function () {
h && h.canvas && (h.canvas.width = 0, h.canvas.height = 0), m && m.canvas && (m.canvas.width = 0, m.canvas.height = 0), h = null, m = null
}
}
}();
t.WebGLUtils = a
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.Metadata = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(1), a = n(146);
var o = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), (0, i.assert)("string" == typeof t, "Metadata: input is not a string"), t = this._repair(t);
var n = (new a.SimpleXMLParser).parseFromString(t);
this._metadata = Object.create(null), n && this._parse(n)
}
return r(e, [{
key: "_repair", value: function (e) {
return e.replace(/>\\376\\377([^<]+)/g, function (e, t) {
for (var n = t.replace(/\\([0-3])([0-7])([0-7])/g, function (e, t, n, r) {
return String.fromCharCode(64 * t + 8 * n + 1 * r)
}), r = "", i = 0, a = n.length; i < a; i += 2) {
var o = 256 * n.charCodeAt(i) + n.charCodeAt(i + 1);
r += o >= 32 && o < 127 && 60 !== o && 62 !== o && 38 !== o ? String.fromCharCode(o) : "&#x" + (65536 + o).toString(16).substring(1) + ";"
}
return ">" + r
})
}
}, {
key: "_parse", value: function (e) {
var t = e.documentElement;
if ("rdf:rdf" !== t.nodeName.toLowerCase()) for (t = t.firstChild; t && "rdf:rdf" !== t.nodeName.toLowerCase();) t = t.nextSibling;
var n = t ? t.nodeName.toLowerCase() : null;
if (t && "rdf:rdf" === n && t.hasChildNodes()) for (var r = t.childNodes, i = 0, a = r.length; i < a; i++) {
var o = r[i];
if ("rdf:description" === o.nodeName.toLowerCase()) for (var s = 0, l = o.childNodes.length; s < l; s++) if ("#text" !== o.childNodes[s].nodeName.toLowerCase()) {
var c = o.childNodes[s], u = c.nodeName.toLowerCase();
this._metadata[u] = c.textContent.trim()
}
}
}
}, {
key: "get", value: function (e) {
return this._metadata[e] || null
}
}, {
key: "getAll", value: function () {
return this._metadata
}
}, {
key: "has", value: function (e) {
return void 0 !== this._metadata[e]
}
}, {
key: "metadata", get: function () {
return (0, i.deprecated)("`metadata` getter; use `getAll()` instead."), this.getAll()
}
}]), e
}();
t.Metadata = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PopupElement = t.AnnotationLayer = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(14), o = n(1), s = n(56), l = n(5);
function c(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}
function u(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function d(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var h = function () {
function e() {
d(this, e)
}
return i(e, null, [{
key: "create", value: function (e) {
switch (e.data.annotationType) {
case o.AnnotationType.LINK:
return new m(e);
case o.AnnotationType.TEXT:
return new v(e);
case o.AnnotationType.WIDGET:
switch (e.data.fieldType) {
case"Tx":
return new y(e);
case"Btn":
if (e.data.radioButton) return new w(e);
if (e.data.checkBox) return new b(e);
(0, o.warn)("Unimplemented button widget annotation: pushbutton");
break;
case"Ch":
return new S(e)
}
return new g(e);
case o.AnnotationType.POPUP:
return new _(e);
case o.AnnotationType.LINE:
return new x(e);
case o.AnnotationType.SQUARE:
return new P(e);
case o.AnnotationType.CIRCLE:
return new C(e);
case o.AnnotationType.POLYLINE:
return new A(e);
case o.AnnotationType.POLYGON:
return new T(e);
case o.AnnotationType.HIGHLIGHT:
return new E(e);
case o.AnnotationType.UNDERLINE:
return new D(e);
case o.AnnotationType.SQUIGGLY:
return new I(e);
case o.AnnotationType.STRIKEOUT:
return new L(e);
case o.AnnotationType.STAMP:
return new O(e);
case o.AnnotationType.FILEATTACHMENT:
return new M(e);
case"prepareStamp":
return new f(e);
default:
return new p(e)
}
}
}]), e
}(), p = function () {
function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
d(this, e), this.isRenderable = n, this.data = t.data, this.layer = t.layer, this.page = t.page, this.pdfPageView = t.pdfPageView, this.viewport = t.viewport, this.linkService = t.linkService, this.downloadManager = t.downloadManager, this.imageResourcesPath = t.imageResourcesPath, this.renderInteractiveForms = t.renderInteractiveForms, this.svgFactory = t.svgFactory, "GoldGrid:AddSeal" !== this.data.subtype && "Sig" !== this.data.fieldType || (this.isRenderable = !0), this.isRenderable && (this.container = this._createContainer(r))
}
return i(e, [{
key: "_createContainer", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = this.data, n = this.page,
r = this.viewport, i = document.createElement("section"), s = t.rect[2] - t.rect[0],
l = t.rect[3] - t.rect[1];
i.setAttribute("data-annotation-id", t.id), i.setAttribute("data-goldGridSeal-id", t.goldGridSealId);
var c = o.Util.normalizeRect([t.rect[0], n.view[3] - t.rect[1] + n.view[1], t.rect[2], n.view[3] - t.rect[3] + n.view[1]]);
if (a.CustomStyle.setProp("transform", i, "matrix(" + r.transform.join(",") + ")"), a.CustomStyle.setProp("transformOrigin", i, -c[0] + "px " + -c[1] + "px"), !e && t.borderStyle.width > 0) {
i.style.borderWidth = t.borderStyle.width + "px", t.borderStyle.style !== o.AnnotationBorderStyleType.UNDERLINE && (s -= 2 * t.borderStyle.width, l -= 2 * t.borderStyle.width);
var u = t.borderStyle.horizontalCornerRadius, d = t.borderStyle.verticalCornerRadius;
if (u > 0 || d > 0) {
var h = u + "px / " + d + "px";
a.CustomStyle.setProp("borderRadius", i, h)
}
switch (t.borderStyle.style) {
case o.AnnotationBorderStyleType.SOLID:
i.style.borderStyle = "solid";
break;
case o.AnnotationBorderStyleType.DASHED:
i.style.borderStyle = "dashed";
break;
case o.AnnotationBorderStyleType.BEVELED:
(0, o.warn)("Unimplemented border style: beveled");
break;
case o.AnnotationBorderStyleType.INSET:
(0, o.warn)("Unimplemented border style: inset");
break;
case o.AnnotationBorderStyleType.UNDERLINE:
i.style.borderBottomStyle = "solid"
}
t.color ? i.style.borderColor = o.Util.makeCssRgb(0 | t.color[0], 0 | t.color[1], 0 | t.color[2]) : i.style.borderWidth = 0
}
return i.style.left = c[0] + "px", i.style.top = c[1] + "px", "Stamp" === t.subtype ? (i.style.width = s - 1 + "px", i.style.height = l - 1 + "px") : (i.style.width = s + "px", i.style.height = l + "px"), i
}
}, {
key: "_createPopup", value: function (e, t, n) {
t || ((t = document.createElement("div")).style.height = e.style.height, t.style.width = e.style.width, e.appendChild(t));
var r = new k({
container: e,
trigger: t,
color: n.color,
title: n.title,
contents: n.contents,
hideWrapper: !0,
viewport: this.viewport
}).render();
r.style.left = e.style.width, e.appendChild(r)
}
}, {
key: "render", value: function () {
var e = this.pdfPageView.div,
t = (e.querySelector(".canvasWrapper"), e.querySelector(".textLayer"), this.layer, this.container),
n = this.container.style.width, r = this.container.style.height,
i = (0, s.createSealNode)(this.page, this.pdfPageView, t, n, r, this);
return this.container.appendChild(i), this.container
}
}]), e
}(), f = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, (0, l.functionalJudgment)("prepareStamp")))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "stampAnnotation", window.KGPdfViewerWebApp.mobile ? (this.container.addEventListener("touchstart", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.pressStart), this.container.addEventListener("touchmove", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.pressEnd), this.container.addEventListener("touchend", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.pressEnd)) : this.container.addEventListener("contextmenu", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.createRightMenu), this.container
}
}]), t
}(), m = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.url || e.data.dest || e.data.action);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "linkAnnotation";
var e = document.createElement("a");
return (0, a.addLinkAttributes)(e, {
url: this.data.url,
target: this.data.newWindow ? a.LinkTarget.BLANK : void 0
}), this.data.url || (this.data.action ? this._bindNamedAction(e, this.data.action) : this._bindLink(e, this.data.dest)), this.container.appendChild(e), this.container
}
}, {
key: "_bindLink", value: function (e, t) {
var n = this;
e.href = this.linkService.getDestinationHash(t), e.onclick = function () {
return t && n.linkService.navigateTo(t), !1
}, t && (e.className = "internalLink")
}
}, {
key: "_bindNamedAction", value: function (e, t) {
var n = this;
e.href = this.linkService.getAnchorUrl(""), e.onclick = function () {
return n.linkService.executeNamedAction(t), !1
}, e.className = "internalLink"
}
}]), t
}(), v = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "textAnnotation";
var e = document.createElement("img");
return e.style.height = this.container.style.height, e.style.width = this.container.style.width, e.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", e.alt = "[{{type}} Annotation]", e.dataset.l10nId = "text_annotation_type", e.dataset.l10nArgs = JSON.stringify({type: this.data.name}), this.data.hasPopup || this._createPopup(this.container, e, this.data), this.container.appendChild(e), this.container
}
}]), t
}(), g = function (e) {
function t() {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container
}
}]), t
}(), y = function (e) {
function t(e) {
d(this, t);
var n = e.renderInteractiveForms || !e.data.hasAppearance && !!e.data.fieldValue;
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "textWidgetAnnotation";
var e = null;
if (this.renderInteractiveForms) {
if (this.data.multiLine ? (e = document.createElement("textarea")).textContent = this.data.fieldValue : ((e = document.createElement("input")).type = "text", e.setAttribute("value", this.data.fieldValue)), e.disabled = this.data.readOnly, null !== this.data.maxLen && (e.maxLength = this.data.maxLen), this.data.comb) {
var t = (this.data.rect[2] - this.data.rect[0]) / this.data.maxLen;
e.classList.add("comb"), e.style.letterSpacing = "calc(" + t + "px - 1ch)"
}
} else {
(e = document.createElement("div")).textContent = this.data.fieldValue, e.style.verticalAlign = "middle", e.style.display = "table-cell";
var n = null;
this.data.fontRefName && (n = this.page.commonObjs.getData(this.data.fontRefName)), this._setTextStyle(e, n)
}
if (null !== this.data.textAlignment && (e.style.textAlign = ["left", "center", "right"][this.data.textAlignment]), !0 === window.KGPdfViewerWebApp.useTextWidget) {
var r = window.KGPdfViewerWebApp.PDFViewerApplication, i = r.KG_TextWidget, a = r.KG_TextConfirm;
i.setTextWidgetValue(this.data.fieldName, this.data.fieldValue), e.onchange = function (e) {
i.setTextWidgetValue(this.data.fieldName, e.target.value)
}.bind(this), e.onkeyup = function (e) {
a.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}, {
key: "_setTextStyle", value: function (e, t) {
var n = e.style;
if (n.fontSize = this.data.fontSize + "px", n.direction = this.data.fontDirection < 0 ? "rtl" : "ltr", t) {
n.fontWeight = t.black ? t.bold ? "900" : "bold" : t.bold ? "bold" : "normal", n.fontStyle = t.italic ? "italic" : "normal";
var r = t.loadedName ? '"' + t.loadedName + '", ' : "", i = t.fallbackName || "Helvetica, sans-serif";
n.fontFamily = r + i
}
}
}]), t
}(), b = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, e.renderInteractiveForms))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "buttonWidgetAnnotation checkBox";
var e = document.createElement("input");
if (e.disabled = this.data.readOnly, e.type = "checkbox", this.data.fieldValue && "Off" !== this.data.fieldValue && e.setAttribute("checked", !0), !0 === window.KGPdfViewerWebApp.useTextWidget) {
var t = window.KGPdfViewerWebApp.PDFViewerApplication, n = t.KG_TextWidget, r = t.KG_TextConfirm,
i = this.data.fieldValue ? this.data.fieldValue : "Off";
n.setTextWidgetValue(this.data.fieldName, i), e.onchange = function (e) {
var t = e.target.checked ? "0" : "Off";
n.setTextWidgetValue(this.data.fieldName, t), r.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}]), t
}(), w = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, e.renderInteractiveForms))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "buttonWidgetAnnotation radioButton";
var e = document.createElement("input");
if (e.disabled = this.data.readOnly, e.type = "radio", e.name = this.data.fieldName, e.value = this.data.buttonValue, this.data.fieldValue === this.data.buttonValue && e.setAttribute("checked", !0), !0 === window.KGPdfViewerWebApp.useTextWidget) {
var t = window.KGPdfViewerWebApp.PDFViewerApplication, n = t.KG_TextWidget, r = t.KG_TextConfirm,
i = this.data.fieldValue ? this.data.fieldValue : "-1";
n.setTextWidgetValue(this.data.fieldName, i), e.onchange = function (e) {
n.setTextWidgetValue(this.data.fieldName, e.target.value), r.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}]), t
}(), S = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, e.renderInteractiveForms))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "choiceWidgetAnnotation";
var e = document.createElement("select");
e.disabled = this.data.readOnly, this.data.combo || (e.size = this.data.options.length, this.data.multiSelect && (e.multiple = !0));
for (var t = 0, n = this.data.options.length; t < n; t++) {
var r = this.data.options[t], i = document.createElement("option");
i.textContent = r.displayValue, i.value = r.exportValue, this.data.fieldValue.indexOf(r.displayValue) >= 0 && i.setAttribute("selected", !0), e.appendChild(i)
}
if (!0 === window.KGPdfViewerWebApp.useTextWidget) {
var a = window.KGPdfViewerWebApp.PDFViewerApplication, o = a.KG_TextWidget, s = a.KG_TextConfirm;
o.setTextWidgetValue(this.data.fieldName, this.data.fieldValue[0]), e.onchange = function (e) {
o.setTextWidgetValue(this.data.fieldName, e.target.value), s.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}]), t
}(), _ = function (e) {
function t(e) {
d(this, t);
var n = !(!e.data.title && !e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, p), i(t, [{
key: "render", value: function () {
if (this.container.className = "popupAnnotation", ["Line", "Square", "Circle", "PolyLine", "Polygon"].indexOf(this.data.parentType) >= 0) return this.container;
var e = '[data-annotation-id="' + this.data.parentId + '"]', t = this.layer.querySelector(e);
if (!t) return this.container;
var n = new k({
container: this.container,
trigger: t,
color: this.data.color,
title: this.data.title,
contents: this.data.contents
}), r = parseFloat(t.style.left), i = parseFloat(t.style.width);
return a.CustomStyle.setProp("transformOrigin", this.container, -(r + i) + "px -" + t.style.top), this.container.style.left = r + i + "px", this.container.appendChild(n.render()), this.container
}
}]), t
}(), k = function () {
function e(t) {
d(this, e), this.container = t.container, this.trigger = t.trigger, this.color = t.color, this.title = t.title, this.contents = t.contents, this.hideWrapper = t.hideWrapper || !1, this.viewport = t.viewport, this.pinned = !1
}
return i(e, [{
key: "render", value: function () {
var e = document.createElement("div");
e.className = "popupWrapper", this.hideElement = this.hideWrapper ? e : this.container, this.hideElement.setAttribute("hidden", !0);
var t = document.createElement("div");
t.className = "popup", t.style.fontSize = "14px";
var n = this.color;
if (n) {
var r = .7 * (255 - n[0]) + n[0], i = .7 * (255 - n[1]) + n[1], a = .7 * (255 - n[2]) + n[2];
t.style.backgroundColor = o.Util.makeCssRgb(0 | r, 0 | i, 0 | a)
}
var s = this._formatContents(this.contents), l = document.createElement("h1");
return l.textContent = this.title, this.trigger.addEventListener("click", this._toggle.bind(this)), this.trigger.addEventListener("mouseover", this._show.bind(this, !1)), this.trigger.addEventListener("mouseout", this._hide.bind(this, !1)), t.addEventListener("click", this._hide.bind(this, !0)), t.appendChild(l), t.appendChild(s), e.appendChild(t), e
}
}, {
key: "_formatContents", value: function (e) {
for (var t = document.createElement("p"), n = e.split(/(?:\r\n?|\n)/), r = 0, i = n.length; r < i; ++r) {
var a = n[r];
t.appendChild(document.createTextNode(a)), r < i - 1 && t.appendChild(document.createElement("br"))
}
return t
}
}, {
key: "_toggle", value: function () {
this.pinned ? this._hide(!0) : this._show(!0)
}
}, {
key: "_show", value: function () {
if (arguments.length > 0 && void 0 !== arguments[0] && arguments[0] && (this.pinned = !0), this.hideElement.hasAttribute("hidden") && (this.hideElement.removeAttribute("hidden"), this.container.style.zIndex += 1, this.viewport)) {
var e = Number(this.container.style.width.slice(0, -2)),
t = Number(this.container.style.height.slice(0, -2)), n = Number(this.container.style.left.slice(0, -2)),
r = Number(this.container.style.top.slice(0, -2)), i = this.viewport.viewBox[2],
a = this.viewport.viewBox[3], o = this.viewport.scale;
e + n + 50 > i && (this.hideElement.style.left = "-" + (this.hideElement.querySelector(".popup").offsetWidth + 5 * o) + "px"), t + r + 50 > a && (this.hideElement.style.top = "-" + t + "px")
}
}
}, {
key: "_hide", value: function () {
(!(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]) && (this.pinned = !1), this.hideElement.hasAttribute("hidden") || this.pinned || (this.hideElement.setAttribute("hidden", !0), this.container.style.zIndex -= 1)
}
}]), e
}(), x = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents), r = window.KGPdfViewerWebApp.globalAnnotation;
r && (n = -1 == (r.hideList || []).indexOf(e.data.title));
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "lineAnnotation";
var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], i = this.svgFactory.create(t, n),
a = this.svgFactory.createElement("line"), o = r(e.lineCoordinates, 4), s = o[0], l = o[1], c = o[2],
u = o[3], d = void 0, h = void 0, p = void 0, f = void 0;
l < u && s < c ? (d = e.rect[2] - c, p = e.rect[2] - s, h = e.rect[3] - l, f = e.rect[3] - u) : (d = e.rect[2] - s, p = e.rect[2] - c, h = e.rect[3] - u, f = e.rect[3] - l), a.setAttribute("x1", d), a.setAttribute("y1", h), a.setAttribute("x2", p), a.setAttribute("y2", f), a.setAttribute("stroke-width", e.borderStyle.width), a.setAttribute("stroke", "transparent");
var m = r(e.color, 3), v = m[0], g = m[1], y = m[2];
return this.container.setAttribute("data-rgb", "rgb(" + v + "," + g + "," + y + ")"), this.container.setAttribute("data-author", e.title), i.appendChild(a), this.container.appendChild(i), this.container
}
}]), t
}(), P = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents), r = window.KGPdfViewerWebApp.globalAnnotation;
r && (n = -1 == (r.hideList || []).indexOf(e.data.title));
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "squareAnnotation";
var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], i = this.svgFactory.create(t, n),
a = e.borderStyle.width, o = this.svgFactory.createElement("rect");
o.setAttribute("x", a / 2), o.setAttribute("y", a / 2), o.setAttribute("width", t - a), o.setAttribute("height", n - a), o.setAttribute("stroke-width", a), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "none");
var s = r(e.color, 3), l = s[0], c = s[1], u = s[2];
return this.container.setAttribute("data-rgb", "rgb(" + l + "," + c + "," + u + ")"), this.container.setAttribute("data-author", e.title), i.appendChild(o), this.container.appendChild(i), this.container
}
}]), t
}(), C = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents), r = window.KGPdfViewerWebApp.globalAnnotation;
r && (n = -1 == (r.hideList || []).indexOf(e.data.title));
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "circleAnnotation";
var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], i = this.svgFactory.create(t, n),
a = e.borderStyle.width, o = this.svgFactory.createElement("ellipse");
o.setAttribute("cx", t / 2), o.setAttribute("cy", n / 2), o.setAttribute("rx", t / 2 - a / 2), o.setAttribute("ry", n / 2 - a / 2), o.setAttribute("stroke-width", a), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "none");
var s = r(e.color, 3), l = s[0], c = s[1], u = s[2];
return this.container.setAttribute("data-rgb", "rgb(" + l + "," + c + "," + u + ")"), this.container.setAttribute("data-author", e.title), i.appendChild(o), this.container.appendChild(i), this.container
}
}]), t
}(), A = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents),
r = c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0));
return r.containerClassName = "polylineAnnotation", r.svgElementName = "svg:polyline", r
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = this.containerClassName;
for (var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], r = this.svgFactory.create(t, n), i = e.vertices, a = [], o = 0, s = i.length; o < s; o++) {
var l = i[o].x - e.rect[0], c = e.rect[3] - i[o].y;
a.push(l + "," + c)
}
a = a.join(" ");
var u = e.borderStyle.width, d = this.svgFactory.createElement(this.svgElementName);
return d.setAttribute("points", a), d.setAttribute("stroke-width", u), d.setAttribute("stroke", "transparent"), d.setAttribute("fill", "none"), r.appendChild(d), this.container.append(r), this._createPopup(this.container, d, e), this.container
}
}]), t
}(), T = function (e) {
function t(e) {
d(this, t);
var n = c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.containerClassName = "polygonAnnotation", n.svgElementName = "svg:polygon", n
}
return u(t, A), t
}(), E = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "highlightAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), D = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "underlineAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), I = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "squigglyAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), L = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "strikeoutAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), O = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "stampAnnotation";
var e = this.data.color;
if (e && (this.container.setAttribute("data-color", "rgb(" + e[0] + ", " + e[1] + ", " + e[2] + ")"), this.container.childNododes || this.container.classList.add("stamp-mask-annotation")), window.KGPdfViewerWebApp.indicateSeal) if (0 == window.KGPdfViewerWebApp.mobile) this.container.addEventListener("contextmenu", window.KGPdfViewerWebApp.PDFViewerApplication.KG_IndicateSeal.createRightMenu); else {
var t = null;
this.container.addEventListener("contextmenu", function (e) {
e.preventDefault(), e.stopPropagation()
}), this.container.addEventListener("touchstart", function (e) {
t = setTimeout(function () {
window.KGPdfViewerWebApp.PDFViewerApplication.KG_IndicateSeal.createRightMenu(e)
}, 500)
}), this.container.addEventListener("touchend", function () {
clearTimeout(t)
})
}
return this.container
}
}]), t
}(), M = function (e) {
function t(e) {
d(this, t);
var n = c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, !0)), r = n.data.file;
return n.filename = (0, a.getFilenameFromUrl)(r.filename), n.content = r.content, n.linkService.onFileAttachmentAnnotation({
id: (0, o.stringToPDFString)(r.filename),
filename: r.filename,
content: r.content
}), n
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "fileAttachmentAnnotation";
var e = document.createElement("div");
return e.style.height = this.container.style.height, e.style.width = this.container.style.width, e.addEventListener("dblclick", this._download.bind(this)), this.data.hasPopup || !this.data.title && !this.data.contents || this._createPopup(this.container, e, this.data), this.container.appendChild(e), this.container
}
}, {
key: "_download", value: function () {
this.downloadManager ? this.downloadManager.downloadData(this.content, this.filename, "") : (0, o.warn)("Download cannot be started due to unavailable download manager")
}
}]), t
}(), N = function () {
function e() {
d(this, e)
}
return i(e, null, [{
key: "render", value: function (e) {
for (var t = 0, n = e.annotations.length; t < n; t++) {
var r = e.annotations[t];
if (r) {
var i = h.create({
data: r,
layer: e.div,
page: e.page,
pdfPageView: e.pdfPageView,
viewport: e.viewport,
linkService: e.linkService,
downloadManager: e.downloadManager,
imageResourcesPath: e.imageResourcesPath || (0, a.getDefaultSetting)("imageResourcesPath"),
renderInteractiveForms: e.renderInteractiveForms || !1,
svgFactory: new a.DOMSVGFactory
});
i.isRenderable && e.div.appendChild(i.render())
}
}
}
}, {
key: "update", value: function (e) {
for (var t = 0, n = e.annotations.length; t < n; t++) {
var r = e.annotations[t], i = e.div.querySelector('[data-annotation-id="' + r.id + '"]');
i && a.CustomStyle.setProp("transform", i, "matrix(" + e.viewport.transform.join(",") + ")")
}
e.div.removeAttribute("hidden")
}
}]), e
}();
t.AnnotationLayer = N, t.PopupElement = k
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return function () {
var t = e, n = t.lib.BlockCipher, r = t.algo, i = [], a = [], o = [], s = [], l = [], c = [], u = [], d = [],
h = [], p = [];
!function () {
for (var e = [], t = 0; t < 256; t++) e[t] = t < 128 ? t << 1 : t << 1 ^ 283;
var n = 0, r = 0;
for (t = 0; t < 256; t++) {
var f = r ^ r << 1 ^ r << 2 ^ r << 3 ^ r << 4;
f = f >>> 8 ^ 255 & f ^ 99, i[n] = f, a[f] = n;
var m = e[n], v = e[m], g = e[v], y = 257 * e[f] ^ 16843008 * f;
o[n] = y << 24 | y >>> 8, s[n] = y << 16 | y >>> 16, l[n] = y << 8 | y >>> 24, c[n] = y;
y = 16843009 * g ^ 65537 * v ^ 257 * m ^ 16843008 * n;
u[f] = y << 24 | y >>> 8, d[f] = y << 16 | y >>> 16, h[f] = y << 8 | y >>> 24, p[f] = y, n ? (n = m ^ e[e[e[g ^ m]]], r ^= e[e[r]]) : n = r = 1
}
}();
var f = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], m = r.AES = n.extend({
_doReset: function () {
if (!this._nRounds || this._keyPriorReset !== this._key) {
for (var e = this._keyPriorReset = this._key, t = e.words, n = e.sigBytes / 4, r = 4 * ((this._nRounds = n + 6) + 1), a = this._keySchedule = [], o = 0; o < r; o++) o < n ? a[o] = t[o] : (c = a[o - 1], o % n ? n > 6 && o % n == 4 && (c = i[c >>> 24] << 24 | i[c >>> 16 & 255] << 16 | i[c >>> 8 & 255] << 8 | i[255 & c]) : (c = i[(c = c << 8 | c >>> 24) >>> 24] << 24 | i[c >>> 16 & 255] << 16 | i[c >>> 8 & 255] << 8 | i[255 & c], c ^= f[o / n | 0] << 24), a[o] = a[o - n] ^ c);
for (var s = this._invKeySchedule = [], l = 0; l < r; l++) {
o = r - l;
if (l % 4) var c = a[o]; else c = a[o - 4];
s[l] = l < 4 || o <= 4 ? c : u[i[c >>> 24]] ^ d[i[c >>> 16 & 255]] ^ h[i[c >>> 8 & 255]] ^ p[i[255 & c]]
}
}
}, encryptBlock: function (e, t) {
this._doCryptBlock(e, t, this._keySchedule, o, s, l, c, i)
}, decryptBlock: function (e, t) {
var n = e[t + 1];
e[t + 1] = e[t + 3], e[t + 3] = n, this._doCryptBlock(e, t, this._invKeySchedule, u, d, h, p, a);
n = e[t + 1];
e[t + 1] = e[t + 3], e[t + 3] = n
}, _doCryptBlock: function (e, t, n, r, i, a, o, s) {
for (var l = this._nRounds, c = e[t] ^ n[0], u = e[t + 1] ^ n[1], d = e[t + 2] ^ n[2], h = e[t + 3] ^ n[3], p = 4, f = 1; f < l; f++) {
var m = r[c >>> 24] ^ i[u >>> 16 & 255] ^ a[d >>> 8 & 255] ^ o[255 & h] ^ n[p++],
v = r[u >>> 24] ^ i[d >>> 16 & 255] ^ a[h >>> 8 & 255] ^ o[255 & c] ^ n[p++],
g = r[d >>> 24] ^ i[h >>> 16 & 255] ^ a[c >>> 8 & 255] ^ o[255 & u] ^ n[p++],
y = r[h >>> 24] ^ i[c >>> 16 & 255] ^ a[u >>> 8 & 255] ^ o[255 & d] ^ n[p++];
c = m, u = v, d = g, h = y
}
m = (s[c >>> 24] << 24 | s[u >>> 16 & 255] << 16 | s[d >>> 8 & 255] << 8 | s[255 & h]) ^ n[p++], v = (s[u >>> 24] << 24 | s[d >>> 16 & 255] << 16 | s[h >>> 8 & 255] << 8 | s[255 & c]) ^ n[p++], g = (s[d >>> 24] << 24 | s[h >>> 16 & 255] << 16 | s[c >>> 8 & 255] << 8 | s[255 & u]) ^ n[p++], y = (s[h >>> 24] << 24 | s[c >>> 16 & 255] << 16 | s[u >>> 8 & 255] << 8 | s[255 & d]) ^ n[p++];
e[t] = m, e[t + 1] = v, e[t + 2] = g, e[t + 3] = y
}, keySize: 8
});
t.AES = n._createHelper(m)
}(), e.AES
}, "object" === s(t) ? e.exports = t = o(n(2), n(15), n(89), n(38), n(92)) : (i = [n(2), n(15), n(89), n(38), n(92)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return function (t) {
var n = e, r = n.lib, i = r.WordArray, a = r.Hasher, o = n.algo, s = [];
!function () {
for (var e = 0; e < 64; e++) s[e] = 4294967296 * t.abs(t.sin(e + 1)) | 0
}();
var l = o.MD5 = a.extend({
_doReset: function () {
this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878])
}, _doProcessBlock: function (e, t) {
for (var n = 0; n < 16; n++) {
var r = t + n, i = e[r];
e[r] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8)
}
var a = this._hash.words, o = e[t + 0], l = e[t + 1], p = e[t + 2], f = e[t + 3], m = e[t + 4],
v = e[t + 5], g = e[t + 6], y = e[t + 7], b = e[t + 8], w = e[t + 9], S = e[t + 10], _ = e[t + 11],
k = e[t + 12], x = e[t + 13], P = e[t + 14], C = e[t + 15], A = a[0], T = a[1], E = a[2], D = a[3];
T = h(T = h(T = h(T = h(T = d(T = d(T = d(T = d(T = u(T = u(T = u(T = u(T = c(T = c(T = c(T = c(T, E = c(E, D = c(D, A = c(A, T, E, D, o, 7, s[0]), T, E, l, 12, s[1]), A, T, p, 17, s[2]), D, A, f, 22, s[3]), E = c(E, D = c(D, A = c(A, T, E, D, m, 7, s[4]), T, E, v, 12, s[5]), A, T, g, 17, s[6]), D, A, y, 22, s[7]), E = c(E, D = c(D, A = c(A, T, E, D, b, 7, s[8]), T, E, w, 12, s[9]), A, T, S, 17, s[10]), D, A, _, 22, s[11]), E = c(E, D = c(D, A = c(A, T, E, D, k, 7, s[12]), T, E, x, 12, s[13]), A, T, P, 17, s[14]), D, A, C, 22, s[15]), E = u(E, D = u(D, A = u(A, T, E, D, l, 5, s[16]), T, E, g, 9, s[17]), A, T, _, 14, s[18]), D, A, o, 20, s[19]), E = u(E, D = u(D, A = u(A, T, E, D, v, 5, s[20]), T, E, S, 9, s[21]), A, T, C, 14, s[22]), D, A, m, 20, s[23]), E = u(E, D = u(D, A = u(A, T, E, D, w, 5, s[24]), T, E, P, 9, s[25]), A, T, f, 14, s[26]), D, A, b, 20, s[27]), E = u(E, D = u(D, A = u(A, T, E, D, x, 5, s[28]), T, E, p, 9, s[29]), A, T, y, 14, s[30]), D, A, k, 20, s[31]), E = d(E, D = d(D, A = d(A, T, E, D, v, 4, s[32]), T, E, b, 11, s[33]), A, T, _, 16, s[34]), D, A, P, 23, s[35]), E = d(E, D = d(D, A = d(A, T, E, D, l, 4, s[36]), T, E, m, 11, s[37]), A, T, y, 16, s[38]), D, A, S, 23, s[39]), E = d(E, D = d(D, A = d(A, T, E, D, x, 4, s[40]), T, E, o, 11, s[41]), A, T, f, 16, s[42]), D, A, g, 23, s[43]), E = d(E, D = d(D, A = d(A, T, E, D, w, 4, s[44]), T, E, k, 11, s[45]), A, T, C, 16, s[46]), D, A, p, 23, s[47]), E = h(E, D = h(D, A = h(A, T, E, D, o, 6, s[48]), T, E, y, 10, s[49]), A, T, P, 15, s[50]), D, A, v, 21, s[51]), E = h(E, D = h(D, A = h(A, T, E, D, k, 6, s[52]), T, E, f, 10, s[53]), A, T, S, 15, s[54]), D, A, l, 21, s[55]), E = h(E, D = h(D, A = h(A, T, E, D, b, 6, s[56]), T, E, C, 10, s[57]), A, T, g, 15, s[58]), D, A, x, 21, s[59]), E = h(E, D = h(D, A = h(A, T, E, D, m, 6, s[60]), T, E, _, 10, s[61]), A, T, p, 15, s[62]), D, A, w, 21, s[63]), a[0] = a[0] + A | 0, a[1] = a[1] + T | 0, a[2] = a[2] + E | 0, a[3] = a[3] + D | 0
}, _doFinalize: function () {
var e = this._data, n = e.words, r = 8 * this._nDataBytes, i = 8 * e.sigBytes;
n[i >>> 5] |= 128 << 24 - i % 32;
var a = t.floor(r / 4294967296), o = r;
n[15 + (i + 64 >>> 9 << 4)] = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8), n[14 + (i + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), e.sigBytes = 4 * (n.length + 1), this._process();
for (var s = this._hash, l = s.words, c = 0; c < 4; c++) {
var u = l[c];
l[c] = 16711935 & (u << 8 | u >>> 24) | 4278255360 & (u << 24 | u >>> 8)
}
return s
}, clone: function () {
var e = a.clone.call(this);
return e._hash = this._hash.clone(), e
}
});
function c(e, t, n, r, i, a, o) {
var s = e + (t & n | ~t & r) + i + o;
return (s << a | s >>> 32 - a) + t
}
function u(e, t, n, r, i, a, o) {
var s = e + (t & r | n & ~r) + i + o;
return (s << a | s >>> 32 - a) + t
}
function d(e, t, n, r, i, a, o) {
var s = e + (t ^ n ^ r) + i + o;
return (s << a | s >>> 32 - a) + t
}
function h(e, t, n, r, i, a, o) {
var s = e + (n ^ (t | ~r)) + i + o;
return (s << a | s >>> 32 - a) + t
}
n.MD5 = a._createHelper(l), n.HmacMD5 = a._createHmacHelper(l)
}(Math), e.MD5
}, "object" === s(t) ? e.exports = t = o(n(2)) : (i = [n(2)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
var t, n, r, i, a, o;
return n = (t = e).lib, r = n.WordArray, i = n.Hasher, a = [], o = t.algo.SHA1 = i.extend({
_doReset: function () {
this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
}, _doProcessBlock: function (e, t) {
for (var n = this._hash.words, r = n[0], i = n[1], o = n[2], s = n[3], l = n[4], c = 0; c < 80; c++) {
if (c < 16) a[c] = 0 | e[t + c]; else {
var u = a[c - 3] ^ a[c - 8] ^ a[c - 14] ^ a[c - 16];
a[c] = u << 1 | u >>> 31
}
var d = (r << 5 | r >>> 27) + l + a[c];
d += c < 20 ? 1518500249 + (i & o | ~i & s) : c < 40 ? 1859775393 + (i ^ o ^ s) : c < 60 ? (i & o | i & s | o & s) - 1894007588 : (i ^ o ^ s) - 899497514, l = s, s = o, o = i << 30 | i >>> 2, i = r, r = d
}
n[0] = n[0] + r | 0, n[1] = n[1] + i | 0, n[2] = n[2] + o | 0, n[3] = n[3] + s | 0, n[4] = n[4] + l | 0
}, _doFinalize: function () {
var e = this._data, t = e.words, n = 8 * this._nDataBytes, r = 8 * e.sigBytes;
return t[r >>> 5] |= 128 << 24 - r % 32, t[14 + (r + 64 >>> 9 << 4)] = Math.floor(n / 4294967296), t[15 + (r + 64 >>> 9 << 4)] = n, e.sigBytes = 4 * t.length, this._process(), this._hash
}, clone: function () {
var e = i.clone.call(this);
return e._hash = this._hash.clone(), e
}
}), t.SHA1 = i._createHelper(o), t.HmacSHA1 = i._createHmacHelper(o), e.SHA1
}, "object" === s(t) ? e.exports = t = o(n(2)) : (i = [n(2)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
var t, n, r;
n = (t = e).lib.Base, r = t.enc.Utf8, t.algo.HMAC = n.extend({
init: function (e, t) {
e = this._hasher = new e.init, "string" == typeof t && (t = r.parse(t));
var n = e.blockSize, i = 4 * n;
t.sigBytes > i && (t = e.finalize(t)), t.clamp();
for (var a = this._oKey = t.clone(), o = this._iKey = t.clone(), s = a.words, l = o.words, c = 0; c < n; c++) s[c] ^= 1549556828, l[c] ^= 909522486;
a.sigBytes = o.sigBytes = i, this.reset()
}, reset: function () {
var e = this._hasher;
e.reset(), e.update(this._iKey)
}, update: function (e) {
return this._hasher.update(e), this
}, finalize: function (e) {
var t = this._hasher, n = t.finalize(e);
return t.reset(), t.finalize(this._oKey.clone().concat(n))
}
})
}, "object" === s(t) ? e.exports = t = o(n(2)) : (i = [n(2)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
e.lib.Cipher || function (t) {
var n = e, r = n.lib, i = r.Base, a = r.WordArray, o = r.BufferedBlockAlgorithm, s = n.enc,
l = (s.Utf8, s.Base64), c = n.algo.EvpKDF, u = r.Cipher = o.extend({
cfg: i.extend(), createEncryptor: function (e, t) {
return this.create(this._ENC_XFORM_MODE, e, t)
}, createDecryptor: function (e, t) {
return this.create(this._DEC_XFORM_MODE, e, t)
}, init: function (e, t, n) {
this.cfg = this.cfg.extend(n), this._xformMode = e, this._key = t, this.reset()
}, reset: function () {
o.reset.call(this), this._doReset()
}, process: function (e) {
return this._append(e), this._process()
}, finalize: function (e) {
return e && this._append(e), this._doFinalize()
}, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function () {
function e(e) {
return "string" == typeof e ? b : g
}
return function (t) {
return {
encrypt: function (n, r, i) {
return e(r).encrypt(t, n, r, i)
}, decrypt: function (n, r, i) {
return e(r).decrypt(t, n, r, i)
}
}
}
}()
}), d = (r.StreamCipher = u.extend({
_doFinalize: function () {
return this._process(!0)
}, blockSize: 1
}), n.mode = {}), h = r.BlockCipherMode = i.extend({
createEncryptor: function (e, t) {
return this.Encryptor.create(e, t)
}, createDecryptor: function (e, t) {
return this.Decryptor.create(e, t)
}, init: function (e, t) {
this._cipher = e, this._iv = t
}
}), p = d.CBC = function () {
var e = h.extend();
function n(e, n, r) {
var i, a = this._iv;
a ? (i = a, this._iv = t) : i = this._prevBlock;
for (var o = 0; o < r; o++) e[n + o] ^= i[o]
}
return e.Encryptor = e.extend({
processBlock: function (e, t) {
var r = this._cipher, i = r.blockSize;
n.call(this, e, t, i), r.encryptBlock(e, t), this._prevBlock = e.slice(t, t + i)
}
}), e.Decryptor = e.extend({
processBlock: function (e, t) {
var r = this._cipher, i = r.blockSize, a = e.slice(t, t + i);
r.decryptBlock(e, t), n.call(this, e, t, i), this._prevBlock = a
}
}), e
}(), f = (n.pad = {}).Pkcs7 = {
pad: function (e, t) {
for (var n = 4 * t, r = n - e.sigBytes % n, i = r << 24 | r << 16 | r << 8 | r, o = [], s = 0; s < r; s += 4) o.push(i);
var l = a.create(o, r);
e.concat(l)
}, unpad: function (e) {
var t = 255 & e.words[e.sigBytes - 1 >>> 2];
e.sigBytes -= t
}
}, m = (r.BlockCipher = u.extend({
cfg: u.cfg.extend({mode: p, padding: f}), reset: function () {
var e;
u.reset.call(this);
var t = this.cfg, n = t.iv, r = t.mode;
this._xformMode == this._ENC_XFORM_MODE ? e = r.createEncryptor : (e = r.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == e ? this._mode.init(this, n && n.words) : (this._mode = e.call(r, this, n && n.words), this._mode.__creator = e)
}, _doProcessBlock: function (e, t) {
this._mode.processBlock(e, t)
}, _doFinalize: function () {
var e, t = this.cfg.padding;
return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize), e = this._process(!0)) : (e = this._process(!0), t.unpad(e)), e
}, blockSize: 4
}), r.CipherParams = i.extend({
init: function (e) {
this.mixIn(e)
}, toString: function (e) {
return (e || this.formatter).stringify(this)
}
})), v = (n.format = {}).OpenSSL = {
stringify: function (e) {
var t = e.ciphertext, n = e.salt;
return (n ? a.create([1398893684, 1701076831]).concat(n).concat(t) : t).toString(l)
}, parse: function (e) {
var t, n = l.parse(e), r = n.words;
return 1398893684 == r[0] && 1701076831 == r[1] && (t = a.create(r.slice(2, 4)), r.splice(0, 4), n.sigBytes -= 16), m.create({
ciphertext: n,
salt: t
})
}
}, g = r.SerializableCipher = i.extend({
cfg: i.extend({format: v}), encrypt: function (e, t, n, r) {
r = this.cfg.extend(r);
var i = e.createEncryptor(n, r), a = i.finalize(t), o = i.cfg;
return m.create({
ciphertext: a,
key: n,
iv: o.iv,
algorithm: e,
mode: o.mode,
padding: o.padding,
blockSize: e.blockSize,
formatter: r.format
})
}, decrypt: function (e, t, n, r) {
return r = this.cfg.extend(r), t = this._parse(t, r.format), e.createDecryptor(n, r).finalize(t.ciphertext)
}, _parse: function (e, t) {
return "string" == typeof e ? t.parse(e, this) : e
}
}), y = (n.kdf = {}).OpenSSL = {
execute: function (e, t, n, r) {
r || (r = a.random(8));
var i = c.create({keySize: t + n}).compute(e, r), o = a.create(i.words.slice(t), 4 * n);
return i.sigBytes = 4 * t, m.create({key: i, iv: o, salt: r})
}
}, b = r.PasswordBasedCipher = g.extend({
cfg: g.cfg.extend({kdf: y}), encrypt: function (e, t, n, r) {
var i = (r = this.cfg.extend(r)).kdf.execute(n, e.keySize, e.ivSize);
r.iv = i.iv;
var a = g.encrypt.call(this, e, t, i.key, r);
return a.mixIn(i), a
}, decrypt: function (e, t, n, r) {
r = this.cfg.extend(r), t = this._parse(t, r.format);
var i = r.kdf.execute(n, e.keySize, e.ivSize, t.salt);
return r.iv = i.iv, g.decrypt.call(this, e, t, i.key, r)
}
})
}()
}, "object" === s(t) ? e.exports = t = o(n(2), n(38)) : (i = [n(2), n(38)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.iWebAssistError = t.iWebAssist = void 0;
var r = n(5), i = n(40);
var a = function (e, t) {
this.kg = new i.KG("IWEBASSIST.iWebAssistCtrl.1", "4240FB41-A213-42B6-8CB5E6705C99B319");
var n = (0, i.createCapability)();
this.promise = n.promise;
var r = this, a = window.KGPdfViewerWebApp.softType, o = window.KGPdfViewerWebApp.appCode;
this.kg.init(t).then(function () {
"0" === (e || {}).clientType ? r.kg.invoke("SetParamByName", "SOFTTYPE", a).then(r.kg.invoke("SetParamByName", "APPCODE", o)).then(n.resolve) : n.resolve()
})
};
a.prototype = {
getCspName: function () {
var e = this.kg, t = (0, i.createCapability)();
return e.invoke("KGGetPublicParm", "Public", "CSPName", "").then(function (e) {
0 == e.indexOf("M") && function e(t, n, r) {
var i = r;
return t.indexOf(n) >= 0 && i < 4 && (i++, i = e(t.substr(t.indexOf(n) + 1, t.length), n, i)), i
}(e, "W", 0) > 0 && (e = e.replace(e.substring(e.indexOf("M") + 1, e.indexOf("W")), "&")), t.resolve(e)
}), t.promise
}, setParamByName: function (e, t) {
return this.kg.invoke("SetParamByName", e, t)
}, getKeyInfo: function () {
return this.kg.invoke("KGGetKeyInfo")
}, getKeyOtherInfo: function () {
return this.kg.invoke("KGGetKeyOtherInfo", "0")
}, getParamByName: function (e) {
return this.kg.invoke("GetParamByName", e)
}, makeGMV4Data: function (e) {
return this.kg.invoke("makeGMV4Data", window.KGPdfViewerWebApp.getPasswordPrompt().pwd, e.imgdata.split(",")[1], e.imgExt, (0, r.pxCovertToMM)(e.width) / 10, (0, r.pxCovertToMM)(e.height) / 10, e.signName, 5)
}, getCert: function () {
this.kg.invoke("KGGetCerInfo", "")
}, verifyPin: function (e, t) {
return this.kg.invoke("KGVerifyPin", e, t)
}, sig_pkcs7: function (e, t, n) {
return "Base64" === n ? this.kg.invoke("KGCrySignMessageEX", e, t, t.length, "Base64") : this.kg.invoke("KGCrySignMessage", e, t, t.length)
}, verifySignMessage: function (e, t) {
return this.kg.invoke("KGVerifySignMessage", "", e, t)
}, getPublicParam: function (e, t, n) {
return t || (t = ""), n || (n = ""), this.kg.invoke("KGGetPublicParm", e, t, n)
}
};
t.iWebAssist = a, t.iWebAssistError = {
getKeyInfo: {
"-1": "未安装组件",
1: "请插入电子密钥盘",
2: "没有进行正确初始化的电子密钥盘",
3: "没有找到key驱动文件",
4: "插入太多的key",
8: "非法授权的电子密钥盘",
11: "密钥盘中不存在印章",
12: "获取印章信息失败",
"-101": "获取钥匙盘有效期异常,请重新尝试签章",
"-103": "钥匙盘未生效,不能签章",
"-104": "钥匙盘已过期,不能签章",
35: "钥匙盘未生效,不能签章",
36: "钥匙盘已过期,不能签章",
37: "授权信息结构非法",
38: "验证失败,签章证书已经过期或还未生效",
39: "验证失败,签章证书不受颁发机构信任",
40: "验证失败,签章证书已被吊销",
41: "验证失败,签章证书根证书未安装或无效的根证书",
42: "验证失败,吊销列表文件不存在",
43: "验证失败,未检测到证书",
44: "验证失败,根证书文件不存在",
45: "验证失败,根证书和该证书的根证书不配套",
46: "验证失败,吊销列表和该证书的吊销列表不配套"
},
getKeyOtherInfo: {
"-100": "不支持此类型的信息获取",
"-4": "插入太多的密钥盘",
"-3": "连接签章服务器失败",
"-2": "获取失败",
"-1": "未安装管理组件",
1: "请插入电子密钥盘",
2: "没有进行正确初始化的电子密钥盘",
3: "没有找到key驱动文件",
4: "插入太多的key",
8: "非法授权的电子密钥盘",
11: "密钥盘中不存在印章",
12: "获取印章信息失败",
"-101": "获取钥匙盘有效期异常,请重新尝试签章",
"-103": "钥匙盘未生效,不能签章",
"-104": "钥匙盘已过期,不能签章"
},
verifyPin: {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
"-3": "未安装手机盾组件",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败",
10: "签章助手登录失败"
}
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.activeSealClassName = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.arrayDeepCopy = f, t.eventPreventDefault = m, t.sealSectionId = v, t.createSealSection = g, t.removeSealSection = y;
var i = n(23), a = h(n(15)), o = n(5), s = h(n(60)), l = h(n(158)), c = n(24), u = n(56), d = n(95);
function h(e) {
return e && e.__esModule ? e : {default: e}
}
var p = t.activeSealClassName = "stamp";
function f(e) {
var t = [];
return e.forEach(function (e, n) {
for (var r in t.push({}), e) e.hasOwnProperty(r) && (t[n][r] = e[r])
}), t
}
function m(e) {
e.preventDefault()
}
function v(e) {
return e + "-" + (new Date).getTime()
}
function g(e, t, n, r, i, a, o) {
var s = document.createElement("section");
s.setAttribute("data-annotation-id", n), s.id = t, s.className = r, s.style.width = e.width + "px", s.style.height = e.height + "px";
var l = document.createElement("img");
return l.src = e.imgData || e.imgdata, l.style.width = "100%", l.style.height = "100%", l.style.opacity = "0.9", s.appendChild(l), (0, d.setSectionStyle)(s, o, i, a), s
}
function y(e) {
var t = document.getElementsByClassName(e);
0 !== t.length && t[0].parentNode.removeChild(t[0])
}
function b(e, t, n, r, i, a) {
var o = arguments.length > 6 && void 0 !== arguments[6] && arguments[6], s = arguments[7], l = e.getContext("2d"),
c = e.width, u = e.height;
l.fillStyle = "#FFFFFF", l.fillRect(0, 0, c, u), l.fillStyle = n, l.fillRect(0, 0, c, u);
var d = (u - t * (r + 1)) / r;
if (l.font = "normal normal normal " + a + "px SimSun serif", l.textAlign = "center", l.textBaseline = "middle", o) {
l.fillStyle = "#FFFFFF";
var h = .16 * (c - 2 * t), p = u - 2 * t;
l.fillRect(t, t, h, p);
for (var f = 0; f < r; f++) l.fillStyle = "#FFFFFF", l.fillRect(h + 2 * t, t * (f + 1) + d * f, c - h - 3 * t, d), i && i[f] && (l.fillStyle = n, l.fillText(i[f], h + 2 * t + (c - h - 3 * t) / 2, t * (f + 1.5) + d * (f + .5), c - h - 4 * t));
l.fillStyle = n;
var m = 0;
switch (s.length) {
case 1:
m = 1.8;
break;
case 2:
m = 1.4;
break;
case 3:
m = 1.2;
break;
default:
m = 0
}
for (var v = 0; v < s.length; v++) l.fillText(s[v], h / 2 + t, (v + 1) * (p / s.length) - a * m / s.length)
} else for (var g = 0; g < r; g++) l.fillStyle = "#FFFFFF", l.fillRect(t, t * (g + 1) + d * g, c - 2 * t, d), i && i[g] && (l.fillStyle = n, l.fillText(i[g], c / 2, t * (g + 1.5) + d * (g + .5), c - 3 * t))
}
var w = function () {
function e(t, n) {
var r = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.overlayName, this.container = t.container;
var i = window.KGPdfViewerWebApp.btnPositionConfig, a = i.toolbar, s = i.sidebar;
this.docSave = t.docSave, a.indexOf("docSave") > -1 && (this.docSave.removeAttribute("hidden"), this.docSave.onclick = this.save.bind(this)), this.secondaryDocSave = t.secondaryDocSave, s.indexOf("docSave") > -1 && (this.secondaryDocSave.removeAttribute("hidden"), this.secondaryDocSave.onclick = this.save.bind(this)), this.docSaveAs = t.docSaveAs, a.indexOf("docSaveAs") > -1 && (this.docSaveAs.removeAttribute("hidden"), this.docSaveAs.onclick = this.saveAs.bind(this)), this.secondaryDocSaveAs = t.secondaryDocSaveAs, s.indexOf("docSaveAs") > -1 && (this.secondaryDocSaveAs.removeAttribute("hidden"), this.secondaryDocSaveAs.onclick = this.saveAs.bind(this)), this.textToSealCanvasContainer = t.textToSealCanvasContainer, this.indicateSealCanvasContainer = t.indicateSealCanvasContainer, this.invariantSealCanvasContainer = t.invariantSealCanvasContainer, this.textToSealCanvas = t.textToSealCanvas, this.indicateSealCanvas = t.indicateSealCanvas, this.invariantSealCanvas = t.invariantSealCanvas, this.textToSealContainer = t.textToSealContainer, this.textToSealText = t.textToSealText, this.textToSealNum = t.textToSealNum, this.textToSealDate = t.textToSealDate, this.textToSealColor = t.textToSealColor, this.indicateSealContainer = t.indicateSealContainer, this.indicateSealText = t.indicateSealText, this.indicateSealNum = t.indicateSealNum, this.indicateSealDate = t.indicateSealDate, this.indicateSealColor = t.indicateSealColor, this.invariantSealContainer = t.invariantSealContainer, this.button = t.button, a.indexOf("textToSeal") > -1 && (this.button.removeAttribute("hidden"), this.button.onclick = this.open.bind(this)), this.secondaryButton = t.secondaryButton, s.indexOf("textToSeal") > -1 && (this.secondaryButton.removeAttribute("hidden"), this.secondaryButton.onclick = this.open.bind(this)), this.exportBtn = t.exportBtn, a.indexOf("exportAnnotations") > -1 && (this.exportBtn.removeAttribute("hidden"), this.exportBtn.onclick = function () {
r.export(function (e) {
window.KGPdfViewerWebApp.exportKGAnnotations(e)
})
}), this.secondaryExportBtn = t.secondaryExportBtn, s.indexOf("exportAnnotations") > -1 && (this.secondaryExportBtn.removeAttribute("hidden"), this.secondaryExportBtn.onclick = function () {
r.export(function (e) {
window.KGPdfViewerWebApp.exportKGAnnotations(e)
})
}), this.showTextToSealBtn = t.showTextToSealBtn, this.showIndicateSealBtn = t.showIndicateSealBtn, this.showInvariantSealBtn = t.showInvariantSealBtn, this.okButton = t.okButton, this.cancelButton = t.cancelButton, this.seals = [], this.activeSeal = null, this.movingData = {
offsetX: 0,
offsetY: 0,
isMoving: !1,
movingSealSection: null
}, this.app = n, this.overlayManager = this.app.overlayManager, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0), this.showTextToSealBtn.onclick = this.showTextToSeal.bind(this), this.showIndicateSealBtn.onclick = this.showIndicateSeal.bind(this), this.showInvariantSealBtn.onclick = this.showInvariantSeal.bind(this), this.okButton.onclick = this.ok.bind(this), this.cancelButton.onclick = this.close.bind(this), this.export = this.export.bind(this), window.exportKGAnnotations = this.export, document.body.addEventListener("click", u.removeStampMenu), l.default.path = "./stamp/laydate/", this.onDocumentContextmenu = this.onDocumentContextmenu.bind(this), this.onDocumentClick = this.onDocumentClick.bind(this), this.onMouseMove = this.onMouseMove.bind(this), this.createRightMenu = this.createRightMenu.bind(this), this.handleTextToSealDateChange = this.handleTextToSealDateChange.bind(this), this.handleIndicateSealDateChange = this.handleIndicateSealDateChange.bind(this), this.drawTextToSeal = this.drawTextToSeal.bind(this), this.drawIndicateSeal = this.drawIndicateSeal.bind(this), this.handleSealOnMoveStart = this.handleSealOnMoveStart.bind(this), this.handleSealOnMoving = this.handleSealOnMoving.bind(this), this.handleSealOnMoveEnd = this.handleSealOnMoveEnd.bind(this), this.textToSealText.oninput = this.textToSealNum.oninput = this.textToSealDate.onchange = this.textToSealColor.onchange = this.drawTextToSeal, this.indicateSealText.oninput = this.indicateSealNum.oninput = this.indicateSealDate.onchange = this.indicateSealColor.onchange = this.drawIndicateSeal, this.textToSealText.onblur = this.textToSealNum.onblur = this.textToSealDate.onblur = this.textToSealColor.onblur = this.indicateSealText.onblur = this.indicateSealNum.onblur = this.indicateSealDate.onblur = this.indicateSealColor.onblur = o.scrollToResizeScreen
}
return r(e, [{
key: "init", value: function () {
this.textToSealText.value = window.KGPdfViewerWebApp.textToSealDefault.textToSealText, this.indicateSealText.value = window.KGPdfViewerWebApp.textToSealDefault.indicateSealText, this.textToSealNum.value = window.KGPdfViewerWebApp.textToSealDefault.textToSealNum, this.indicateSealNum.value = window.KGPdfViewerWebApp.textToSealDefault.indicateSealNum, l.default.render({
elem: this.textToSealDate,
value: new Date,
format: "yyyy年M月d日",
showBottom: !1,
done: this.handleTextToSealDateChange,
ready: this.handleTextToSealDateChange
}), l.default.render({
elem: this.indicateSealDate,
value: new Date,
format: "yyyy年M月d日",
showBottom: !1,
done: this.handleIndicateSealDateChange,
ready: this.handleIndicateSealDateChange
}), this.textToSealDate.value = (0, s.default)().format("YYYY年M月D日"), this.indicateSealDate.value = (0, s.default)().format("YYYY年M月D日"), this.textToSealColor.jscolor.fromString(window.KGPdfViewerWebApp.textToSealDefault.color.slice(1)), this.indicateSealColor.jscolor.fromString(window.KGPdfViewerWebApp.textToSealDefault.color.slice(1)), this.showTextToSeal()
}
}, {
key: "handleTextToSealDateChange", value: function (e) {
this.textToSealDate.value = "string" == typeof e ? e : e.year + "年" + e.month + "月" + e.date + "日", this.drawTextToSeal()
}
}, {
key: "handleIndicateSealDateChange", value: function (e) {
this.indicateSealDate.value = "string" == typeof e ? e : e.year + "年" + e.month + "月" + e.date + "日", this.drawIndicateSeal()
}
}, {
key: "open", value: function () {
var e = this;
null == this.activeSeal && this.overlayManager.open(this.overlayName).then(function () {
e.init()
})
}
}, {
key: "close", value: function () {
var e = this;
return this.overlayManager.close(this.overlayName).then(function () {
e.textToSealColor.jscolor.hide(), e.indicateSealColor.jscolor.hide()
})
}
}, {
key: "ok", value: function () {
var e = this, t = void 0, n = void 0;
"block" === this.textToSealContainer.style.display ? (t = this.textToSealCanvas, n = window.KGPdfViewerWebApp.textToSealDefault.textToSealType) : "block" === this.indicateSealContainer.style.display ? (t = this.indicateSealCanvas, n = window.KGPdfViewerWebApp.textToSealDefault.indicateSealType) : (t = this.invariantSealCanvas, n = window.KGPdfViewerWebApp.textToSealDefault.invariantSealType);
var r = t.toDataURL("image/png", 1);
return window.KGPdfViewerWebApp.transparentImg(r).then(function (i) {
if (!i || "string" != typeof i) return Promise.reject("生成印章失败");
e.activeSeal = {
originImgData: r,
imgData: "data:image/png;base64," + i,
width: .25 * t.width,
height: .25 * t.height,
customType: n
}, document.body.style.cursor = "move"
}).then(function () {
return e.close()
}).then(function () {
e.documentEventRegister(!0)
}).catch(function (t) {
e.close().then(function () {
e.app.KGAlertPrompt.open(t)
})
})
}
}, {
key: "documentEventRegister", value: function (e) {
e ? (document.body.addEventListener("contextmenu", this.onDocumentContextmenu), document.body.addEventListener("mousedown", this.onDocumentClick), document.body.addEventListener("mousemove", this.onMouseMove), this.sealSectionEventRegister(!1)) : (document.body.removeEventListener("contextmenu", this.onDocumentContextmenu), document.body.removeEventListener("mousedown", this.onDocumentClick), document.body.removeEventListener("mousemove", this.onMouseMove), this.sealSectionEventRegister(!0))
}
}, {
key: "handleSealOnMoveStart", value: function (e) {
e && "IMG" === e.target.nodeName && 0 === e.button && (this.movingData.movingSealSection = e.target.parentNode, this.movingData.offsetX = e.offsetX, this.movingData.offsetY = e.offsetY, this.movingData.isMoving = !0, this.movingData.movingSealSection.querySelector("img").style.opacity = .9)
}
}, {
key: "handleSealOnMoving", value: function (e) {
var t = this;
if (this.movingData.isMoving) {
var n = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (n) {
var r = n.pageX, a = n.pageY, o = n.pageNumber, s = this.app.pdfViewer.getPageView(Number(o) - 1),
l = s.annotationLayer, u = s.viewport.scale, h = this.seals.filter(function (e) {
return e.section.id === t.movingData.movingSealSection.id
})[0];
if (h && !h.hasSaved && (h.left = r / u - this.movingData.offsetX, h.top = a / u - this.movingData.offsetY, (0, d.setSectionStyle)(this.movingData.movingSealSection, u, h.left, h.top), Number(h.page) > 1 && Number(o) < Number(h.page) || Number(h.page) < this.app.pagesCount && Number(o) > Number(h.page))) {
this.movingData.movingSealSection.parentNode.removeChild(this.movingData.movingSealSection), l.div || (l.div = document.createElement("div"), l.div.className = "annotationLayer", s.div.appendChild(l.div)), l.div.appendChild(this.movingData.movingSealSection);
var p = this.app.pdfViewer.getPageView(Number(h.page) - 1);
p.deleteStampCallback = function () {
var e = p.div.querySelector(".canvasWrapper"), n = p.div.querySelector(".textLayer");
e && p.div.removeChild(e), n && p.div.removeChild(n);
var r = t.app.pdfThumbnailViewer.getThumbnail(p.pdfPage.pageIndex);
r.renderingState = i.RenderingStates.INITIAL, r.setImage(p)
}, p.renderingState = i.RenderingStates.INITIAL, p.renderingQueue.renderView(p);
for (var f = 0; f < p.pdfPage.textToSeals.length; f++) if (p.pdfPage.textToSeals[f].section.id === h.section.id) {
p.pdfPage.textToSeals.splice(f, 1);
break
}
h.page = o, s.pdfPage.textToSeals.push(h)
}
}
}
}
}, {
key: "handleSealOnMoveEnd", value: function (e) {
var t = this;
if (this.movingData.isMoving) {
this.movingData.isMoving = !1;
var n = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (n) {
var r = n.pageNumber, a = this.app.pdfViewer.getPageView(Number(r) - 1);
a.deleteStampCallback = function () {
var e = a.div.querySelector(".canvasWrapper"), n = a.div.querySelector(".textLayer");
e && a.div.removeChild(e), n && a.div.removeChild(n), t.movingData.movingSealSection.querySelector("img").style.opacity = 0;
var r = t.app.pdfThumbnailViewer.getThumbnail(a.pdfPage.pageIndex);
r.renderingState = i.RenderingStates.INITIAL, r.setImage(a)
}, a.renderingState = i.RenderingStates.INITIAL, a.renderingQueue.renderView(a)
}
}
}
}, {
key: "sealSectionEventRegister", value: function (e) {
var t = this;
e ? (this.seals.forEach(function (e) {
e.section && e.section.addEventListener("mousedown", t.handleSealOnMoveStart)
}), document.body.addEventListener("mousemove", this.handleSealOnMoving), document.body.addEventListener("mouseup", this.handleSealOnMoveEnd)) : (this.seals.forEach(function (e) {
e.section && e.section.removeEventListener("mouseout", t.handleSealOnMoveStart)
}), document.body.removeEventListener("mousemove", this.handleSealOnMoving), document.body.removeEventListener("mouseup", this.handleSealOnMoveEnd))
}
}, {
key: "onMouseMove", value: function (e) {
var t = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (t) {
var n = t.node, r = t.pageNumber, i = t.pageX, a = t.pageY, o = v(r);
n.style.overflow = "hidden";
var s = this.app.pdfViewer.getPageView(r - 1), l = s.annotationLayer, u = s.viewport.scale;
if (l.div || (l.div = document.createElement("div"), l.div.className = "annotationLayer", n.appendChild(l.div)), i > 0 && a > 0) {
this.activeSeal.section = document.getElementById(o);
var h = i / u - this.activeSeal.width / 2, f = a / u - this.activeSeal.height / 2;
if (this.activeSeal.section) (0, d.setSectionStyle)(this.activeSeal.section, u, h, f); else {
y(p);
var m = (new Date).getTime();
this.activeSeal.section = g(this.activeSeal, o, m, p, h, f, u), l.div.appendChild(this.activeSeal.section)
}
} else y(p)
} else y(p)
}
}, {
key: "onDocumentContextmenu", value: function (e) {
e.preventDefault(), y(p), this.activeSeal = null, document.body.style.cursor = "default", this.documentEventRegister(!1)
}
}, {
key: "onDocumentClick", value: function (e) {
if (e && 0 === e.button) {
var t = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (t) {
var n = t.pageNumber, r = t.pageX, i = t.pageY, a = this.app.pdfViewer.getPageView(n - 1),
o = a.pdfPage.textToSeals;
if (r < 0 || r > a.width || i < 0 || i > a.height) return;
this.activeSeal.section.setAttribute("class", "stampAnnotation"), this.activeSeal.left = (0, c.getNumbOfPx)(this.activeSeal.section.style.left), this.activeSeal.top = (0, c.getNumbOfPx)(this.activeSeal.section.style.top), this.activeSeal.width = (0, c.getNumbOfPx)(this.activeSeal.section.style.width), this.activeSeal.height = (0, c.getNumbOfPx)(this.activeSeal.section.style.height), this.activeSeal.page = n, this.activeSeal.createTime = (0, s.default)().format("YYYY-MM-DD HH:mm:ss"), this.activeSeal.section.style.zIndex = "2", this.seals.push(this.activeSeal), o.push(this.activeSeal), this.activeSeal.section.querySelector("img").addEventListener("mousedown", m), this.activeSeal.section.querySelector("img").addEventListener("contextmenu", this.createRightMenu), this.updateUI(a, this.activeSeal.section), window.KGPdfViewerWebApp.textToSealCb(), this.onDocumentContextmenu(e)
}
}
}
}, {
key: "updateUI", value: function (e, t) {
var n = e.pdfPage, r = e.canvas, a = e.viewport, o = t.querySelector("img");
o.style.opacity = 0;
var s = r.getContext("2d");
s.globalCompositeOperation = "multiply", "multiply" !== s.globalCompositeOperation && (s.globalAlpha = .85);
var l = a.scale * (e.canvas.width / e.canvas.offsetWidth), u = ((0, c.getNumbOfPx)(t.style.left) + 1) * l,
d = ((0, c.getNumbOfPx)(t.style.top) + 1) * l, h = (0, c.getNumbOfPx)(t.style.width) * l,
p = (0, c.getNumbOfPx)(t.style.height) * l;
s.drawImage(o, u, d, h, p);
var f = this.app.pdfThumbnailViewer.getThumbnail(n.pageIndex);
f.renderingState = i.RenderingStates.INITIAL, f.setImage(e)
}
}, {
key: "createRightMenu", value: function (e) {
if (e && "IMG" === e.target.nodeName) {
e.preventDefault();
var t = e.target.parentNode, n = this.seals.filter(function (e) {
return e.section.id === t.id
})[0];
if (n) {
if (n.hasSaved) return;
(0, u.removeStampMenu)();
var r = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar), a = r.pageNumber, o = r.pageX,
s = r.pageY, l = this.app.pdfViewer.getPageView(a - 1), d = document.createElement("div");
d.id = "rightMenu", d.style.position = "absolute", d.style["background-color"] = "white", d.style.border = "1px solid #999", d.style.zIndex = "200", l.viewport.width < parseFloat(o) + 94 && (o -= 94), l.viewport.height < parseFloat(s) + 70 && (s -= 70), d.style.top = s + "px", d.style.left = o + "px";
var h = document.createElement("span");
h.classList.add("menuDeleteSeal"), h.setAttribute("data-l10n-id", "menuDeleteSeal"), d.appendChild(h), h.addEventListener("contextmenu", m), h.addEventListener("click", function () {
var t = this;
(0, u.removeStampMenu)();
var n = e.target.parentNode;
n.parentNode.removeChild(n);
for (var r = this.seals.filter(function (e) {
return e.section.id === n.id
})[0], a = this.app.pdfViewer.getPageView(r.page - 1), o = a.pdfPage.textToSeals, s = 0; s < o.length; s++) if (o[s].section.id === r.section.id) {
o.splice(s, 1);
break
}
for (var l = 0; l < this.seals.length; l++) if (this.seals[l].section.id === n.id) {
this.seals.splice(l, 1);
break
}
a.deleteStampCallback = function () {
var e = a.div.querySelector(".canvasWrapper"), n = a.div.querySelector(".textLayer");
e && a.div.removeChild(e), n && a.div.removeChild(n);
var r = t.app.pdfThumbnailViewer.getThumbnail(a.pdfPage.pageIndex);
r.renderingState = i.RenderingStates.INITIAL, r.setImage(a)
}, a.renderingState = i.RenderingStates.INITIAL, a.renderingQueue.renderView(a)
}.bind(this)), l.div.appendChild(d), this.app.l10n.translate(d)
}
}
}
}, {
key: "showTextToSeal", value: function () {
switch (this.app.l10n._lang) {
case"zh-TW":
this.container.querySelector(".kgtitle").innerHTML = "轉文章";
break;
case"en-US":
this.container.querySelector(".kgtitle").innerHTML = "TextToSeal";
break;
default:
this.container.querySelector(".kgtitle").innerHTML = "转文章"
}
this.showTextToSealBtn.setAttribute("class", "selected"), this.showTextToSealBtn.parentNode.style.borderBottomColor = "#fff", this.textToSealContainer.style.display = "block", this.showInvariantSealBtn.removeAttribute("class"), this.showInvariantSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.invariantSealContainer.style.display = "none", this.showIndicateSealBtn.removeAttribute("class"), this.showIndicateSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.indicateSealContainer.style.display = "none", this.drawTextToSeal()
}
}, {
key: "showIndicateSeal", value: function () {
switch (this.app.l10n._lang) {
case"zh-TW":
this.container.querySelector(".kgtitle").innerHTML = "批示章";
break;
case"en-US":
this.container.querySelector(".kgtitle").innerHTML = "IndicateSeal";
break;
default:
this.container.querySelector(".kgtitle").innerHTML = "批示章"
}
this.showIndicateSealBtn.setAttribute("class", "selected"), this.indicateSealContainer.style.display = "block", this.showIndicateSealBtn.parentNode.style.borderBottomColor = "#fff", this.showTextToSealBtn.removeAttribute("class"), this.textToSealContainer.style.display = "none", this.showTextToSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.showInvariantSealBtn.removeAttribute("class"), this.showInvariantSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.invariantSealContainer.style.display = "none", this.drawIndicateSeal()
}
}, {
key: "showInvariantSeal", value: function () {
switch (this.app.l10n._lang) {
case"zh-TW":
this.container.querySelector(".kgtitle").innerHTML = "固定章";
break;
case"en-US":
this.container.querySelector(".kgtitle").innerHTML = "InvariantSeal";
break;
default:
this.container.querySelector(".kgtitle").innerHTML = "固定章"
}
this.showInvariantSealBtn.setAttribute("class", "selected"), this.invariantSealContainer.style.display = "block", this.showInvariantSealBtn.parentNode.style.borderBottomColor = "#fff", this.showTextToSealBtn.removeAttribute("class"), this.textToSealContainer.style.display = "none", this.showTextToSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.showIndicateSealBtn.removeAttribute("class"), this.showIndicateSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.indicateSealContainer.style.display = "none", this.drawInvariantSeal()
}
}, {
key: "drawTextToSeal", value: function () {
var e = this.textToSealCanvas;
b(e, 7, "#" + this.textToSealColor.value, 3, [this.textToSealText.value, "第 " + this.textToSealNum.value + " 号", this.textToSealDate.value], Math.ceil(e.width / 9))
}
}, {
key: "drawIndicateSeal", value: function () {
var e = this.indicateSealCanvas, t = "#" + this.indicateSealColor.value, n = this.indicateSealText.value;
b(e, 7, t, 2, ["网第 " + this.indicateSealNum.value + " 号", this.indicateSealDate.value], Math.ceil(e.width / 9), !0, n)
}
}, {
key: "drawInvariantSeal", value: function () {
var e = this.invariantSealCanvas, t = window.KGPdfViewerWebApp.textToSealDefault.invariantSealImgPath,
n = new Image;
n.onload = function () {
var t = e.getContext("2d");
function r(r) {
t.drawImage(n, 0, 0, n.width, n.height, (e.width - n.width * r * 4) / 2, (e.height - n.height * r * 4) / 2, n.width * r * 4, n.height * r * 4)
}
var i = e.height / e.width, a = n.height / n.width;
t.fillStyle = "#FFFFFF", t.fillRect(0, 0, e.width, e.height), a <= i && n.width > n.height ? r(e.width / (4 * n.width)) : r(e.height / (4 * n.height))
}, n.src = t
}
}, {
key: "export", value: function (e) {
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], i = f(this.seals),
o = f(this.app.kgAnnotationViewer.annotationList),
l = "D:" + (0, s.default)().format("YYYYMMDDHHmmss") + "+08'00'";
r || (i = i.filter(function (e) {
return !e.hasSaved
})), i.forEach(function (e) {
var t;
t = window.KGPdfViewerWebApp.PDFViewerApplication.pdfViewer.getPageView(Number(e.page) - 1).viewport.viewBox[3] - e.height - e.top, e.x = e.left, e.y = t, e.styleId = "12", e.styleName = "Stamp", e.pageNo = e.page, e.curDateTime = l, e.authorName = window.KGPdfViewerWebApp.userId, e.annotInfo = JSON.stringify({
customType: e.customType,
type: e.styleName,
author: e.authorName
});
var n = e.originImgData.split(",")[1];
e.annotSignature = a.default.parse(n).toString(), delete e.customType, delete e.top, delete e.left, delete e.section, delete e.page, delete e.imgData, delete e.originImgData, delete e.hasSaved
}), o.forEach(function (e) {
var t;
t = window.KGPdfViewerWebApp.PDFViewerApplication.pdfViewer.getPageView(Number(e.page) - 1).viewport.viewBox[3] - e.height - e.y, e.y = t, e.styleId = "12", e.styleName = "Stamp", e.pageNo = e.page, e.curDateTime = l, delete e.page
});
var c = void 0;
if (c = t ? JSON.stringify({d: i.concat(o)}).slice(5, -1) : JSON.stringify({d: i}).slice(5, -1), n && this.seals.forEach(function (e) {
e.hasSaved = !0
}), !e) return c;
e(c)
}
}, {
key: "save", value: function () {
var e = window.KGPdfViewerWebApp.getTipPrompt(),
t = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt;
e.open("正在合并文档..."), this.export(function (n) {
window.KGPdfViewerWebApp.saveAnnotations(n).then(function (n) {
e.close(), "status" in n && !1 === n.status && t.open(n.message)
})
}, !1, !0, !1)
}
}, {
key: "saveAs", value: function () {
this.export(function (e) {
window.KGPdfViewerWebApp.saveAnnotations(e, !0)
}, !1, !1, !1)
}
}]), e
}();
t.default = w
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.rotateBase64Img = function (e, t, n) {
var r = document.createElement("canvas"), i = r.getContext("2d"), a = void 0, o = void 0, s = void 0;
if (t % 90 != 0) throw console.error("旋转角度必须是90的倍数!"), "旋转角度必须是90的倍数!";
var l = t / 90 % 4, c = {sx: 0, sy: 0, ex: 0, ey: 0}, u = new Image;
u.crossOrigin = "anonymous", u.src = e, u.onload = function () {
switch (a = u.width, o = u.height, s = a > o ? a : o, r.width = 2 * s, r.height = 2 * s, l) {
case 0:
c.sx = s, c.sy = s, c.ex = s + a, c.ey = s + o;
break;
case 1:
c.sx = s - o, c.sy = s, c.ex = s, c.ey = s + a;
break;
case 2:
c.sx = s - a, c.sy = s - o, c.ex = s, c.ey = s;
break;
case 3:
c.sx = s, c.sy = s - a, c.ex = s + o, c.ey = s + a
}
i.translate(s, s), i.rotate(t * Math.PI / 180), i.drawImage(u, 0, 0);
var e = i.getImageData(c.sx, c.sy, c.ex, c.ey);
l % 2 == 0 ? (r.width = a, r.height = o) : (r.width = o, r.height = a), i.putImageData(e, 0, 0), n && n(r.toDataURL())
}
}, t.setSectionStyle = s;
var i = n(14), a = n(24), o = n(5);
function s(e, t, n, r, o, s) {
o && (e.style.width = o + "px"), s && (e.style.height = s + "px"), e.style.transform = "matrix(" + t + ", 0, 0, " + t + ", 0, 0)", n && (e.style.left = n + "px"), r && (e.style.top = r + "px"), i.CustomStyle.setProp("transform", e, "matrix(" + t + ", 0, 0, " + t + ", 0, 0)"), i.CustomStyle.setProp("transformOrigin", e, -1 * (n || (0, a.getNumbOfPx)(e.style.left)) + "px " + -1 * r + "px")
}
var l = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = window.KGPdfViewerWebApp.PDFViewerApplication, this.isMobile = "1" === window.KGPdfViewerWebApp.mobile.toString(), this.deleteNodeSize = this.isMobile ? 27 : 18, this.createScaleNode = this.createScaleNode.bind(this);
var r = t.id + "-" + (new Date).getTime().toString();
for (var i in this.section = t.cloneNode(!0), this.section.setAttribute("id", r), this.section.setAttribute("class", "tempStampSection"), this.sealData = {}, n) n.hasOwnProperty(i) && (this.sealData[i] = n[i]);
if (this.sealData.lastSelected = Object.create(null), this.sealData.extraPosition = Object.create(null), this.banNodeList = [], this.sealData._tempStampkey = r, this.sealData.isContinuityStampCheck) for (var a = this.sealData.page.split("-"), l = parseInt(a[0]), c = parseInt(a[1]), u = this.sealData.actionPageInfo, d = l; d <= c; d++) {
var h = this.section.cloneNode(!0);
h.setAttribute("id", this.section.id + "-" + d);
var p = this.app.pdfViewer.getPageView(d - 1), f = p.div, m = parseInt(getComputedStyle(f).width),
v = parseInt(getComputedStyle(f).height),
g = {width: m, height: v, direction: v > m ? "vertical" : "horizontal"}, y = u.direction != g.direction,
b = y ? u.height != g.width : u.width != g.width, w = p.viewport, S = p.annotationLayer,
_ = p.pdfPage.tempStamps, k = w.scale;
if (this.createDeleteNode(h), h.querySelector("img").onmousedown = function (e) {
e.preventDefault()
}, h.oncontextmenu = function (e) {
e.preventDefault()
}, y) {
var x = (0, o.getXYPoint)(this.sealData, {width: v / k, height: m / k});
s(h, k, x.r_left, x.r_top)
}
if (b) {
var P = g.width / u.width, C = g.height / u.height,
A = (0, o.getXYPoint_diffentSize)({wRatio: P, hRatio: C, tempSeal: this.sealData}), T = A.d_top;
s(h, k, A.d_left, T)
}
_[h.id] = h, S && (S.div || (S.div = document.createElement("div"), S.div.className = "annotationLayer", p.div.appendChild(S.div)), S.div.appendChild(h))
} else if (this.sealData.isStampOfQfz) for (var E = 0; E < this.sealData.qfzSeal.length; E++) {
var D = this.sealData.qfzSeal[E];
D.sealdata = [], D.sealdata[0] = {
left: D.left,
width: D.width,
imgdata: D.imgdata
}, delete D.left, delete D.width, delete D.imgdata;
var I = this.section.cloneNode(!0);
I.setAttribute("id", this.section.id + "-" + D.page);
var L = this.app.pdfViewer.getPageView(D.page - 1), O = L.viewport, M = L.annotationLayer,
N = L.pdfPage.tempStamps, R = O.scale, W = L.width / R;
I.style.width = D.sealdata[0].width + "px", I.style.height = D.height + "px", D.sealdata[0].left = W - D.sealdata[0].width, s(I, R, D.sealdata[0].left, D.top), I.querySelector("img").src = D.sealdata[0].imgdata, this.createDeleteNode(I), I.querySelector("img").onmousedown = function (e) {
e.preventDefault()
}, I.oncontextmenu = function (e) {
e.preventDefault()
}, N[I.id] = I, M && (M.div || (M.div = document.createElement("div"), M.div.className = "annotationLayer", L.div.appendChild(M.div)), M.div.appendChild(I))
} else {
var V = this.app.pdfViewer.getPageView(Number(this.sealData.currentPage) - 1), F = V.annotationLayer,
G = V.div, B = V.pdfPage.tempStamps;
if (this.createDeleteNode(this.section), "signature" !== this.sealData.sealType || window.KGPdfViewerWebApp.fingerPrint || this.createScaleNode(this.section), this.section.querySelector("img").onmousedown = function (e) {
e.preventDefault()
}, this.section.oncontextmenu = function (e) {
e.preventDefault()
}, B[this.section.id] = this.section, !F) return;
F.div || (F.div = document.createElement("div"), F.div.className = "annotationLayer", G.appendChild(F.div)), F.div.appendChild(this.section)
}
}
return r(e, [{
key: "createScaleNode", value: function (e) {
if (!window.KGPdfViewerWebApp.hideDeleteNode) {
var t = document.createElement("a"), n = document.createElement("img");
t.classList.add("scaleTempStampSection"), t.style.cursor = "se-resize", t.style.position = "absolute", t.style.padding = "10px", n.setAttribute("src", "images/move.png"), n.style.width = "100%", n.style.height = "100%", this.isMobile ? (t.style.width = "24px", t.style.height = "24px", t.style.right = "-22px", t.style.bottom = "-22px") : (t.style.width = "16px", t.style.height = "16px", t.style.right = "-18px", t.style.bottom = "-18px", n.addEventListener("mousedown", function (e) {
e.preventDefault()
})), e.appendChild(t), t.appendChild(n)
}
}
}, {
key: "createDeleteNode", value: function (e) {
if (!window.KGPdfViewerWebApp.hideDeleteNode) {
var t = document.createElement("a"), n = document.createElement("img");
t.setAttribute("class", "deleteTempStampSection"), t.style.padding = "10px", n.setAttribute("src", "images/close.png"), this.isMobile ? (t.style.width = "24px", t.style.height = "24px", t.style.right = "-22px", t.style.top = "-22px") : this.sealData.isStampOfQfz ? (t.style.width = "16px", t.style.height = "16px", t.style.left = "-18px", t.style.top = "-18px") : (t.style.width = "16px", t.style.height = "16px", t.style.right = "-18px", t.style.top = "-18px"), e.appendChild(t), t.appendChild(n)
}
}
}, {
key: "delete", value: function (e) {
var t = void 0;
if ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("deleteTempStampSection")) t = e.target.parentNode.parentNode; else {
if (!e.target.classList.contains("deleteTempStampSection")) return;
t = e.target.parentNode
}
var n = this.sealData.isContinuityStampCheck ? t.id.slice(0, -2) : t.id;
if (this.sealData.isContinuityStampCheck) {
var r = this.sealData.page.split("-"), i = parseInt(r[0]), a = parseInt(r[1]);
n = [n.split("-")[0], n.split("-")[1]].join("-");
for (var o = i; o <= a; o++) {
var s = this.app.pdfViewer.getPageView(o - 1), l = s.annotationLayer, c = s.pdfPage.tempStamps,
u = n + "-" + o, d = document.getElementById(u);
c.hasOwnProperty(u) && delete c[u], d && l && l.div && l.div.removeChild(d)
}
window.KGPdfViewerWebApp.chainStamp || this.banNodeList.map(function (e) {
e.style["pointer-events"] = "auto"
})
} else if (this.sealData.isStampOfQfz) for (var h = 0; h < this.sealData.qfzSeal.length; h++) {
var p = this.sealData.qfzSeal[h], f = this.app.pdfViewer.getPageView(p.page - 1), m = f.annotationLayer,
v = f.pdfPage.tempStamps, g = (n = [n.split("-")[0], n.split("-")[1]].join("-")) + "-" + p.page,
y = document.getElementById(g);
v.hasOwnProperty(g) && delete v[g], y && m && m.div && m.div.removeChild(y)
} else {
var b = this.app.pdfViewer.getPageView(Number(this.sealData.page) - 1), w = b.annotationLayer,
S = b.pdfPage.tempStamps, _ = document.getElementById(n);
S.hasOwnProperty(n) && delete S.id, _ && w && w.div && w.div.removeChild(_)
}
this.app.pdfStamp.tempSeals = this.app.pdfStamp.tempSeals.filter(function (e) {
return e.section.id !== n
}), this.app.KGStampConfirm.sealDatas = this.app.pdfStamp.tempSeals.map(function (e) {
return e.sealData
}), this.app.pdfStamp.tempSeals.length || (this.app.pdfStamp.cancelStamp(), this.app.KGStampConfirm.hide(), this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData())
}
}, {
key: "eventRegister", value: function () {
var e = this.app, t = e.pdfViewer, n = e.pdfSidebar, r = this.sealData, i = this.section, l = this;
function c(c) {
var u = !1, d = !1, h = !1, p = 0, f = 0, m = 0, v = 0;
function g(e) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : r.currentPage,
i = t.getPageView(Number(n) - 1).pdfPage.tempStamps;
i.hasOwnProperty(e.id) && delete i[e.id]
}
function y(e, n) {
if (!r.isStampOfQfz) {
r.page = r.currentPage = parseInt(e);
var i = t.getPageView(parseInt(e) - 1), a = i.annotationLayer;
i.pdfPage.tempStamps[n.id] = n, a.div || (a.div = document.createElement("div"), a.div.className = "annotationLayer", i.div.appendChild(a.div)), n.parentNode.removeChild(n), a.div.appendChild(n)
}
}
function b(e) {
e.preventDefault(), e.stopPropagation(), c.style.zIndex = 200, !window.KGPdfViewerWebApp.chainStamp && r.isContinuityStampCheck && (l.banNodeList = [].concat(function (e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
return Array.from(e)
}(c.parentNode.children)), l.banNodeList.map(function (e) {
e.style["pointer-events"] = "none"
}), c.style["pointer-events"] = "auto"), ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("deleteTempStampSection") || e.target.classList.contains("deleteTempStampSection")) && l.delete(e), ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("scaleTempStampSection") || e.target.classList.contains("scaleTempStampSection")) && (v = l.isMobile ? e.touches[0].clientX : e.clientX, m = (0, a.getNumbOfPx)(c.style.width), h = !0), ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("tempStampSection") || e.target.classList.contains("tempStampSection")) && (p = e.offsetX || e.target.offsetWidth / 2, f = e.offsetY || e.target.offsetHeight / 2, u = !0), l.isMobile && (document.ontouchmove = w, document.ontouchend = S)
}
function w(b) {
if (!window.KGPdfViewerWebApp.chainStamp && r.isContinuityStampCheck) {
if ("IMG" !== b.target.nodeName) return;
if ("move" !== window.getComputedStyle(b.target.parentNode).cursor) return
}
if (u) {
var w = (0, a.convertScreenToViewportPoint)(b, n);
if (w) {
var S = (0, a.getNumbOfPx)(c.style.height), _ = w.pageNumber, k = w.pageX, x = w.pageY,
P = t.getPageView(parseInt(_) - 1), C = P.viewport.scale, A = P.width / C, T = P.height / C,
E = k / C - p, D = x / C - f, I = r.left, L = r.top, O = r.xsacle, M = r.ysacle;
if (r.isStampOfQfz ? (D < 0 && (D = 0), D > T - S && (D = T - S)) : r.left = E, r.top = D, r.isContinuityStampCheck) {
d = !0;
var N = P.div, R = parseInt(getComputedStyle(N).width), W = parseInt(getComputedStyle(N).height),
V = {width: R, height: W, direction: W > R ? "vertical" : "horizontal"},
F = (0, o.getXYPoint)(r, {width: R / C, height: W / C}), G = F.XYType, B = F.xsacle, K = F.ysacle,
j = F.r_left, z = F.r_top;
r.xsacle = B, r.ysacle = K, s(i, C, E, D);
for (var U = r.page.split("-"), q = parseInt(U[0]), H = parseInt(U[1]), Y = [], X = q; X <= H; X++) {
var J = e.pdfViewer.getPageView(X - 1), Q = J.div, $ = J.pdfPage.tempStamps,
Z = parseInt(getComputedStyle(Q).width), ee = parseInt(getComputedStyle(Q).height),
te = {width: Z, height: ee, direction: ee > Z ? "vertical" : "horizontal"},
ne = V.direction != te.direction, re = ne ? V.height != te.width : V.width != te.width,
ie = {wRatio: te.width / V.width, hRatio: te.height / V.height};
for (var ae in $) -1 != ae.indexOf(i.id) && ($[ae].isRotate = ne, $[ae].isDiffentSize = re, $[ae].ratio = ie, $[ae].page = {
width: Z,
height: ee
}, Y.push((be = {}, we = ae, Se = $[ae], we in be ? Object.defineProperty(be, we, {
value: Se,
enumerable: !0,
configurable: !0,
writable: !0
}) : be[we] = Se, be)))
}
if (window.KGPdfViewerWebApp.chainStamp) {
r.XYType = G;
var oe = void 0, se = void 0;
Y.map(function (e, t) {
var n = i.id + "-" + (t + q);
if (e.hasOwnProperty(n)) {
var a = e[n], l = a.isRotate, c = a.isDiffentSize, u = a.ratio;
if (l ? (oe = z, se = j) : (oe = D, se = E), c) {
var d = (0, o.getXYPoint_diffentSize)({wRatio: u.wRatio, hRatio: u.hRatio, tempSeal: r}),
h = d.d_top, p = d.d_left;
oe = h, se = p
}
s(e[n], C, se, oe)
}
})
} else {
var le = (0, o.closest)(b.target, "section");
if (!le) return;
var ce = (0, o.getXYPoint)(r, {width: R / C, height: W / C}), ue = ce.xsacle, de = ce.ysacle;
s(le, C, E, D), r.extraPosition[_] = (0, o.removePrototype)({
left: E,
top: D,
xsacle: ue,
ysacle: de,
XYType: G
}), r.lastSelected = (0, o.removePrototype)({
index: _,
tempStampSections: Y,
scale: C
}), r.top = L, r.left = I, r.xsacle = O, r.ysacle = M, l.app.pdfStamp.selectSealData = l.sealData
}
} else if (r.isStampOfQfz) {
r.xsacle = E / A, r.ysacle = D / T, s(i, C, null, D);
var he = (0, a.getNumbOfPx)(c.style.height), pe = (0, a.getNumbOfPx)(c.style.top), fe = T - pe - he;
r.pageAttr.bottom = fe, r.pageAttr.top = pe + he;
for (var me = 0; me < r.qfzSeal.length; me++) {
var ve = r.qfzSeal[me];
ve.top = D;
var ge = i.id + "-" + ve.page, ye = e.pdfViewer.getPageView(ve.page - 1).pdfPage.tempStamps;
ye.hasOwnProperty(ge) && s(ye[ge], C, null, D)
}
} else s(c, C, E, D), l.isMobile ? (r.currentPage < e.pagesCount && D + S / 2 > T && (g(c), y(parseInt(_) + 1, c)), r.currentPage > 1 && D < 0 && -D > S / 2 && (g(c), y(parseInt(_) - 1, c))) : (r.currentPage > 1 && Number(_) < Number(r.currentPage) || r.currentPage < e.pagesCount && Number(_) > Number(r.currentPage)) && (g(c), y(_, c))
}
}
var be, we, Se;
if (h) {
var _e = (0, a.convertScreenToViewportPoint)(b, n);
if (_e) {
var ke = _e.pageNumber, xe = t.getPageView(parseInt(ke) - 1).viewport.scale,
Pe = (0, a.getNumbOfPx)(c.style.width) * xe, Ce = (0, a.getNumbOfPx)(c.style.height) * xe,
Ae = Ce / Pe;
l.isMobile ? r.width = Pe = (m * xe - v + b.touches[0].clientX) / xe : r.width = Pe = (m * xe - v + b.clientX) / xe, r.height = Ce = Pe * Ae, s(c, xe, void 0, void 0, Pe, Ce)
}
}
}
function S() {
d && function () {
if (window.KGPdfViewerWebApp.chainStamp) return;
r.isContinuityStampCheck && l.banNodeList.map(function (e) {
e.style["pointer-events"] = "auto"
});
l.app.pdfStamp.continuityStampModal.open()
}(), c.style.zIndex = 100, d = !1, u = !1, h = !1, p = 0, f = 0, m = 0, v = 0
}
l.isMobile ? c.ontouchstart = b : c.onmouseenter = function () {
c.onmousedown = b, document.onmousemove = w, document.onmouseup = S
}
}
if (r.isContinuityStampCheck) for (var u = r.page.split("-"), d = parseInt(u[0]), h = parseInt(u[1]), p = d; p <= h; p++) {
var f = i.id + "-" + p, m = e.pdfViewer.getPageView(p - 1).pdfPage.tempStamps;
m.hasOwnProperty(f) && c(m[f])
} else if (r.isStampOfQfz) for (var v = 0; v < r.qfzSeal.length; v++) {
var g = r.qfzSeal[v], y = i.id + "-" + g.page, b = e.pdfViewer.getPageView(g.page - 1).pdfPage.tempStamps;
b.hasOwnProperty(y) && c(b[y])
} else {
var w = i.id, S = e.pdfViewer.getPageView(Number(r.page) - 1).pdfPage.tempStamps;
S.hasOwnProperty(w) && c(S[w])
}
}
}, {
key: "eventUnregister", value: function () {
var e = this.app, t = this.sealData, n = this.section;
if (t.isContinuityStampCheck) for (var r = t.page.split("-"), i = parseInt(r[0]), a = parseInt(r[1]), o = i; o <= a; o++) {
var s = n.id + "-" + o, l = e.pdfViewer.getPageView(o - 1).pdfPage.tempStamps;
l.hasOwnProperty(s) && (l[s].onmouseenter = null)
} else if (t.isStampOfQfz) for (var c = 0; c < t.qfzSeal.length; c++) {
var u = t.qfzSeal[c], d = n.id + "-" + u.page, h = e.pdfViewer.getPageView(u.page - 1).pdfPage.tempStamps;
h.hasOwnProperty(d) && (h[d].onmouseenter = null)
} else {
var p = n.id, f = e.pdfViewer.getPageView(Number(t.page) - 1).pdfPage.tempStamps;
f.hasOwnProperty(p) && (f[p].onmouseenter = null)
}
}
}]), e
}();
t.default = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.renderTextLayer = void 0;
var r = n(1), i = n(14), a = function () {
var e = 1e5, t = /\S/;
var n = ["left: ", 0, "px; top: ", 0, "px; font-size: ", 0, "px; font-family: ", "", ";"];
function a(e, a, o) {
var s, l = document.createElement("div"), c = {
style: null,
angle: 0,
canvasWidth: 0,
isWhitespace: !1,
originalTransform: null,
paddingBottom: 0,
paddingLeft: 0,
paddingRight: 0,
paddingTop: 0,
scale: 1
};
if (e._textDivs.push(l), s = a.str, !t.test(s)) return c.isWhitespace = !0, void e._textDivProperties.set(l, c);
var u = r.Util.transform(e._viewport.transform, a.transform), d = Math.atan2(u[1], u[0]), h = o[a.fontName];
h.vertical && (d += Math.PI / 2);
var p, f, m = Math.sqrt(u[2] * u[2] + u[3] * u[3]), v = m;
if (h.ascent ? v = h.ascent * v : h.descent && (v = (1 + h.descent) * v), 0 === d ? (p = u[4], f = u[5] - v) : (p = u[4] + v * Math.sin(d), f = u[5] - v * Math.cos(d)), n[1] = p, n[3] = f, n[5] = m, n[7] = h.fontFamily, c.style = n.join(""), l.setAttribute("style", c.style), l.textContent = a.str, (0, i.getDefaultSetting)("pdfBug") && (l.dataset.fontName = a.fontName), 0 !== d && (c.angle = d * (180 / Math.PI)), a.str.length > 1 && (h.vertical ? c.canvasWidth = a.height * e._viewport.scale : c.canvasWidth = a.width * e._viewport.scale), e._textDivProperties.set(l, c), e._textContentStream && e._layoutText(l), e._enhanceTextSelection) {
var g = 1, y = 0;
0 !== d && (g = Math.cos(d), y = Math.sin(d));
var b, w, S = (h.vertical ? a.height : a.width) * e._viewport.scale, _ = m;
0 !== d ? (b = [g, y, -y, g, p, f], w = r.Util.getAxialAlignedBoundingBox([0, 0, S, _], b)) : w = [p, f, p + S, f + _], e._bounds.push({
left: w[0],
top: w[1],
right: w[2],
bottom: w[3],
div: l,
size: [S, _],
m: b
})
}
}
function o(t) {
if (!t._canceled) {
var n = t._textDivs, r = t._capability, i = n.length;
if (i > e) return t._renderingDone = !0, void r.resolve();
if (!t._textContentStream) for (var a = 0; a < i; a++) t._layoutText(n[a]);
t._renderingDone = !0, r.resolve()
}
}
function s(e) {
for (var t = e._bounds, n = e._viewport, i = function (e, t, n) {
var r = n.map(function (e, t) {
return {x1: e.left, y1: e.top, x2: e.right, y2: e.bottom, index: t, x1New: void 0, x2New: void 0}
});
l(e, r);
var i = new Array(n.length);
return r.forEach(function (e) {
var t = e.index;
i[t] = {left: e.x1New, top: 0, right: e.x2New, bottom: 0}
}), n.map(function (t, n) {
var a = i[n], o = r[n];
o.x1 = t.top, o.y1 = e - a.right, o.x2 = t.bottom, o.y2 = e - a.left, o.index = n, o.x1New = void 0, o.x2New = void 0
}), l(t, r), r.forEach(function (e) {
var t = e.index;
i[t].top = e.x1New, i[t].bottom = e.x2New
}), i
}(n.width, n.height, t), a = 0; a < i.length; a++) {
var o = t[a].div, s = e._textDivProperties.get(o);
if (0 !== s.angle) {
var c = i[a], u = t[a], d = u.m, h = d[0], p = d[1], f = [[0, 0], [0, u.size[1]], [u.size[0], 0], u.size],
m = new Float64Array(64);
f.forEach(function (e, t) {
var n = r.Util.applyTransform(e, d);
m[t + 0] = h && (c.left - n[0]) / h, m[t + 4] = p && (c.top - n[1]) / p, m[t + 8] = h && (c.right - n[0]) / h, m[t + 12] = p && (c.bottom - n[1]) / p, m[t + 16] = p && (c.left - n[0]) / -p, m[t + 20] = h && (c.top - n[1]) / h, m[t + 24] = p && (c.right - n[0]) / -p, m[t + 28] = h && (c.bottom - n[1]) / h, m[t + 32] = h && (c.left - n[0]) / -h, m[t + 36] = p && (c.top - n[1]) / -p, m[t + 40] = h && (c.right - n[0]) / -h, m[t + 44] = p && (c.bottom - n[1]) / -p, m[t + 48] = p && (c.left - n[0]) / p, m[t + 52] = h && (c.top - n[1]) / -h, m[t + 56] = p && (c.right - n[0]) / p, m[t + 60] = h && (c.bottom - n[1]) / -h
});
var v = function (e, t, n) {
for (var r = 0, i = 0; i < n; i++) {
var a = e[t++];
a > 0 && (r = r ? Math.min(a, r) : a)
}
return r
}, g = 1 + Math.min(Math.abs(h), Math.abs(p));
s.paddingLeft = v(m, 32, 16) / g, s.paddingTop = v(m, 48, 16) / g, s.paddingRight = v(m, 0, 16) / g, s.paddingBottom = v(m, 16, 16) / g, e._textDivProperties.set(o, s)
} else s.paddingLeft = t[a].left - i[a].left, s.paddingTop = t[a].top - i[a].top, s.paddingRight = i[a].right - t[a].right, s.paddingBottom = i[a].bottom - t[a].bottom, e._textDivProperties.set(o, s)
}
}
function l(e, t) {
t.sort(function (e, t) {
return e.x1 - t.x1 || e.index - t.index
});
var n = [{
start: -1 / 0,
end: 1 / 0,
boundary: {x1: -1 / 0, y1: -1 / 0, x2: 0, y2: 1 / 0, index: -1, x1New: 0, x2New: 0}
}];
t.forEach(function (e) {
for (var t = 0; t < n.length && n[t].end <= e.y1;) t++;
for (var r, i, a = n.length - 1; a >= 0 && n[a].start >= e.y2;) a--;
var o, s, l = -1 / 0;
for (o = t; o <= a; o++) {
var c;
(c = (i = (r = n[o]).boundary).x2 > e.x1 ? i.index > e.index ? i.x1New : e.x1 : void 0 === i.x2New ? (i.x2 + e.x1) / 2 : i.x2New) > l && (l = c)
}
for (e.x1New = l, o = t; o <= a; o++) void 0 === (i = (r = n[o]).boundary).x2New ? i.x2 > e.x1 ? i.index > e.index && (i.x2New = i.x2) : i.x2New = l : i.x2New > l && (i.x2New = Math.max(l, i.x2));
var u = [], d = null;
for (o = t; o <= a; o++) {
var h = (i = (r = n[o]).boundary).x2 > e.x2 ? i : e;
d === h ? u[u.length - 1].end = r.end : (u.push({start: r.start, end: r.end, boundary: h}), d = h)
}
for (n[t].start < e.y1 && (u[0].start = e.y1, u.unshift({
start: n[t].start,
end: e.y1,
boundary: n[t].boundary
})), e.y2 < n[a].end && (u[u.length - 1].end = e.y2, u.push({
start: e.y2,
end: n[a].end,
boundary: n[a].boundary
})), o = t; o <= a; o++) if (void 0 === (i = (r = n[o]).boundary).x2New) {
var p = !1;
for (s = t - 1; !p && s >= 0 && n[s].start >= i.y1; s--) p = n[s].boundary === i;
for (s = a + 1; !p && s < n.length && n[s].end <= i.y2; s++) p = n[s].boundary === i;
for (s = 0; !p && s < u.length; s++) p = u[s].boundary === i;
p || (i.x2New = l)
}
Array.prototype.splice.apply(n, [t, a - t + 1].concat(u))
}), n.forEach(function (t) {
var n = t.boundary;
void 0 === n.x2New && (n.x2New = Math.max(e, n.x2))
})
}
function c(e) {
var t = e.textContent, n = e.textContentStream, i = e.container, a = e.viewport, o = e.textDivs,
s = e.textContentItemsStr, l = e.enhanceTextSelection;
this._textContent = t, this._textContentStream = n, this._container = i, this._viewport = a, this._textDivs = o || [], this._textContentItemsStr = s || [], this._enhanceTextSelection = !!l, this._reader = null, this._layoutTextLastFontSize = null, this._layoutTextLastFontFamily = null, this._layoutTextCtx = null, this._textDivProperties = new WeakMap, this._renderingDone = !1, this._canceled = !1, this._capability = (0, r.createPromiseCapability)(), this._renderTimer = null, this._bounds = []
}
return c.prototype = {
get promise() {
return this._capability.promise
}, cancel: function () {
this._reader && (this._reader.cancel(new r.AbortException("text layer task cancelled")), this._reader = null), this._canceled = !0, null !== this._renderTimer && (clearTimeout(this._renderTimer), this._renderTimer = null), this._capability.reject("canceled")
}, _processItems: function (e, t) {
for (var n = 0, r = e.length; n < r; n++) this._textContentItemsStr.push(e[n].str), a(this, e[n], t)
}, _layoutText: function (e) {
var t = this._container, n = this._textDivProperties.get(e);
if (!n.isWhitespace) {
var r = e.style.fontSize, a = e.style.fontFamily;
r === this._layoutTextLastFontSize && a === this._layoutTextLastFontFamily || (this._layoutTextCtx.font = r + " " + a, this._lastFontSize = r, this._lastFontFamily = a);
var o = this._layoutTextCtx.measureText(e.textContent).width, s = "";
0 !== n.canvasWidth && o > 0 && (n.scale = n.canvasWidth / o, s = "scaleX(" + n.scale + ")"), 0 !== n.angle && (s = "rotate(" + n.angle + "deg) " + s), "" !== s && (n.originalTransform = s, i.CustomStyle.setProp("transform", e, s)), this._textDivProperties.set(e, n), t.appendChild(e)
}
}, _render: function (e) {
var t = this, n = (0, r.createPromiseCapability)(), i = Object.create(null),
a = document.createElement("canvas");
if (a.mozOpaque = !0, this._layoutTextCtx = a.getContext("2d", {alpha: !1}), this._textContent) {
var s = this._textContent.items, l = this._textContent.styles;
this._processItems(s, l), n.resolve()
} else {
if (!this._textContentStream) throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');
this._reader = this._textContentStream.getReader(), function e() {
t._reader.read().then(function (a) {
var o = a.value;
a.done ? n.resolve() : (r.Util.extendObj(i, o.styles), t._processItems(o.items, i), e())
}, n.reject)
}()
}
n.promise.then(function () {
i = null, e ? t._renderTimer = setTimeout(function () {
o(t), t._renderTimer = null
}, e) : o(t)
}, this._capability.reject)
}, expandTextDivs: function (e) {
if (this._enhanceTextSelection && this._renderingDone) {
null !== this._bounds && (s(this), this._bounds = null);
for (var t = 0, n = this._textDivs.length; t < n; t++) {
var r = this._textDivs[t], a = this._textDivProperties.get(r);
if (!a.isWhitespace) if (e) {
var o = "", l = "";
1 !== a.scale && (o = "scaleX(" + a.scale + ")"), 0 !== a.angle && (o = "rotate(" + a.angle + "deg) " + o), 0 !== a.paddingLeft && (l += " padding-left: " + a.paddingLeft / a.scale + "px;", o += " translateX(" + -a.paddingLeft / a.scale + "px)"), 0 !== a.paddingTop && (l += " padding-top: " + a.paddingTop + "px;", o += " translateY(" + -a.paddingTop + "px)"), 0 !== a.paddingRight && (l += " padding-right: " + a.paddingRight / a.scale + "px;"), 0 !== a.paddingBottom && (l += " padding-bottom: " + a.paddingBottom + "px;"), "" !== l && r.setAttribute("style", a.style + l), "" !== o && i.CustomStyle.setProp("transform", r, o)
} else r.style.padding = 0, i.CustomStyle.setProp("transform", r, a.originalTransform || "")
}
}
}
}, function (e) {
var t = new c({
textContent: e.textContent,
textContentStream: e.textContentStream,
container: e.container,
viewport: e.viewport,
textDivs: e.textDivs,
textContentItemsStr: e.textContentItemsStr,
enhanceTextSelection: e.enhanceTextSelection
});
return t._render(e.timeout), t
}
}();
t.renderTextLayer = a
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.SVGGraphics = void 0;
var r, i = n(1), a = n(14), o = {fontStyle: "normal", fontWeight: "normal", fillColor: "#000000"}, s = function () {
for (var e = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), t = 12, n = new Int32Array(256), r = 0; r < 256; r++) {
for (var a = r, o = 0; o < 8; o++) a = 1 & a ? 3988292384 ^ a >> 1 & 2147483647 : a >> 1 & 2147483647;
n[r] = a
}
function s(e, t, r, i) {
var a = i, o = t.length;
r[a] = o >> 24 & 255, r[a + 1] = o >> 16 & 255, r[a + 2] = o >> 8 & 255, r[a + 3] = 255 & o, r[a += 4] = 255 & e.charCodeAt(0), r[a + 1] = 255 & e.charCodeAt(1), r[a + 2] = 255 & e.charCodeAt(2), r[a + 3] = 255 & e.charCodeAt(3), a += 4, r.set(t, a);
var s = function (e, t, r) {
for (var i = -1, a = t; a < r; a++) {
var o = 255 & (i ^ e[a]);
i = i >>> 8 ^ n[o]
}
return -1 ^ i
}(r, i + 4, a += t.length);
r[a] = s >> 24 & 255, r[a + 1] = s >> 16 & 255, r[a + 2] = s >> 8 & 255, r[a + 3] = 255 & s
}
function l(e) {
var t = e.length, n = Math.ceil(t / 65535), r = new Uint8Array(2 + t + 5 * n + 4), i = 0;
r[i++] = 120, r[i++] = 156;
for (var a = 0; t > 65535;) r[i++] = 0, r[i++] = 255, r[i++] = 255, r[i++] = 0, r[i++] = 0, r.set(e.subarray(a, a + 65535), i), i += 65535, a += 65535, t -= 65535;
r[i++] = 1, r[i++] = 255 & t, r[i++] = t >> 8 & 255, r[i++] = 255 & ~t, r[i++] = (65535 & ~t) >> 8 & 255, r.set(e.subarray(a), i), i += e.length - a;
var o = function (e, t, n) {
for (var r = 1, i = 0, a = t; a < n; ++a) i = (i + (r = (r + (255 & e[a])) % 65521)) % 65521;
return i << 16 | r
}(e, 0, e.length);
return r[i++] = o >> 24 & 255, r[i++] = o >> 16 & 255, r[i++] = o >> 8 & 255, r[i++] = 255 & o, r
}
function c(n, r, a) {
var o, c, u, d = n.width, h = n.height, p = n.data;
switch (r) {
case i.ImageKind.GRAYSCALE_1BPP:
c = 0, o = 1, u = d + 7 >> 3;
break;
case i.ImageKind.RGB_24BPP:
c = 2, o = 8, u = 3 * d;
break;
case i.ImageKind.RGBA_32BPP:
c = 6, o = 8, u = 4 * d;
break;
default:
throw new Error("invalid format")
}
var f, m, v = new Uint8Array((1 + u) * h), g = 0, y = 0;
for (f = 0; f < h; ++f) v[g++] = 0, v.set(p.subarray(y, y + u), g), y += u, g += u;
if (r === i.ImageKind.GRAYSCALE_1BPP) for (g = 0, f = 0; f < h; f++) for (g++, m = 0; m < u; m++) v[g++] ^= 255;
var b = new Uint8Array([d >> 24 & 255, d >> 16 & 255, d >> 8 & 255, 255 & d, h >> 24 & 255, h >> 16 & 255, h >> 8 & 255, 255 & h, o, c, 0, 0, 0]),
w = function (e) {
if (!(0, i.isNodeJS)()) return l(e);
try {
var t;
t = parseInt(process.versions.node) >= 8 ? e : new Buffer(e);
var n = require("zlib").deflateSync(t, {level: 9});
return n instanceof Uint8Array ? n : new Uint8Array(n)
} catch (e) {
(0, i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + e)
}
return l(e)
}(v), S = e.length + 3 * t + b.length + w.length, _ = new Uint8Array(S), k = 0;
return _.set(e, k), s("IHDR", b, _, k += e.length), s("IDATA", w, _, k += t + b.length), k += t + w.length, s("IEND", new Uint8Array(0), _, k), (0, i.createObjectURL)(_, "image/png", a)
}
return function (e, t) {
return c(e, void 0 === e.kind ? i.ImageKind.GRAYSCALE_1BPP : e.kind, t)
}
}(), l = function () {
function e() {
this.fontSizeScale = 1, this.fontWeight = o.fontWeight, this.fontSize = 0, this.textMatrix = i.IDENTITY_MATRIX, this.fontMatrix = i.FONT_IDENTITY_MATRIX, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRise = 0, this.fillColor = o.fillColor, this.strokeColor = "#000000", this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.lineJoin = "", this.lineCap = "", this.miterLimit = 0, this.dashArray = [], this.dashPhase = 0, this.dependencies = [], this.activeClipUrl = null, this.clipGroup = null, this.maskId = ""
}
return e.prototype = {
clone: function () {
return Object.create(this)
}, setCurrentPoint: function (e, t) {
this.x = e, this.y = t
}
}, e
}();
t.SVGGraphics = r = function () {
function e(e) {
if (Number.isInteger(e)) return e.toString();
var t = e.toFixed(10), n = t.length - 1;
if ("0" !== t[n]) return t;
do {
n--
} while ("0" === t[n]);
return t.substr(0, "." === t[n] ? n : n + 1)
}
function t(t) {
if (0 === t[4] && 0 === t[5]) {
if (0 === t[1] && 0 === t[2]) return 1 === t[0] && 1 === t[3] ? "" : "scale(" + e(t[0]) + " " + e(t[3]) + ")";
if (t[0] === t[3] && t[1] === -t[2]) return "rotate(" + e(180 * Math.acos(t[0]) / Math.PI) + ")"
} else if (1 === t[0] && 0 === t[1] && 0 === t[2] && 1 === t[3]) return "translate(" + e(t[4]) + " " + e(t[5]) + ")";
return "matrix(" + e(t[0]) + " " + e(t[1]) + " " + e(t[2]) + " " + e(t[3]) + " " + e(t[4]) + " " + e(t[5]) + ")"
}
function n(e, t, n) {
this.svgFactory = new a.DOMSVGFactory, this.current = new l, this.transformMatrix = i.IDENTITY_MATRIX, this.transformStack = [], this.extraStack = [], this.commonObjs = e, this.objs = t, this.pendingClip = null, this.pendingEOFill = !1, this.embedFonts = !1, this.embeddedFonts = Object.create(null), this.cssStyle = null, this.forceDataSchema = !!n
}
var r = "http://www.w3.org/1999/xlink", c = ["butt", "round", "square"], u = ["miter", "round", "bevel"], d = 0,
h = 0;
return n.prototype = {
save: function () {
this.transformStack.push(this.transformMatrix);
var e = this.current;
this.extraStack.push(e), this.current = e.clone()
}, restore: function () {
this.transformMatrix = this.transformStack.pop(), this.current = this.extraStack.pop(), this.pendingClip = null, this.tgrp = null
}, group: function (e) {
this.save(), this.executeOpTree(e), this.restore()
}, loadDependencies: function (e) {
for (var t = this, n = e.fnArray, r = n.length, a = e.argsArray, o = 0; o < r; o++) if (i.OPS.dependency === n[o]) for (var s = a[o], l = 0, c = s.length; l < c; l++) {
var u, d = s[l];
u = "g_" === d.substring(0, 2) ? new Promise(function (e) {
t.commonObjs.get(d, e)
}) : new Promise(function (e) {
t.objs.get(d, e)
}), this.current.dependencies.push(u)
}
return Promise.all(this.current.dependencies)
}, transform: function (e, t, n, r, a, o) {
var s = [e, t, n, r, a, o];
this.transformMatrix = i.Util.transform(this.transformMatrix, s), this.tgrp = null
}, getSVG: function (e, t) {
var n = this;
this.viewport = t;
var r = this._initialize(t);
return this.loadDependencies(e).then(function () {
n.transformMatrix = i.IDENTITY_MATRIX;
var t = n.convertOpList(e);
return n.executeOpTree(t), r
})
}, convertOpList: function (e) {
var t = e.argsArray, n = e.fnArray, r = n.length, a = [], o = [];
for (var s in i.OPS) a[i.OPS[s]] = s;
for (var l = 0; l < r; l++) {
var c = n[l];
o.push({fnId: c, fn: a[c], args: t[l]})
}
return function (e) {
for (var t = [], n = [], r = e.length, i = 0; i < r; i++) "save" !== e[i].fn ? "restore" === e[i].fn ? t = n.pop() : t.push(e[i]) : (t.push({
fnId: 92,
fn: "group",
items: []
}), n.push(t), t = t[t.length - 1].items);
return t
}(o)
}, executeOpTree: function (e) {
for (var t = e.length, n = 0; n < t; n++) {
var r = e[n].fn, a = e[n].fnId, o = e[n].args;
switch (0 | a) {
case i.OPS.beginText:
this.beginText();
break;
case i.OPS.setLeading:
this.setLeading(o);
break;
case i.OPS.setLeadingMoveText:
this.setLeadingMoveText(o[0], o[1]);
break;
case i.OPS.setFont:
this.setFont(o);
break;
case i.OPS.showText:
case i.OPS.showSpacedText:
this.showText(o[0]);
break;
case i.OPS.endText:
this.endText();
break;
case i.OPS.moveText:
this.moveText(o[0], o[1]);
break;
case i.OPS.setCharSpacing:
this.setCharSpacing(o[0]);
break;
case i.OPS.setWordSpacing:
this.setWordSpacing(o[0]);
break;
case i.OPS.setHScale:
this.setHScale(o[0]);
break;
case i.OPS.setTextMatrix:
this.setTextMatrix(o[0], o[1], o[2], o[3], o[4], o[5]);
break;
case i.OPS.setTextRise:
this.setTextRise(o[0]);
break;
case i.OPS.setLineWidth:
this.setLineWidth(o[0]);
break;
case i.OPS.setLineJoin:
this.setLineJoin(o[0]);
break;
case i.OPS.setLineCap:
this.setLineCap(o[0]);
break;
case i.OPS.setMiterLimit:
this.setMiterLimit(o[0]);
break;
case i.OPS.setFillRGBColor:
this.setFillRGBColor(o[0], o[1], o[2]);
break;
case i.OPS.setStrokeRGBColor:
this.setStrokeRGBColor(o[0], o[1], o[2]);
break;
case i.OPS.setDash:
this.setDash(o[0], o[1]);
break;
case i.OPS.setGState:
this.setGState(o[0]);
break;
case i.OPS.fill:
this.fill();
break;
case i.OPS.eoFill:
this.eoFill();
break;
case i.OPS.stroke:
this.stroke();
break;
case i.OPS.fillStroke:
this.fillStroke();
break;
case i.OPS.eoFillStroke:
this.eoFillStroke();
break;
case i.OPS.clip:
this.clip("nonzero");
break;
case i.OPS.eoClip:
this.clip("evenodd");
break;
case i.OPS.paintSolidColorImageMask:
this.paintSolidColorImageMask();
break;
case i.OPS.paintJpegXObject:
this.paintJpegXObject(o[0], o[1], o[2]);
break;
case i.OPS.paintImageXObject:
this.paintImageXObject(o[0]);
break;
case i.OPS.paintInlineImageXObject:
this.paintInlineImageXObject(o[0]);
break;
case i.OPS.paintImageMaskXObject:
this.paintImageMaskXObject(o[0]);
break;
case i.OPS.paintFormXObjectBegin:
this.paintFormXObjectBegin(o[0], o[1]);
break;
case i.OPS.paintFormXObjectEnd:
this.paintFormXObjectEnd();
break;
case i.OPS.closePath:
this.closePath();
break;
case i.OPS.closeStroke:
this.closeStroke();
break;
case i.OPS.closeFillStroke:
this.closeFillStroke();
break;
case i.OPS.nextLine:
this.nextLine();
break;
case i.OPS.transform:
this.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
break;
case i.OPS.constructPath:
this.constructPath(o[0], o[1]);
break;
case i.OPS.endPath:
this.endPath();
break;
case 92:
this.group(e[n].items);
break;
default:
(0, i.warn)("Unimplemented operator " + r)
}
}
}, setWordSpacing: function (e) {
this.current.wordSpacing = e
}, setCharSpacing: function (e) {
this.current.charSpacing = e
}, nextLine: function () {
this.moveText(0, this.current.leading)
}, setTextMatrix: function (t, n, r, i, a, o) {
var s = this.current;
this.current.textMatrix = this.current.lineMatrix = [t, n, r, i, a, o], this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0, s.xcoords = [], s.tspan = this.svgFactory.createElement("svg:tspan"), s.tspan.setAttributeNS(null, "font-family", s.fontFamily), s.tspan.setAttributeNS(null, "font-size", e(s.fontSize) + "px"), s.tspan.setAttributeNS(null, "y", e(-s.y)), s.txtElement = this.svgFactory.createElement("svg:text"), s.txtElement.appendChild(s.tspan)
}, beginText: function () {
this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0, this.current.textMatrix = i.IDENTITY_MATRIX, this.current.lineMatrix = i.IDENTITY_MATRIX, this.current.tspan = this.svgFactory.createElement("svg:tspan"), this.current.txtElement = this.svgFactory.createElement("svg:text"), this.current.txtgrp = this.svgFactory.createElement("svg:g"), this.current.xcoords = []
}, moveText: function (t, n) {
var r = this.current;
this.current.x = this.current.lineX += t, this.current.y = this.current.lineY += n, r.xcoords = [], r.tspan = this.svgFactory.createElement("svg:tspan"), r.tspan.setAttributeNS(null, "font-family", r.fontFamily), r.tspan.setAttributeNS(null, "font-size", e(r.fontSize) + "px"), r.tspan.setAttributeNS(null, "y", e(-r.y))
}, showText: function (n) {
var r = this.current, a = r.font, s = r.fontSize;
if (0 !== s) {
var l, c = r.charSpacing, u = r.wordSpacing, d = r.fontDirection, h = r.textHScale * d, p = n.length,
f = a.vertical, m = s * r.fontMatrix[0], v = 0;
for (l = 0; l < p; ++l) {
var g = n[l];
if (null !== g) if ((0, i.isNum)(g)) v += -g * s * .001; else {
var y = g.width, b = g.fontChar, w = y * m + ((g.isSpace ? u : 0) + c) * d;
g.isInFont || a.missingFile ? (r.xcoords.push(r.x + v * h), r.tspan.textContent += b, v += w) : v += w
} else v += d * u
}
f ? r.y -= v * h : r.x += v * h, r.tspan.setAttributeNS(null, "x", r.xcoords.map(e).join(" ")), r.tspan.setAttributeNS(null, "y", e(-r.y)), r.tspan.setAttributeNS(null, "font-family", r.fontFamily), r.tspan.setAttributeNS(null, "font-size", e(r.fontSize) + "px"), r.fontStyle !== o.fontStyle && r.tspan.setAttributeNS(null, "font-style", r.fontStyle), r.fontWeight !== o.fontWeight && r.tspan.setAttributeNS(null, "font-weight", r.fontWeight), r.fillColor !== o.fillColor && r.tspan.setAttributeNS(null, "fill", r.fillColor);
var S = r.textMatrix;
0 !== r.textRise && ((S = S.slice())[5] += r.textRise), r.txtElement.setAttributeNS(null, "transform", t(S) + " scale(1, -1)"), r.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), r.txtElement.appendChild(r.tspan), r.txtgrp.appendChild(r.txtElement), this._ensureTransformGroup().appendChild(r.txtElement)
}
}, setLeadingMoveText: function (e, t) {
this.setLeading(-t), this.moveText(e, t)
}, addFontStyle: function (e) {
this.cssStyle || (this.cssStyle = this.svgFactory.createElement("svg:style"), this.cssStyle.setAttributeNS(null, "type", "text/css"), this.defs.appendChild(this.cssStyle));
var t = (0, i.createObjectURL)(e.data, e.mimetype, this.forceDataSchema);
this.cssStyle.textContent += '@font-face { font-family: "' + e.loadedName + '"; src: url(' + t + "); }\n"
}, setFont: function (t) {
var n = this.current, r = this.commonObjs.get(t[0]), a = t[1];
this.current.font = r, this.embedFonts && r.data && !this.embeddedFonts[r.loadedName] && (this.addFontStyle(r), this.embeddedFonts[r.loadedName] = r), n.fontMatrix = r.fontMatrix ? r.fontMatrix : i.FONT_IDENTITY_MATRIX;
var o = r.black ? r.bold ? "bolder" : "bold" : r.bold ? "bold" : "normal", s = r.italic ? "italic" : "normal";
a < 0 ? (a = -a, n.fontDirection = -1) : n.fontDirection = 1, n.fontSize = a, n.fontFamily = r.loadedName, n.fontWeight = o, n.fontStyle = s, n.tspan = this.svgFactory.createElement("svg:tspan"), n.tspan.setAttributeNS(null, "y", e(-n.y)), n.xcoords = []
}, endText: function () {
}, setLineWidth: function (e) {
this.current.lineWidth = e
}, setLineCap: function (e) {
this.current.lineCap = c[e]
}, setLineJoin: function (e) {
this.current.lineJoin = u[e]
}, setMiterLimit: function (e) {
this.current.miterLimit = e
}, setStrokeAlpha: function (e) {
this.current.strokeAlpha = e
}, setStrokeRGBColor: function (e, t, n) {
var r = i.Util.makeCssRgb(e, t, n);
this.current.strokeColor = r
}, setFillAlpha: function (e) {
this.current.fillAlpha = e
}, setFillRGBColor: function (e, t, n) {
var r = i.Util.makeCssRgb(e, t, n);
this.current.fillColor = r, this.current.tspan = this.svgFactory.createElement("svg:tspan"), this.current.xcoords = []
}, setDash: function (e, t) {
this.current.dashArray = e, this.current.dashPhase = t
}, constructPath: function (t, n) {
var r = this.current, a = r.x, o = r.y;
r.path = this.svgFactory.createElement("svg:path");
for (var s = [], l = t.length, c = 0, u = 0; c < l; c++) switch (0 | t[c]) {
case i.OPS.rectangle:
a = n[u++], o = n[u++];
var d = a + n[u++], h = o + n[u++];
s.push("M", e(a), e(o), "L", e(d), e(o), "L", e(d), e(h), "L", e(a), e(h), "Z");
break;
case i.OPS.moveTo:
a = n[u++], o = n[u++], s.push("M", e(a), e(o));
break;
case i.OPS.lineTo:
a = n[u++], o = n[u++], s.push("L", e(a), e(o));
break;
case i.OPS.curveTo:
a = n[u + 4], o = n[u + 5], s.push("C", e(n[u]), e(n[u + 1]), e(n[u + 2]), e(n[u + 3]), e(a), e(o)), u += 6;
break;
case i.OPS.curveTo2:
a = n[u + 2], o = n[u + 3], s.push("C", e(a), e(o), e(n[u]), e(n[u + 1]), e(n[u + 2]), e(n[u + 3])), u += 4;
break;
case i.OPS.curveTo3:
a = n[u + 2], o = n[u + 3], s.push("C", e(n[u]), e(n[u + 1]), e(a), e(o), e(a), e(o)), u += 4;
break;
case i.OPS.closePath:
s.push("Z")
}
r.path.setAttributeNS(null, "d", s.join(" ")), r.path.setAttributeNS(null, "fill", "none"), this._ensureTransformGroup().appendChild(r.path), r.element = r.path, r.setCurrentPoint(a, o)
}, endPath: function () {
if (this.pendingClip) {
var e = this.current, n = "clippath" + d;
d++;
var r = this.svgFactory.createElement("svg:clipPath");
r.setAttributeNS(null, "id", n), r.setAttributeNS(null, "transform", t(this.transformMatrix));
var i = e.element.cloneNode();
"evenodd" === this.pendingClip ? i.setAttributeNS(null, "clip-rule", "evenodd") : i.setAttributeNS(null, "clip-rule", "nonzero"), this.pendingClip = null, r.appendChild(i), this.defs.appendChild(r), e.activeClipUrl && (e.clipGroup = null, this.extraStack.forEach(function (e) {
e.clipGroup = null
})), e.activeClipUrl = "url(#" + n + ")", this.tgrp = null
}
}, clip: function (e) {
this.pendingClip = e
}, closePath: function () {
var e = this.current, t = e.path.getAttributeNS(null, "d");
t += "Z", e.path.setAttributeNS(null, "d", t)
}, setLeading: function (e) {
this.current.leading = -e
}, setTextRise: function (e) {
this.current.textRise = e
}, setHScale: function (e) {
this.current.textHScale = e / 100
}, setGState: function (e) {
for (var t = 0, n = e.length; t < n; t++) {
var r = e[t], a = r[0], o = r[1];
switch (a) {
case"LW":
this.setLineWidth(o);
break;
case"LC":
this.setLineCap(o);
break;
case"LJ":
this.setLineJoin(o);
break;
case"ML":
this.setMiterLimit(o);
break;
case"D":
this.setDash(o[0], o[1]);
break;
case"Font":
this.setFont(o);
break;
case"CA":
this.setStrokeAlpha(o);
break;
case"ca":
this.setFillAlpha(o);
break;
default:
(0, i.warn)("Unimplemented graphic state " + a)
}
}
}, fill: function () {
var e = this.current;
e.element.setAttributeNS(null, "fill", e.fillColor), e.element.setAttributeNS(null, "fill-opacity", e.fillAlpha)
}, stroke: function () {
var t = this.current;
t.element.setAttributeNS(null, "stroke", t.strokeColor), t.element.setAttributeNS(null, "stroke-opacity", t.strokeAlpha), t.element.setAttributeNS(null, "stroke-miterlimit", e(t.miterLimit)), t.element.setAttributeNS(null, "stroke-linecap", t.lineCap), t.element.setAttributeNS(null, "stroke-linejoin", t.lineJoin), t.element.setAttributeNS(null, "stroke-width", e(t.lineWidth) + "px"), t.element.setAttributeNS(null, "stroke-dasharray", t.dashArray.map(e).join(" ")), t.element.setAttributeNS(null, "stroke-dashoffset", e(t.dashPhase) + "px"), t.element.setAttributeNS(null, "fill", "none")
}, eoFill: function () {
this.current.element.setAttributeNS(null, "fill-rule", "evenodd"), this.fill()
}, fillStroke: function () {
this.stroke(), this.fill()
}, eoFillStroke: function () {
this.current.element.setAttributeNS(null, "fill-rule", "evenodd"), this.fillStroke()
}, closeStroke: function () {
this.closePath(), this.stroke()
}, closeFillStroke: function () {
this.closePath(), this.fillStroke()
}, paintSolidColorImageMask: function () {
var e = this.current, t = this.svgFactory.createElement("svg:rect");
t.setAttributeNS(null, "x", "0"), t.setAttributeNS(null, "y", "0"), t.setAttributeNS(null, "width", "1px"), t.setAttributeNS(null, "height", "1px"), t.setAttributeNS(null, "fill", e.fillColor), this._ensureTransformGroup().appendChild(t)
}, paintJpegXObject: function (t, n, i) {
var a = this.objs.get(t), o = this.svgFactory.createElement("svg:image");
o.setAttributeNS(r, "xlink:href", a.src), o.setAttributeNS(null, "width", e(n)), o.setAttributeNS(null, "height", e(i)), o.setAttributeNS(null, "x", "0"), o.setAttributeNS(null, "y", e(-i)), o.setAttributeNS(null, "transform", "scale(" + e(1 / n) + " " + e(-1 / i) + ")"), this._ensureTransformGroup().appendChild(o)
}, paintImageXObject: function (e) {
var t = this.objs.get(e);
t ? this.paintInlineImageXObject(t) : (0, i.warn)("Dependent image isn't ready yet")
}, paintInlineImageXObject: function (t, n) {
var i = t.width, a = t.height, o = s(t, this.forceDataSchema), l = this.svgFactory.createElement("svg:rect");
l.setAttributeNS(null, "x", "0"), l.setAttributeNS(null, "y", "0"), l.setAttributeNS(null, "width", e(i)), l.setAttributeNS(null, "height", e(a)), this.current.element = l, this.clip("nonzero");
var c = this.svgFactory.createElement("svg:image");
c.setAttributeNS(r, "xlink:href", o), c.setAttributeNS(null, "x", "0"), c.setAttributeNS(null, "y", e(-a)), c.setAttributeNS(null, "width", e(i) + "px"), c.setAttributeNS(null, "height", e(a) + "px"), c.setAttributeNS(null, "transform", "scale(" + e(1 / i) + " " + e(-1 / a) + ")"), n ? n.appendChild(c) : this._ensureTransformGroup().appendChild(c)
}, paintImageMaskXObject: function (t) {
var n = this.current, r = t.width, i = t.height, a = n.fillColor;
n.maskId = "mask" + h++;
var o = this.svgFactory.createElement("svg:mask");
o.setAttributeNS(null, "id", n.maskId);
var s = this.svgFactory.createElement("svg:rect");
s.setAttributeNS(null, "x", "0"), s.setAttributeNS(null, "y", "0"), s.setAttributeNS(null, "width", e(r)), s.setAttributeNS(null, "height", e(i)), s.setAttributeNS(null, "fill", a), s.setAttributeNS(null, "mask", "url(#" + n.maskId + ")"), this.defs.appendChild(o), this._ensureTransformGroup().appendChild(s), this.paintInlineImageXObject(t, o)
}, paintFormXObjectBegin: function (t, n) {
if (Array.isArray(t) && 6 === t.length && this.transform(t[0], t[1], t[2], t[3], t[4], t[5]), Array.isArray(n) && 4 === n.length) {
var r = n[2] - n[0], i = n[3] - n[1], a = this.svgFactory.createElement("svg:rect");
a.setAttributeNS(null, "x", n[0]), a.setAttributeNS(null, "y", n[1]), a.setAttributeNS(null, "width", e(r)), a.setAttributeNS(null, "height", e(i)), this.current.element = a, this.clip("nonzero"), this.endPath()
}
}, paintFormXObjectEnd: function () {
}, _initialize: function (e) {
var n = this.svgFactory.create(e.width, e.height), r = this.svgFactory.createElement("svg:defs");
n.appendChild(r), this.defs = r;
var i = this.svgFactory.createElement("svg:g");
return i.setAttributeNS(null, "transform", t(e.transform)), n.appendChild(i), this.svg = i, n
}, _ensureClipGroup: function () {
if (!this.current.clipGroup) {
var e = this.svgFactory.createElement("svg:g");
e.setAttributeNS(null, "clip-path", this.current.activeClipUrl), this.svg.appendChild(e), this.current.clipGroup = e
}
return this.current.clipGroup
}, _ensureTransformGroup: function () {
return this.tgrp || (this.tgrp = this.svgFactory.createElement("svg:g"), this.tgrp.setAttributeNS(null, "transform", t(this.transformMatrix)), this.current.activeClipUrl ? this._ensureClipGroup().appendChild(this.tgrp) : this.svg.appendChild(this.tgrp)), this.tgrp
}
}, n
}(), t.SVGGraphics = r
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(142), a = n(84), o = n(96), s = n(87), l = n(14), c = n(97);
if (r.isNodeJS()) {
var u = n(166).PDFNodeStream;
a.setPDFNetworkStreamClass(u)
} else if ("undefined" != typeof Response && "body" in Response.prototype && "undefined" != typeof ReadableStream) {
var d = n(167).PDFFetchStream;
a.setPDFNetworkStreamClass(d)
} else {
var h = n(168).PDFNetworkStream;
a.setPDFNetworkStreamClass(h)
}
t.PDFJS = i.PDFJS, t.build = a.build, t.version = a.version, t.getDocument = a.getDocument, t.LoopbackPort = a.LoopbackPort, t.PDFDataRangeTransport = a.PDFDataRangeTransport, t.PDFWorker = a.PDFWorker, t.renderTextLayer = o.renderTextLayer, t.AnnotationLayer = s.AnnotationLayer, t.CustomStyle = l.CustomStyle, t.createPromiseCapability = r.createPromiseCapability, t.PasswordResponses = r.PasswordResponses, t.InvalidPDFException = r.InvalidPDFException, t.MissingPDFException = r.MissingPDFException, t.SVGGraphics = c.SVGGraphics, t.NativeImageDecoding = r.NativeImageDecoding, t.UnexpectedResponseException = r.UnexpectedResponseException, t.OPS = r.OPS, t.UNSUPPORTED_FEATURES = r.UNSUPPORTED_FEATURES, t.isValidUrl = l.isValidUrl, t.createValidAbsoluteUrl = r.createValidAbsoluteUrl, t.createObjectURL = r.createObjectURL, t.removeNullCharacters = r.removeNullCharacters, t.shadow = r.shadow, t.createBlob = r.createBlob, t.RenderingCancelledException = l.RenderingCancelledException, t.getFilenameFromUrl = l.getFilenameFromUrl, t.addLinkAttributes = l.addLinkAttributes, t.StatTimer = r.StatTimer
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
if ("undefined" == typeof PDFJS || !PDFJS.compatibilityChecked) {
var i = n(25), a = "undefined" != typeof navigator && navigator.userAgent || "", o = /Android/.test(a),
s = /Android\s[0-2][^\d]/.test(a), l = /Android\s[0-4][^\d]/.test(a), c = a.indexOf("Chrom") >= 0,
u = (/Chrome\/(39|40)\./.test(a), a.indexOf("CriOS") >= 0), d = a.indexOf("Trident") >= 0,
h = /\b(iPad|iPhone|iPod)(?=;)/.test(a), p = a.indexOf("Opera") >= 0,
f = /Safari\//.test(a) && !/(Chrome\/|Android\s)/.test(a),
m = "object" === ("undefined" == typeof window ? "undefined" : r(window)) && "object" === ("undefined" == typeof document ? "undefined" : r(document));
"undefined" == typeof PDFJS && (i.PDFJS = {}), PDFJS.compatibilityChecked = !0, function () {
if ("undefined" == typeof Uint8ClampedArray && (i.Uint8ClampedArray = n(100)), "undefined" != typeof Uint8Array) return void 0 === Uint8Array.prototype.subarray && (Uint8Array.prototype.subarray = function (e, t) {
return new Uint8Array(this.slice(e, t))
}, Float32Array.prototype.subarray = function (e, t) {
return new Float32Array(this.slice(e, t))
}), void ("undefined" == typeof Float64Array && (i.Float64Array = Float32Array));
function e(e, t) {
return new l(this.slice(e, t))
}
function t(e, t) {
arguments.length < 2 && (t = 0);
for (var n = 0, r = e.length; n < r; ++n, ++t) this[t] = 255 & e[n]
}
function a(e, t) {
this.buffer = e, this.byteLength = e.length, this.length = t, function (e) {
for (; o < e;) Object.defineProperty(a.prototype, o, s(o)), o++
}(this.length)
}
a.prototype = Object.create(null);
var o = 0;
function s(e) {
return {
get: function () {
var t = this.buffer, n = e << 2;
return (t[n] | t[n + 1] << 8 | t[n + 2] << 16 | t[n + 3] << 24) >>> 0
}, set: function (t) {
var n = this.buffer, r = e << 2;
n[r] = 255 & t, n[r + 1] = t >> 8 & 255, n[r + 2] = t >> 16 & 255, n[r + 3] = t >>> 24 & 255
}
}
}
function l(n) {
var i, a, o;
if ("number" == typeof n) for (i = [], a = 0; a < n; ++a) i[a] = 0; else if ("slice" in n) i = n.slice(0); else for (i = [], a = 0, o = n.length; a < o; ++a) i[a] = n[a];
return i.subarray = e, i.buffer = i, i.byteLength = i.length, i.set = t, "object" === (void 0 === n ? "undefined" : r(n)) && n.buffer && (i.buffer = n.buffer), i
}
i.Uint8Array = l, i.Int8Array = l, i.Int32Array = l, i.Uint16Array = l, i.Float32Array = l, i.Float64Array = l, i.Uint32Array = function () {
if (3 === arguments.length) {
if (0 !== arguments[1]) throw new Error("offset !== 0 is not supported");
return new a(arguments[0], arguments[2])
}
return l.apply(this, arguments)
}
}(), function () {
if (m && window.CanvasPixelArray) {
var e = window.CanvasPixelArray.prototype;
"buffer" in e || (Object.defineProperty(e, "buffer", {
get: function () {
return this
}, enumerable: !1, configurable: !0
}), Object.defineProperty(e, "byteLength", {
get: function () {
return this.length
}, enumerable: !1, configurable: !0
}))
}
}(), i.URL || (i.URL = i.webkitURL), function () {
if (void 0 !== Object.defineProperty) {
var e = !0;
try {
m && Object.defineProperty(new Image, "id", {value: "test"});
var t = function () {
};
t.prototype = {
get id() {
}
}, Object.defineProperty(new t, "id", {value: "", configurable: !0, enumerable: !0, writable: !1})
} catch (t) {
e = !1
}
if (e) return
}
Object.defineProperty = function (e, t, n) {
delete e[t], "get" in n && e.__defineGetter__(t, n.get), "set" in n && e.__defineSetter__(t, n.set), "value" in n && (e.__defineSetter__(t, function (e) {
return this.__defineGetter__(t, function () {
return e
}), e
}), e[t] = n.value)
}
}(), function () {
if ("undefined" != typeof XMLHttpRequest) {
var e = XMLHttpRequest.prototype, t = new XMLHttpRequest;
"overrideMimeType" in t || Object.defineProperty(e, "overrideMimeType", {
value: function (e) {
}
}), "responseType" in t || (Object.defineProperty(e, "responseType", {
get: function () {
return this._responseType || "text"
}, set: function (e) {
"text" !== e && "arraybuffer" !== e || (this._responseType = e, "arraybuffer" === e && "function" == typeof this.overrideMimeType && this.overrideMimeType("text/plain; charset=x-user-defined"))
}
}), "undefined" == typeof VBArray ? Object.defineProperty(e, "response", {
get: function () {
if ("arraybuffer" !== this.responseType) return this.responseText;
var e, t = this.responseText, n = t.length, r = new Uint8Array(n);
for (e = 0; e < n; ++e) r[e] = 255 & t.charCodeAt(e);
return r.buffer
}
}) : Object.defineProperty(e, "response", {
get: function () {
return "arraybuffer" === this.responseType ? new Uint8Array(new VBArray(this.responseBody).toArray()) : this.responseText
}
}))
}
}(), function () {
if (!("btoa" in i)) {
var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
i.btoa = function (t) {
var n, r, i = "";
for (n = 0, r = t.length; n < r; n += 3) {
var a = 255 & t.charCodeAt(n), o = 255 & t.charCodeAt(n + 1), s = 255 & t.charCodeAt(n + 2),
l = (3 & a) << 4 | o >> 4, c = n + 1 < r ? (15 & o) << 2 | s >> 6 : 64, u = n + 2 < r ? 63 & s : 64;
i += e.charAt(a >> 2) + e.charAt(l) + e.charAt(c) + e.charAt(u)
}
return i
}
}
}(), function () {
if (!("atob" in i)) {
i.atob = function (e) {
if ((e = e.replace(/=+$/, "")).length % 4 == 1) throw new Error("bad atob input");
for (var t, n, r = 0, i = 0, a = ""; n = e.charAt(i++); ~n && (t = r % 4 ? 64 * t + n : n, r++ % 4) ? a += String.fromCharCode(255 & t >> (-2 * r & 6)) : 0) n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);
return a
}
}
}(), void 0 === Function.prototype.bind && (Function.prototype.bind = function (e) {
var t = this, n = Array.prototype.slice.call(arguments, 1);
return function () {
var r = n.concat(Array.prototype.slice.call(arguments));
return t.apply(e, r)
}
}), m && ("dataset" in document.createElement("div") || Object.defineProperty(HTMLElement.prototype, "dataset", {
get: function () {
if (this._dataset) return this._dataset;
for (var e = {}, t = 0, n = this.attributes.length; t < n; t++) {
var r = this.attributes[t];
"data-" === r.name.substring(0, 5) && (e[r.name.substring(5).replace(/\-([a-z])/g, function (e, t) {
return t.toUpperCase()
})] = r.value)
}
return Object.defineProperty(this, "_dataset", {value: e, writable: !1, enumerable: !1}), e
}, enumerable: !0
})), function () {
function e(e, t, n, r) {
var i = (e.className || "").split(/\s+/g);
"" === i[0] && i.shift();
var a = i.indexOf(t);
return a < 0 && n && i.push(t), a >= 0 && r && i.splice(a, 1), e.className = i.join(" "), a >= 0
}
if (m && !("classList" in document.createElement("div"))) {
var t = {
add: function (t) {
e(this.element, t, !0, !1)
}, contains: function (t) {
return e(this.element, t, !1, !1)
}, remove: function (t) {
e(this.element, t, !1, !0)
}, toggle: function (t) {
e(this.element, t, !0, !0)
}
};
Object.defineProperty(HTMLElement.prototype, "classList", {
get: function () {
if (this._classList) return this._classList;
var e = Object.create(t, {element: {value: this, writable: !1, enumerable: !0}});
return Object.defineProperty(this, "_classList", {value: e, writable: !1, enumerable: !1}), e
}, enumerable: !0
})
}
}(), function () {
if (!("undefined" == typeof importScripts || "console" in i)) {
var e = {}, t = {
log: function () {
var e = Array.prototype.slice.call(arguments);
i.postMessage({targetName: "main", action: "console_log", data: e})
}, error: function () {
var e = Array.prototype.slice.call(arguments);
i.postMessage({targetName: "main", action: "console_error", data: e})
}, time: function (t) {
e[t] = Date.now()
}, timeEnd: function (t) {
var n = e[t];
if (!n) throw new Error("Unknown timer name " + t);
this.log("Timer:", t, Date.now() - n)
}
};
i.console = t
}
}(), function () {
var e;
if (m) {
if ("console" in window) return "bind" in console.log ? void 0 : (console.log = (e = console.log, function (t) {
return e(t)
}), console.error = function (e) {
return function (t) {
return e(t)
}
}(console.error), void (console.warn = function (e) {
return function (t) {
return e(t)
}
}(console.warn)));
window.console = {
log: function () {
}, error: function () {
}, warn: function () {
}
}
}
}(), function () {
p && document.addEventListener("click", function (e) {
(function e(t) {
return t.disabled || t.parentNode && e(t.parentNode)
})(e.target) && e.stopPropagation()
}, !0)
}(), (d || u) && (PDFJS.disableCreateObjectURL = !0), "undefined" != typeof navigator && ("language" in navigator || (PDFJS.locale = navigator.userLanguage || "en-US")), (f || h) && (PDFJS.disableRange = !0, PDFJS.disableStream = !0), m && (history.pushState && !s || (PDFJS.disableHistory = !0)), function () {
if (m) if (window.CanvasPixelArray) "function" != typeof window.CanvasPixelArray.prototype.set && (window.CanvasPixelArray.prototype.set = function (e) {
for (var t = 0, n = this.length; t < n; t++) this[t] = e[t]
}); else {
var e, t = !1;
if (c ? t = (e = a.match(/Chrom(e|ium)\/([0-9]+)\./)) && parseInt(e[2]) < 21 : o ? t = l : f && (t = (e = a.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//)) && parseInt(e[1]) < 6), t) {
var n = window.CanvasRenderingContext2D.prototype, r = n.createImageData;
n.createImageData = function (e, t) {
var n = r.call(this, e, t);
return n.data.set = function (e) {
for (var t = 0, n = this.length; t < n; t++) this[t] = e[t]
}, n
}, n = null
}
}
}(), function () {
function e() {
window.requestAnimationFrame = function (e) {
return window.setTimeout(e, 20)
}, window.cancelAnimationFrame = function (e) {
window.clearTimeout(e)
}
}
m && (h ? e() : "requestAnimationFrame" in window || (window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame, window.requestAnimationFrame || e()))
}(), (h || o) && (PDFJS.maxCanvasPixels = 5242880), m && d && window.parent !== window && (PDFJS.disableFullscreen = !0), m && ("currentScript" in document || Object.defineProperty(document, "currentScript", {
get: function () {
var e = document.getElementsByTagName("script");
return e[e.length - 1]
}, enumerable: !0, configurable: !0
})), function () {
if (m) {
var e = document.createElement("input");
try {
e.type = "number"
} catch (r) {
var t = e.constructor.prototype, n = Object.getOwnPropertyDescriptor(t, "type");
Object.defineProperty(t, "type", {
get: function () {
return n.get.call(this)
}, set: function (e) {
n.set.call(this, "number" === e ? "text" : e)
}, enumerable: !0, configurable: !0
})
}
}
}(), function () {
if (m && document.attachEvent) {
var e = document.constructor.prototype, t = Object.getOwnPropertyDescriptor(e, "readyState");
Object.defineProperty(e, "readyState", {
get: function () {
var e = t.get.call(this);
return "interactive" === e ? "loading" : e
}, set: function (e) {
t.set.call(this, e)
}, enumerable: !0, configurable: !0
})
}
}(), m && void 0 === Element.prototype.remove && (Element.prototype.remove = function () {
this.parentNode && this.parentNode.removeChild(this)
}), Number.isNaN || (Number.isNaN = n(113)), Number.isInteger || (Number.isInteger = n(115)), i.Promise || (i.Promise = n(118)), i.WeakMap || (i.WeakMap = n(128)), function () {
var e = !1;
try {
if ("function" == typeof URL && "object" === r(URL.prototype) && "origin" in URL.prototype) {
var t = new URL("b", "http://a");
t.pathname = "c%20d", e = "http://a/c%20d" === t.href
}
} catch (e) {
}
if (!e) {
var n = Object.create(null);
n.ftp = 21, n.file = 0, n.gopher = 70, n.http = 80, n.https = 443, n.ws = 80, n.wss = 443;
var a = Object.create(null);
a["%2e"] = ".", a[".%2e"] = "..", a["%2e."] = "..", a["%2e%2e"] = "..";
var o, s = /[a-zA-Z]/, l = /[a-zA-Z0-9\+\-\.]/;
g.prototype = {
toString: function () {
return this.href
}, get href() {
if (this._isInvalid) return this._url;
var e = "";
return "" === this._username && null === this._password || (e = this._username + (null !== this._password ? ":" + this._password : "") + "@"), this.protocol + (this._isRelative ? "//" + e + this.host : "") + this.pathname + this._query + this._fragment
}, set href(e) {
v.call(this), m.call(this, e)
}, get protocol() {
return this._scheme + ":"
}, set protocol(e) {
this._isInvalid || m.call(this, e + ":", "scheme start")
}, get host() {
return this._isInvalid ? "" : this._port ? this._host + ":" + this._port : this._host
}, set host(e) {
!this._isInvalid && this._isRelative && m.call(this, e, "host")
}, get hostname() {
return this._host
}, set hostname(e) {
!this._isInvalid && this._isRelative && m.call(this, e, "hostname")
}, get port() {
return this._port
}, set port(e) {
!this._isInvalid && this._isRelative && m.call(this, e, "port")
}, get pathname() {
return this._isInvalid ? "" : this._isRelative ? "/" + this._path.join("/") : this._schemeData
}, set pathname(e) {
!this._isInvalid && this._isRelative && (this._path = [], m.call(this, e, "relative path start"))
}, get search() {
return this._isInvalid || !this._query || "?" === this._query ? "" : this._query
}, set search(e) {
!this._isInvalid && this._isRelative && (this._query = "?", "?" === e[0] && (e = e.slice(1)), m.call(this, e, "query"))
}, get hash() {
return this._isInvalid || !this._fragment || "#" === this._fragment ? "" : this._fragment
}, set hash(e) {
this._isInvalid || (this._fragment = "#", "#" === e[0] && (e = e.slice(1)), m.call(this, e, "fragment"))
}, get origin() {
var e;
if (this._isInvalid || !this._scheme) return "";
switch (this._scheme) {
case"data":
case"file":
case"javascript":
case"mailto":
return "null";
case"blob":
try {
return new g(this._schemeData).origin || "null"
} catch (e) {
}
return "null"
}
return (e = this.host) ? this._scheme + "://" + e : ""
}
};
var c = i.URL;
c && (g.createObjectURL = function (e) {
return c.createObjectURL.apply(c, arguments)
}, g.revokeObjectURL = function (e) {
c.revokeObjectURL(e)
}), i.URL = g
}
function u(e) {
return void 0 !== n[e]
}
function d() {
v.call(this), this._isInvalid = !0
}
function h(e) {
return "" === e && d.call(this), e.toLowerCase()
}
function p(e) {
var t = e.charCodeAt(0);
return t > 32 && t < 127 && -1 === [34, 35, 60, 62, 63, 96].indexOf(t) ? e : encodeURIComponent(e)
}
function f(e) {
var t = e.charCodeAt(0);
return t > 32 && t < 127 && -1 === [34, 35, 60, 62, 96].indexOf(t) ? e : encodeURIComponent(e)
}
function m(e, t, r) {
function i(e) {
b.push(e)
}
var c = t || "scheme start", m = 0, v = "", g = !1, y = !1, b = [];
e:for (; (e[m - 1] !== o || 0 === m) && !this._isInvalid;) {
var w = e[m];
switch (c) {
case"scheme start":
if (!w || !s.test(w)) {
if (t) {
i("Invalid scheme.");
break e
}
v = "", c = "no scheme";
continue
}
v += w.toLowerCase(), c = "scheme";
break;
case"scheme":
if (w && l.test(w)) v += w.toLowerCase(); else {
if (":" !== w) {
if (t) {
if (w === o) break e;
i("Code point not allowed in scheme: " + w);
break e
}
v = "", m = 0, c = "no scheme";
continue
}
if (this._scheme = v, v = "", t) break e;
u(this._scheme) && (this._isRelative = !0), c = "file" === this._scheme ? "relative" : this._isRelative && r && r._scheme === this._scheme ? "relative or authority" : this._isRelative ? "authority first slash" : "scheme data"
}
break;
case"scheme data":
"?" === w ? (this._query = "?", c = "query") : "#" === w ? (this._fragment = "#", c = "fragment") : w !== o && "\t" !== w && "\n" !== w && "\r" !== w && (this._schemeData += p(w));
break;
case"no scheme":
if (r && u(r._scheme)) {
c = "relative";
continue
}
i("Missing scheme."), d.call(this);
break;
case"relative or authority":
if ("/" !== w || "/" !== e[m + 1]) {
i("Expected /, got: " + w), c = "relative";
continue
}
c = "authority ignore slashes";
break;
case"relative":
if (this._isRelative = !0, "file" !== this._scheme && (this._scheme = r._scheme), w === o) {
this._host = r._host, this._port = r._port, this._path = r._path.slice(), this._query = r._query, this._username = r._username, this._password = r._password;
break e
}
if ("/" === w || "\\" === w) "\\" === w && i("\\ is an invalid code point."), c = "relative slash"; else if ("?" === w) this._host = r._host, this._port = r._port, this._path = r._path.slice(), this._query = "?", this._username = r._username, this._password = r._password, c = "query"; else {
if ("#" !== w) {
var S = e[m + 1], _ = e[m + 2];
("file" !== this._scheme || !s.test(w) || ":" !== S && "|" !== S || _ !== o && "/" !== _ && "\\" !== _ && "?" !== _ && "#" !== _) && (this._host = r._host, this._port = r._port, this._username = r._username, this._password = r._password, this._path = r._path.slice(), this._path.pop()), c = "relative path";
continue
}
this._host = r._host, this._port = r._port, this._path = r._path.slice(), this._query = r._query, this._fragment = "#", this._username = r._username, this._password = r._password, c = "fragment"
}
break;
case"relative slash":
if ("/" !== w && "\\" !== w) {
"file" !== this._scheme && (this._host = r._host, this._port = r._port, this._username = r._username, this._password = r._password), c = "relative path";
continue
}
"\\" === w && i("\\ is an invalid code point."), c = "file" === this._scheme ? "file host" : "authority ignore slashes";
break;
case"authority first slash":
if ("/" !== w) {
i("Expected '/', got: " + w), c = "authority ignore slashes";
continue
}
c = "authority second slash";
break;
case"authority second slash":
if (c = "authority ignore slashes", "/" !== w) {
i("Expected '/', got: " + w);
continue
}
break;
case"authority ignore slashes":
if ("/" !== w && "\\" !== w) {
c = "authority";
continue
}
i("Expected authority, got: " + w);
break;
case"authority":
if ("@" === w) {
g && (i("@ already seen."), v += "%40"), g = !0;
for (var k = 0; k < v.length; k++) {
var x = v[k];
if ("\t" !== x && "\n" !== x && "\r" !== x) if (":" !== x || null !== this._password) {
var P = p(x);
null !== this._password ? this._password += P : this._username += P
} else this._password = ""; else i("Invalid whitespace in authority.")
}
v = ""
} else {
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w) {
m -= v.length, v = "", c = "host";
continue
}
v += w
}
break;
case"file host":
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w) {
2 !== v.length || !s.test(v[0]) || ":" !== v[1] && "|" !== v[1] ? 0 === v.length ? c = "relative path start" : (this._host = h.call(this, v), v = "", c = "relative path start") : c = "relative path";
continue
}
"\t" === w || "\n" === w || "\r" === w ? i("Invalid whitespace in file host.") : v += w;
break;
case"host":
case"hostname":
if (":" !== w || y) {
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w) {
if (this._host = h.call(this, v), v = "", c = "relative path start", t) break e;
continue
}
"\t" !== w && "\n" !== w && "\r" !== w ? ("[" === w ? y = !0 : "]" === w && (y = !1), v += w) : i("Invalid code point in host/hostname: " + w)
} else if (this._host = h.call(this, v), v = "", c = "port", "hostname" === t) break e;
break;
case"port":
if (/[0-9]/.test(w)) v += w; else {
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w || t) {
if ("" !== v) {
var C = parseInt(v, 10);
C !== n[this._scheme] && (this._port = C + ""), v = ""
}
if (t) break e;
c = "relative path start";
continue
}
"\t" === w || "\n" === w || "\r" === w ? i("Invalid code point in port: " + w) : d.call(this)
}
break;
case"relative path start":
if ("\\" === w && i("'\\' not allowed in path."), c = "relative path", "/" !== w && "\\" !== w) continue;
break;
case"relative path":
var A;
if (w !== o && "/" !== w && "\\" !== w && (t || "?" !== w && "#" !== w)) "\t" !== w && "\n" !== w && "\r" !== w && (v += p(w)); else "\\" === w && i("\\ not allowed in relative path."), (A = a[v.toLowerCase()]) && (v = A), ".." === v ? (this._path.pop(), "/" !== w && "\\" !== w && this._path.push("")) : "." === v && "/" !== w && "\\" !== w ? this._path.push("") : "." !== v && ("file" === this._scheme && 0 === this._path.length && 2 === v.length && s.test(v[0]) && "|" === v[1] && (v = v[0] + ":"), this._path.push(v)), v = "", "?" === w ? (this._query = "?", c = "query") : "#" === w && (this._fragment = "#", c = "fragment");
break;
case"query":
t || "#" !== w ? w !== o && "\t" !== w && "\n" !== w && "\r" !== w && (this._query += f(w)) : (this._fragment = "#", c = "fragment");
break;
case"fragment":
w !== o && "\t" !== w && "\n" !== w && "\r" !== w && (this._fragment += w)
}
m++
}
}
function v() {
this._scheme = "", this._schemeData = "", this._username = "", this._password = null, this._host = "", this._port = "", this._path = [], this._query = "", this._fragment = "", this._isInvalid = !1, this._isRelative = !1
}
function g(e, t) {
void 0 === t || t instanceof g || (t = new g(String(t))), this._url = e, v.call(this);
var n = e.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, "");
m.call(this, n, null, t)
}
}()
}
}, function (e, t, n) {
"use strict";
n(101), e.exports = n(6).Uint8ClampedArray
}, function (e, t, n) {
"use strict";
n(102)("Uint8", 1, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
}, !0)
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
if (n(8)) {
var i = n(26), a = n(0), o = n(16), s = n(7), l = n(63), c = n(104), u = n(12), d = n(29), h = n(33), p = n(9),
f = n(28), m = n(20), v = n(13), g = n(64), y = n(35), b = n(43), w = n(11), S = n(36), _ = n(3), k = n(21),
x = n(69), P = n(70), C = n(72), A = n(65).f, T = n(73), E = n(19), D = n(4), I = n(50), L = n(67), O = n(51),
M = n(74), N = n(22), R = n(52), W = n(76), V = n(68), F = n(112), G = n(17), B = n(77), K = G.f, j = B.f,
z = a.RangeError, U = a.TypeError, q = a.Uint8Array, H = Array.prototype, Y = c.ArrayBuffer, X = c.DataView,
J = I(0), Q = I(2), $ = I(3), Z = I(4), ee = I(5), te = I(6), ne = L(!0), re = L(!1), ie = M.values,
ae = M.keys, oe = M.entries, se = H.lastIndexOf, le = H.reduce, ce = H.reduceRight, ue = H.join, de = H.sort,
he = H.slice, pe = H.toString, fe = H.toLocaleString, me = D("iterator"), ve = D("toStringTag"),
ge = E("typed_constructor"), ye = E("def_constructor"), be = l.CONSTR, we = l.TYPED, Se = l.VIEW,
_e = I(1, function (e, t) {
return Ae(O(e, e[ye]), t)
}), ke = o(function () {
return 1 === new q(new Uint16Array([1]).buffer)[0]
}), xe = !!q && !!q.prototype.set && o(function () {
new q(1).set({})
}), Pe = function (e, t) {
var n = m(e);
if (n < 0 || n % t) throw z("Wrong offset!");
return n
}, Ce = function (e) {
if (_(e) && we in e) return e;
throw U(e + " is not a typed array!")
}, Ae = function (e, t) {
if (!(_(e) && ge in e)) throw U("It is not a typed array constructor!");
return new e(t)
}, Te = function (e, t) {
return Ee(O(e, e[ye]), t)
}, Ee = function (e, t) {
for (var n = 0, r = t.length, i = Ae(e, r); r > n;) i[n] = t[n++];
return i
}, De = function (e, t, n) {
K(e, t, {
get: function () {
return this._d[n]
}
})
}, Ie = function (e) {
var t, n, r, i, a, o, s = k(e), l = arguments.length, c = l > 1 ? arguments[1] : void 0, d = void 0 !== c,
h = T(s);
if (void 0 != h && !x(h)) {
for (o = h.call(s), r = [], t = 0; !(a = o.next()).done; t++) r.push(a.value);
s = r
}
for (d && l > 2 && (c = u(c, arguments[2], 2)), t = 0, n = v(s.length), i = Ae(this, n); n > t; t++) i[t] = d ? c(s[t], t) : s[t];
return i
}, Le = function () {
for (var e = 0, t = arguments.length, n = Ae(this, t); t > e;) n[e] = arguments[e++];
return n
}, Oe = !!q && o(function () {
fe.call(new q(1))
}), Me = function () {
return fe.apply(Oe ? he.call(Ce(this)) : Ce(this), arguments)
}, Ne = {
copyWithin: function (e, t) {
return F.call(Ce(this), e, t, arguments.length > 2 ? arguments[2] : void 0)
}, every: function (e) {
return Z(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, fill: function (e) {
return V.apply(Ce(this), arguments)
}, filter: function (e) {
return Te(this, Q(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0))
}, find: function (e) {
return ee(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, findIndex: function (e) {
return te(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, forEach: function (e) {
J(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, indexOf: function (e) {
return re(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, includes: function (e) {
return ne(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, join: function (e) {
return ue.apply(Ce(this), arguments)
}, lastIndexOf: function (e) {
return se.apply(Ce(this), arguments)
}, map: function (e) {
return _e(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, reduce: function (e) {
return le.apply(Ce(this), arguments)
}, reduceRight: function (e) {
return ce.apply(Ce(this), arguments)
}, reverse: function () {
for (var e, t = Ce(this).length, n = Math.floor(t / 2), r = 0; r < n;) e = this[r], this[r++] = this[--t], this[t] = e;
return this
}, some: function (e) {
return $(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, sort: function (e) {
return de.call(Ce(this), e)
}, subarray: function (e, t) {
var n = Ce(this), r = n.length, i = y(e, r);
return new (O(n, n[ye]))(n.buffer, n.byteOffset + i * n.BYTES_PER_ELEMENT, v((void 0 === t ? r : y(t, r)) - i))
}
}, Re = function (e, t) {
return Te(this, he.call(Ce(this), e, t))
}, We = function (e) {
Ce(this);
var t = Pe(arguments[1], 1), n = this.length, r = k(e), i = v(r.length), a = 0;
if (i + t > n) throw z("Wrong length!");
for (; a < i;) this[t + a] = r[a++]
}, Ve = {
entries: function () {
return oe.call(Ce(this))
}, keys: function () {
return ae.call(Ce(this))
}, values: function () {
return ie.call(Ce(this))
}
}, Fe = function (e, t) {
return _(e) && e[we] && "symbol" != (void 0 === t ? "undefined" : r(t)) && t in e && String(+t) == String(t)
}, Ge = function (e, t) {
return Fe(e, t = b(t, !0)) ? h(2, e[t]) : j(e, t)
}, Be = function (e, t, n) {
return !(Fe(e, t = b(t, !0)) && _(n) && w(n, "value")) || w(n, "get") || w(n, "set") || n.configurable || w(n, "writable") && !n.writable || w(n, "enumerable") && !n.enumerable ? K(e, t, n) : (e[t] = n.value, e)
};
be || (B.f = Ge, G.f = Be), s(s.S + s.F * !be, "Object", {
getOwnPropertyDescriptor: Ge,
defineProperty: Be
}), o(function () {
pe.call({})
}) && (pe = fe = function () {
return ue.call(this)
});
var Ke = f({}, Ne);
f(Ke, Ve), p(Ke, me, Ve.values), f(Ke, {
slice: Re, set: We, constructor: function () {
}, toString: pe, toLocaleString: Me
}), De(Ke, "buffer", "b"), De(Ke, "byteOffset", "o"), De(Ke, "byteLength", "l"), De(Ke, "length", "e"), K(Ke, ve, {
get: function () {
return this[we]
}
}), e.exports = function (e, t, n, r) {
var c = e + ((r = !!r) ? "Clamped" : "") + "Array", u = "get" + e, h = "set" + e, f = a[c], m = f || {},
y = f && C(f), b = !f || !l.ABV, w = {}, k = f && f.prototype, x = function (e, n) {
K(e, n, {
get: function () {
return function (e, n) {
var r = e._d;
return r.v[u](n * t + r.o, ke)
}(this, n)
}, set: function (e) {
return function (e, n, i) {
var a = e._d;
r && (i = (i = Math.round(i)) < 0 ? 0 : i > 255 ? 255 : 255 & i), a.v[h](n * t + a.o, i, ke)
}(this, n, e)
}, enumerable: !0
})
};
b ? (f = n(function (e, n, r, i) {
d(e, f, c, "_d");
var a, o, s, l, u = 0, h = 0;
if (_(n)) {
if (!(n instanceof Y || "ArrayBuffer" == (l = S(n)) || "SharedArrayBuffer" == l)) return we in n ? Ee(f, n) : Ie.call(f, n);
a = n, h = Pe(r, t);
var m = n.byteLength;
if (void 0 === i) {
if (m % t) throw z("Wrong length!");
if ((o = m - h) < 0) throw z("Wrong length!")
} else if ((o = v(i) * t) + h > m) throw z("Wrong length!");
s = o / t
} else s = g(n), a = new Y(o = s * t);
for (p(e, "_d", {b: a, o: h, l: o, e: s, v: new X(a)}); u < s;) x(e, u++)
}), k = f.prototype = P(Ke), p(k, "constructor", f)) : o(function () {
f(1)
}) && o(function () {
new f(-1)
}) && R(function (e) {
new f, new f(null), new f(1.5), new f(e)
}, !0) || (f = n(function (e, n, r, i) {
var a;
return d(e, f, c), _(n) ? n instanceof Y || "ArrayBuffer" == (a = S(n)) || "SharedArrayBuffer" == a ? void 0 !== i ? new m(n, Pe(r, t), i) : void 0 !== r ? new m(n, Pe(r, t)) : new m(n) : we in n ? Ee(f, n) : Ie.call(f, n) : new m(g(n))
}), J(y !== Function.prototype ? A(m).concat(A(y)) : A(m), function (e) {
e in f || p(f, e, m[e])
}), f.prototype = k, i || (k.constructor = f));
var T = k[me], E = !!T && ("values" == T.name || void 0 == T.name), D = Ve.values;
p(f, ge, !0), p(k, we, c), p(k, Se, !0), p(k, ye, f), (r ? new f(1)[ve] == c : ve in k) || K(k, ve, {
get: function () {
return c
}
}), w[c] = f, s(s.G + s.W + s.F * (f != m), w), s(s.S, c, {BYTES_PER_ELEMENT: t}), s(s.S + s.F * o(function () {
m.of.call(f, 1)
}), c, {
from: Ie,
of: Le
}), "BYTES_PER_ELEMENT" in k || p(k, "BYTES_PER_ELEMENT", t), s(s.P, c, Ne), W(c), s(s.P + s.F * xe, c, {set: We}), s(s.P + s.F * !E, c, Ve), i || k.toString == pe || (k.toString = pe), s(s.P + s.F * o(function () {
new f(1).slice()
}), c, {slice: Re}), s(s.P + s.F * (o(function () {
return [1, 2].toLocaleString() != new f([1, 2]).toLocaleString()
}) || !o(function () {
k.toLocaleString.call([1, 2])
})), c, {toLocaleString: Me}), N[c] = E ? T : D, i || E || p(k, me, D)
}
} else e.exports = function () {
}
}, function (e, t, n) {
"use strict";
e.exports = n(44)("native-function-to-string", Function.toString)
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(8), a = n(26), o = n(63), s = n(9), l = n(28), c = n(16), u = n(29), d = n(20), h = n(13),
p = n(64), f = n(65).f, m = n(17).f, v = n(68), g = n(31), y = "prototype", b = "Wrong index!", w = r.ArrayBuffer,
S = r.DataView, _ = r.Math, k = r.RangeError, x = r.Infinity, P = w, C = _.abs, A = _.pow, T = _.floor, E = _.log,
D = _.LN2, I = i ? "_b" : "buffer", L = i ? "_l" : "byteLength", O = i ? "_o" : "byteOffset";
function M(e, t, n) {
var r, i, a, o = new Array(n), s = 8 * n - t - 1, l = (1 << s) - 1, c = l >> 1,
u = 23 === t ? A(2, -24) - A(2, -77) : 0, d = 0, h = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
for ((e = C(e)) != e || e === x ? (i = e != e ? 1 : 0, r = l) : (r = T(E(e) / D), e * (a = A(2, -r)) < 1 && (r--, a *= 2), (e += r + c >= 1 ? u / a : u * A(2, 1 - c)) * a >= 2 && (r++, a /= 2), r + c >= l ? (i = 0, r = l) : r + c >= 1 ? (i = (e * a - 1) * A(2, t), r += c) : (i = e * A(2, c - 1) * A(2, t), r = 0)); t >= 8; o[d++] = 255 & i, i /= 256, t -= 8) ;
for (r = r << t | i, s += t; s > 0; o[d++] = 255 & r, r /= 256, s -= 8) ;
return o[--d] |= 128 * h, o
}
function N(e, t, n) {
var r, i = 8 * n - t - 1, a = (1 << i) - 1, o = a >> 1, s = i - 7, l = n - 1, c = e[l--], u = 127 & c;
for (c >>= 7; s > 0; u = 256 * u + e[l], l--, s -= 8) ;
for (r = u & (1 << -s) - 1, u >>= -s, s += t; s > 0; r = 256 * r + e[l], l--, s -= 8) ;
if (0 === u) u = 1 - o; else {
if (u === a) return r ? NaN : c ? -x : x;
r += A(2, t), u -= o
}
return (c ? -1 : 1) * r * A(2, u - t)
}
function R(e) {
return e[3] << 24 | e[2] << 16 | e[1] << 8 | e[0]
}
function W(e) {
return [255 & e]
}
function V(e) {
return [255 & e, e >> 8 & 255]
}
function F(e) {
return [255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255]
}
function G(e) {
return M(e, 52, 8)
}
function B(e) {
return M(e, 23, 4)
}
function K(e, t, n) {
m(e[y], t, {
get: function () {
return this[n]
}
})
}
function j(e, t, n, r) {
var i = p(+n);
if (i + t > e[L]) throw k(b);
var a = e[I]._b, o = i + e[O], s = a.slice(o, o + t);
return r ? s : s.reverse()
}
function z(e, t, n, r, i, a) {
var o = p(+n);
if (o + t > e[L]) throw k(b);
for (var s = e[I]._b, l = o + e[O], c = r(+i), u = 0; u < t; u++) s[l + u] = c[a ? u : t - u - 1]
}
if (o.ABV) {
if (!c(function () {
w(1)
}) || !c(function () {
new w(-1)
}) || c(function () {
return new w, new w(1.5), new w(NaN), "ArrayBuffer" != w.name
})) {
for (var U, q = (w = function (e) {
return u(this, w), new P(p(e))
})[y] = P[y], H = f(P), Y = 0; H.length > Y;) (U = H[Y++]) in w || s(w, U, P[U]);
a || (q.constructor = w)
}
var X = new S(new w(2)), J = S[y].setInt8;
X.setInt8(0, 2147483648), X.setInt8(1, 2147483649), !X.getInt8(0) && X.getInt8(1) || l(S[y], {
setInt8: function (e, t) {
J.call(this, e, t << 24 >> 24)
}, setUint8: function (e, t) {
J.call(this, e, t << 24 >> 24)
}
}, !0)
} else w = function (e) {
u(this, w, "ArrayBuffer");
var t = p(e);
this._b = v.call(new Array(t), 0), this[L] = t
}, S = function (e, t, n) {
u(this, S, "DataView"), u(e, w, "DataView");
var r = e[L], i = d(t);
if (i < 0 || i > r) throw k("Wrong offset!");
if (i + (n = void 0 === n ? r - i : h(n)) > r) throw k("Wrong length!");
this[I] = e, this[O] = i, this[L] = n
}, i && (K(w, "byteLength", "_l"), K(S, "buffer", "_b"), K(S, "byteLength", "_l"), K(S, "byteOffset", "_o")), l(S[y], {
getInt8: function (e) {
return j(this, 1, e)[0] << 24 >> 24
}, getUint8: function (e) {
return j(this, 1, e)[0]
}, getInt16: function (e) {
var t = j(this, 2, e, arguments[1]);
return (t[1] << 8 | t[0]) << 16 >> 16
}, getUint16: function (e) {
var t = j(this, 2, e, arguments[1]);
return t[1] << 8 | t[0]
}, getInt32: function (e) {
return R(j(this, 4, e, arguments[1]))
}, getUint32: function (e) {
return R(j(this, 4, e, arguments[1])) >>> 0
}, getFloat32: function (e) {
return N(j(this, 4, e, arguments[1]), 23, 4)
}, getFloat64: function (e) {
return N(j(this, 8, e, arguments[1]), 52, 8)
}, setInt8: function (e, t) {
z(this, 1, e, W, t)
}, setUint8: function (e, t) {
z(this, 1, e, W, t)
}, setInt16: function (e, t) {
z(this, 2, e, V, t, arguments[2])
}, setUint16: function (e, t) {
z(this, 2, e, V, t, arguments[2])
}, setInt32: function (e, t) {
z(this, 4, e, F, t, arguments[2])
}, setUint32: function (e, t) {
z(this, 4, e, F, t, arguments[2])
}, setFloat32: function (e, t) {
z(this, 4, e, B, t, arguments[2])
}, setFloat64: function (e, t) {
z(this, 8, e, G, t, arguments[2])
}
});
g(w, "ArrayBuffer"), g(S, "DataView"), s(S[y], o.VIEW, !0), t.ArrayBuffer = w, t.DataView = S
}, function (e, t, n) {
"use strict";
var r = n(17), i = n(10), a = n(49);
e.exports = n(8) ? Object.defineProperties : function (e, t) {
i(e);
for (var n, o = a(t), s = o.length, l = 0; s > l;) r.f(e, n = o[l++], t[n]);
return e
}
}, function (e, t, n) {
"use strict";
var r = n(107);
e.exports = function (e, t) {
return new (r(e))(t)
}
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(108), a = n(4)("species");
e.exports = function (e) {
var t;
return i(e) && ("function" != typeof (t = e.constructor) || t !== Array && !i(t.prototype) || (t = void 0), r(t) && null === (t = t[a]) && (t = void 0)), void 0 === t ? Array : t
}
}, function (e, t, n) {
"use strict";
var r = n(30);
e.exports = Array.isArray || function (e) {
return "Array" == r(e)
}
}, function (e, t, n) {
"use strict";
var r = n(4)("unscopables"), i = Array.prototype;
void 0 == i[r] && n(9)(i, r, {}), e.exports = function (e) {
i[r][e] = !0
}
}, function (e, t, n) {
"use strict";
e.exports = function (e, t) {
return {value: t, done: !!e}
}
}, function (e, t, n) {
"use strict";
var r = n(70), i = n(33), a = n(31), o = {};
n(9)(o, n(4)("iterator"), function () {
return this
}), e.exports = function (e, t, n) {
e.prototype = r(o, {next: i(1, n)}), a(e, t + " Iterator")
}
}, function (e, t, n) {
"use strict";
var r = n(21), i = n(35), a = n(13);
e.exports = [].copyWithin || function (e, t) {
var n = r(this), o = a(n.length), s = i(e, o), l = i(t, o), c = arguments.length > 2 ? arguments[2] : void 0,
u = Math.min((void 0 === c ? o : i(c, o)) - l, o - s), d = 1;
for (l < s && s < l + u && (d = -1, l += u - 1, s += u - 1); u-- > 0;) l in n ? n[s] = n[l] : delete n[s], s += d, l += d;
return n
}
}, function (e, t, n) {
"use strict";
n(114), e.exports = n(6).Number.isNaN
}, function (e, t, n) {
"use strict";
var r = n(7);
r(r.S, "Number", {
isNaN: function (e) {
return e != e
}
})
}, function (e, t, n) {
"use strict";
n(116), e.exports = n(6).Number.isInteger
}, function (e, t, n) {
"use strict";
var r = n(7);
r(r.S, "Number", {isInteger: n(117)})
}, function (e, t, n) {
"use strict";
var r = n(3), i = Math.floor;
e.exports = function (e) {
return !r(e) && isFinite(e) && i(e) === e
}
}, function (e, t, n) {
"use strict";
n(79), n(119), n(80), n(121), n(126), n(127), e.exports = n(6).Promise
}, function (e, t, n) {
"use strict";
var r = n(120)(!0);
n(75)(String, "String", function (e) {
this._t = String(e), this._i = 0
}, function () {
var e, t = this._t, n = this._i;
return n >= t.length ? {value: void 0, done: !0} : (e = r(t, n), this._i += e.length, {value: e, done: !1})
})
}, function (e, t, n) {
"use strict";
var r = n(20), i = n(46);
e.exports = function (e) {
return function (t, n) {
var a, o, s = String(i(t)), l = r(n), c = s.length;
return l < 0 || l >= c ? e ? "" : void 0 : (a = s.charCodeAt(l)) < 55296 || a > 56319 || l + 1 === c || (o = s.charCodeAt(l + 1)) < 56320 || o > 57343 ? e ? s.charAt(l) : a : e ? s.slice(l, l + 2) : o - 56320 + (a - 55296 << 10) + 65536
}
}
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = n(26), l = n(0), c = n(12), u = n(36), d = n(7), h = n(3), p = n(27), f = n(29), m = n(37),
v = n(51), g = n(81).set, y = n(124)(), b = n(53), w = n(82), S = n(125), _ = n(83), k = l.TypeError,
x = l.process, P = x && x.versions, C = P && P.v8 || "", A = l.Promise, T = "process" == u(x), E = function () {
}, D = i = b.f, I = !!function () {
try {
var e = A.resolve(1), t = (e.constructor = {})[n(4)("species")] = function (e) {
e(E, E)
};
return (T || "function" == typeof PromiseRejectionEvent) && e.then(E) instanceof t && 0 !== C.indexOf("6.6") && -1 === S.indexOf("Chrome/66")
} catch (e) {
}
}(), L = function (e) {
var t;
return !(!h(e) || "function" != typeof (t = e.then)) && t
}, O = function (e, t) {
if (!e._n) {
e._n = !0;
var n = e._c;
y(function () {
for (var r = e._v, i = 1 == e._s, a = 0, o = function (t) {
var n, a, o, s = i ? t.ok : t.fail, l = t.resolve, c = t.reject, u = t.domain;
try {
s ? (i || (2 == e._h && R(e), e._h = 1), !0 === s ? n = r : (u && u.enter(), n = s(r), u && (u.exit(), o = !0)), n === t.promise ? c(k("Promise-chain cycle")) : (a = L(n)) ? a.call(n, l, c) : l(n)) : c(r)
} catch (e) {
u && !o && u.exit(), c(e)
}
}; n.length > a;) o(n[a++]);
e._c = [], e._n = !1, t && !e._h && M(e)
})
}
}, M = function (e) {
g.call(l, function () {
var t, n, r, i = e._v, a = N(e);
if (a && (t = w(function () {
T ? x.emit("unhandledRejection", i, e) : (n = l.onunhandledrejection) ? n({
promise: e,
reason: i
}) : (r = l.console) && r.error && r.error("Unhandled promise rejection", i)
}), e._h = T || N(e) ? 2 : 1), e._a = void 0, a && t.e) throw t.v
})
}, N = function (e) {
return 1 !== e._h && 0 === (e._a || e._c).length
}, R = function (e) {
g.call(l, function () {
var t;
T ? x.emit("rejectionHandled", e) : (t = l.onrejectionhandled) && t({promise: e, reason: e._v})
})
}, W = function (e) {
var t = this;
t._d || (t._d = !0, (t = t._w || t)._v = e, t._s = 2, t._a || (t._a = t._c.slice()), O(t, !0))
}, V = function e(t) {
var n, r = this;
if (!r._d) {
r._d = !0, r = r._w || r;
try {
if (r === t) throw k("Promise can't be resolved itself");
(n = L(t)) ? y(function () {
var i = {_w: r, _d: !1};
try {
n.call(t, c(e, i, 1), c(W, i, 1))
} catch (e) {
W.call(i, e)
}
}) : (r._v = t, r._s = 1, O(r, !1))
} catch (e) {
W.call({_w: r, _d: !1}, e)
}
}
};
I || (A = function (e) {
f(this, A, "Promise", "_h"), p(e), r.call(this);
try {
e(c(V, this, 1), c(W, this, 1))
} catch (e) {
W.call(this, e)
}
}, (r = function (e) {
this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, this._n = !1
}).prototype = n(28)(A.prototype, {
then: function (e, t) {
var n = D(v(this, A));
return n.ok = "function" != typeof e || e, n.fail = "function" == typeof t && t, n.domain = T ? x.domain : void 0, this._c.push(n), this._a && this._a.push(n), this._s && O(this, !1), n.promise
}, catch: function (e) {
return this.then(void 0, e)
}
}), a = function () {
var e = new r;
this.promise = e, this.resolve = c(V, e, 1), this.reject = c(W, e, 1)
}, b.f = D = function (e) {
return e === A || e === o ? new a(e) : i(e)
}), d(d.G + d.W + d.F * !I, {Promise: A}), n(31)(A, "Promise"), n(76)("Promise"), o = n(6).Promise, d(d.S + d.F * !I, "Promise", {
reject: function (e) {
var t = D(this);
return (0, t.reject)(e), t.promise
}
}), d(d.S + d.F * (s || !I), "Promise", {
resolve: function (e) {
return _(s && this === o ? A : this, e)
}
}), d(d.S + d.F * !(I && n(52)(function (e) {
A.all(e).catch(E)
})), "Promise", {
all: function (e) {
var t = this, n = D(t), r = n.resolve, i = n.reject, a = w(function () {
var n = [], a = 0, o = 1;
m(e, !1, function (e) {
var s = a++, l = !1;
n.push(void 0), o++, t.resolve(e).then(function (e) {
l || (l = !0, n[s] = e, --o || r(n))
}, i)
}), --o || r(n)
});
return a.e && i(a.v), n.promise
}, race: function (e) {
var t = this, n = D(t), r = n.reject, i = w(function () {
m(e, !1, function (e) {
t.resolve(e).then(n.resolve, r)
})
});
return i.e && r(i.v), n.promise
}
})
}, function (e, t, n) {
"use strict";
var r = n(10);
e.exports = function (e, t, n, i) {
try {
return i ? t(r(n)[0], n[1]) : t(n)
} catch (t) {
var a = e.return;
throw void 0 !== a && r(a.call(e)), t
}
}
}, function (e, t, n) {
"use strict";
e.exports = function (e, t, n) {
var r = void 0 === n;
switch (t.length) {
case 0:
return r ? e() : e.call(n);
case 1:
return r ? e(t[0]) : e.call(n, t[0]);
case 2:
return r ? e(t[0], t[1]) : e.call(n, t[0], t[1]);
case 3:
return r ? e(t[0], t[1], t[2]) : e.call(n, t[0], t[1], t[2]);
case 4:
return r ? e(t[0], t[1], t[2], t[3]) : e.call(n, t[0], t[1], t[2], t[3])
}
return e.apply(n, t)
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(81).set, a = r.MutationObserver || r.WebKitMutationObserver, o = r.process, s = r.Promise,
l = "process" == n(30)(o);
e.exports = function () {
var e, t, n, c = function () {
var r, i;
for (l && (r = o.domain) && r.exit(); e;) {
i = e.fn, e = e.next;
try {
i()
} catch (r) {
throw e ? n() : t = void 0, r
}
}
t = void 0, r && r.enter()
};
if (l) n = function () {
o.nextTick(c)
}; else if (!a || r.navigator && r.navigator.standalone) if (s && s.resolve) {
var u = s.resolve(void 0);
n = function () {
u.then(c)
}
} else n = function () {
i.call(r, c)
}; else {
var d = !0, h = document.createTextNode("");
new a(c).observe(h, {characterData: !0}), n = function () {
h.data = d = !d
}
}
return function (r) {
var i = {fn: r, next: void 0};
t && (t.next = i), e || (e = i, n()), t = i
}
}
}, function (e, t, n) {
"use strict";
var r = n(0).navigator;
e.exports = r && r.userAgent || ""
}, function (e, t, n) {
"use strict";
var r = n(7), i = n(6), a = n(0), o = n(51), s = n(83);
r(r.P + r.R, "Promise", {
finally: function (e) {
var t = o(this, i.Promise || a.Promise), n = "function" == typeof e;
return this.then(n ? function (n) {
return s(t, e()).then(function () {
return n
})
} : e, n ? function (n) {
return s(t, e()).then(function () {
throw n
})
} : e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(7), i = n(53), a = n(82);
r(r.S, "Promise", {
try: function (e) {
var t = i.f(this), n = a(e);
return (n.e ? t.reject : t.resolve)(n.v), t.promise
}
})
}, function (e, t, n) {
"use strict";
n(79), n(80), n(129), n(136), n(138), e.exports = n(6).WeakMap
}, function (e, t, n) {
"use strict";
var r, i = n(0), a = n(50)(0), o = n(18), s = n(54), l = n(130), c = n(132), u = n(3), d = n(55), h = n(55),
p = !i.ActiveXObject && "ActiveXObject" in i, f = s.getWeak, m = Object.isExtensible, v = c.ufstore,
g = function (e) {
return function () {
return e(this, arguments.length > 0 ? arguments[0] : void 0)
}
}, y = {
get: function (e) {
if (u(e)) {
var t = f(e);
return !0 === t ? v(d(this, "WeakMap")).get(e) : t ? t[this._i] : void 0
}
}, set: function (e, t) {
return c.def(d(this, "WeakMap"), e, t)
}
}, b = e.exports = n(133)("WeakMap", g, y, c, !0, !0);
h && p && (l((r = c.getConstructor(g, "WeakMap")).prototype, y), s.NEED = !0, a(["delete", "has", "get", "set"], function (e) {
var t = b.prototype, n = t[e];
o(t, e, function (t, i) {
if (u(t) && !m(t)) {
this._f || (this._f = new r);
var a = this._f[e](t, i);
return "set" == e ? this : a
}
return n.call(this, t, i)
})
}))
}, function (e, t, n) {
"use strict";
var r = n(8), i = n(49), a = n(131), o = n(78), s = n(21), l = n(45), c = Object.assign;
e.exports = !c || n(16)(function () {
var e = {}, t = {}, n = Symbol(), r = "abcdefghijklmnopqrst";
return e[n] = 7, r.split("").forEach(function (e) {
t[e] = e
}), 7 != c({}, e)[n] || Object.keys(c({}, t)).join("") != r
}) ? function (e, t) {
for (var n = s(e), c = arguments.length, u = 1, d = a.f, h = o.f; c > u;) for (var p, f = l(arguments[u++]), m = d ? i(f).concat(d(f)) : i(f), v = m.length, g = 0; v > g;) p = m[g++], r && !h.call(f, p) || (n[p] = f[p]);
return n
} : c
}, function (e, t, n) {
"use strict";
t.f = Object.getOwnPropertySymbols
}, function (e, t, n) {
"use strict";
var r = n(28), i = n(54).getWeak, a = n(10), o = n(3), s = n(29), l = n(37), c = n(50), u = n(11), d = n(55),
h = c(5), p = c(6), f = 0, m = function (e) {
return e._l || (e._l = new v)
}, v = function () {
this.a = []
}, g = function (e, t) {
return h(e.a, function (e) {
return e[0] === t
})
};
v.prototype = {
get: function (e) {
var t = g(this, e);
if (t) return t[1]
}, has: function (e) {
return !!g(this, e)
}, set: function (e, t) {
var n = g(this, e);
n ? n[1] = t : this.a.push([e, t])
}, delete: function (e) {
var t = p(this.a, function (t) {
return t[0] === e
});
return ~t && this.a.splice(t, 1), !!~t
}
}, e.exports = {
getConstructor: function (e, t, n, a) {
var c = e(function (e, r) {
s(e, c, t, "_i"), e._t = t, e._i = f++, e._l = void 0, void 0 != r && l(r, n, e[a], e)
});
return r(c.prototype, {
delete: function (e) {
if (!o(e)) return !1;
var n = i(e);
return !0 === n ? m(d(this, t)).delete(e) : n && u(n, this._i) && delete n[this._i]
}, has: function (e) {
if (!o(e)) return !1;
var n = i(e);
return !0 === n ? m(d(this, t)).has(e) : n && u(n, this._i)
}
}), c
}, def: function (e, t, n) {
var r = i(a(t), !0);
return !0 === r ? m(e).set(t, n) : r[e._i] = n, e
}, ufstore: m
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(7), a = n(18), o = n(28), s = n(54), l = n(37), c = n(29), u = n(3), d = n(16), h = n(52),
p = n(31), f = n(134);
e.exports = function (e, t, n, m, v, g) {
var y = r[e], b = y, w = v ? "set" : "add", S = b && b.prototype, _ = {}, k = function (e) {
var t = S[e];
a(S, e, "delete" == e ? function (e) {
return !(g && !u(e)) && t.call(this, 0 === e ? 0 : e)
} : "has" == e ? function (e) {
return !(g && !u(e)) && t.call(this, 0 === e ? 0 : e)
} : "get" == e ? function (e) {
return g && !u(e) ? void 0 : t.call(this, 0 === e ? 0 : e)
} : "add" == e ? function (e) {
return t.call(this, 0 === e ? 0 : e), this
} : function (e, n) {
return t.call(this, 0 === e ? 0 : e, n), this
})
};
if ("function" == typeof b && (g || S.forEach && !d(function () {
(new b).entries().next()
}))) {
var x = new b, P = x[w](g ? {} : -0, 1) != x, C = d(function () {
x.has(1)
}), A = h(function (e) {
new b(e)
}), T = !g && d(function () {
for (var e = new b, t = 5; t--;) e[w](t, t);
return !e.has(-0)
});
A || ((b = t(function (t, n) {
c(t, b, e);
var r = f(new y, t, b);
return void 0 != n && l(n, v, r[w], r), r
})).prototype = S, S.constructor = b), (C || T) && (k("delete"), k("has"), v && k("get")), (T || P) && k(w), g && S.clear && delete S.clear
} else b = m.getConstructor(t, e, v, w), o(b.prototype, n), s.NEED = !0;
return p(b, e), _[e] = b, i(i.G + i.W + i.F * (b != y), _), g || m.setStrong(b, e, v), b
}
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(135).set;
e.exports = function (e, t, n) {
var a, o = t.constructor;
return o !== n && "function" == typeof o && (a = o.prototype) !== n.prototype && r(a) && i && i(e, a), e
}
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(10), a = function (e, t) {
if (i(e), !r(t) && null !== t) throw TypeError(t + ": can't set as prototype!")
};
e.exports = {
set: Object.setPrototypeOf || ("__proto__" in {} ? function (e, t, r) {
try {
(r = n(12)(Function.call, n(77).f(Object.prototype, "__proto__").set, 2))(e, []), t = !(e instanceof Array)
} catch (e) {
t = !0
}
return function (e, n) {
return a(e, n), t ? e.__proto__ = n : r(e, n), e
}
}({}, !1) : void 0), check: a
}
}, function (e, t, n) {
"use strict";
n(137)("WeakMap")
}, function (e, t, n) {
"use strict";
var r = n(7);
e.exports = function (e) {
r(r.S, e, {
of: function () {
for (var e = arguments.length, t = new Array(e); e--;) t[e] = arguments[e];
return new this(t)
}
})
}
}, function (e, t, n) {
"use strict";
n(139)("WeakMap")
}, function (e, t, n) {
"use strict";
var r = n(7), i = n(27), a = n(12), o = n(37);
e.exports = function (e) {
r(r.S, e, {
from: function (e) {
var t, n, r, s, l = arguments[1];
return i(this), (t = void 0 !== l) && i(l), void 0 == e ? new this : (n = [], t ? (r = 0, s = a(l, arguments[2], 2), o(e, !1, function (e) {
n.push(s(e, r++))
})) : o(e, !1, n.push, n), new this(n))
}
})
}
}, function (e, t, n) {
"use strict";
var r = !1;
if ("undefined" != typeof ReadableStream) try {
new ReadableStream({
start: function (e) {
e.close()
}
}), r = !0
} catch (e) {
}
t.ReadableStream = r ? ReadableStream : n(141).ReadableStream
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
!function (e, t) {
for (var n in t) e[n] = t[n]
}(t, function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {i: r, l: !1, exports: {}};
return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports
}
return n.m = e, n.c = t, n.i = function (e) {
return e
}, n.d = function (e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: r})
}, n.n = function (e) {
var t = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return n.d(t, "a", t), t
}, n.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 7)
}([function (e, t, n) {
var i = "function" == typeof Symbol && "symbol" === r(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : r(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : r(e)
}, a = n(1).assert;
function o(e) {
return "string" == typeof e || "symbol" === (void 0 === e ? "undefined" : i(e))
}
function s(e, t, n) {
if ("function" != typeof e) throw new TypeError("Argument is not a function");
return Function.prototype.apply.call(e, t, n)
}
t.typeIsObject = function (e) {
return "object" === (void 0 === e ? "undefined" : i(e)) && null !== e || "function" == typeof e
}, t.createDataProperty = function (e, n, r) {
a(t.typeIsObject(e)), Object.defineProperty(e, n, {value: r, writable: !0, enumerable: !0, configurable: !0})
}, t.createArrayFromList = function (e) {
return e.slice()
}, t.ArrayBufferCopy = function (e, t, n, r, i) {
new Uint8Array(e).set(new Uint8Array(n, r, i), t)
}, t.CreateIterResultObject = function (e, t) {
a("boolean" == typeof t);
var n = {};
return Object.defineProperty(n, "value", {
value: e,
enumerable: !0,
writable: !0,
configurable: !0
}), Object.defineProperty(n, "done", {value: t, enumerable: !0, writable: !0, configurable: !0}), n
}, t.IsFiniteNonNegativeNumber = function (e) {
return !Number.isNaN(e) && (e !== 1 / 0 && !(e < 0))
}, t.InvokeOrNoop = function (e, t, n) {
a(void 0 !== e), a(o(t)), a(Array.isArray(n));
var r = e[t];
if (void 0 !== r) return s(r, e, n)
}, t.PromiseInvokeOrNoop = function (e, n, r) {
a(void 0 !== e), a(o(n)), a(Array.isArray(r));
try {
return Promise.resolve(t.InvokeOrNoop(e, n, r))
} catch (e) {
return Promise.reject(e)
}
}, t.PromiseInvokeOrPerformFallback = function (e, t, n, r, i) {
a(void 0 !== e), a(o(t)), a(Array.isArray(n)), a(Array.isArray(i));
var l = void 0;
try {
l = e[t]
} catch (e) {
return Promise.reject(e)
}
if (void 0 === l) return r.apply(null, i);
try {
return Promise.resolve(s(l, e, n))
} catch (e) {
return Promise.reject(e)
}
}, t.TransferArrayBuffer = function (e) {
return e.slice()
}, t.ValidateAndNormalizeHighWaterMark = function (e) {
if (e = Number(e), Number.isNaN(e) || e < 0) throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");
return e
}, t.ValidateAndNormalizeQueuingStrategy = function (e, n) {
if (void 0 !== e && "function" != typeof e) throw new TypeError("size property of a queuing strategy must be a function");
return {size: e, highWaterMark: n = t.ValidateAndNormalizeHighWaterMark(n)}
}
}, function (e, t, n) {
function r(e) {
this.name = "AssertionError", this.message = e || "", this.stack = (new Error).stack
}
r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, e.exports = {
rethrowAssertionErrorRejection: function (e) {
e && e.constructor === r && setTimeout(function () {
throw e
}, 0)
}, AssertionError: r, assert: function (e, t) {
if (!e) throw new r(t)
}
}
}, function (e, t, n) {
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
function i(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var a = n(0), o = a.InvokeOrNoop, s = a.PromiseInvokeOrNoop, l = a.ValidateAndNormalizeQueuingStrategy,
c = a.typeIsObject, u = n(1), d = u.assert, h = u.rethrowAssertionErrorRejection, p = n(3), f = p.DequeueValue,
m = p.EnqueueValueWithSize, v = p.PeekQueueValue, g = p.ResetQueue, y = function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.size, a = n.highWaterMark,
o = void 0 === a ? 1 : a;
if (i(this, e), this._state = "writable", this._storedError = void 0, this._writer = void 0, this._writableStreamController = void 0, this._writeRequests = [], this._inFlightWriteRequest = void 0, this._closeRequest = void 0, this._inFlightCloseRequest = void 0, this._pendingAbortRequest = void 0, this._backpressure = !1, void 0 !== t.type) throw new RangeError("Invalid type is specified");
this._writableStreamController = new V(this, t, r, o), this._writableStreamController.__startSteps()
}
return r(e, [{
key: "abort", value: function (e) {
return !1 === w(this) ? Promise.reject(z("abort")) : !0 === S(this) ? Promise.reject(new TypeError("Cannot abort a stream that already has a writer")) : _(this, e)
}
}, {
key: "getWriter", value: function () {
if (!1 === w(this)) throw z("getWriter");
return b(this)
}
}, {
key: "locked", get: function () {
if (!1 === w(this)) throw z("locked");
return S(this)
}
}]), e
}();
function b(e) {
return new I(e)
}
function w(e) {
return !!c(e) && !!Object.prototype.hasOwnProperty.call(e, "_writableStreamController")
}
function S(e) {
return d(!0 === w(e), "IsWritableStreamLocked should only be used on known writable streams"), void 0 !== e._writer
}
function _(e, t) {
var n = e._state;
if ("closed" === n) return Promise.resolve(void 0);
if ("errored" === n) return Promise.reject(e._storedError);
var r = new TypeError("Requested to abort");
if (void 0 !== e._pendingAbortRequest) return Promise.reject(r);
d("writable" === n || "erroring" === n, "state must be writable or erroring");
var i = !1;
"erroring" === n && (i = !0, t = void 0);
var a = new Promise(function (n, r) {
e._pendingAbortRequest = {_resolve: n, _reject: r, _reason: t, _wasAlreadyErroring: i}
});
return !1 === i && x(e, r), a
}
function k(e, t) {
var n = e._state;
"writable" !== n ? (d("erroring" === n), P(e)) : x(e, t)
}
function x(e, t) {
d(void 0 === e._storedError, "stream._storedError === undefined"), d("writable" === e._state, "state must be writable");
var n = e._writableStreamController;
d(void 0 !== n, "controller must not be undefined"), e._state = "erroring", e._storedError = t;
var r = e._writer;
void 0 !== r && N(r, t), !1 === T(e) && !0 === n._started && P(e)
}
function P(e) {
d("erroring" === e._state, "stream._state === erroring"), d(!1 === T(e), "WritableStreamHasOperationMarkedInFlight(stream) === false"), e._state = "errored", e._writableStreamController.__errorSteps();
for (var t = e._storedError, n = 0; n < e._writeRequests.length; n++) {
e._writeRequests[n]._reject(t)
}
if (e._writeRequests = [], void 0 !== e._pendingAbortRequest) {
var r = e._pendingAbortRequest;
if (e._pendingAbortRequest = void 0, !0 === r._wasAlreadyErroring) return r._reject(t), void E(e);
e._writableStreamController.__abortSteps(r._reason).then(function () {
r._resolve(), E(e)
}, function (t) {
r._reject(t), E(e)
})
} else E(e)
}
function C(e) {
d(void 0 !== e._inFlightCloseRequest), e._inFlightCloseRequest._resolve(void 0), e._inFlightCloseRequest = void 0;
var t = e._state;
d("writable" === t || "erroring" === t), "erroring" === t && (e._storedError = void 0, void 0 !== e._pendingAbortRequest && (e._pendingAbortRequest._resolve(), e._pendingAbortRequest = void 0)), e._state = "closed";
var n = e._writer;
void 0 !== n && function (e) {
d(void 0 !== e._closedPromise_resolve, "writer._closedPromise_resolve !== undefined"), d(void 0 !== e._closedPromise_reject, "writer._closedPromise_reject !== undefined"), d("pending" === e._closedPromiseState, "writer._closedPromiseState is pending"), e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "resolved"
}(n), d(void 0 === e._pendingAbortRequest, "stream._pendingAbortRequest === undefined"), d(void 0 === e._storedError, "stream._storedError === undefined")
}
function A(e) {
return void 0 !== e._closeRequest || void 0 !== e._inFlightCloseRequest
}
function T(e) {
return void 0 !== e._inFlightWriteRequest || void 0 !== e._inFlightCloseRequest
}
function E(e) {
d("errored" === e._state, '_stream_.[[state]] is `"errored"`'), void 0 !== e._closeRequest && (d(void 0 === e._inFlightCloseRequest), e._closeRequest._reject(e._storedError), e._closeRequest = void 0);
var t = e._writer;
void 0 !== t && (Y(t, e._storedError), t._closedPromise.catch(function () {
}))
}
function D(e, t) {
d("writable" === e._state), d(!1 === A(e));
var n = e._writer;
void 0 !== n && t !== e._backpressure && (!0 === t ? function (e) {
d(void 0 === e._readyPromise_resolve, "writer._readyPromise_resolve === undefined"), d(void 0 === e._readyPromise_reject, "writer._readyPromise_reject === undefined"), e._readyPromise = new Promise(function (t, n) {
e._readyPromise_resolve = t, e._readyPromise_reject = n
}), e._readyPromiseState = "pending"
}(n) : (d(!1 === t), Q(n))), e._backpressure = t
}
e.exports = {
AcquireWritableStreamDefaultWriter: b,
IsWritableStream: w,
IsWritableStreamLocked: S,
WritableStream: y,
WritableStreamAbort: _,
WritableStreamDefaultControllerError: j,
WritableStreamDefaultWriterCloseWithErrorPropagation: function (e) {
var t = e._ownerWritableStream;
d(void 0 !== t);
var n = t._state;
if (!0 === A(t) || "closed" === n) return Promise.resolve();
if ("errored" === n) return Promise.reject(t._storedError);
return d("writable" === n || "erroring" === n), O(e)
},
WritableStreamDefaultWriterRelease: R,
WritableStreamDefaultWriterWrite: W,
WritableStreamCloseQueuedOrInFlight: A
};
var I = function () {
function e(t) {
if (i(this, e), !1 === w(t)) throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");
if (!0 === S(t)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");
this._ownerWritableStream = t, t._writer = this;
var n, r = t._state;
if ("writable" === r) !1 === A(t) && !0 === t._backpressure ? ((n = this)._readyPromise = new Promise(function (e, t) {
n._readyPromise_resolve = e, n._readyPromise_reject = t
}), n._readyPromiseState = "pending") : J(this), H(this); else if ("erroring" === r) X(this, t._storedError), this._readyPromise.catch(function () {
}), H(this); else if ("closed" === r) J(this), function (e) {
e._closedPromise = Promise.resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "resolved"
}(this); else {
d("errored" === r, "state must be errored");
var a = t._storedError;
X(this, a), this._readyPromise.catch(function () {
}), function (e, t) {
e._closedPromise = Promise.reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "rejected"
}(this, a), this._closedPromise.catch(function () {
})
}
}
return r(e, [{
key: "abort", value: function (e) {
return !1 === L(this) ? Promise.reject(U("abort")) : void 0 === this._ownerWritableStream ? Promise.reject(q("abort")) : function (e, t) {
var n = e._ownerWritableStream;
return d(void 0 !== n), _(n, t)
}(this, e)
}
}, {
key: "close", value: function () {
if (!1 === L(this)) return Promise.reject(U("close"));
var e = this._ownerWritableStream;
return void 0 === e ? Promise.reject(q("close")) : !0 === A(e) ? Promise.reject(new TypeError("cannot close an already-closing stream")) : O(this)
}
}, {
key: "releaseLock", value: function () {
if (!1 === L(this)) throw U("releaseLock");
var e = this._ownerWritableStream;
void 0 !== e && (d(void 0 !== e._writer), R(this))
}
}, {
key: "write", value: function (e) {
return !1 === L(this) ? Promise.reject(U("write")) : void 0 === this._ownerWritableStream ? Promise.reject(q("write to")) : W(this, e)
}
}, {
key: "closed", get: function () {
return !1 === L(this) ? Promise.reject(U("closed")) : this._closedPromise
}
}, {
key: "desiredSize", get: function () {
if (!1 === L(this)) throw U("desiredSize");
if (void 0 === this._ownerWritableStream) throw q("desiredSize");
return function (e) {
var t = e._ownerWritableStream, n = t._state;
if ("errored" === n || "erroring" === n) return null;
if ("closed" === n) return 0;
return F(t._writableStreamController)
}(this)
}
}, {
key: "ready", get: function () {
return !1 === L(this) ? Promise.reject(U("ready")) : this._readyPromise
}
}]), e
}();
function L(e) {
return !!c(e) && !!Object.prototype.hasOwnProperty.call(e, "_ownerWritableStream")
}
function O(e) {
var t = e._ownerWritableStream;
d(void 0 !== t);
var n = t._state;
if ("closed" === n || "errored" === n) return Promise.reject(new TypeError("The stream (in " + n + " state) is not in the writable state and cannot be closed"));
d("writable" === n || "erroring" === n), d(!1 === A(t));
var r, i = new Promise(function (e, n) {
var r = {_resolve: e, _reject: n};
t._closeRequest = r
});
return !0 === t._backpressure && "writable" === n && Q(e), r = t._writableStreamController, m(r, "close", 0), G(r), i
}
function M(e, t) {
"pending" === e._closedPromiseState ? Y(e, t) : function (e, t) {
d(void 0 === e._closedPromise_resolve, "writer._closedPromise_resolve === undefined"), d(void 0 === e._closedPromise_reject, "writer._closedPromise_reject === undefined"), d("pending" !== e._closedPromiseState, "writer._closedPromiseState is not pending"), e._closedPromise = Promise.reject(t), e._closedPromiseState = "rejected"
}(e, t), e._closedPromise.catch(function () {
})
}
function N(e, t) {
"pending" === e._readyPromiseState ? function (e, t) {
d(void 0 !== e._readyPromise_resolve, "writer._readyPromise_resolve !== undefined"), d(void 0 !== e._readyPromise_reject, "writer._readyPromise_reject !== undefined"), e._readyPromise_reject(t), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "rejected"
}(e, t) : function (e, t) {
d(void 0 === e._readyPromise_resolve, "writer._readyPromise_resolve === undefined"), d(void 0 === e._readyPromise_reject, "writer._readyPromise_reject === undefined"), e._readyPromise = Promise.reject(t), e._readyPromiseState = "rejected"
}(e, t), e._readyPromise.catch(function () {
})
}
function R(e) {
var t = e._ownerWritableStream;
d(void 0 !== t), d(t._writer === e);
var n = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
N(e, n), M(e, n), t._writer = void 0, e._ownerWritableStream = void 0
}
function W(e, t) {
var n = e._ownerWritableStream;
d(void 0 !== n);
var r = n._writableStreamController, i = function (e, t) {
var n = e._strategySize;
if (void 0 === n) return 1;
try {
return n(t)
} catch (t) {
return B(e, t), 1
}
}(r, t);
if (n !== e._ownerWritableStream) return Promise.reject(q("write to"));
var a = n._state;
if ("errored" === a) return Promise.reject(n._storedError);
if (!0 === A(n) || "closed" === a) return Promise.reject(new TypeError("The stream is closing or closed and cannot be written to"));
if ("erroring" === a) return Promise.reject(n._storedError);
d("writable" === a);
var o = function (e) {
return d(!0 === S(e)), d("writable" === e._state), new Promise(function (t, n) {
var r = {_resolve: t, _reject: n};
e._writeRequests.push(r)
})
}(n);
return function (e, t, n) {
var r = {chunk: t};
try {
m(e, r, n)
} catch (t) {
return void B(e, t)
}
var i = e._controlledWritableStream;
if (!1 === A(i) && "writable" === i._state) {
var a = K(e);
D(i, a)
}
G(e)
}(r, t, i), o
}
var V = function () {
function e(t, n, r, a) {
if (i(this, e), !1 === w(t)) throw new TypeError("WritableStreamDefaultController can only be constructed with a WritableStream instance");
if (void 0 !== t._writableStreamController) throw new TypeError("WritableStreamDefaultController instances can only be created by the WritableStream constructor");
this._controlledWritableStream = t, this._underlyingSink = n, this._queue = void 0, this._queueTotalSize = void 0, g(this), this._started = !1;
var o = l(r, a);
this._strategySize = o.size, this._strategyHWM = o.highWaterMark, D(t, K(this))
}
return r(e, [{
key: "error", value: function (e) {
if (!1 === function (e) {
if (!c(e)) return !1;
if (!Object.prototype.hasOwnProperty.call(e, "_underlyingSink")) return !1;
return !0
}(this)) throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");
"writable" === this._controlledWritableStream._state && j(this, e)
}
}, {
key: "__abortSteps", value: function (e) {
return s(this._underlyingSink, "abort", [e])
}
}, {
key: "__errorSteps", value: function () {
g(this)
}
}, {
key: "__startSteps", value: function () {
var e = this, t = o(this._underlyingSink, "start", [this]), n = this._controlledWritableStream;
Promise.resolve(t).then(function () {
d("writable" === n._state || "erroring" === n._state), e._started = !0, G(e)
}, function (t) {
d("writable" === n._state || "erroring" === n._state), e._started = !0, k(n, t)
}).catch(h)
}
}]), e
}();
function F(e) {
return e._strategyHWM - e._queueTotalSize
}
function G(e) {
var t = e._controlledWritableStream;
if (!1 !== e._started && void 0 === t._inFlightWriteRequest) {
var n = t._state;
if ("closed" !== n && "errored" !== n) if ("erroring" !== n) {
if (0 !== e._queue.length) {
var r = v(e);
"close" === r ? function (e) {
var t = e._controlledWritableStream;
(function (e) {
d(void 0 === e._inFlightCloseRequest), d(void 0 !== e._closeRequest), e._inFlightCloseRequest = e._closeRequest, e._closeRequest = void 0
})(t), f(e), d(0 === e._queue.length, "queue must be empty once the final write record is dequeued"), s(e._underlyingSink, "close", []).then(function () {
C(t)
}, function (e) {
!function (e, t) {
d(void 0 !== e._inFlightCloseRequest), e._inFlightCloseRequest._reject(t), e._inFlightCloseRequest = void 0, d("writable" === e._state || "erroring" === e._state), void 0 !== e._pendingAbortRequest && (e._pendingAbortRequest._reject(t), e._pendingAbortRequest = void 0), k(e, t)
}(t, e)
}).catch(h)
}(e) : function (e, t) {
var n = e._controlledWritableStream;
(function (e) {
d(void 0 === e._inFlightWriteRequest, "there must be no pending write request"), d(0 !== e._writeRequests.length, "writeRequests must not be empty"), e._inFlightWriteRequest = e._writeRequests.shift()
})(n), s(e._underlyingSink, "write", [t, e]).then(function () {
!function (e) {
d(void 0 !== e._inFlightWriteRequest), e._inFlightWriteRequest._resolve(void 0), e._inFlightWriteRequest = void 0
}(n);
var t = n._state;
if (d("writable" === t || "erroring" === t), f(e), !1 === A(n) && "writable" === t) {
var r = K(e);
D(n, r)
}
G(e)
}, function (e) {
!function (e, t) {
d(void 0 !== e._inFlightWriteRequest), e._inFlightWriteRequest._reject(t), e._inFlightWriteRequest = void 0, d("writable" === e._state || "erroring" === e._state), k(e, t)
}(n, e)
}).catch(h)
}(e, r.chunk)
}
} else P(t)
}
}
function B(e, t) {
"writable" === e._controlledWritableStream._state && j(e, t)
}
function K(e) {
return F(e) <= 0
}
function j(e, t) {
var n = e._controlledWritableStream;
d("writable" === n._state), x(n, t)
}
function z(e) {
return new TypeError("WritableStream.prototype." + e + " can only be used on a WritableStream")
}
function U(e) {
return new TypeError("WritableStreamDefaultWriter.prototype." + e + " can only be used on a WritableStreamDefaultWriter")
}
function q(e) {
return new TypeError("Cannot " + e + " a stream using a released writer")
}
function H(e) {
e._closedPromise = new Promise(function (t, n) {
e._closedPromise_resolve = t, e._closedPromise_reject = n, e._closedPromiseState = "pending"
})
}
function Y(e, t) {
d(void 0 !== e._closedPromise_resolve, "writer._closedPromise_resolve !== undefined"), d(void 0 !== e._closedPromise_reject, "writer._closedPromise_reject !== undefined"), d("pending" === e._closedPromiseState, "writer._closedPromiseState is pending"), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "rejected"
}
function X(e, t) {
e._readyPromise = Promise.reject(t), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "rejected"
}
function J(e) {
e._readyPromise = Promise.resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "fulfilled"
}
function Q(e) {
d(void 0 !== e._readyPromise_resolve, "writer._readyPromise_resolve !== undefined"), d(void 0 !== e._readyPromise_reject, "writer._readyPromise_reject !== undefined"), e._readyPromise_resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "fulfilled"
}
}, function (e, t, n) {
var r = n(0).IsFiniteNonNegativeNumber, i = n(1).assert;
t.DequeueValue = function (e) {
i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: DequeueValue should only be used on containers with [[queue]] and [[queueTotalSize]]."), i(e._queue.length > 0, "Spec-level failure: should never dequeue from an empty queue.");
var t = e._queue.shift();
return e._queueTotalSize -= t.size, e._queueTotalSize < 0 && (e._queueTotalSize = 0), t.value
}, t.EnqueueValueWithSize = function (e, t, n) {
if (i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: EnqueueValueWithSize should only be used on containers with [[queue]] and [[queueTotalSize]]."), n = Number(n), !r(n)) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");
e._queue.push({value: t, size: n}), e._queueTotalSize += n
}, t.PeekQueueValue = function (e) {
return i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: PeekQueueValue should only be used on containers with [[queue]] and [[queueTotalSize]]."), i(e._queue.length > 0, "Spec-level failure: should never peek at an empty queue."), e._queue[0].value
}, t.ResetQueue = function (e) {
i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: ResetQueue should only be used on containers with [[queue]] and [[queueTotalSize]]."), e._queue = [], e._queueTotalSize = 0
}
}, function (e, t, n) {
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
function i(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var a = n(0), o = a.ArrayBufferCopy, s = a.CreateIterResultObject, l = a.IsFiniteNonNegativeNumber,
c = a.InvokeOrNoop, u = a.PromiseInvokeOrNoop, d = a.TransferArrayBuffer,
h = a.ValidateAndNormalizeQueuingStrategy, p = a.ValidateAndNormalizeHighWaterMark, f = n(0),
m = f.createArrayFromList, v = f.createDataProperty, g = f.typeIsObject, y = n(1), b = y.assert,
w = y.rethrowAssertionErrorRejection, S = n(3), _ = S.DequeueValue, k = S.EnqueueValueWithSize,
x = S.ResetQueue, P = n(2), C = P.AcquireWritableStreamDefaultWriter, A = P.IsWritableStream,
T = P.IsWritableStreamLocked, E = P.WritableStreamAbort,
D = P.WritableStreamDefaultWriterCloseWithErrorPropagation, I = P.WritableStreamDefaultWriterRelease,
L = P.WritableStreamDefaultWriterWrite, O = P.WritableStreamCloseQueuedOrInFlight, M = function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.size, a = n.highWaterMark;
i(this, e), this._state = "readable", this._reader = void 0, this._storedError = void 0, this._disturbed = !1, this._readableStreamController = void 0;
var o = t.type;
if ("bytes" === String(o)) void 0 === a && (a = 0), this._readableStreamController = new he(this, t, a); else {
if (void 0 !== o) throw new RangeError("Invalid type is specified");
void 0 === a && (a = 1), this._readableStreamController = new re(this, t, r, a)
}
}
return r(e, [{
key: "cancel", value: function (e) {
return !1 === R(this) ? Promise.reject(Ee("cancel")) : !0 === W(this) ? Promise.reject(new TypeError("Cannot cancel a stream that already has a reader")) : B(this, e)
}
}, {
key: "getReader", value: function () {
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).mode;
if (!1 === R(this)) throw Ee("getReader");
if (void 0 === e) return N(this);
if ("byob" === (e = String(e))) return new J(this);
throw new RangeError("Invalid mode is specified")
}
}, {
key: "pipeThrough", value: function (e, t) {
var n = e.writable, r = e.readable;
return function (e) {
try {
Promise.prototype.then.call(e, void 0, function () {
})
} catch (e) {
}
}(this.pipeTo(n, t)), r
}
}, {
key: "pipeTo", value: function (e) {
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.preventClose,
i = n.preventAbort, a = n.preventCancel;
if (!1 === R(this)) return Promise.reject(Ee("pipeTo"));
if (!1 === A(e)) return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
if (r = Boolean(r), i = Boolean(i), a = Boolean(a), !0 === W(this)) return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream"));
if (!0 === T(e)) return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream"));
var o = N(this), s = C(e), l = !1, c = Promise.resolve();
return new Promise(function (n, u) {
var d, h, p;
if (v(t, o._closedPromise, function (t) {
!1 === i ? g(function () {
return E(e, t)
}, !0, t) : y(!0, t)
}), v(e, s._closedPromise, function (e) {
!1 === a ? g(function () {
return B(t, e)
}, !0, e) : y(!0, e)
}), d = t, h = o._closedPromise, p = function () {
!1 === r ? g(function () {
return D(s)
}) : y()
}, "closed" === d._state ? p() : h.then(p).catch(w), !0 === O(e) || "closed" === e._state) {
var f = new TypeError("the destination writable stream closed before all data could be piped to it");
!1 === a ? g(function () {
return B(t, f)
}, !0, f) : y(!0, f)
}
function m() {
var e = c;
return c.then(function () {
return e !== c ? m() : void 0
})
}
function v(e, t, n) {
"errored" === e._state ? n(e._storedError) : t.catch(n).catch(w)
}
function g(t, n, r) {
function i() {
t().then(function () {
return b(n, r)
}, function (e) {
return b(!0, e)
}).catch(w)
}
!0 !== l && (l = !0, "writable" === e._state && !1 === O(e) ? m().then(i) : i())
}
function y(t, n) {
!0 !== l && (l = !0, "writable" === e._state && !1 === O(e) ? m().then(function () {
return b(t, n)
}).catch(w) : b(t, n))
}
function b(e, t) {
I(s), te(o), e ? u(t) : n(void 0)
}
(function e() {
return c = Promise.resolve(), !0 === l ? Promise.resolve() : s._readyPromise.then(function () {
return ne(o).then(function (e) {
var t = e.value;
!0 !== e.done && (c = L(s, t).catch(function () {
}))
})
}).then(e)
})().catch(function (e) {
c = Promise.resolve(), w(e)
})
})
}
}, {
key: "tee", value: function () {
if (!1 === R(this)) throw Ee("tee");
var e = V(this, !1);
return m(e)
}
}, {
key: "locked", get: function () {
if (!1 === R(this)) throw Ee("locked");
return W(this)
}
}]), e
}();
function N(e) {
return new X(e)
}
function R(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_readableStreamController")
}
function W(e) {
return b(!0 === R(e), "IsReadableStreamLocked should only be used on known readable streams"), void 0 !== e._reader
}
function V(e, t) {
b(!0 === R(e)), b("boolean" == typeof t);
var n = N(e), r = {closedOrErrored: !1, canceled1: !1, canceled2: !1, reason1: void 0, reason2: void 0};
r.promise = new Promise(function (e) {
r._resolve = e
});
var i = function () {
return function e() {
var t = e._reader, n = e._branch1, r = e._branch2, i = e._teeState;
return ne(t).then(function (e) {
b(g(e));
var t = e.value, a = e.done;
if (b("boolean" == typeof a), !0 === a && !1 === i.closedOrErrored && (!1 === i.canceled1 && oe(n), !1 === i.canceled2 && oe(r), i.closedOrErrored = !0), !0 !== i.closedOrErrored) {
var o = t, s = t;
!1 === i.canceled1 && se(n, o), !1 === i.canceled2 && se(r, s)
}
})
}
}();
i._reader = n, i._teeState = r, i._cloneForBranch2 = t;
var a = function () {
return function e(t) {
var n = e._stream, r = e._teeState;
r.canceled1 = !0;
r.reason1 = t;
if (!0 === r.canceled2) {
var i = m([r.reason1, r.reason2]), a = B(n, i);
r._resolve(a)
}
return r.promise
}
}();
a._stream = e, a._teeState = r;
var o = function () {
return function e(t) {
var n = e._stream, r = e._teeState;
r.canceled2 = !0;
r.reason2 = t;
if (!0 === r.canceled1) {
var i = m([r.reason1, r.reason2]), a = B(n, i);
r._resolve(a)
}
return r.promise
}
}();
o._stream = e, o._teeState = r;
var s = Object.create(Object.prototype);
v(s, "pull", i), v(s, "cancel", a);
var l = new M(s), c = Object.create(Object.prototype);
v(c, "pull", i), v(c, "cancel", o);
var u = new M(c);
return i._branch1 = l._readableStreamController, i._branch2 = u._readableStreamController, n._closedPromise.catch(function (e) {
!0 !== r.closedOrErrored && (le(i._branch1, e), le(i._branch2, e), r.closedOrErrored = !0)
}), [l, u]
}
function F(e) {
return b(!0 === Q(e._reader)), b("readable" === e._state || "closed" === e._state), new Promise(function (t, n) {
var r = {_resolve: t, _reject: n};
e._reader._readIntoRequests.push(r)
})
}
function G(e) {
return b(!0 === $(e._reader)), b("readable" === e._state), new Promise(function (t, n) {
var r = {_resolve: t, _reject: n};
e._reader._readRequests.push(r)
})
}
function B(e, t) {
return e._disturbed = !0, "closed" === e._state ? Promise.resolve(void 0) : "errored" === e._state ? Promise.reject(e._storedError) : (K(e), e._readableStreamController.__cancelSteps(t).then(function () {
}))
}
function K(e) {
b("readable" === e._state), e._state = "closed";
var t = e._reader;
if (void 0 !== t) {
if (!0 === $(t)) {
for (var n = 0; n < t._readRequests.length; n++) {
(0, t._readRequests[n]._resolve)(s(void 0, !0))
}
t._readRequests = []
}
!function (e) {
b(void 0 !== e._closedPromise_resolve), b(void 0 !== e._closedPromise_reject), e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}(t)
}
}
function j(e, t) {
b(!0 === R(e), "stream must be ReadableStream"), b("readable" === e._state, "state must be readable"), e._state = "errored", e._storedError = t;
var n = e._reader;
if (void 0 !== n) {
if (!0 === $(n)) {
for (var r = 0; r < n._readRequests.length; r++) {
n._readRequests[r]._reject(t)
}
n._readRequests = []
} else {
b(Q(n), "reader must be ReadableStreamBYOBReader");
for (var i = 0; i < n._readIntoRequests.length; i++) {
n._readIntoRequests[i]._reject(t)
}
n._readIntoRequests = []
}
Le(n, t), n._closedPromise.catch(function () {
})
}
}
function z(e, t, n) {
var r = e._reader;
b(r._readRequests.length > 0), r._readRequests.shift()._resolve(s(t, n))
}
function U(e) {
return e._reader._readIntoRequests.length
}
function q(e) {
return e._reader._readRequests.length
}
function H(e) {
var t = e._reader;
return void 0 !== t && !1 !== Q(t)
}
function Y(e) {
var t = e._reader;
return void 0 !== t && !1 !== $(t)
}
e.exports = {
ReadableStream: M,
IsReadableStreamDisturbed: function (e) {
return b(!0 === R(e), "IsReadableStreamDisturbed should only be used on known readable streams"), e._disturbed
},
ReadableStreamDefaultControllerClose: oe,
ReadableStreamDefaultControllerEnqueue: se,
ReadableStreamDefaultControllerError: le,
ReadableStreamDefaultControllerGetDesiredSize: ue
};
var X = function () {
function e(t) {
if (i(this, e), !1 === R(t)) throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");
if (!0 === W(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
Z(this, t), this._readRequests = []
}
return r(e, [{
key: "cancel", value: function (e) {
return !1 === $(this) ? Promise.reject(Ie("cancel")) : void 0 === this._ownerReadableStream ? Promise.reject(De("cancel")) : ee(this, e)
}
}, {
key: "read", value: function () {
return !1 === $(this) ? Promise.reject(Ie("read")) : void 0 === this._ownerReadableStream ? Promise.reject(De("read from")) : ne(this)
}
}, {
key: "releaseLock", value: function () {
if (!1 === $(this)) throw Ie("releaseLock");
if (void 0 !== this._ownerReadableStream) {
if (this._readRequests.length > 0) throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");
te(this)
}
}
}, {
key: "closed", get: function () {
return !1 === $(this) ? Promise.reject(Ie("closed")) : this._closedPromise
}
}]), e
}(), J = function () {
function e(t) {
if (i(this, e), !R(t)) throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");
if (!1 === pe(t._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");
if (W(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
Z(this, t), this._readIntoRequests = []
}
return r(e, [{
key: "cancel", value: function (e) {
return Q(this) ? void 0 === this._ownerReadableStream ? Promise.reject(De("cancel")) : ee(this, e) : Promise.reject(Oe("cancel"))
}
}, {
key: "read", value: function (e) {
return Q(this) ? void 0 === this._ownerReadableStream ? Promise.reject(De("read from")) : ArrayBuffer.isView(e) ? 0 === e.byteLength ? Promise.reject(new TypeError("view must have non-zero byteLength")) : function (e, t) {
var n = e._ownerReadableStream;
if (b(void 0 !== n), n._disturbed = !0, "errored" === n._state) return Promise.reject(n._storedError);
return function (e, t) {
var n = e._controlledReadableStream, r = 1;
t.constructor !== DataView && (r = t.constructor.BYTES_PER_ELEMENT);
var i = t.constructor, a = {
buffer: t.buffer,
byteOffset: t.byteOffset,
byteLength: t.byteLength,
bytesFilled: 0,
elementSize: r,
ctor: i,
readerType: "byob"
};
if (e._pendingPullIntos.length > 0) return a.buffer = d(a.buffer), e._pendingPullIntos.push(a), F(n);
if ("closed" === n._state) {
var o = new t.constructor(a.buffer, a.byteOffset, 0);
return Promise.resolve(s(o, !0))
}
if (e._queueTotalSize > 0) {
if (!0 === we(e, a)) {
var l = ye(a);
return _e(e), Promise.resolve(s(l, !1))
}
if (!0 === e._closeRequested) {
var c = new TypeError("Insufficient bytes to fill elements in the given buffer");
return Ae(e, c), Promise.reject(c)
}
}
a.buffer = d(a.buffer), e._pendingPullIntos.push(a);
var u = F(n);
return me(e), u
}(n._readableStreamController, t)
}(this, e) : Promise.reject(new TypeError("view must be an array buffer view")) : Promise.reject(Oe("read"))
}
}, {
key: "releaseLock", value: function () {
if (!Q(this)) throw Oe("releaseLock");
if (void 0 !== this._ownerReadableStream) {
if (this._readIntoRequests.length > 0) throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");
te(this)
}
}
}, {
key: "closed", get: function () {
return Q(this) ? this._closedPromise : Promise.reject(Oe("closed"))
}
}]), e
}();
function Q(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_readIntoRequests")
}
function $(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_readRequests")
}
function Z(e, t) {
e._ownerReadableStream = t, t._reader = e, "readable" === t._state ? function (e) {
e._closedPromise = new Promise(function (t, n) {
e._closedPromise_resolve = t, e._closedPromise_reject = n
})
}(e) : "closed" === t._state ? function (e) {
e._closedPromise = Promise.resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}(e) : (b("errored" === t._state, "state must be errored"), function (e, t) {
e._closedPromise = Promise.reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}(e, t._storedError), e._closedPromise.catch(function () {
}))
}
function ee(e, t) {
var n = e._ownerReadableStream;
return b(void 0 !== n), B(n, t)
}
function te(e) {
b(void 0 !== e._ownerReadableStream), b(e._ownerReadableStream._reader === e), "readable" === e._ownerReadableStream._state ? Le(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : function (e, t) {
b(void 0 === e._closedPromise_resolve), b(void 0 === e._closedPromise_reject), e._closedPromise = Promise.reject(t)
}(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), e._closedPromise.catch(function () {
}), e._ownerReadableStream._reader = void 0, e._ownerReadableStream = void 0
}
function ne(e) {
var t = e._ownerReadableStream;
return b(void 0 !== t), t._disturbed = !0, "closed" === t._state ? Promise.resolve(s(void 0, !0)) : "errored" === t._state ? Promise.reject(t._storedError) : (b("readable" === t._state), t._readableStreamController.__pullSteps())
}
var re = function () {
function e(t, n, r, a) {
if (i(this, e), !1 === R(t)) throw new TypeError("ReadableStreamDefaultController can only be constructed with a ReadableStream instance");
if (void 0 !== t._readableStreamController) throw new TypeError("ReadableStreamDefaultController instances can only be created by the ReadableStream constructor");
this._controlledReadableStream = t, this._underlyingSource = n, this._queue = void 0, this._queueTotalSize = void 0, x(this), this._started = !1, this._closeRequested = !1, this._pullAgain = !1, this._pulling = !1;
var o = h(r, a);
this._strategySize = o.size, this._strategyHWM = o.highWaterMark;
var s = this, l = c(n, "start", [this]);
Promise.resolve(l).then(function () {
s._started = !0, b(!1 === s._pulling), b(!1 === s._pullAgain), ae(s)
}, function (e) {
ce(s, e)
}).catch(w)
}
return r(e, [{
key: "close", value: function () {
if (!1 === ie(this)) throw Me("close");
if (!0 === this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
var e = this._controlledReadableStream._state;
if ("readable" !== e) throw new TypeError("The stream (in " + e + " state) is not in the readable state and cannot be closed");
oe(this)
}
}, {
key: "enqueue", value: function (e) {
if (!1 === ie(this)) throw Me("enqueue");
if (!0 === this._closeRequested) throw new TypeError("stream is closed or draining");
var t = this._controlledReadableStream._state;
if ("readable" !== t) throw new TypeError("The stream (in " + t + " state) is not in the readable state and cannot be enqueued to");
return se(this, e)
}
}, {
key: "error", value: function (e) {
if (!1 === ie(this)) throw Me("error");
var t = this._controlledReadableStream;
if ("readable" !== t._state) throw new TypeError("The stream is " + t._state + " and so cannot be errored");
le(this, e)
}
}, {
key: "__cancelSteps", value: function (e) {
return x(this), u(this._underlyingSource, "cancel", [e])
}
}, {
key: "__pullSteps", value: function () {
var e = this._controlledReadableStream;
if (this._queue.length > 0) {
var t = _(this);
return !0 === this._closeRequested && 0 === this._queue.length ? K(e) : ae(this), Promise.resolve(s(t, !1))
}
var n = G(e);
return ae(this), n
}
}, {
key: "desiredSize", get: function () {
if (!1 === ie(this)) throw Me("desiredSize");
return ue(this)
}
}]), e
}();
function ie(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_underlyingSource")
}
function ae(e) {
!1 !== function (e) {
var t = e._controlledReadableStream;
if ("closed" === t._state || "errored" === t._state) return !1;
if (!0 === e._closeRequested) return !1;
if (!1 === e._started) return !1;
if (!0 === W(t) && q(t) > 0) return !0;
if (ue(e) > 0) return !0;
return !1
}(e) && (!0 !== e._pulling ? (b(!1 === e._pullAgain), e._pulling = !0, u(e._underlyingSource, "pull", [e]).then(function () {
if (e._pulling = !1, !0 === e._pullAgain) return e._pullAgain = !1, ae(e)
}, function (t) {
ce(e, t)
}).catch(w)) : e._pullAgain = !0)
}
function oe(e) {
var t = e._controlledReadableStream;
b(!1 === e._closeRequested), b("readable" === t._state), e._closeRequested = !0, 0 === e._queue.length && K(t)
}
function se(e, t) {
var n = e._controlledReadableStream;
if (b(!1 === e._closeRequested), b("readable" === n._state), !0 === W(n) && q(n) > 0) z(n, t, !1); else {
var r = 1;
if (void 0 !== e._strategySize) {
var i = e._strategySize;
try {
r = i(t)
} catch (t) {
throw ce(e, t), t
}
}
try {
k(e, t, r)
} catch (t) {
throw ce(e, t), t
}
}
ae(e)
}
function le(e, t) {
var n = e._controlledReadableStream;
b("readable" === n._state), x(e), j(n, t)
}
function ce(e, t) {
"readable" === e._controlledReadableStream._state && le(e, t)
}
function ue(e) {
var t = e._controlledReadableStream._state;
return "errored" === t ? null : "closed" === t ? 0 : e._strategyHWM - e._queueTotalSize
}
var de = function () {
function e(t, n) {
i(this, e), this._associatedReadableByteStreamController = t, this._view = n
}
return r(e, [{
key: "respond", value: function (e) {
if (!1 === fe(this)) throw Ne("respond");
if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");
!function (e, t) {
if (t = Number(t), !1 === l(t)) throw new RangeError("bytesWritten must be a finite");
b(e._pendingPullIntos.length > 0), Pe(e, t)
}(this._associatedReadableByteStreamController, e)
}
}, {
key: "respondWithNewView", value: function (e) {
if (!1 === fe(this)) throw Ne("respond");
if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");
if (!ArrayBuffer.isView(e)) throw new TypeError("You can only respond with array buffer views");
!function (e, t) {
b(e._pendingPullIntos.length > 0);
var n = e._pendingPullIntos[0];
if (n.byteOffset + n.bytesFilled !== t.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");
if (n.byteLength !== t.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");
n.buffer = t.buffer, Pe(e, t.byteLength)
}(this._associatedReadableByteStreamController, e)
}
}, {
key: "view", get: function () {
return this._view
}
}]), e
}(), he = function () {
function e(t, n, r) {
if (i(this, e), !1 === R(t)) throw new TypeError("ReadableByteStreamController can only be constructed with a ReadableStream instance given a byte source");
if (void 0 !== t._readableStreamController) throw new TypeError("ReadableByteStreamController instances can only be created by the ReadableStream constructor given a byte source");
this._controlledReadableStream = t, this._underlyingByteSource = n, this._pullAgain = !1, this._pulling = !1, ve(this), this._queue = this._queueTotalSize = void 0, x(this), this._closeRequested = !1, this._started = !1, this._strategyHWM = p(r);
var a = n.autoAllocateChunkSize;
if (void 0 !== a && (!1 === Number.isInteger(a) || a <= 0)) throw new RangeError("autoAllocateChunkSize must be a positive integer");
this._autoAllocateChunkSize = a, this._pendingPullIntos = [];
var o = this, s = c(n, "start", [this]);
Promise.resolve(s).then(function () {
o._started = !0, b(!1 === o._pulling), b(!1 === o._pullAgain), me(o)
}, function (e) {
"readable" === t._state && Ae(o, e)
}).catch(w)
}
return r(e, [{
key: "close", value: function () {
if (!1 === pe(this)) throw Re("close");
if (!0 === this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
var e = this._controlledReadableStream._state;
if ("readable" !== e) throw new TypeError("The stream (in " + e + " state) is not in the readable state and cannot be closed");
!function (e) {
var t = e._controlledReadableStream;
if (b(!1 === e._closeRequested), b("readable" === t._state), e._queueTotalSize > 0) return void (e._closeRequested = !0);
if (e._pendingPullIntos.length > 0) {
var n = e._pendingPullIntos[0];
if (n.bytesFilled > 0) {
var r = new TypeError("Insufficient bytes to fill elements in the given buffer");
throw Ae(e, r), r
}
}
K(t)
}(this)
}
}, {
key: "enqueue", value: function (e) {
if (!1 === pe(this)) throw Re("enqueue");
if (!0 === this._closeRequested) throw new TypeError("stream is closed or draining");
var t = this._controlledReadableStream._state;
if ("readable" !== t) throw new TypeError("The stream (in " + t + " state) is not in the readable state and cannot be enqueued to");
if (!ArrayBuffer.isView(e)) throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");
!function (e, t) {
var n = e._controlledReadableStream;
b(!1 === e._closeRequested), b("readable" === n._state);
var r = t.buffer, i = t.byteOffset, a = t.byteLength, o = d(r);
if (!0 === Y(n)) if (0 === q(n)) be(e, o, i, a); else {
b(0 === e._queue.length);
var s = new Uint8Array(o, i, a);
z(n, s, !1)
} else !0 === H(n) ? (be(e, o, i, a), xe(e)) : (b(!1 === W(n), "stream must not be locked"), be(e, o, i, a))
}(this, e)
}
}, {
key: "error", value: function (e) {
if (!1 === pe(this)) throw Re("error");
var t = this._controlledReadableStream;
if ("readable" !== t._state) throw new TypeError("The stream is " + t._state + " and so cannot be errored");
Ae(this, e)
}
}, {
key: "__cancelSteps", value: function (e) {
this._pendingPullIntos.length > 0 && (this._pendingPullIntos[0].bytesFilled = 0);
return x(this), u(this._underlyingByteSource, "cancel", [e])
}
}, {
key: "__pullSteps", value: function () {
var e = this._controlledReadableStream;
if (b(!0 === Y(e)), this._queueTotalSize > 0) {
b(0 === q(e));
var t = this._queue.shift();
this._queueTotalSize -= t.byteLength, _e(this);
var n = void 0;
try {
n = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)
} catch (e) {
return Promise.reject(e)
}
return Promise.resolve(s(n, !1))
}
var r = this._autoAllocateChunkSize;
if (void 0 !== r) {
var i = void 0;
try {
i = new ArrayBuffer(r)
} catch (e) {
return Promise.reject(e)
}
var a = {
buffer: i,
byteOffset: 0,
byteLength: r,
bytesFilled: 0,
elementSize: 1,
ctor: Uint8Array,
readerType: "default"
};
this._pendingPullIntos.push(a)
}
var o = G(e);
return me(this), o
}
}, {
key: "byobRequest", get: function () {
if (!1 === pe(this)) throw Re("byobRequest");
if (void 0 === this._byobRequest && this._pendingPullIntos.length > 0) {
var e = this._pendingPullIntos[0],
t = new Uint8Array(e.buffer, e.byteOffset + e.bytesFilled, e.byteLength - e.bytesFilled);
this._byobRequest = new de(this, t)
}
return this._byobRequest
}
}, {
key: "desiredSize", get: function () {
if (!1 === pe(this)) throw Re("desiredSize");
return Te(this)
}
}]), e
}();
function pe(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_underlyingByteSource")
}
function fe(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_associatedReadableByteStreamController")
}
function me(e) {
!1 !== function (e) {
var t = e._controlledReadableStream;
if ("readable" !== t._state) return !1;
if (!0 === e._closeRequested) return !1;
if (!1 === e._started) return !1;
if (!0 === Y(t) && q(t) > 0) return !0;
if (!0 === H(t) && U(t) > 0) return !0;
if (Te(e) > 0) return !0;
return !1
}(e) && (!0 !== e._pulling ? (b(!1 === e._pullAgain), e._pulling = !0, u(e._underlyingByteSource, "pull", [e]).then(function () {
e._pulling = !1, !0 === e._pullAgain && (e._pullAgain = !1, me(e))
}, function (t) {
"readable" === e._controlledReadableStream._state && Ae(e, t)
}).catch(w)) : e._pullAgain = !0)
}
function ve(e) {
ke(e), e._pendingPullIntos = []
}
function ge(e, t) {
b("errored" !== e._state, "state must not be errored");
var n = !1;
"closed" === e._state && (b(0 === t.bytesFilled), n = !0);
var r = ye(t);
"default" === t.readerType ? z(e, r, n) : (b("byob" === t.readerType), function (e, t, n) {
var r = e._reader;
b(r._readIntoRequests.length > 0), r._readIntoRequests.shift()._resolve(s(t, n))
}(e, r, n))
}
function ye(e) {
var t = e.bytesFilled, n = e.elementSize;
return b(t <= e.byteLength), b(t % n == 0), new e.ctor(e.buffer, e.byteOffset, t / n)
}
function be(e, t, n, r) {
e._queue.push({buffer: t, byteOffset: n, byteLength: r}), e._queueTotalSize += r
}
function we(e, t) {
var n = t.elementSize, r = t.bytesFilled - t.bytesFilled % n,
i = Math.min(e._queueTotalSize, t.byteLength - t.bytesFilled), a = t.bytesFilled + i, s = a - a % n, l = i,
c = !1;
s > r && (l = s - t.bytesFilled, c = !0);
for (var u = e._queue; l > 0;) {
var d = u[0], h = Math.min(l, d.byteLength), p = t.byteOffset + t.bytesFilled;
o(t.buffer, p, d.buffer, d.byteOffset, h), d.byteLength === h ? u.shift() : (d.byteOffset += h, d.byteLength -= h), e._queueTotalSize -= h, Se(e, h, t), l -= h
}
return !1 === c && (b(0 === e._queueTotalSize, "queue must be empty"), b(t.bytesFilled > 0), b(t.bytesFilled < t.elementSize)), c
}
function Se(e, t, n) {
b(0 === e._pendingPullIntos.length || e._pendingPullIntos[0] === n), ke(e), n.bytesFilled += t
}
function _e(e) {
b("readable" === e._controlledReadableStream._state), 0 === e._queueTotalSize && !0 === e._closeRequested ? K(e._controlledReadableStream) : me(e)
}
function ke(e) {
void 0 !== e._byobRequest && (e._byobRequest._associatedReadableByteStreamController = void 0, e._byobRequest._view = void 0, e._byobRequest = void 0)
}
function xe(e) {
for (b(!1 === e._closeRequested); e._pendingPullIntos.length > 0;) {
if (0 === e._queueTotalSize) return;
var t = e._pendingPullIntos[0];
!0 === we(e, t) && (Ce(e), ge(e._controlledReadableStream, t))
}
}
function Pe(e, t) {
var n = e._pendingPullIntos[0], r = e._controlledReadableStream;
if ("closed" === r._state) {
if (0 !== t) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");
!function (e, t) {
t.buffer = d(t.buffer), b(0 === t.bytesFilled, "bytesFilled must be 0");
var n = e._controlledReadableStream;
if (!0 === H(n)) for (; U(n) > 0;) ge(n, Ce(e))
}(e, n)
} else b("readable" === r._state), function (e, t, n) {
if (n.bytesFilled + t > n.byteLength) throw new RangeError("bytesWritten out of range");
if (Se(e, t, n), !(n.bytesFilled < n.elementSize)) {
Ce(e);
var r = n.bytesFilled % n.elementSize;
if (r > 0) {
var i = n.byteOffset + n.bytesFilled, a = n.buffer.slice(i - r, i);
be(e, a, 0, a.byteLength)
}
n.buffer = d(n.buffer), n.bytesFilled -= r, ge(e._controlledReadableStream, n), xe(e)
}
}(e, t, n)
}
function Ce(e) {
var t = e._pendingPullIntos.shift();
return ke(e), t
}
function Ae(e, t) {
var n = e._controlledReadableStream;
b("readable" === n._state), ve(e), x(e), j(n, t)
}
function Te(e) {
var t = e._controlledReadableStream._state;
return "errored" === t ? null : "closed" === t ? 0 : e._strategyHWM - e._queueTotalSize
}
function Ee(e) {
return new TypeError("ReadableStream.prototype." + e + " can only be used on a ReadableStream")
}
function De(e) {
return new TypeError("Cannot " + e + " a stream using a released reader")
}
function Ie(e) {
return new TypeError("ReadableStreamDefaultReader.prototype." + e + " can only be used on a ReadableStreamDefaultReader")
}
function Le(e, t) {
b(void 0 !== e._closedPromise_resolve), b(void 0 !== e._closedPromise_reject), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}
function Oe(e) {
return new TypeError("ReadableStreamBYOBReader.prototype." + e + " can only be used on a ReadableStreamBYOBReader")
}
function Me(e) {
return new TypeError("ReadableStreamDefaultController.prototype." + e + " can only be used on a ReadableStreamDefaultController")
}
function Ne(e) {
return new TypeError("ReadableStreamBYOBRequest.prototype." + e + " can only be used on a ReadableStreamBYOBRequest")
}
function Re(e) {
return new TypeError("ReadableByteStreamController.prototype." + e + " can only be used on a ReadableByteStreamController")
}
}, function (e, t, n) {
var r = n(6), i = n(4), a = n(2);
t.TransformStream = r.TransformStream, t.ReadableStream = i.ReadableStream, t.IsReadableStreamDisturbed = i.IsReadableStreamDisturbed, t.ReadableStreamDefaultControllerClose = i.ReadableStreamDefaultControllerClose, t.ReadableStreamDefaultControllerEnqueue = i.ReadableStreamDefaultControllerEnqueue, t.ReadableStreamDefaultControllerError = i.ReadableStreamDefaultControllerError, t.ReadableStreamDefaultControllerGetDesiredSize = i.ReadableStreamDefaultControllerGetDesiredSize, t.AcquireWritableStreamDefaultWriter = a.AcquireWritableStreamDefaultWriter, t.IsWritableStream = a.IsWritableStream, t.IsWritableStreamLocked = a.IsWritableStreamLocked, t.WritableStream = a.WritableStream, t.WritableStreamAbort = a.WritableStreamAbort, t.WritableStreamDefaultControllerError = a.WritableStreamDefaultControllerError, t.WritableStreamDefaultWriterCloseWithErrorPropagation = a.WritableStreamDefaultWriterCloseWithErrorPropagation, t.WritableStreamDefaultWriterRelease = a.WritableStreamDefaultWriterRelease, t.WritableStreamDefaultWriterWrite = a.WritableStreamDefaultWriterWrite
}, function (e, t, n) {
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
function i(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var a = n(1).assert, o = n(0), s = o.InvokeOrNoop, l = o.PromiseInvokeOrPerformFallback,
c = o.PromiseInvokeOrNoop, u = o.typeIsObject, d = n(4), h = d.ReadableStream,
p = d.ReadableStreamDefaultControllerClose, f = d.ReadableStreamDefaultControllerEnqueue,
m = d.ReadableStreamDefaultControllerError, v = d.ReadableStreamDefaultControllerGetDesiredSize, g = n(2),
y = g.WritableStream, b = g.WritableStreamDefaultControllerError;
function w(e, t) {
if (!0 === e._errored) throw new TypeError("TransformStream is already errored");
if (!0 === e._readableClosed) throw new TypeError("Readable side is already closed");
var n = e._readableController;
try {
f(n, t)
} catch (t) {
throw e._readableClosed = !0, _(e, t), e._storedError
}
!0 === v(n) <= 0 && !1 === e._backpressure && P(e, !0)
}
function S(e) {
a(!1 === e._errored), a(!1 === e._readableClosed);
try {
p(e._readableController)
} catch (e) {
a(!1)
}
e._readableClosed = !0
}
function _(e, t) {
!1 === e._errored && k(e, t)
}
function k(e, t) {
a(!1 === e._errored), e._errored = !0, e._storedError = t, !1 === e._writableDone && b(e._writableController, t), !1 === e._readableClosed && m(e._readableController, t)
}
function x(e) {
return a(void 0 !== e._backpressureChangePromise, "_backpressureChangePromise should have been initialized"), !1 === e._backpressure ? Promise.resolve() : (a(!0 === e._backpressure, "_backpressure should have been initialized"), e._backpressureChangePromise)
}
function P(e, t) {
a(e._backpressure !== t, "TransformStreamSetBackpressure() should be called only when backpressure is changed"), void 0 !== e._backpressureChangePromise && e._backpressureChangePromise_resolve(t), e._backpressureChangePromise = new Promise(function (t) {
e._backpressureChangePromise_resolve = t
}), e._backpressureChangePromise.then(function (e) {
a(e !== t, "_backpressureChangePromise should be fulfilled only when backpressure is changed")
}), e._backpressure = t
}
function C(e, t) {
return w(t._controlledTransformStream, e), Promise.resolve()
}
function A(e) {
return !!u(e) && !!Object.prototype.hasOwnProperty.call(e, "_controlledTransformStream")
}
function T(e) {
return !!u(e) && !!Object.prototype.hasOwnProperty.call(e, "_transformStreamController")
}
var E = function () {
function e(t, n) {
i(this, e), this._transformStream = t, this._startPromise = n
}
return r(e, [{
key: "start", value: function (e) {
var t = this._transformStream;
return t._writableController = e, this._startPromise.then(function () {
return x(t)
})
}
}, {
key: "write", value: function (e) {
return function (e, t) {
a(!1 === e._errored), a(!1 === e._transforming), a(!1 === e._backpressure), e._transforming = !0;
var n = e._transformer, r = e._transformStreamController;
return l(n, "transform", [t, r], C, [t, r]).then(function () {
return e._transforming = !1, x(e)
}, function (t) {
return _(e, t), Promise.reject(t)
})
}(this._transformStream, e)
}
}, {
key: "abort", value: function () {
var e = this._transformStream;
e._writableDone = !0, k(e, new TypeError("Writable side aborted"))
}
}, {
key: "close", value: function () {
var e = this._transformStream;
return a(!1 === e._transforming), e._writableDone = !0, c(e._transformer, "flush", [e._transformStreamController]).then(function () {
return !0 === e._errored ? Promise.reject(e._storedError) : (!1 === e._readableClosed && S(e), Promise.resolve())
}).catch(function (t) {
return _(e, t), Promise.reject(e._storedError)
})
}
}]), e
}(), D = function () {
function e(t, n) {
i(this, e), this._transformStream = t, this._startPromise = n
}
return r(e, [{
key: "start", value: function (e) {
var t = this._transformStream;
return t._readableController = e, this._startPromise.then(function () {
return a(void 0 !== t._backpressureChangePromise, "_backpressureChangePromise should have been initialized"), !0 === t._backpressure ? Promise.resolve() : (a(!1 === t._backpressure, "_backpressure should have been initialized"), t._backpressureChangePromise)
})
}
}, {
key: "pull", value: function () {
var e = this._transformStream;
return a(!0 === e._backpressure, "pull() should be never called while _backpressure is false"), a(void 0 !== e._backpressureChangePromise, "_backpressureChangePromise should have been initialized"), P(e, !1), e._backpressureChangePromise
}
}, {
key: "cancel", value: function () {
var e = this._transformStream;
e._readableClosed = !0, k(e, new TypeError("Readable side canceled"))
}
}]), e
}(), I = function () {
function e(t) {
if (i(this, e), !1 === T(t)) throw new TypeError("TransformStreamDefaultController can only be constructed with a TransformStream instance");
if (void 0 !== t._transformStreamController) throw new TypeError("TransformStreamDefaultController instances can only be created by the TransformStream constructor");
this._controlledTransformStream = t
}
return r(e, [{
key: "enqueue", value: function (e) {
if (!1 === A(this)) throw O("enqueue");
w(this._controlledTransformStream, e)
}
}, {
key: "close", value: function () {
if (!1 === A(this)) throw O("close");
!function (e) {
if (!0 === e._errored) throw new TypeError("TransformStream is already errored");
if (!0 === e._readableClosed) throw new TypeError("Readable side is already closed");
S(e)
}(this._controlledTransformStream)
}
}, {
key: "error", value: function (e) {
if (!1 === A(this)) throw O("error");
!function (e, t) {
if (!0 === e._errored) throw new TypeError("TransformStream is already errored");
k(e, t)
}(this._controlledTransformStream, e)
}
}, {
key: "desiredSize", get: function () {
if (!1 === A(this)) throw O("desiredSize");
var e = this._controlledTransformStream._readableController;
return v(e)
}
}]), e
}(), L = function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
i(this, e), this._transformer = t;
var n = t.readableStrategy, r = t.writableStrategy;
this._transforming = !1, this._errored = !1, this._storedError = void 0, this._writableController = void 0, this._readableController = void 0, this._transformStreamController = void 0, this._writableDone = !1, this._readableClosed = !1, this._backpressure = void 0, this._backpressureChangePromise = void 0, this._backpressureChangePromise_resolve = void 0, this._transformStreamController = new I(this);
var o = void 0, l = new Promise(function (e) {
o = e
}), c = new D(this, l);
this._readable = new h(c, n);
var u = new E(this, l);
this._writable = new y(u, r), a(void 0 !== this._writableController), a(void 0 !== this._readableController), P(this, v(this._readableController) <= 0);
var d = this, p = s(t, "start", [d._transformStreamController]);
o(p), l.catch(function (e) {
!1 === d._errored && (d._errored = !0, d._storedError = e)
})
}
return r(e, [{
key: "readable", get: function () {
if (!1 === T(this)) throw M("readable");
return this._readable
}
}, {
key: "writable", get: function () {
if (!1 === T(this)) throw M("writable");
return this._writable
}
}]), e
}();
function O(e) {
return new TypeError("TransformStreamDefaultController.prototype." + e + " can only be used on a TransformStreamDefaultController")
}
function M(e) {
return new TypeError("TransformStream.prototype." + e + " can only be used on a TransformStream")
}
e.exports = {TransformStream: L}
}, function (e, t, n) {
e.exports = n(5)
}]))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFJS = t.globalScope = void 0;
var r, i = n(84), a = n(14), o = n(1), s = n(87), l = n(25), c = (r = l) && r.__esModule ? r : {default: r},
u = n(86), d = n(96), h = n(97);
c.default.PDFJS || (c.default.PDFJS = {});
var p = c.default.PDFJS;
p.version = "1.10.0", p.build = "d08dce4", p.pdfBug = !1, void 0 !== p.verbosity && (0, o.setVerbosityLevel)(p.verbosity), delete p.verbosity, Object.defineProperty(p, "verbosity", {
get: function () {
return (0, o.getVerbosityLevel)()
}, set: function (e) {
(0, o.setVerbosityLevel)(e)
}, enumerable: !0, configurable: !0
}), p.VERBOSITY_LEVELS = o.VERBOSITY_LEVELS, p.OPS = o.OPS, p.UNSUPPORTED_FEATURES = o.UNSUPPORTED_FEATURES, p.isValidUrl = a.isValidUrl, p.shadow = o.shadow, p.createBlob = o.createBlob, p.createObjectURL = function (e, t) {
return (0, o.createObjectURL)(e, t, p.disableCreateObjectURL)
}, Object.defineProperty(p, "isLittleEndian", {
configurable: !0, get: function () {
return (0, o.shadow)(p, "isLittleEndian", (0, o.isLittleEndian)())
}
}), p.removeNullCharacters = o.removeNullCharacters, p.PasswordResponses = o.PasswordResponses, p.PasswordException = o.PasswordException, p.UnknownErrorException = o.UnknownErrorException, p.InvalidPDFException = o.InvalidPDFException, p.MissingPDFException = o.MissingPDFException, p.UnexpectedResponseException = o.UnexpectedResponseException, p.Util = o.Util, p.PageViewport = o.PageViewport, p.createPromiseCapability = o.createPromiseCapability, p.maxImageSize = void 0 === p.maxImageSize ? -1 : p.maxImageSize, p.cMapUrl = void 0 === p.cMapUrl ? null : p.cMapUrl, p.cMapPacked = void 0 !== p.cMapPacked && p.cMapPacked, p.disableFontFace = void 0 !== p.disableFontFace && p.disableFontFace, p.imageResourcesPath = void 0 === p.imageResourcesPath ? "" : p.imageResourcesPath, p.disableWorker = void 0 !== p.disableWorker && p.disableWorker, p.workerSrc = void 0 === p.workerSrc ? null : p.workerSrc, p.workerPort = void 0 === p.workerPort ? null : p.workerPort, p.disableRange = void 0 !== p.disableRange && p.disableRange, p.disableStream = void 0 !== p.disableStream && p.disableStream, p.disableAutoFetch = void 0 !== p.disableAutoFetch && p.disableAutoFetch, p.pdfBug = void 0 !== p.pdfBug && p.pdfBug, p.postMessageTransfers = void 0 === p.postMessageTransfers || p.postMessageTransfers, p.disableCreateObjectURL = void 0 !== p.disableCreateObjectURL && p.disableCreateObjectURL, p.disableWebGL = void 0 === p.disableWebGL || p.disableWebGL, p.externalLinkTarget = void 0 === p.externalLinkTarget ? a.LinkTarget.NONE : p.externalLinkTarget, p.externalLinkRel = void 0 === p.externalLinkRel ? a.DEFAULT_LINK_REL : p.externalLinkRel, p.isEvalSupported = void 0 === p.isEvalSupported || p.isEvalSupported, p.pdfjsNext = void 0 !== p.pdfjsNext && p.pdfjsNext;
var f = p.openExternalLinksInNewWindow;
delete p.openExternalLinksInNewWindow, Object.defineProperty(p, "openExternalLinksInNewWindow", {
get: function () {
return p.externalLinkTarget === a.LinkTarget.BLANK
}, set: function (e) {
e && (0, o.deprecated)('PDFJS.openExternalLinksInNewWindow, please use "PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'), p.externalLinkTarget === a.LinkTarget.NONE ? p.externalLinkTarget = e ? a.LinkTarget.BLANK : a.LinkTarget.NONE : (0, o.warn)("PDFJS.externalLinkTarget is already initialized")
}, enumerable: !0, configurable: !0
}), f && (p.openExternalLinksInNewWindow = f), p.getDocument = i.getDocument, p.LoopbackPort = i.LoopbackPort, p.PDFDataRangeTransport = i.PDFDataRangeTransport, p.PDFWorker = i.PDFWorker, p.hasCanvasTypedArrays = !0, p.CustomStyle = a.CustomStyle, p.LinkTarget = a.LinkTarget, p.addLinkAttributes = a.addLinkAttributes, p.getFilenameFromUrl = a.getFilenameFromUrl, p.isExternalLinkTargetSet = a.isExternalLinkTargetSet, p.AnnotationLayer = s.AnnotationLayer, p.renderTextLayer = d.renderTextLayer, p.Metadata = u.Metadata, p.SVGGraphics = h.SVGGraphics, p.UnsupportedManager = i._UnsupportedManager, t.globalScope = c.default, t.PDFJS = p
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.FontLoader = t.FontFaceObject = void 0;
var r = n(1);
function i(e) {
this.docId = e, this.styleElement = null, this.nativeFontFaces = [], this.loadTestFontId = 0, this.loadingContext = {
requests: [],
nextRequestId: 0
}
}
i.prototype = {
insertRule: function (e) {
var t = this.styleElement;
t || ((t = this.styleElement = document.createElement("style")).id = "PDFJS_FONT_STYLE_TAG_" + this.docId, document.documentElement.getElementsByTagName("head")[0].appendChild(t));
var n = t.sheet;
n.insertRule(e, n.cssRules.length)
}, clear: function () {
this.styleElement && (this.styleElement.remove(), this.styleElement = null), this.nativeFontFaces.forEach(function (e) {
document.fonts.delete(e)
}), this.nativeFontFaces.length = 0
}
};
Object.defineProperty(i.prototype, "loadTestFont", {
get: function () {
return (0, r.shadow)(this, "loadTestFont", atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))
}, configurable: !0
}), i.prototype.addNativeFontFace = function (e) {
this.nativeFontFaces.push(e), document.fonts.add(e)
}, i.prototype.bind = function (e, t) {
for (var n = [], a = [], o = [], s = function (e) {
return e.loaded.catch(function (t) {
(0, r.warn)('Failed to load font "' + e.family + '": ' + t)
})
}, l = i.isFontLoadingAPISupported && !i.isSyncFontLoadingSupported, c = 0, u = e.length; c < u; c++) {
var d = e[c];
if (!d.attached && !1 !== d.loading) if (d.attached = !0, l) {
var h = d.createNativeFontFace();
h && (this.addNativeFontFace(h), o.push(s(h)))
} else {
var p = d.createFontFaceRule();
p && (this.insertRule(p), n.push(p), a.push(d))
}
}
var f = this.queueLoadingCallback(t);
l ? Promise.all(o).then(function () {
f.complete()
}) : n.length > 0 && !i.isSyncFontLoadingSupported ? this.prepareFontLoadEvent(n, a, f) : f.complete()
}, i.prototype.queueLoadingCallback = function (e) {
var t = this.loadingContext, n = {
id: "pdfjs-font-loading-" + t.nextRequestId++, complete: function () {
for ((0, r.assert)(!n.end, "completeRequest() cannot be called twice"), n.end = Date.now(); t.requests.length > 0 && t.requests[0].end;) {
var e = t.requests.shift();
setTimeout(e.callback, 0)
}
}, callback: e, started: Date.now()
};
return t.requests.push(n), n
}, i.prototype.prepareFontLoadEvent = function (e, t, n) {
function i(e, t) {
return e.charCodeAt(t) << 24 | e.charCodeAt(t + 1) << 16 | e.charCodeAt(t + 2) << 8 | 255 & e.charCodeAt(t + 3)
}
function a(e, t, n, r) {
return e.substr(0, t) + r + e.substr(t + n)
}
var o, s, l = document.createElement("canvas");
l.width = 1, l.height = 1;
var c = l.getContext("2d"), u = 0;
var d = "lt" + Date.now() + this.loadTestFontId++, h = this.loadTestFont, p = i(h = a(h, 976, d.length, d), 16);
for (o = 0, s = d.length - 3; o < s; o += 4) p = p - 1482184792 + i(d, o) | 0;
o < d.length && (p = p - 1482184792 + i(d + "XXX", o) | 0), h = a(h, 16, 4, (0, r.string32)(p));
var f = '@font-face { font-family:"' + d + '";src:' + ("url(data:font/opentype;base64," + btoa(h) + ");") + "}";
this.insertRule(f);
var m = [];
for (o = 0, s = t.length; o < s; o++) m.push(t[o].loadedName);
m.push(d);
var v = document.createElement("div");
for (v.setAttribute("style", "visibility: hidden;width: 10px; height: 10px;position: absolute; top: 0px; left: 0px;"), o = 0, s = m.length; o < s; ++o) {
var g = document.createElement("span");
g.textContent = "Hi", g.style.fontFamily = m[o], v.appendChild(g)
}
document.body.appendChild(v), function e(t, n) {
if (++u > 30) return (0, r.warn)("Load test font never loaded."), void n();
c.font = "30px " + t, c.fillText(".", 0, 20), c.getImageData(0, 0, 1, 1).data[3] > 0 ? n() : setTimeout(e.bind(null, t, n))
}(d, function () {
document.body.removeChild(v), n.complete()
})
}, i.isFontLoadingAPISupported = "undefined" != typeof document && !!document.fonts;
Object.defineProperty(i, "isSyncFontLoadingSupported", {
get: function () {
return (0, r.shadow)(i, "isSyncFontLoadingSupported", function () {
if ("undefined" == typeof navigator) return !0;
var e = !1, t = /Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);
return t && t[1] >= 14 && (e = !0), e
}())
}, enumerable: !0, configurable: !0
});
var a = {
get value() {
return (0, r.shadow)(this, "value", (0, r.isEvalSupported)())
}
}, o = function () {
function e(e, t) {
for (var n in this.compiledGlyphs = Object.create(null), e) this[n] = e[n];
this.options = t
}
return e.prototype = {
createNativeFontFace: function () {
if (!this.data) return null;
if (this.options.disableFontFace) return this.disableFontFace = !0, null;
var e = new FontFace(this.loadedName, this.data, {});
return this.options.fontRegistry && this.options.fontRegistry.registerFont(this), e
}, createFontFaceRule: function () {
if (!this.data) return null;
if (this.options.disableFontFace) return this.disableFontFace = !0, null;
var e = (0, r.bytesToString)(new Uint8Array(this.data)), t = this.loadedName,
n = "url(data:" + this.mimetype + ";base64," + btoa(e) + ");",
i = '@font-face { font-family:"' + t + '";src:' + n + "}";
return this.options.fontRegistry && this.options.fontRegistry.registerFont(this, n), i
}, getPathGenerator: function (e, t) {
if (!(t in this.compiledGlyphs)) {
var n, r, i, o = e.get(this.loadedName + "_path_" + t);
if (this.options.isEvalSupported && a.value) {
var s, l = "";
for (r = 0, i = o.length; r < i; r++) s = void 0 !== (n = o[r]).args ? n.args.join(",") : "", l += "c." + n.cmd + "(" + s + ");\n";
this.compiledGlyphs[t] = new Function("c", "size", l)
} else this.compiledGlyphs[t] = function (e, t) {
for (r = 0, i = o.length; r < i; r++) "scale" === (n = o[r]).cmd && (n.args = [t, -t]), e[n.cmd].apply(e, n.args)
}
}
return this.compiledGlyphs[t]
}
}, e
}();
t.FontFaceObject = o, t.FontLoader = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.CanvasGraphics = void 0;
var r = n(1), i = n(145), a = n(85), o = 16, s = {
get value() {
return (0, r.shadow)(s, "value", (0, r.isLittleEndian)())
}
};
function l(e) {
e.mozCurrentTransform || (e._originalSave = e.save, e._originalRestore = e.restore, e._originalRotate = e.rotate, e._originalScale = e.scale, e._originalTranslate = e.translate, e._originalTransform = e.transform, e._originalSetTransform = e.setTransform, e._transformMatrix = e._transformMatrix || [1, 0, 0, 1, 0, 0], e._transformStack = [], Object.defineProperty(e, "mozCurrentTransform", {
get: function () {
return this._transformMatrix
}
}), Object.defineProperty(e, "mozCurrentTransformInverse", {
get: function () {
var e = this._transformMatrix, t = e[0], n = e[1], r = e[2], i = e[3], a = e[4], o = e[5], s = t * i - n * r,
l = n * r - t * i;
return [i / s, n / l, r / l, t / s, (i * a - r * o) / l, (n * a - t * o) / s]
}
}), e.save = function () {
var e = this._transformMatrix;
this._transformStack.push(e), this._transformMatrix = e.slice(0, 6), this._originalSave()
}, e.restore = function () {
var e = this._transformStack.pop();
e && (this._transformMatrix = e, this._originalRestore())
}, e.translate = function (e, t) {
var n = this._transformMatrix;
n[4] = n[0] * e + n[2] * t + n[4], n[5] = n[1] * e + n[3] * t + n[5], this._originalTranslate(e, t)
}, e.scale = function (e, t) {
var n = this._transformMatrix;
n[0] = n[0] * e, n[1] = n[1] * e, n[2] = n[2] * t, n[3] = n[3] * t, this._originalScale(e, t)
}, e.transform = function (t, n, r, i, a, o) {
var s = this._transformMatrix;
this._transformMatrix = [s[0] * t + s[2] * n, s[1] * t + s[3] * n, s[0] * r + s[2] * i, s[1] * r + s[3] * i, s[0] * a + s[2] * o + s[4], s[1] * a + s[3] * o + s[5]], e._originalTransform(t, n, r, i, a, o)
}, e.setTransform = function (t, n, r, i, a, o) {
this._transformMatrix = [t, n, r, i, a, o], e._originalSetTransform(t, n, r, i, a, o)
}, e.rotate = function (e) {
var t = Math.cos(e), n = Math.sin(e), r = this._transformMatrix;
this._transformMatrix = [r[0] * t + r[2] * n, r[1] * t + r[3] * n, r[0] * -n + r[2] * t, r[1] * -n + r[3] * t, r[4], r[5]], this._originalRotate(e)
})
}
var c = function () {
function e(e) {
this.canvasFactory = e, this.cache = Object.create(null)
}
return e.prototype = {
getCanvas: function (e, t, n, r) {
var i;
return void 0 !== this.cache[e] ? (i = this.cache[e], this.canvasFactory.reset(i, t, n), i.context.setTransform(1, 0, 0, 1, 0, 0)) : (i = this.canvasFactory.create(t, n), this.cache[e] = i), r && l(i.context), i
}, clear: function () {
for (var e in this.cache) {
var t = this.cache[e];
this.canvasFactory.destroy(t), delete this.cache[e]
}
}
}, e
}();
var u = function () {
function e() {
this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = r.IDENTITY_MATRIX, this.textMatrixScale = 1, this.fontMatrix = r.FONT_IDENTITY_MATRIX, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode = r.TextRenderingMode.FILL, this.textRise = 0, this.fillColor = "#000000", this.strokeColor = "#000000", this.patternFill = !1, this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.activeSMask = null, this.resumeSMaskCtx = null
}
return e.prototype = {
clone: function () {
return Object.create(this)
}, setCurrentPoint: function (e, t) {
this.x = e, this.y = t
}
}, e
}(), d = function () {
function e(e, t, n, r, i) {
this.ctx = e, this.current = new u, this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = t, this.objs = n, this.canvasFactory = r, this.imageLayer = i, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.cachedCanvases = new c(this.canvasFactory), e && l(e), this.cachedGetSinglePixelWidth = null
}
function t(e, t) {
if ("undefined" != typeof ImageData && t instanceof ImageData) e.putImageData(t, 0, 0); else {
var n, i, a, l, c, u = t.height, d = t.width, h = u % o, p = (u - h) / o, f = 0 === h ? p : p + 1,
m = e.createImageData(d, o), v = 0, g = t.data, y = m.data;
if (t.kind === r.ImageKind.GRAYSCALE_1BPP) {
var b = g.byteLength, w = new Uint32Array(y.buffer, 0, y.byteLength >> 2), S = w.length, _ = d + 7 >> 3,
k = 4294967295, x = s.value ? 4278190080 : 255;
for (i = 0; i < f; i++) {
for (l = i < p ? o : h, n = 0, a = 0; a < l; a++) {
for (var P = b - v, C = 0, A = P > _ ? d : 8 * P - 7, T = -8 & A, E = 0, D = 0; C < T; C += 8) D = g[v++], w[n++] = 128 & D ? k : x, w[n++] = 64 & D ? k : x, w[n++] = 32 & D ? k : x, w[n++] = 16 & D ? k : x, w[n++] = 8 & D ? k : x, w[n++] = 4 & D ? k : x, w[n++] = 2 & D ? k : x, w[n++] = 1 & D ? k : x;
for (; C < A; C++) 0 === E && (D = g[v++], E = 128), w[n++] = D & E ? k : x, E >>= 1
}
for (; n < S;) w[n++] = 0;
e.putImageData(m, 0, i * o)
}
} else if (t.kind === r.ImageKind.RGBA_32BPP) {
for (a = 0, c = d * o * 4, i = 0; i < p; i++) y.set(g.subarray(v, v + c)), v += c, e.putImageData(m, 0, a), a += o;
i < f && (c = d * h * 4, y.set(g.subarray(v, v + c)), e.putImageData(m, 0, a))
} else {
if (t.kind !== r.ImageKind.RGB_24BPP) throw new Error("bad image kind: " + t.kind);
for (c = d * (l = o), i = 0; i < f; i++) {
for (i >= p && (c = d * (l = h)), n = 0, a = c; a--;) y[n++] = g[v++], y[n++] = g[v++], y[n++] = g[v++], y[n++] = 255;
e.putImageData(m, 0, i * o)
}
}
}
}
function n(e, t) {
for (var n = t.height, r = t.width, i = n % o, a = (n - i) / o, s = 0 === i ? a : a + 1, l = e.createImageData(r, o), c = 0, u = t.data, d = l.data, h = 0; h < s; h++) {
for (var p = h < a ? o : i, f = 3, m = 0; m < p; m++) for (var v = 0, g = 0; g < r; g++) {
if (!v) {
var y = u[c++];
v = 128
}
d[f] = y & v ? 0 : 255, f += 4, v >>= 1
}
e.putImageData(l, 0, h * o)
}
}
function d(e, t) {
for (var n = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font"], r = 0, i = n.length; r < i; r++) {
var a = n[r];
void 0 !== e[a] && (t[a] = e[a])
}
void 0 !== e.setLineDash && (t.setLineDash(e.getLineDash()), t.lineDashOffset = e.lineDashOffset)
}
function h(e) {
e.strokeStyle = "#000000", e.fillStyle = "#000000", e.fillRule = "nonzero", e.globalAlpha = 1, e.lineWidth = 1, e.lineCap = "butt", e.lineJoin = "miter", e.miterLimit = 10, e.globalCompositeOperation = "source-over", e.font = "10px sans-serif", void 0 !== e.setLineDash && (e.setLineDash([]), e.lineDashOffset = 0)
}
function p(e, t, n, r) {
for (var i = e.length, a = 3; a < i; a += 4) {
var o = e[a];
if (0 === o) e[a - 3] = t, e[a - 2] = n, e[a - 1] = r; else if (o < 255) {
var s = 255 - o;
e[a - 3] = e[a - 3] * o + t * s >> 8, e[a - 2] = e[a - 2] * o + n * s >> 8, e[a - 1] = e[a - 1] * o + r * s >> 8
}
}
}
function f(e, t, n) {
for (var r = e.length, i = 3; i < r; i += 4) {
var a = n ? n[e[i]] : e[i];
t[i] = t[i] * a * (1 / 255) | 0
}
}
function m(e, t, n) {
for (var r = e.length, i = 3; i < r; i += 4) {
var a = 77 * e[i - 3] + 152 * e[i - 2] + 28 * e[i - 1];
t[i] = n ? t[i] * n[a >> 8] >> 8 : t[i] * a >> 16
}
}
function v(e, t, n) {
var r = t.canvas, i = t.context;
e.setTransform(t.scaleX, 0, 0, t.scaleY, t.offsetX, t.offsetY);
var o = t.backdrop || null;
if (!t.transferMap && a.WebGLUtils.isEnabled) {
var s = a.WebGLUtils.composeSMask(n.canvas, r, {subtype: t.subtype, backdrop: o});
return e.setTransform(1, 0, 0, 1, 0, 0), void e.drawImage(s, t.offsetX, t.offsetY)
}
!function (e, t, n, r, i, a, o) {
var s, l = !!a, c = l ? a[0] : 0, u = l ? a[1] : 0, d = l ? a[2] : 0;
s = "Luminosity" === i ? m : f;
for (var h = Math.min(r, Math.ceil(1048576 / n)), v = 0; v < r; v += h) {
var g = Math.min(h, r - v), y = e.getImageData(0, v, n, g), b = t.getImageData(0, v, n, g);
l && p(y.data, c, u, d), s(y.data, b.data, o), e.putImageData(b, 0, v)
}
}(i, n, r.width, r.height, t.subtype, o, t.transferMap), e.drawImage(r, 0, 0)
}
var g = ["butt", "round", "square"], y = ["miter", "round", "bevel"], b = {}, w = {};
for (var S in e.prototype = {
beginDrawing: function (e) {
var t = e.transform, n = e.viewport, r = e.transparency, i = e.background, a = void 0 === i ? null : i,
o = this.ctx.canvas.width, s = this.ctx.canvas.height;
if (this.ctx.save(), this.ctx.fillStyle = a || "rgb(255, 255, 255)", this.ctx.fillRect(0, 0, o, s), this.ctx.restore(), r) {
var l = this.cachedCanvases.getCanvas("transparent", o, s, !0);
this.compositeCtx = this.ctx, this.transparentCanvas = l.canvas, this.ctx = l.context, this.ctx.save(), this.ctx.transform.apply(this.ctx, this.compositeCtx.mozCurrentTransform)
}
this.ctx.save(), h(this.ctx), t && this.ctx.transform.apply(this.ctx, t), this.ctx.transform.apply(this.ctx, n.transform), this.baseTransform = this.ctx.mozCurrentTransform.slice(), this.imageLayer && this.imageLayer.beginLayout()
}, executeOperatorList: function (e, t, n, i) {
var a = e.argsArray, o = e.fnArray, s = t || 0, l = a.length;
if (l === s) return s;
for (var c, u = l - s > 10 && "function" == typeof n, d = u ? Date.now() + 15 : 0, h = 0, p = this.commonObjs, f = this.objs; ;) {
if (void 0 !== i && s === i.nextBreakPoint) return i.breakIt(s, n), s;
if ((c = o[s]) !== r.OPS.dependency) this[c].apply(this, a[s]); else for (var m = a[s], v = 0, g = m.length; v < g; v++) {
var y = m[v], b = "g" === y[0] && "_" === y[1] ? p : f;
if (!b.isResolved(y)) return b.get(y, n), s
}
if (++s === l) return s;
if (u && ++h > 10) {
if (Date.now() > d) return n(), s;
h = 0
}
}
}, endDrawing: function () {
null !== this.current.activeSMask && this.endSMaskGroup(), this.ctx.restore(), this.transparentCanvas && (this.ctx = this.compositeCtx, this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.drawImage(this.transparentCanvas, 0, 0), this.ctx.restore(), this.transparentCanvas = null), this.cachedCanvases.clear(), a.WebGLUtils.clear(), this.imageLayer && this.imageLayer.endLayout()
}, setLineWidth: function (e) {
this.current.lineWidth = e, this.ctx.lineWidth = e
}, setLineCap: function (e) {
this.ctx.lineCap = g[e]
}, setLineJoin: function (e) {
this.ctx.lineJoin = y[e]
}, setMiterLimit: function (e) {
this.ctx.miterLimit = e
}, setDash: function (e, t) {
var n = this.ctx;
void 0 !== n.setLineDash && (n.setLineDash(e), n.lineDashOffset = t)
}, setRenderingIntent: function (e) {
}, setFlatness: function (e) {
}, setGState: function (e) {
for (var t = 0, n = e.length; t < n; t++) {
var r = e[t], i = r[0], a = r[1];
switch (i) {
case"LW":
this.setLineWidth(a);
break;
case"LC":
this.setLineCap(a);
break;
case"LJ":
this.setLineJoin(a);
break;
case"ML":
this.setMiterLimit(a);
break;
case"D":
this.setDash(a[0], a[1]);
break;
case"RI":
this.setRenderingIntent(a);
break;
case"FL":
this.setFlatness(a);
break;
case"Font":
this.setFont(a[0], a[1]);
break;
case"CA":
this.current.strokeAlpha = r[1];
break;
case"ca":
this.current.fillAlpha = r[1], this.ctx.globalAlpha = r[1];
break;
case"BM":
this.ctx.globalCompositeOperation = a, this.ctx.globalCompositeOperation !== a && (this.ctx.globalAlpha = .75);
break;
case"SMask":
this.current.activeSMask && (this.stateStack.length > 0 && this.stateStack[this.stateStack.length - 1].activeSMask === this.current.activeSMask ? this.suspendSMaskGroup() : this.endSMaskGroup()), this.current.activeSMask = a ? this.tempSMask : null, this.current.activeSMask && this.beginSMaskGroup(), this.tempSMask = null
}
}
}, beginSMaskGroup: function () {
var e = this.current.activeSMask, t = e.canvas.width, n = e.canvas.height,
r = "smaskGroupAt" + this.groupLevel, i = this.cachedCanvases.getCanvas(r, t, n, !0), a = this.ctx,
o = a.mozCurrentTransform;
this.ctx.save();
var s = i.context;
s.scale(1 / e.scaleX, 1 / e.scaleY), s.translate(-e.offsetX, -e.offsetY), s.transform.apply(s, o), e.startTransformInverse = s.mozCurrentTransformInverse, d(a, s), this.ctx = s, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(a), this.groupLevel++
}, suspendSMaskGroup: function () {
var e = this.ctx;
this.groupLevel--, this.ctx = this.groupStack.pop(), v(this.ctx, this.current.activeSMask, e), this.ctx.restore(), this.ctx.save(), d(e, this.ctx), this.current.resumeSMaskCtx = e;
var t = r.Util.transform(this.current.activeSMask.startTransformInverse, e.mozCurrentTransform);
this.ctx.transform.apply(this.ctx, t), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, e.canvas.width, e.canvas.height), e.restore()
}, resumeSMaskGroup: function () {
var e = this.current.resumeSMaskCtx, t = this.ctx;
this.ctx = e, this.groupStack.push(t), this.groupLevel++
}, endSMaskGroup: function () {
var e = this.ctx;
this.groupLevel--, this.ctx = this.groupStack.pop(), v(this.ctx, this.current.activeSMask, e), this.ctx.restore(), d(e, this.ctx);
var t = r.Util.transform(this.current.activeSMask.startTransformInverse, e.mozCurrentTransform);
this.ctx.transform.apply(this.ctx, t)
}, save: function () {
this.ctx.save();
var e = this.current;
this.stateStack.push(e), this.current = e.clone(), this.current.resumeSMaskCtx = null
}, restore: function () {
this.current.resumeSMaskCtx && this.resumeSMaskGroup(), null === this.current.activeSMask || 0 !== this.stateStack.length && this.stateStack[this.stateStack.length - 1].activeSMask === this.current.activeSMask || this.endSMaskGroup(), 0 !== this.stateStack.length && (this.current = this.stateStack.pop(), this.ctx.restore(), this.pendingClip = null, this.cachedGetSinglePixelWidth = null)
}, transform: function (e, t, n, r, i, a) {
this.ctx.transform(e, t, n, r, i, a), this.cachedGetSinglePixelWidth = null
}, constructPath: function (e, t) {
for (var n = this.ctx, i = this.current, a = i.x, o = i.y, s = 0, l = 0, c = e.length; s < c; s++) switch (0 | e[s]) {
case r.OPS.rectangle:
a = t[l++], o = t[l++];
var u = t[l++], d = t[l++];
0 === u && (u = this.getSinglePixelWidth()), 0 === d && (d = this.getSinglePixelWidth());
var h = a + u, p = o + d;
this.ctx.moveTo(a, o), this.ctx.lineTo(h, o), this.ctx.lineTo(h, p), this.ctx.lineTo(a, p), this.ctx.lineTo(a, o), this.ctx.closePath();
break;
case r.OPS.moveTo:
a = t[l++], o = t[l++], n.moveTo(a, o);
break;
case r.OPS.lineTo:
a = t[l++], o = t[l++], n.lineTo(a, o);
break;
case r.OPS.curveTo:
a = t[l + 4], o = t[l + 5], n.bezierCurveTo(t[l], t[l + 1], t[l + 2], t[l + 3], a, o), l += 6;
break;
case r.OPS.curveTo2:
n.bezierCurveTo(a, o, t[l], t[l + 1], t[l + 2], t[l + 3]), a = t[l + 2], o = t[l + 3], l += 4;
break;
case r.OPS.curveTo3:
a = t[l + 2], o = t[l + 3], n.bezierCurveTo(t[l], t[l + 1], a, o, a, o), l += 4;
break;
case r.OPS.closePath:
n.closePath()
}
i.setCurrentPoint(a, o)
}, closePath: function () {
this.ctx.closePath()
}, stroke: function (e) {
e = void 0 === e || e;
var t = this.ctx, n = this.current.strokeColor;
t.lineWidth = Math.max(.65 * this.getSinglePixelWidth(), this.current.lineWidth), t.globalAlpha = this.current.strokeAlpha, n && n.hasOwnProperty("type") && "Pattern" === n.type ? (t.save(), t.strokeStyle = n.getPattern(t, this), t.stroke(), t.restore()) : t.stroke(), e && this.consumePath(), t.globalAlpha = this.current.fillAlpha
}, closeStroke: function () {
this.closePath(), this.stroke()
}, fill: function (e) {
e = void 0 === e || e;
var t = this.ctx, n = this.current.fillColor, r = !1;
this.current.patternFill && (t.save(), this.baseTransform && t.setTransform.apply(t, this.baseTransform), t.fillStyle = n.getPattern(t, this), r = !0), this.pendingEOFill ? (t.fill("evenodd"), this.pendingEOFill = !1) : t.fill(), r && t.restore(), e && this.consumePath()
}, eoFill: function () {
this.pendingEOFill = !0, this.fill()
}, fillStroke: function () {
this.fill(!1), this.stroke(!1), this.consumePath()
}, eoFillStroke: function () {
this.pendingEOFill = !0, this.fillStroke()
}, closeFillStroke: function () {
this.closePath(), this.fillStroke()
}, closeEOFillStroke: function () {
this.pendingEOFill = !0, this.closePath(), this.fillStroke()
}, endPath: function () {
this.consumePath()
}, clip: function () {
this.pendingClip = b
}, eoClip: function () {
this.pendingClip = w
}, beginText: function () {
this.current.textMatrix = r.IDENTITY_MATRIX, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0
}, endText: function () {
var e = this.pendingTextPaths, t = this.ctx;
if (void 0 !== e) {
t.save(), t.beginPath();
for (var n = 0; n < e.length; n++) {
var r = e[n];
t.setTransform.apply(t, r.transform), t.translate(r.x, r.y), r.addToPath(t, r.fontSize)
}
t.restore(), t.clip(), t.beginPath(), delete this.pendingTextPaths
} else t.beginPath()
}, setCharSpacing: function (e) {
this.current.charSpacing = e
}, setWordSpacing: function (e) {
this.current.wordSpacing = e
}, setHScale: function (e) {
this.current.textHScale = e / 100
}, setLeading: function (e) {
this.current.leading = -e
}, setFont: function (e, t) {
var n = this.commonObjs.get(e), i = this.current;
if (!n) throw new Error("Can't find font for " + e);
if (i.fontMatrix = n.fontMatrix ? n.fontMatrix : r.FONT_IDENTITY_MATRIX, 0 !== i.fontMatrix[0] && 0 !== i.fontMatrix[3] || (0, r.warn)("Invalid font matrix for font " + e), t < 0 ? (t = -t, i.fontDirection = -1) : i.fontDirection = 1, this.current.font = n, this.current.fontSize = t, !n.isType3Font) {
var a = n.loadedName || "sans-serif", o = n.black ? "900" : n.bold ? "bold" : "normal",
s = n.italic ? "italic" : "normal", l = '"' + a + '", ' + n.fallbackName,
c = t < 16 ? 16 : t > 100 ? 100 : t;
this.current.fontSizeScale = t / c;
var u = s + " " + o + " " + c + "px " + l;
this.ctx.font = u
}
}, setTextRenderingMode: function (e) {
this.current.textRenderingMode = e
}, setTextRise: function (e) {
this.current.textRise = e
}, moveText: function (e, t) {
this.current.x = this.current.lineX += e, this.current.y = this.current.lineY += t
}, setLeadingMoveText: function (e, t) {
this.setLeading(-t), this.moveText(e, t)
}, setTextMatrix: function (e, t, n, r, i, a) {
this.current.textMatrix = [e, t, n, r, i, a], this.current.textMatrixScale = Math.sqrt(e * e + t * t), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0
}, nextLine: function () {
this.moveText(0, this.current.leading)
}, paintChar: function (e, t, n) {
var i, a = this.ctx, o = this.current, s = o.font, l = o.textRenderingMode, c = o.fontSize / o.fontSizeScale,
u = l & r.TextRenderingMode.FILL_STROKE_MASK, d = !!(l & r.TextRenderingMode.ADD_TO_PATH_FLAG);
((s.disableFontFace || d) && (i = s.getPathGenerator(this.commonObjs, e)), s.disableFontFace ? (a.save(), a.translate(t, n), a.beginPath(), i(a, c), u !== r.TextRenderingMode.FILL && u !== r.TextRenderingMode.FILL_STROKE || a.fill(), u !== r.TextRenderingMode.STROKE && u !== r.TextRenderingMode.FILL_STROKE || a.stroke(), a.restore()) : (u !== r.TextRenderingMode.FILL && u !== r.TextRenderingMode.FILL_STROKE || a.fillText(e, t, n), u !== r.TextRenderingMode.STROKE && u !== r.TextRenderingMode.FILL_STROKE || a.strokeText(e, t, n)), d) && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
transform: a.mozCurrentTransform,
x: t,
y: n,
fontSize: c,
addToPath: i
})
}, get isFontSubpixelAAEnabled() {
var e = this.canvasFactory.create(10, 10).context;
e.scale(1.5, 1), e.fillText("I", 0, 10);
for (var t = e.getImageData(0, 0, 10, 10).data, n = !1, i = 3; i < t.length; i += 4) if (t[i] > 0 && t[i] < 255) {
n = !0;
break
}
return (0, r.shadow)(this, "isFontSubpixelAAEnabled", n)
}, showText: function (e) {
var t = this.current, n = t.font;
if (n.isType3Font) return this.showType3Text(e);
var i = t.fontSize;
if (0 !== i) {
var a = this.ctx, o = t.fontSizeScale, s = t.charSpacing, l = t.wordSpacing, c = t.fontDirection,
u = t.textHScale * c, d = e.length, h = n.vertical, p = h ? 1 : -1, f = n.defaultVMetrics,
m = i * t.fontMatrix[0], v = t.textRenderingMode === r.TextRenderingMode.FILL && !n.disableFontFace;
a.save(), a.transform.apply(a, t.textMatrix), a.translate(t.x, t.y + t.textRise), t.patternFill && (a.fillStyle = t.fillColor.getPattern(a, this)), c > 0 ? a.scale(u, -1) : a.scale(u, 1);
var g = t.lineWidth, y = t.textMatrixScale;
if (0 === y || 0 === g) {
var b = t.textRenderingMode & r.TextRenderingMode.FILL_STROKE_MASK;
b !== r.TextRenderingMode.STROKE && b !== r.TextRenderingMode.FILL_STROKE || (this.cachedGetSinglePixelWidth = null, g = .65 * this.getSinglePixelWidth())
} else g /= y;
1 !== o && (a.scale(o, o), g /= o), a.lineWidth = g;
var w, S = 0;
for (w = 0; w < d; ++w) {
var _ = e[w];
if ((0, r.isNum)(_)) S += p * _ * i / 1e3; else {
var k, x, P, C, A, T, E, D = !1, I = (_.isSpace ? l : 0) + s, L = _.fontChar, O = _.accent, M = _.width;
if (h) A = _.vmetric || f, T = -(T = _.vmetric ? A[1] : .5 * M) * m, E = A[2] * m, M = A ? -A[0] : M, k = T / o, x = (S + E) / o; else k = S / o, x = 0;
if (n.remeasure && M > 0) {
var N = 1e3 * a.measureText(L).width / i * o;
if (M < N && this.isFontSubpixelAAEnabled) {
var R = M / N;
D = !0, a.save(), a.scale(R, 1), k /= R
} else M !== N && (k += (M - N) / 2e3 * i / o)
}
(_.isInFont || n.missingFile) && (v && !O ? a.fillText(L, k, x) : (this.paintChar(L, k, x), O && (P = k + O.offset.x / o, C = x - O.offset.y / o, this.paintChar(O.fontChar, P, C)))), S += M * m + I * c, D && a.restore()
}
}
h ? t.y -= S * u : t.x += S * u, a.restore()
}
}, showType3Text: function (e) {
var t, n, i, a, o = this.ctx, s = this.current, l = s.font, c = s.fontSize, u = s.fontDirection,
d = l.vertical ? 1 : -1, h = s.charSpacing, p = s.wordSpacing, f = s.textHScale * u,
m = s.fontMatrix || r.FONT_IDENTITY_MATRIX, v = e.length;
if (!(s.textRenderingMode === r.TextRenderingMode.INVISIBLE) && 0 !== c) {
for (this.cachedGetSinglePixelWidth = null, o.save(), o.transform.apply(o, s.textMatrix), o.translate(s.x, s.y), o.scale(f, u), t = 0; t < v; ++t) if (n = e[t], (0, r.isNum)(n)) a = d * n * c / 1e3, this.ctx.translate(a, 0), s.x += a * f; else {
var g = (n.isSpace ? p : 0) + h, y = l.charProcOperatorList[n.operatorListId];
if (y) this.processingType3 = n, this.save(), o.scale(c, c), o.transform.apply(o, m), this.executeOperatorList(y), this.restore(), i = r.Util.applyTransform([n.width, 0], m)[0] * c + g, o.translate(i, 0), s.x += i * f; else (0, r.warn)('Type3 character "' + n.operatorListId + '" is not available.')
}
o.restore(), this.processingType3 = null
}
}, setCharWidth: function (e, t) {
}, setCharWidthAndBounds: function (e, t, n, r, i, a) {
this.ctx.rect(n, r, i - n, a - r), this.clip(), this.endPath()
}, getColorN_Pattern: function (t) {
var n, r = this;
if ("TilingPattern" === t[0]) {
var a = t[1], o = this.baseTransform || this.ctx.mozCurrentTransform.slice(), s = {
createCanvasGraphics: function (t) {
return new e(t, r.commonObjs, r.objs, r.canvasFactory)
}
};
n = new i.TilingPattern(t, a, this.ctx, s, o)
} else n = (0, i.getShadingPatternFromIR)(t);
return n
}, setStrokeColorN: function () {
this.current.strokeColor = this.getColorN_Pattern(arguments)
}, setFillColorN: function () {
this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0
}, setStrokeRGBColor: function (e, t, n) {
var i = r.Util.makeCssRgb(e, t, n);
this.ctx.strokeStyle = i, this.current.strokeColor = i
}, setFillRGBColor: function (e, t, n) {
var i = r.Util.makeCssRgb(e, t, n);
this.ctx.fillStyle = i, this.current.fillColor = i, this.current.patternFill = !1
}, shadingFill: function (e) {
var t = this.ctx;
this.save();
var n = (0, i.getShadingPatternFromIR)(e);
t.fillStyle = n.getPattern(t, this, !0);
var a = t.mozCurrentTransformInverse;
if (a) {
var o = t.canvas, s = o.width, l = o.height, c = r.Util.applyTransform([0, 0], a),
u = r.Util.applyTransform([0, l], a), d = r.Util.applyTransform([s, 0], a),
h = r.Util.applyTransform([s, l], a), p = Math.min(c[0], u[0], d[0], h[0]),
f = Math.min(c[1], u[1], d[1], h[1]), m = Math.max(c[0], u[0], d[0], h[0]),
v = Math.max(c[1], u[1], d[1], h[1]);
this.ctx.fillRect(p, f, m - p, v - f)
} else this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
this.restore()
}, beginInlineImage: function () {
throw new Error("Should not call beginInlineImage")
}, beginImageData: function () {
throw new Error("Should not call beginImageData")
}, paintFormXObjectBegin: function (e, t) {
if (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(e) && 6 === e.length && this.transform.apply(this, e), this.baseTransform = this.ctx.mozCurrentTransform, Array.isArray(t) && 4 === t.length) {
var n = t[2] - t[0], r = t[3] - t[1];
this.ctx.rect(t[0], t[1], n, r), this.clip(), this.endPath()
}
}, paintFormXObjectEnd: function () {
this.restore(), this.baseTransform = this.baseTransformStack.pop()
}, beginGroup: function (e) {
this.save();
var t = this.ctx;
e.isolated || (0, r.info)("TODO: Support non-isolated groups."), e.knockout && (0, r.warn)("Knockout groups not supported.");
var n = t.mozCurrentTransform;
if (e.matrix && t.transform.apply(t, e.matrix), !e.bbox) throw new Error("Bounding box is required.");
var i = r.Util.getAxialAlignedBoundingBox(e.bbox, t.mozCurrentTransform),
a = [0, 0, t.canvas.width, t.canvas.height];
i = r.Util.intersect(i, a) || [0, 0, 0, 0];
var o = Math.floor(i[0]), s = Math.floor(i[1]), l = Math.max(Math.ceil(i[2]) - o, 1),
c = Math.max(Math.ceil(i[3]) - s, 1), u = 1, h = 1;
l > 4096 && (u = l / 4096, l = 4096), c > 4096 && (h = c / 4096, c = 4096);
var p = "groupAt" + this.groupLevel;
e.smask && (p += "_smask_" + this.smaskCounter++ % 2);
var f = this.cachedCanvases.getCanvas(p, l, c, !0), m = f.context;
m.scale(1 / u, 1 / h), m.translate(-o, -s), m.transform.apply(m, n), e.smask ? this.smaskStack.push({
canvas: f.canvas,
context: m,
offsetX: o,
offsetY: s,
scaleX: u,
scaleY: h,
subtype: e.smask.subtype,
backdrop: e.smask.backdrop,
transferMap: e.smask.transferMap || null,
startTransformInverse: null
}) : (t.setTransform(1, 0, 0, 1, 0, 0), t.translate(o, s), t.scale(u, h)), d(t, m), this.ctx = m, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(t), this.groupLevel++, this.current.activeSMask = null
}, endGroup: function (e) {
this.groupLevel--;
var t = this.ctx;
this.ctx = this.groupStack.pop(), void 0 !== this.ctx.imageSmoothingEnabled ? this.ctx.imageSmoothingEnabled = !1 : this.ctx.mozImageSmoothingEnabled = !1, e.smask ? this.tempSMask = this.smaskStack.pop() : this.ctx.drawImage(t.canvas, 0, 0), this.restore()
}, beginAnnotations: function () {
for (var e = 0; e < 5; e++) this.ctx.restore();
this.save(), this.baseTransform && this.ctx.setTransform.apply(this.ctx, this.baseTransform)
}, endAnnotations: function () {
this.restore()
}, beginAnnotation: function (e, t, n) {
if (this.save(), h(this.ctx), this.current = new u, Array.isArray(e) && 4 === e.length) {
var r = e[2] - e[0], i = e[3] - e[1];
this.ctx.rect(e[0], e[1], r, i), this.clip(), this.endPath()
}
this.transform.apply(this, t), this.transform.apply(this, n)
}, endAnnotation: function () {
this.restore()
}, paintJpegXObject: function (e, t, n) {
var i = this, a = this.objs.get(e);
if (a) {
this.save();
var o = this.ctx;
if (o.scale(1 / t, -1 / n), window.KGPdfViewerWebApp.repairJpegXObjectByIE({
width: a.width,
height: a.height,
callback: function (e) {
i.ctx.globalAlpha = e
}
}), o.drawImage(a, 0, 0, a.width, a.height, 0, -n, t, n), this.imageLayer) {
var s = o.mozCurrentTransformInverse, l = this.getCanvasPosition(0, 0);
this.imageLayer.appendImage({objId: e, left: l[0], top: l[1], width: t / s[0], height: n / s[3]})
}
this.restore()
} else (0, r.warn)("Dependent image isn't ready yet")
}, paintImageMaskXObject: function (e) {
var t = this.ctx, r = e.width, i = e.height, a = this.current.fillColor, o = this.current.patternFill,
s = this.processingType3;
if (s && void 0 === s.compiled && (s.compiled = r <= 1e3 && i <= 1e3 ? function (e) {
var t, n, r, i, a = e.width, o = e.height, s = a + 1, l = new Uint8Array(s * (o + 1)),
c = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), u = a + 7 & -8, d = e.data,
h = new Uint8Array(u * o), p = 0;
for (t = 0, i = d.length; t < i; t++) for (var f = 128, m = d[t]; f > 0;) h[p++] = m & f ? 0 : 255, f >>= 1;
var v = 0;
for (0 !== h[p = 0] && (l[0] = 1, ++v), n = 1; n < a; n++) h[p] !== h[p + 1] && (l[n] = h[p] ? 2 : 1, ++v), p++;
for (0 !== h[p] && (l[n] = 2, ++v), t = 1; t < o; t++) {
r = t * s, h[(p = t * u) - u] !== h[p] && (l[r] = h[p] ? 1 : 8, ++v);
var g = (h[p] ? 4 : 0) + (h[p - u] ? 8 : 0);
for (n = 1; n < a; n++) c[g = (g >> 2) + (h[p + 1] ? 4 : 0) + (h[p - u + 1] ? 8 : 0)] && (l[r + n] = c[g], ++v), p++;
if (h[p - u] !== h[p] && (l[r + n] = h[p] ? 2 : 4, ++v), v > 1e3) return null
}
for (r = t * s, 0 !== h[p = u * (o - 1)] && (l[r] = 8, ++v), n = 1; n < a; n++) h[p] !== h[p + 1] && (l[r + n] = h[p] ? 4 : 8, ++v), p++;
if (0 !== h[p] && (l[r + n] = 4, ++v), v > 1e3) return null;
var y = new Int32Array([0, s, -1, 0, -s, 0, 0, 0, 1]), b = [];
for (t = 0; v && t <= o; t++) {
for (var w = t * s, S = w + a; w < S && !l[w];) w++;
if (w !== S) {
var _, k = [w % s, t], x = l[w], P = w;
do {
var C = y[x];
do {
w += C
} while (!l[w]);
5 !== (_ = l[w]) && 10 !== _ ? (x = _, l[w] = 0) : (x = _ & 51 * x >> 4, l[w] &= x >> 2 | x << 2), k.push(w % s), k.push(w / s | 0), --v
} while (P !== w);
b.push(k), --t
}
}
return function (e) {
e.save(), e.scale(1 / a, -1 / o), e.translate(0, -o), e.beginPath();
for (var t = 0, n = b.length; t < n; t++) {
var r = b[t];
e.moveTo(r[0], r[1]);
for (var i = 2, s = r.length; i < s; i += 2) e.lineTo(r[i], r[i + 1])
}
e.fill(), e.beginPath(), e.restore()
}
}({data: e.data, width: r, height: i}) : null), s && s.compiled) s.compiled(t); else {
var l = this.cachedCanvases.getCanvas("maskCanvas", r, i), c = l.context;
c.save(), n(c, e), c.globalCompositeOperation = "source-in", c.fillStyle = o ? a.getPattern(c, this) : a, c.fillRect(0, 0, r, i), c.restore(), this.paintInlineImageXObject(l.canvas)
}
}, paintImageMaskXObjectRepeat: function (e, t, r, i) {
var a = e.width, o = e.height, s = this.current.fillColor, l = this.current.patternFill,
c = this.cachedCanvases.getCanvas("maskCanvas", a, o), u = c.context;
u.save(), n(u, e), u.globalCompositeOperation = "source-in", u.fillStyle = l ? s.getPattern(u, this) : s, u.fillRect(0, 0, a, o), u.restore();
for (var d = this.ctx, h = 0, p = i.length; h < p; h += 2) d.save(), d.transform(t, 0, 0, r, i[h], i[h + 1]), d.scale(1, -1), d.drawImage(c.canvas, 0, 0, a, o, 0, -1, 1, 1), d.restore()
}, paintImageMaskXObjectGroup: function (e) {
for (var t = this.ctx, r = this.current.fillColor, i = this.current.patternFill, a = 0, o = e.length; a < o; a++) {
var s = e[a], l = s.width, c = s.height, u = this.cachedCanvases.getCanvas("maskCanvas", l, c),
d = u.context;
d.save(), n(d, s), d.globalCompositeOperation = "source-in", d.fillStyle = i ? r.getPattern(d, this) : r, d.fillRect(0, 0, l, c), d.restore(), t.save(), t.transform.apply(t, s.transform), t.scale(1, -1), t.drawImage(u.canvas, 0, 0, l, c, 0, -1, 1, 1), t.restore()
}
}, paintImageXObject: function (e) {
var t = this.objs.get(e);
t ? this.paintInlineImageXObject(t) : (0, r.warn)("Dependent image isn't ready yet")
}, paintImageXObjectRepeat: function (e, t, n, i) {
var a = this.objs.get(e);
if (a) {
for (var o = a.width, s = a.height, l = [], c = 0, u = i.length; c < u; c += 2) l.push({
transform: [t, 0, 0, n, i[c], i[c + 1]],
x: 0,
y: 0,
w: o,
h: s
});
this.paintInlineImageXObjectGroup(a, l)
} else (0, r.warn)("Dependent image isn't ready yet")
}, paintInlineImageXObject: function (e) {
var n = e.width, r = e.height, i = this.ctx;
this.save(), i.scale(1 / n, -1 / r);
var a, o, s = i.mozCurrentTransformInverse, l = s[0], c = s[1], u = Math.max(Math.sqrt(l * l + c * c), 1),
d = s[2], h = s[3], p = Math.max(Math.sqrt(d * d + h * h), 1);
if (e instanceof HTMLElement || !e.data) a = e; else {
var f = (o = this.cachedCanvases.getCanvas("inlineImage", n, r)).context;
t(f, e), a = o.canvas
}
for (var m = n, v = r, g = "prescale1"; u > 2 && m > 1 || p > 2 && v > 1;) {
var y = m, b = v;
u > 2 && m > 1 && (u /= m / (y = Math.ceil(m / 2))), p > 2 && v > 1 && (p /= v / (b = Math.ceil(v / 2))), (f = (o = this.cachedCanvases.getCanvas(g, y, b)).context).clearRect(0, 0, y, b), f.drawImage(a, 0, 0, m, v, 0, 0, y, b), a = o.canvas, m = y, v = b, g = "prescale1" === g ? "prescale2" : "prescale1"
}
if (i.drawImage(a, 0, 0, m, v, 0, -r, n, r), this.imageLayer) {
var w = this.getCanvasPosition(0, -r);
this.imageLayer.appendImage({imgData: e, left: w[0], top: w[1], width: n / s[0], height: r / s[3]})
}
this.restore()
}, paintInlineImageXObjectGroup: function (e, n) {
var r = this.ctx, i = e.width, a = e.height, o = this.cachedCanvases.getCanvas("inlineImage", i, a);
t(o.context, e);
for (var s = 0, l = n.length; s < l; s++) {
var c = n[s];
if (r.save(), r.transform.apply(r, c.transform), r.scale(1, -1), r.drawImage(o.canvas, c.x, c.y, c.w, c.h, 0, -1, 1, 1), this.imageLayer) {
var u = this.getCanvasPosition(c.x, c.y);
this.imageLayer.appendImage({imgData: e, left: u[0], top: u[1], width: i, height: a})
}
r.restore()
}
}, paintSolidColorImageMask: function () {
this.ctx.fillRect(0, 0, 1, 1)
}, paintXObject: function () {
(0, r.warn)("Unsupported 'paintXObject' command.")
}, markPoint: function (e) {
}, markPointProps: function (e, t) {
}, beginMarkedContent: function (e) {
}, beginMarkedContentProps: function (e, t) {
}, endMarkedContent: function () {
}, beginCompat: function () {
}, endCompat: function () {
}, consumePath: function () {
var e = this.ctx;
this.pendingClip && (this.pendingClip === w ? e.clip("evenodd") : e.clip(), this.pendingClip = null), e.beginPath()
}, getSinglePixelWidth: function (e) {
if (null === this.cachedGetSinglePixelWidth) {
this.ctx.save();
var t = this.ctx.mozCurrentTransformInverse;
this.ctx.restore(), this.cachedGetSinglePixelWidth = Math.sqrt(Math.max(t[0] * t[0] + t[1] * t[1], t[2] * t[2] + t[3] * t[3]))
}
return this.cachedGetSinglePixelWidth
}, getCanvasPosition: function (e, t) {
var n = this.ctx.mozCurrentTransform;
return [n[0] * e + n[2] * t + n[4], n[1] * e + n[3] * t + n[5]]
}
}, r.OPS) e.prototype[r.OPS[S]] = e.prototype[S];
return e
}();
t.CanvasGraphics = d
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.TilingPattern = t.getShadingPatternFromIR = void 0;
var r = n(1), i = n(85), a = {
RadialAxial: {
fromIR: function (e) {
var t = e[1], n = e[2], r = e[3], i = e[4], a = e[5], o = e[6];
return {
type: "Pattern", getPattern: function (e) {
var s;
"axial" === t ? s = e.createLinearGradient(r[0], r[1], i[0], i[1]) : "radial" === t && (s = e.createRadialGradient(r[0], r[1], a, i[0], i[1], o));
for (var l = 0, c = n.length; l < c; ++l) {
var u = n[l];
s.addColorStop(u[0], u[1])
}
return s
}
}
}
}
}, o = function () {
function e(e, t, n, r, i, a, o, s) {
var l, c = t.coords, u = t.colors, d = e.data, h = 4 * e.width;
c[n + 1] > c[r + 1] && (l = n, n = r, r = l, l = a, a = o, o = l), c[r + 1] > c[i + 1] && (l = r, r = i, i = l, l = o, o = s, s = l), c[n + 1] > c[r + 1] && (l = n, n = r, r = l, l = a, a = o, o = l);
var p = (c[n] + t.offsetX) * t.scaleX, f = (c[n + 1] + t.offsetY) * t.scaleY, m = (c[r] + t.offsetX) * t.scaleX,
v = (c[r + 1] + t.offsetY) * t.scaleY, g = (c[i] + t.offsetX) * t.scaleX,
y = (c[i + 1] + t.offsetY) * t.scaleY;
if (!(f >= y)) for (var b, w, S, _, k, x, P, C, A, T = u[a], E = u[a + 1], D = u[a + 2], I = u[o], L = u[o + 1], O = u[o + 2], M = u[s], N = u[s + 1], R = u[s + 2], W = Math.round(f), V = Math.round(y), F = W; F <= V; F++) {
F < v ? (b = p - (p - m) * (A = F < f ? 0 : f === v ? 1 : (f - F) / (f - v)), w = T - (T - I) * A, S = E - (E - L) * A, _ = D - (D - O) * A) : (b = m - (m - g) * (A = F > y ? 1 : v === y ? 0 : (v - F) / (v - y)), w = I - (I - M) * A, S = L - (L - N) * A, _ = O - (O - R) * A), k = p - (p - g) * (A = F < f ? 0 : F > y ? 1 : (f - F) / (f - y)), x = T - (T - M) * A, P = E - (E - N) * A, C = D - (D - R) * A;
for (var G = Math.round(Math.min(b, k)), B = Math.round(Math.max(b, k)), K = h * F + 4 * G, j = G; j <= B; j++) A = (A = (b - j) / (b - k)) < 0 ? 0 : A > 1 ? 1 : A, d[K++] = w - (w - x) * A | 0, d[K++] = S - (S - P) * A | 0, d[K++] = _ - (_ - C) * A | 0, d[K++] = 255
}
}
function t(t, n, r) {
var i, a, o = n.coords, s = n.colors;
switch (n.type) {
case"lattice":
var l = n.verticesPerRow, c = Math.floor(o.length / l) - 1, u = l - 1;
for (i = 0; i < c; i++) for (var d = i * l, h = 0; h < u; h++, d++) e(t, r, o[d], o[d + 1], o[d + l], s[d], s[d + 1], s[d + l]), e(t, r, o[d + l + 1], o[d + 1], o[d + l], s[d + l + 1], s[d + 1], s[d + l]);
break;
case"triangles":
for (i = 0, a = o.length; i < a; i += 3) e(t, r, o[i], o[i + 1], o[i + 2], s[i], s[i + 1], s[i + 2]);
break;
default:
throw new Error("illegal figure")
}
}
return function (e, n, r, a, o, s, l) {
var c, u, d, h, p = Math.floor(e[0]), f = Math.floor(e[1]), m = Math.ceil(e[2]) - p, v = Math.ceil(e[3]) - f,
g = Math.min(Math.ceil(Math.abs(m * n[0] * 1.1)), 3e3),
y = Math.min(Math.ceil(Math.abs(v * n[1] * 1.1)), 3e3), b = m / g, w = v / y,
S = {coords: r, colors: a, offsetX: -p, offsetY: -f, scaleX: 1 / b, scaleY: 1 / w}, _ = g + 4, k = y + 4;
if (i.WebGLUtils.isEnabled) c = i.WebGLUtils.drawFigures(g, y, s, o, S), (u = l.getCanvas("mesh", _, k, !1)).context.drawImage(c, 2, 2), c = u.canvas; else {
var x = (u = l.getCanvas("mesh", _, k, !1)).context, P = x.createImageData(g, y);
if (s) {
var C = P.data;
for (d = 0, h = C.length; d < h; d += 4) C[d] = s[0], C[d + 1] = s[1], C[d + 2] = s[2], C[d + 3] = 255
}
for (d = 0; d < o.length; d++) t(P, o[d], S);
x.putImageData(P, 2, 2), c = u.canvas
}
return {canvas: c, offsetX: p - 2 * b, offsetY: f - 2 * w, scaleX: b, scaleY: w}
}
}();
a.Mesh = {
fromIR: function (e) {
var t = e[2], n = e[3], i = e[4], a = e[5], s = e[6], l = e[8];
return {
type: "Pattern", getPattern: function (e, c, u) {
var d;
if (u) d = r.Util.singularValueDecompose2dScale(e.mozCurrentTransform); else if (d = r.Util.singularValueDecompose2dScale(c.baseTransform), s) {
var h = r.Util.singularValueDecompose2dScale(s);
d = [d[0] * h[0], d[1] * h[1]]
}
var p = o(a, d, t, n, i, u ? null : l, c.cachedCanvases);
return u || (e.setTransform.apply(e, c.baseTransform), s && e.transform.apply(e, s)), e.translate(p.offsetX, p.offsetY), e.scale(p.scaleX, p.scaleY), e.createPattern(p.canvas, "no-repeat")
}
}
}
}, a.Dummy = {
fromIR: function () {
return {
type: "Pattern", getPattern: function () {
return "hotpink"
}
}
}
};
var s = function () {
var e = 1, t = 2;
function n(e, t, n, r, i) {
this.operatorList = e[2], this.matrix = e[3] || [1, 0, 0, 1, 0, 0], this.bbox = e[4], this.xstep = e[5], this.ystep = e[6], this.paintType = e[7], this.tilingType = e[8], this.color = t, this.canvasGraphicsFactory = r, this.baseTransform = i, this.type = "Pattern", this.ctx = n
}
return n.prototype = {
createPatternCanvas: function (e) {
var t = this.operatorList, n = this.bbox, i = this.xstep, a = this.ystep, o = this.paintType,
s = this.tilingType, l = this.color, c = this.canvasGraphicsFactory;
(0, r.info)("TilingType: " + s);
var u = n[0], d = n[1], h = n[2], p = n[3], f = [u, d], m = [u + i, d + a], v = m[0] - f[0], g = m[1] - f[1],
y = r.Util.singularValueDecompose2dScale(this.matrix),
b = r.Util.singularValueDecompose2dScale(this.baseTransform), w = [y[0] * b[0], y[1] * b[1]];
v = Math.min(Math.ceil(Math.abs(v * w[0])), 3e3), g = Math.min(Math.ceil(Math.abs(g * w[1])), 3e3);
var S = e.cachedCanvases.getCanvas("pattern", v, g, !0), _ = S.context, k = c.createCanvasGraphics(_);
k.groupLevel = e.groupLevel, this.setFillAndStrokeStyleToContext(k, o, l), this.setScale(v, g, i, a), this.transformToScale(k);
var x = [1, 0, 0, 1, -f[0], -f[1]];
return k.transform.apply(k, x), this.clipBbox(k, n, u, d, h, p), k.executeOperatorList(t), S.canvas
}, setScale: function (e, t, n, r) {
this.scale = [e / n, t / r]
}, transformToScale: function (e) {
var t = this.scale, n = [t[0], 0, 0, t[1], 0, 0];
e.transform.apply(e, n)
}, scaleToContext: function () {
var e = this.scale;
this.ctx.scale(1 / e[0], 1 / e[1])
}, clipBbox: function (e, t, n, r, i, a) {
if (Array.isArray(t) && 4 === t.length) {
var o = i - n, s = a - r;
e.ctx.rect(n, r, o, s), e.clip(), e.endPath()
}
}, setFillAndStrokeStyleToContext: function (n, i, a) {
var o = n.ctx, s = n.current;
switch (i) {
case e:
var l = this.ctx;
o.fillStyle = l.fillStyle, o.strokeStyle = l.strokeStyle, s.fillColor = l.fillStyle, s.strokeColor = l.strokeStyle;
break;
case t:
var c = r.Util.makeCssRgb(a[0], a[1], a[2]);
o.fillStyle = c, o.strokeStyle = c, s.fillColor = c, s.strokeColor = c;
break;
default:
throw new r.FormatError("Unsupported paint type: " + i)
}
}, getPattern: function (e, t) {
var n = this.createPatternCanvas(t);
return (e = this.ctx).setTransform.apply(e, this.baseTransform), e.transform.apply(e, this.matrix), this.scaleToContext(), e.createPattern(n, "repeat")
}
}, n
}();
t.getShadingPatternFromIR = function (e) {
var t = a[e[0]];
if (!t) throw new Error("Unknown IR type: " + e[0]);
return t.fromIR(e)
}, t.TilingPattern = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
function a(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var o = {
NoError: 0,
EndOfDocument: -1,
UnterminatedCdat: -2,
UnterminatedXmlDeclaration: -3,
UnterminatedDoctypeDeclaration: -4,
UnterminatedComment: -5,
MalformedElement: -6,
OutOfMemory: -7,
UnterminatedAttributeValue: -8,
UnterminatedElement: -9,
ElementNeverBegun: -10
};
function s(e, t) {
var n = e[t];
return " " === n || "\n" === n || "\r" === n || "\t" === n
}
var l = function () {
function e() {
a(this, e)
}
return i(e, [{
key: "_resolveEntities", value: function (e) {
return e.replace(/&([^;]+);/g, function (e, t) {
if ("#x" === t.substring(0, 2)) return String.fromCharCode(parseInt(t.substring(2), 16));
if ("#" === t.substring(0, 1)) return String.fromCharCode(parseInt(t.substring(1), 10));
switch (t) {
case"lt":
return "<";
case"gt":
return ">";
case"amp":
return "&";
case"quot":
return '"'
}
return this.onResolveEntity(t)
})
}
}, {
key: "_parseContent", value: function (e, t) {
var n, r = t, i = [];
function a() {
for (; r < e.length && s(e, r);) ++r
}
for (; r < e.length && !s(e, r) && ">" !== e[r] && "/" !== e[r];) ++r;
for (n = e.substring(t, r), a(); r < e.length && ">" !== e[r] && "/" !== e[r] && "?" !== e[r];) {
a();
for (var o, l = ""; r < e.length && !s(e, r) && "=" !== e[r];) l += e[r], ++r;
if (a(), "=" !== e[r]) return null;
++r, a();
var c = e[r];
if ('"' !== c && "'" !== c) return null;
var u = e.indexOf(c, ++r);
if (u < 0) return null;
o = e.substring(r, u), i.push({name: l, value: this._resolveEntities(o)}), r = u + 1, a()
}
return {name: n, attributes: i, parsed: r - t}
}
}, {
key: "_parseProcessingInstruction", value: function (e, t) {
var n, r = t;
for (; r < e.length && !s(e, r) && ">" !== e[r] && "/" !== e[r];) ++r;
n = e.substring(t, r), function () {
for (; r < e.length && s(e, r);) ++r
}();
for (var i = r; r < e.length && ("?" !== e[r] || ">" !== e[r + 1]);) ++r;
return {name: n, value: e.substring(i, r), parsed: r - t}
}
}, {
key: "parseXml", value: function (e) {
for (var t = 0; t < e.length;) {
var n = t;
if ("<" === e[t]) {
var r = void 0;
switch (e[++n]) {
case"/":
if (++n, (r = e.indexOf(">", n)) < 0) return void this.onError(o.UnterminatedElement);
this.onEndElement(e.substring(n, r)), n = r + 1;
break;
case"?":
++n;
var i = this._parseProcessingInstruction(e, n);
if ("?>" !== e.substring(n + i.parsed, n + i.parsed + 2)) return void this.onError(o.UnterminatedXmlDeclaration);
this.onPi(i.name, i.value), n += i.parsed + 2;
break;
case"!":
if ("--" === e.substring(n + 1, n + 3)) {
if ((r = e.indexOf("--\x3e", n + 3)) < 0) return void this.onError(o.UnterminatedComment);
this.onComment(e.substring(n + 3, r)), n = r + 3
} else if ("[CDATA[" === e.substring(n + 1, n + 8)) {
if ((r = e.indexOf("]]>", n + 8)) < 0) return void this.onError(o.UnterminatedCdat);
this.onCdata(e.substring(n + 8, r)), n = r + 3
} else {
if ("DOCTYPE" !== e.substring(n + 1, n + 8)) return void this.onError(o.MalformedElement);
var a = e.indexOf("[", n + 8), s = !1;
if ((r = e.indexOf(">", n + 8)) < 0) return void this.onError(o.UnterminatedDoctypeDeclaration);
if (a > 0 && r > a) {
if ((r = e.indexOf("]>", n + 8)) < 0) return void this.onError(o.UnterminatedDoctypeDeclaration);
s = !0
}
var l = e.substring(n + 8, r + (s ? 1 : 0));
this.onDoctype(l), n = r + (s ? 2 : 1)
}
break;
default:
var c = this._parseContent(e, n);
if (null === c) return void this.onError(o.MalformedElement);
var u = !1;
if ("/>" === e.substring(n + c.parsed, n + c.parsed + 2)) u = !0; else if (">" !== e.substring(n + c.parsed, n + c.parsed + 1)) return void this.onError(o.UnterminatedElement);
this.onBeginElement(c.name, c.attributes, u), n += c.parsed + (u ? 2 : 1)
}
} else {
for (; n < e.length && "<" !== e[n];) n++;
var d = e.substring(t, n);
this.onText(this._resolveEntities(d))
}
t = n
}
}
}, {
key: "onResolveEntity", value: function (e) {
return "&" + e + ";"
}
}, {
key: "onPi", value: function (e, t) {
}
}, {
key: "onComment", value: function (e) {
}
}, {
key: "onCdata", value: function (e) {
}
}, {
key: "onDoctype", value: function (e) {
}
}, {
key: "onText", value: function (e) {
}
}, {
key: "onBeginElement", value: function (e, t, n) {
}
}, {
key: "onEndElement", value: function (e) {
}
}, {
key: "onError", value: function (e) {
}
}]), e
}(), c = function () {
function e(t, n) {
a(this, e), this.nodeName = t, this.nodeValue = n, Object.defineProperty(this, "parentNode", {
value: null,
writable: !0
})
}
return i(e, [{
key: "hasChildNodes", value: function () {
return this.childNodes && this.childNodes.length > 0
}
}, {
key: "firstChild", get: function () {
return this.childNodes[0]
}
}, {
key: "nextSibling", get: function () {
var e = this.parentNode.childNodes.indexOf(this);
return this.parentNode.childNodes[e + 1]
}
}, {
key: "textContent", get: function () {
return this.childNodes ? this.childNodes.map(function (e) {
return e.textContent
}).join("") : this.nodeValue || ""
}
}]), e
}(), u = function (e) {
function t() {
a(this, t);
var e = function (e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
return e._currentFragment = null, e._stack = null, e._errorCode = o.NoError, e
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, l), i(t, [{
key: "parseFromString", value: function (e) {
if (this._currentFragment = [], this._stack = [], this._errorCode = o.NoError, this.parseXml(e), this._errorCode === o.NoError) return {documentElement: r(this._currentFragment, 1)[0]}
}
}, {
key: "onResolveEntity", value: function (e) {
switch (e) {
case"apos":
return "'"
}
return function e(t, n, r) {
null === t && (t = Function.prototype);
var i = Object.getOwnPropertyDescriptor(t, n);
if (void 0 === i) {
var a = Object.getPrototypeOf(t);
return null === a ? void 0 : e(a, n, r)
}
if ("value" in i) return i.value;
var o = i.get;
return void 0 !== o ? o.call(r) : void 0
}(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "onResolveEntity", this).call(this, e)
}
}, {
key: "onText", value: function (e) {
if (!function (e) {
for (var t = 0, n = e.length; t < n; t++) if (!s(e, t)) return !1;
return !0
}(e)) {
var t = new c("#text", e);
this._currentFragment.push(t)
}
}
}, {
key: "onCdata", value: function (e) {
var t = new c("#text", e);
this._currentFragment.push(t)
}
}, {
key: "onBeginElement", value: function (e, t, n) {
var r = new c(e);
r.childNodes = [], this._currentFragment.push(r), n || (this._stack.push(this._currentFragment), this._currentFragment = r.childNodes)
}
}, {
key: "onEndElement", value: function (e) {
this._currentFragment = this._stack.pop();
for (var t = this._currentFragment[this._currentFragment.length - 1], n = 0, r = t.childNodes.length; n < r; n++) t.childNodes[n].parentNode = t
}
}, {
key: "onError", value: function (e) {
this._errorCode = e
}
}]), t
}();
t.SimpleXMLParser = u
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFDataTransportStream = void 0;
var r = n(1), i = function () {
function e(e, t) {
var n = this;
(0, r.assert)(t), this._queuedChunks = [];
var i = e.initialData;
if (i && i.length > 0) {
var a = new Uint8Array(i).buffer;
this._queuedChunks.push(a)
}
this._pdfDataRangeTransport = t, this._isRangeSupported = !e.disableRange, this._isStreamingSupported = !e.disableStream, this._contentLength = e.length, this._fullRequestReader = null, this._rangeReaders = [], this._pdfDataRangeTransport.addRangeListener(function (e, t) {
n._onReceiveData({begin: e, chunk: t})
}), this._pdfDataRangeTransport.addProgressListener(function (e) {
n._onProgress({loaded: e})
}), this._pdfDataRangeTransport.addProgressiveReadListener(function (e) {
n._onReceiveData({chunk: e})
}), this._pdfDataRangeTransport.transportReady()
}
function t(e, t) {
this._stream = e, this._done = !1, this._queuedChunks = t || [], this._requests = [], this._headersReady = Promise.resolve(), e._fullRequestReader = this, this.onProgress = null
}
function n(e, t, n) {
this._stream = e, this._begin = t, this._end = n, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null
}
return e.prototype = {
_onReceiveData: function (e) {
var t = new Uint8Array(e.chunk).buffer;
if (void 0 === e.begin) this._fullRequestReader ? this._fullRequestReader._enqueue(t) : this._queuedChunks.push(t); else {
var n = this._rangeReaders.some(function (n) {
return n._begin === e.begin && (n._enqueue(t), !0)
});
(0, r.assert)(n)
}
}, _onProgress: function (e) {
if (this._rangeReaders.length > 0) {
var t = this._rangeReaders[0];
t.onProgress && t.onProgress({loaded: e.loaded})
}
}, _removeRangeReader: function (e) {
var t = this._rangeReaders.indexOf(e);
t >= 0 && this._rangeReaders.splice(t, 1)
}, getFullReader: function () {
(0, r.assert)(!this._fullRequestReader);
var e = this._queuedChunks;
return this._queuedChunks = null, new t(this, e)
}, getRangeReader: function (e, t) {
var r = new n(this, e, t);
return this._pdfDataRangeTransport.requestDataRange(e, t), this._rangeReaders.push(r), r
}, cancelAllRequests: function (e) {
this._fullRequestReader && this._fullRequestReader.cancel(e), this._rangeReaders.slice(0).forEach(function (t) {
t.cancel(e)
}), this._pdfDataRangeTransport.abort()
}
}, t.prototype = {
_enqueue: function (e) {
this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
value: e,
done: !1
}) : this._queuedChunks.push(e))
}, get headersReady() {
return this._headersReady
}, get isRangeSupported() {
return this._stream._isRangeSupported
}, get isStreamingSupported() {
return this._stream._isStreamingSupported
}, get contentLength() {
return this._stream._contentLength
}, read: function () {
if (this._queuedChunks.length > 0) {
var e = this._queuedChunks.shift();
return Promise.resolve({value: e, done: !1})
}
if (this._done) return Promise.resolve({value: void 0, done: !0});
var t = (0, r.createPromiseCapability)();
return this._requests.push(t), t.promise
}, cancel: function (e) {
this._done = !0, this._requests.forEach(function (e) {
e.resolve({value: void 0, done: !0})
}), this._requests = []
}
}, n.prototype = {
_enqueue: function (e) {
if (!this._done) {
if (0 === this._requests.length) this._queuedChunk = e; else this._requests.shift().resolve({
value: e,
done: !1
}), this._requests.forEach(function (e) {
e.resolve({value: void 0, done: !0})
}), this._requests = [];
this._done = !0, this._stream._removeRangeReader(this)
}
}, get isStreamingSupported() {
return !1
}, read: function () {
if (this._queuedChunk) {
var e = this._queuedChunk;
return this._queuedChunk = null, Promise.resolve({value: e, done: !1})
}
if (this._done) return Promise.resolve({value: void 0, done: !0});
var t = (0, r.createPromiseCapability)();
return this._requests.push(t), t.promise
}, cancel: function (e) {
this._done = !0, this._requests.forEach(function (e) {
e.resolve({value: void 0, done: !0})
}), this._requests = [], this._stream._removeRangeReader(this)
}
}, e
}();
t.PDFDataTransportStream = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFStampSeal = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(57), o = n(58), s = n(39), l = n(5), c = n(152), u = n(41), d = p(n(15)), h = p(n(32));
function p(e) {
return e && e.__esModule ? e : {default: e}
}
var f = u.iWebAssistError.getKeyInfo, m = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.KGPdfViewerWebApp = t, this.userCode = this.KGPdfViewerWebApp.userCode, this.imgTag = this.KGPdfViewerWebApp.imgTag, this.keyPwd = null, this.passwordPrompt = t.getPasswordPrompt(), this.getSealsFromServer = this.getSealsFromServer.bind(this), this.SCSJTT_getFirstSealFromServer = this.SCSJTT_getFirstSealFromServer.bind(this), this.getSealsFromKey_OFD = this.getSealsFromKey_OFD.bind(this), this.getSealsFromKey_PDF = this.getSealsFromKey_PDF.bind(this), this.transparentImg = this.transparentImg.bind(this), this.passwordPromptCallback = this.passwordPromptCallback.bind(this)
}
return i(e, [{
key: "createAddSealPromise", value: function () {
var e = this, t = (0, u.createCapability)(), n = this.KGPdfViewerWebApp, i = n.externalStampSeal,
a = n.externalUnit, o = n.sealOrigin, s = n.certOrigin, c = n.fileType, d = n.stampType, h = n.sealType,
p = n.externalSign, f = n.PDFViewerApplication;
return t.promise.then(function (t) {
var n = t.capability, i = t.sealdata, a = t.captcha;
if ("OFD" === c || 2 == d && "GM" == h) {
var p = function () {
e.KGPdfViewerWebApp.getTipPrompt().open("正在进行签章加盖...");
for (var t = [], r = void 0, c = function (e) {
var n = i[e];
"signature" == n.sealType ? 1 === o && 1 === s ? (r || (r = new u.iWebAssist({cilentType: "0"})), t.push(new Promise(function (e, t) {
r.promise.then(function () {
return r.makeGMV4Data(n)
}).then(function (r) {
r.result ? (n.version = 4, n.sealData = r.res, e(n)) : t(r.errmsg)
}).catch(function (e) {
(0, l.closeOverlay)().then(function () {
window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e)
})
})
}))) : t.push(window.KGPdfViewerWebApp.transformSignatureToGmSeal(n)) : t.push(n)
}, d = 0; d < i.length; d++) c(d);
return {
v: Promise.all(t).then(function (e) {
return Promise.resolve({capability: n, sealdata: e, captcha: a})
}).catch(function (e) {
n.resolve({status: !1}), f.KGAlertPrompt.open(e)
})
}
}();
if ("object" === (void 0 === p ? "undefined" : r(p))) return p.v
}
return Promise.resolve({capability: n, sealdata: i, captcha: a})
}).then(function (t) {
if (t) if (null != i) {
var n = t.sealdata.map(function (e) {
var t = f.pdfViewer.getPageView(Number(e.page) - 1).viewport.viewBox, n = (t[2], t[3]), r = n - e.top,
i = e.left + e.width, o = n - e.top - e.height, s = e.left;
switch (a) {
case"mm":
return e.top = (0, l.pxCovertToMM)(r), e.right = (0, l.pxCovertToMM)(i), e.bottom = (0, l.pxCovertToMM)(o), e.left = (0, l.pxCovertToMM)(s), e.width = (0, l.pxCovertToMM)(e.width), e.height = (0, l.pxCovertToMM)(e.height), e;
case"cm":
return e.top = (0, l.pxCovertToMM)(r) / 10, e.right = (0, l.pxCovertToMM)(i) / 10, e.bottom = (0, l.pxCovertToMM)(o) / 10, e.left = (0, l.pxCovertToMM)(s) / 10, e.width = (0, l.pxCovertToMM)(e.width) / 10, e.height = (0, l.pxCovertToMM)(e.height) / 10, e;
default:
return e.top = r, e.right = i, e.bottom = o, e.left = s, e
}
});
i(t.capability.resolve, n)
} else 1 == s && ("OFD" === c || "PDF" === c && 2 == d || null != p) ? e.KGPdfViewerWebApp.addOFDSeal(t) : (e.sealdata = t.sealdata, e.KGPdfViewerWebApp.addSeal(t, e.sigAndReWriteSigData.bind(e)))
}), t
}
}, {
key: "SCSJTT_getFirstSealFromServer", value: function (e, t) {
var n = this, r = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, i = function () {
var r = {
action: "getSeals",
keySN: window.KGPdfViewerWebApp.userId,
userCode: window.KGPdfViewerWebApp.userCode,
imgTag: window.KGPdfViewerWebApp.imgTag,
sealType: window.KGPdfViewerWebApp.sealType,
appCode: window.KGPdfViewerWebApp.appCode,
sealOrigin: window.KGPdfViewerWebApp.sealOrigin,
certOrigin: window.KGPdfViewerWebApp.certOrigin,
isEncrypt: window.KGPdfViewerWebApp.encryptPWd,
isUkey: window.KGPdfViewerWebApp.isUkey,
disable: !1,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
},
i = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt(e || n.keyPwd) : e || n.keyPwd;
if (window.KGPdfViewerWebApp.useCaptcha || window.KGPdfViewerWebApp.isUkey || window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) {
var o = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt("123456") : "123456";
r.useCaptcha = window.KGPdfViewerWebApp.useCaptcha, r.password = o
} else r.password = i;
a.myaxios.post(n.KGPdfViewerWebApp.getDocTypeUrl(), r).then(function (e) {
e.data.hasOwnProperty("sigWithDifferentCert") && (n.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert = e.data.sigWithDifferentCert), (0, l.closeOverlay)().then(function () {
if (e.data.seals) {
var n = e.data.seals[0];
n.signSN = d.default.stringify(h.default.parse(n.signSN)), t(n)
} else t([])
})
})
};
0 == window.KGPdfViewerWebApp.sealOrigin && 1 == window.KGPdfViewerWebApp.certOrigin && "GM" == window.KGPdfViewerWebApp.sealType ? (0, s.getCert)(this.keyPwd, function (e) {
return window.KGPdfViewerWebApp.cert = e, Promise.resolve()
}, i, function (e) {
(0, l.closeOverlay)().then(function () {
r.open(e || "获取证书失败")
})
}) : i()
}
}, {
key: "getSealsFromServer", value: function (e) {
var t = this, n = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
r = window.KGPdfViewerWebApp.passwordPrompt.pwdConfig, i = r.type, o = r.disable, c = function () {
var r = {
action: "getSeals",
keySN: window.KGPdfViewerWebApp.userId,
userCode: window.KGPdfViewerWebApp.userCode,
imgTag: window.KGPdfViewerWebApp.imgTag,
sealType: window.KGPdfViewerWebApp.sealType,
appCode: window.KGPdfViewerWebApp.appCode,
sealOrigin: window.KGPdfViewerWebApp.sealOrigin,
certOrigin: window.KGPdfViewerWebApp.certOrigin,
isEncrypt: window.KGPdfViewerWebApp.encryptPWd,
isUkey: window.KGPdfViewerWebApp.isUkey,
disable: o,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
if (!o && i && (r.verifyType = i), null != window.KGPdfViewerWebApp.filterSealNames) {
if (!Array.isArray(window.KGPdfViewerWebApp.filterSealNames)) return n.open("印章名称列表filterSealNames格式不正确");
r.filterSealNames = (0, l.unique)(window.KGPdfViewerWebApp.filterSealNames)
}
window.KGPdfViewerWebApp.isUkey && (r.esidList = window.KGPdfViewerWebApp.PDFViewerApplication.KG_UkeyStamp.esidList);
var s = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt(t.keyPwd) : t.keyPwd;
if (window.KGPdfViewerWebApp.useCaptcha || window.KGPdfViewerWebApp.isUkey || window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) {
var c = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt("123456") : "123456";
r.useCaptcha = window.KGPdfViewerWebApp.useCaptcha, r.password = c
} else r.password = s;
a.myaxios.post(t.KGPdfViewerWebApp.getDocTypeUrl(), r).then(function (n) {
n.data.hasOwnProperty("sigWithDifferentCert") && (t.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert = n.data.sigWithDifferentCert), (0, l.closeOverlay)().then(function () {
window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer && n.data.status && n.data.seals.forEach(function (e) {
e.bSignByCalibrary = "1"
}), e(n.data)
})
})
};
0 == window.KGPdfViewerWebApp.sealOrigin && 1 == window.KGPdfViewerWebApp.certOrigin && "GM" == window.KGPdfViewerWebApp.sealType ? (0, s.getCert)(this.keyPwd, function (e) {
return window.KGPdfViewerWebApp.cert = e, Promise.resolve()
}, c, function (e) {
(0, l.closeOverlay)().then(function () {
n.open(e || "获取证书失败")
})
}) : c()
}
}, {
key: "getSealsFromKey_OFD", value: function (e) {
var t = this, n = function (e) {
return a.myaxios.post(t.KGPdfViewerWebApp.getDocTypeUrl(), e)
}, r = function (n, r, i) {
return (0, l.closeOverlay)().then(function () {
t.KGPdfViewerWebApp.keySN = i, t.KGPdfViewerWebApp.cert = r, e(n)
})
}, i = function (t) {
var n = t.message, r = t.defaultMsg;
return (0, l.closeOverlay)().then(function () {
e({status: !1, message: n, defaultMsg: r})
})
};
!0 === this.KGPdfViewerWebApp.useNFSSystem ? (0, o.getNFSSeals)(this.keyPwd, n, r, i) : (0, s.getOfdSeals)(this.keyPwd, n, r, i)
}
}, {
key: "getKeySN_PDF", value: function () {
var e = new u.iWebAssist({clientType: "0"});
return Promise.resolve(e.promise).then(function () {
return e.getKeyInfo()
}).then(function (e) {
if (!e.result) {
var t = e.errmsg || f[e.errcode] || f[e.errmsg] || "未知异常";
return Promise.reject(t)
}
return Promise.resolve(e.keysn)
})
}
}, {
key: "getSealsFromKey_PDF", value: function (e, t) {
var n = this, r = this.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
i = this.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS, o = new u.iWebAssist({clientType: "0"});
t && t.keySN ? Promise.resolve(o.promise).then(function () {
var i = t.keySN;
o.verifyPin(n.keyPwd, i).then(function (o) {
if (!o.result) {
var s = o.errmsg || {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败"
}[o.errcode] || "未知异常";
return n.KGPdfViewerWebApp.getTipPrompt().close(), r.open(s), void window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd()
}
if (null != t.seals && "" != t.seals) {
var l = {
action: "handleCilentSeal",
keySN: i,
unitName: t.orgname,
stampType: n.KGPdfViewerWebApp.stampType,
seals: t.seals
};
a.myaxios.post(n.KGPdfViewerWebApp.getDocTypeUrl(), l).then(function (t) {
e(t.data)
})
} else r.open(f[11])
})
}).finally(function () {
n.KGPdfViewerWebApp.getTipPrompt().close()
}) : Promise.resolve(o.promise).then(function () {
return i ? o.setParamByName("FJRSISPHONE", "0").then(function () {
return o.setParamByName("ISPHONE", "0")
}) : Promise.resolve()
}).then(function () {
return new Promise(function (e, t) {
n.userCode && o.setParamByName("USERCODE", n.userCode), (n.imgTag || "0" == n.imgTag) && o.setParamByName("SIGNTYPE", n.imgTag), e()
})
}).then(function () {
return o.getKeyInfo()
}).then(function (t) {
if (t.result) {
var i = t.usercode, s = t.seals, c = t.keysn, u = void 0;
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs) {
u = o.verifyPin(n.keyPwd, c).then(function (e) {
if (!e.result) {
var t = e.errmsg || {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败"
}[e.errcode] || "未知异常";
return n.KGPdfViewerWebApp.getTipPrompt().close(), r.open(t), void window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd()
}
return Promise.resolve()
});
for (var d = 0, h = s.length; d < h; d++) s[d].usercode = i, s[d].sesealinfo && delete s[d].sesealinfo, s[d].certlist && delete s[d].certlist, s[d].signercert && delete s[d].signercert
} else {
u = Promise.resolve();
for (var p = 0, m = s.length; p < m; p++) s[p].usercode = i, s[p].imgdata = (0, l.parseCilentSealImgData)(s[p].imgdata), s[p].sesealinfo && delete s[p].sesealinfo, s[p].certlist && delete s[p].certlist, s[p].signercert && delete s[p].signercert
}
n.KGPdfViewerWebApp.userId = c, u.then(function () {
if (null != t.seals && "" != t.seals) {
var i = {
action: "handleCilentSeal",
keySN: c,
unitName: t.orgname,
stampType: n.KGPdfViewerWebApp.stampType,
seals: t.seals
};
a.myaxios.post(n.KGPdfViewerWebApp.getDocTypeUrl(), i).then(function (t) {
e(t.data)
})
} else r.open(f[11])
})
} else {
var v = t.errmsg || f[t.errcode] || f[t.errmsg] || "未知异常";
r.open(v)
}
}).finally(function () {
n.KGPdfViewerWebApp.getTipPrompt().close()
})
}
}, {
key: "transparentImg", value: function (e) {
var t = this;
return (0, l.closeOverlay)().then(function () {
return t.KGPdfViewerWebApp.getTipPrompt().open("正在获取印章...")
}).then(function () {
return new Promise(function (t) {
setTimeout(function () {
return t((0, c.transparent)(e.seal.imgdata))
}, 100)
})
}).then(function (e) {
return t.KGPdfViewerWebApp.getTipPrompt().close(), e
}).then(function (t) {
return e.seal.imgdata = t, e.seal.imgExt = "png", e
})
}
}, {
key: "passwordPromptCallback", value: function (e, t, n) {
var r = this;
this.keyPwd = e, 0 == this.KGPdfViewerWebApp.sealOrigin ? 1 == this.KGPdfViewerWebApp.certOrigin && null == this.KGPdfViewerWebApp.externalSign ? Promise.resolve("OFD" == this.KGPdfViewerWebApp.fileType ? (0, s.getKeySN)() : this.getKeySN_PDF()).then(function (e) {
r.KGPdfViewerWebApp.userId = e, r.getSealsFromServer(t)
}).catch(function (e) {
r.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.message)
}) : this.getSealsFromServer(t) : "OFD" === this.KGPdfViewerWebApp.fileType || "PDF" === this.KGPdfViewerWebApp.fileType && 2 == this.KGPdfViewerWebApp.stampType ? this.getSealsFromKey_OFD(t) : this.getSealsFromKey_PDF(t, n)
}
}, {
key: "getSealObjet", value: function (e) {
var t = this, n = this.KGPdfViewerWebApp, r = n.externalGetSeals, i = n.PDFViewerApplication,
a = n.externalUnit, o = n.imageTransparent, s = i.KGAlertPrompt, c = i.KG_FJRS, u = i.KG_ScanStamp,
p = i.pdfStamp, f = i.KG_UkeyStamp, m = i.KG_ScanStamp_V2, v = i.KG_Finger_Print,
g = window.KGPdfViewerWebApp.passwordPrompt.pwdConfig.disable;
return new Promise(function (n) {
"fingerPrint" == e ? v.stamp(n) : "scan_v2" == e ? m.stamp(n) : c && c.config.isScanStamp ? c.handleScanClick(n, t.getSealsFromServer) : u && "scan" === e ? (t.KGPdfViewerWebApp.systemStampMode = e, u.handleScanClick(n)) : !0 === t.KGPdfViewerWebApp.isUkey && "ukey" === e ? f.seals ? n({
status: !0,
seals: f.seals
}) : (t.KGPdfViewerWebApp.systemStampMode = e, t.getSealsFromServer(n)) : g || !0 === t.KGPdfViewerWebApp.useCaptcha ? t.getSealsFromServer(n) : null !== r ? r(n) : window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs && 1 === window.KGPdfViewerWebApp.certOrigin && 1 === window.KGPdfViewerWebApp.sealOrigin ? t.getKeySn().then(function (e) {
t.passwordPrompt.open(!0, "add"), t.passwordPrompt.setUpdateCallback(function (r) {
t.passwordPromptCallback(r, n, e)
})
}) : (t.passwordPrompt.open(!0, "add"), t.passwordPrompt.setUpdateCallback(function (e) {
t.passwordPromptCallback(e, n)
}))
}).then(function (n) {
return new Promise(function (i, c) {
if (n.status) if (t.passwordPrompt.remember(), null != r && (n.seals = n.seals.map(function (e) {
switch (a) {
case"mm":
return e.width = (0, l.mmCovertToPx)(e.width), e.height = (0, l.mmCovertToPx)(e.height), e;
case"cm":
return e.width = (0, l.mmCovertToPx)(10 * e.width), e.height = (0, l.mmCovertToPx)(10 * e.height), e;
default:
return e
}
})), null != r && 1 == n.seals.length) {
var u = {seal: n.seals[0]};
p.setSealData(u), i(u)
} else {
var f = t.KGPdfViewerWebApp.getSelectSealPrompt();
if (n.seals = t.filterSeals(n.seals), !n.seals.length && !t.KGPdfViewerWebApp.unifySealPlatformV2) {
return s.open("没有可用的印章!")
}
new Promise(function (r) {
if ((0, l.functionalJudgment)("secretSeal") && "secret" == e) {
for (var i = void 0, a = 0; a < n.seals.length && (i = n.seals[a]).hasOwnProperty("sealtag"); a++) ;
var o = document.createElement("canvas"), c = o.getContext("2d"), u = new Image;
u.src = t.KGPdfViewerWebApp.secretSealImg, u.onload = function () {
i.width = o.width = 72 * this.width / 96, i.height = o.height = 72 * this.height / 96, c.drawImage(u, 0, 0, i.width, i.height);
var e = o.toDataURL();
i.imgdata = e, i.imgExt = "png", i.isSecretSeal = !0, i.signSN = d.default.stringify(h.default.parse(i.signSN)), f.setSeals([i]), r()
}, u.onerror = function () {
s.open("加载暗章图片失败!")
}
} else {
var p = n.seals.map(function (e) {
return e.signSN = d.default.stringify(h.default.parse(e.signSN)), e
});
f.setSeals(p), r()
}
}).then(function () {
f.setUpdateCallback(function (e) {
var n = e.seal, r = {
isContinuityStampCheck: e.isContinuityStampCheck,
continuityRange: e.continuityRange,
isStampOfQfz: e.isStampOfQfz
};
!0 === o ? (r.seal = n, t.transparentImg(r).then(function (e) {
p.setSealData(e), i(e)
})) : (r.seal = n, p.setSealData(r), i(r))
}), (0, l.closeOverlay)().then(setTimeout(function () {
switch (p.stampSealType) {
case"default":
f.open();
break;
case"singleSeal":
f.singleSealNoSelectSealPrompt();
break;
case"pagingSeal":
f.pagingSealNoSelectSealPrompt(n.seals[0]);
break;
case"continuitySeal":
f.continuitySealNoSelectSealPrompt()
}
}, 50))
})
} else {
if (n.message && "密码错误" == n.message || n.defaultMsg && "密钥盘密码错误" == n.defaultMsg) window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), s.closeCallback = function () {
t.getSealObjet(e)
};
s.open(n.message || "获取印章失败")
}
})
})
}
}, {
key: "getKeySn", value: function () {
var e = this, t = this.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
n = this.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS, r = new u.iWebAssist({clientType: "0"});
return Promise.resolve(r.promise).then(function () {
return n ? r.setParamByName("FJRSISPHONE", "0").then(function () {
return r.setParamByName("ISPHONE", "0")
}) : Promise.resolve()
}).then(function () {
return new Promise(function (t, n) {
e.userCode && r.setParamByName("USERCODE", e.userCode), (e.imgTag || "0" == e.imgTag) && r.setParamByName("SIGNTYPE", e.imgTag), t()
})
}).then(function () {
return r.getKeyInfo()
}).then(function (r) {
if (r.result) {
for (var i = r.usercode, a = r.seals, o = r.keysn, s = 0, c = a.length; s < c; s++) a[s].usercode = i, n || (a[s].imgdata = (0, l.parseCilentSealImgData)(a[s].imgdata)), a[s].sesealinfo && delete a[s].sesealinfo, a[s].certlist && delete a[s].certlist, a[s].signercert && delete a[s].signercert;
return e.KGPdfViewerWebApp.userId = o, {
keySN: o,
seals: a,
orgname: r.orgname,
phoneshield: r.phoneshield,
result: r.result,
servertime: r.servertime,
sinopec: r.sinopec,
usercode: r.usercode
}
}
var u = r.errmsg || f[r.errcode] || f[r.errmsg] || "未知异常";
t.open(u)
}).finally(function () {
e.KGPdfViewerWebApp.getTipPrompt().close()
})
}
}, {
key: "sigAndReWriteSigData", value: function (e, t) {
var n = this.KGPdfViewerWebApp, r = n.stampType, i = n.userId, a = n.iWebAuth, o = this.keyPwd, s = this;
if (1 == r) if (a.scan || a.uKey) {
var l = window.KGPdfViewerWebApp.PDFViewerApplication.KG_IWebAuth, c = e[0].needSigMessage;
l.sign(c).then(function (n) {
var r = n.sigData, i = n.cert;
e[0].sigData = r, s.KGPdfViewerWebApp.reWriteSigData(e, i, t)
})
} else {
var p = new u.iWebAssist({clientType: "0"});
Promise.all([p.promise]).then(function () {
return p.getCspName()
}).then(function (n) {
var r = e;
(0, u.cryptAPISig)(n, o, r).then(function (e) {
if (e.result) {
var n = e.message.sigedData, r = e.message.cert;
s.KGPdfViewerWebApp.reWriteSigData(n, r, t)
} else s.KGPdfViewerWebApp.sigError(), e.message ? s.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.message) : e.warnning && s.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.warnning)
})
})
} else if (2 === r) ; else if (null != window.KGPdfViewerWebApp.externalSign) ; else if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.p7Sign(e); else {
var f = new u.iWebAssist({clientType: "0"});
Promise.all([f.promise]).then(function () {
var n = (0, u.createCapability)(), r = e;
!function e(t, a) {
if (t >= r.length) n.resolve({ret: !0, 0: r, 1: a}); else {
var l = r[t], c = l.sealtag;
Promise.resolve().then(function () {
if ("GB" === c) {
var e = void 0;
return f.setParamByName("CLEARGBSESEALINFO", "").then(function () {
return f.getKeyInfo()
}).then(function (t) {
return e = t.seals[0], f.setParamByName("GBSESEALINFO", e.sesealinfo)
}).then(function () {
return f.setParamByName("GBSIGNSN", e.signsn)
})
}
if ("GM" === c) {
var t = s.sealdata.filter(function (e) {
return "GM" === e.sealtag
})[0].signSN;
return f.setParamByName("ISGM", "1").then(function () {
return f.setParamByName("SIGNSN", d.default.parse(t).toString())
})
}
return Promise.resolve()
}).then(function () {
var e = s.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS;
return e ? e.config.isScanStamp ? f.setParamByName("FJRSTOKEN", e.token) : f.setParamByName("FJRSTOKEN", "undefined") : Promise.resolve()
}).then(function () {
return f.setParamByName("KEYSN", i)
}).then(function () {
f.sig_pkcs7(o, l.needSigMessage).then(function (r) {
r.result ? (l.certSignMsg = d.default.stringify(h.default.parse(r.signeddata)), void 0 === a && (a = r.certinfo.crtdata), e(t + 1, a)) : n.resolve({
ret: !1,
msg: r.errmsg || {
"-1": "未安装签名组件",
"-12": "获取证书失败",
"-13": "签名时,加载证书失败",
"-15": "签名数据不能为空",
"-16": "密码不能为空",
"-17": "解析证书失败",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key"
}[r.errcode]
})
})
}).then(function () {
"GB" === c && (f.setParamByName("GBSESEALINFO", ""), f.setParamByName("GBSIGNSN", ""))
})
}
}(0), n.promise.then(function (e) {
if (e.ret) {
var n = e[0], r = e[1], i = n;
s.KGPdfViewerWebApp.reWriteSigData(i, r, t)
} else s.KGPdfViewerWebApp.sigError(), s.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.msg)
})
})
}
}
}, {
key: "filterSeals", value: function (e) {
var t = window.KGPdfViewerWebApp.filterSealNames;
if (!t) return e;
if (Array.isArray(t)) {
var n = Array.from(new Set(t));
return e = e.filter(function (e) {
return -1 !== n.indexOf(e.signName)
})
}
}
}]), e
}();
t.PDFStampSeal = m
}, function (e, t, n) {
"use strict";
var r, i, a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
!function (o) {
var s;
if (n(150) && (void 0 !== (i = "function" == typeof (r = o) ? r.call(t, n, t, e) : r) && (e.exports = i), s = !0), "object" == a(t) && (e.exports = o(), s = !0), !s) {
var l = window.Cookies, c = window.Cookies = o();
c.noConflict = function () {
return window.Cookies = l, c
}
}
}(function () {
function e() {
for (var e = 0, t = {}; e < arguments.length; e++) {
var n = arguments[e];
for (var r in n) t[r] = n[r]
}
return t
}
function t(e) {
return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent)
}
return function n(r) {
function i() {
}
function a(t, n, a) {
if ("undefined" != typeof document) {
"number" == typeof (a = e({path: "/"}, i.defaults, a)).expires && (a.expires = new Date(1 * new Date + 864e5 * a.expires)), a.expires = a.expires ? a.expires.toUTCString() : "";
try {
var o = JSON.stringify(n);
/^[\{\[]/.test(o) && (n = o)
} catch (e) {
}
n = r.write ? r.write(n, t) : encodeURIComponent(n + "").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), t = encodeURIComponent(t + "").replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
var s = "";
for (var l in a) a[l] && (s += "; " + l, !0 !== a[l] && (s += "=" + a[l].split(";")[0]));
return document.cookie = t + "=" + n + s
}
}
function o(e, n) {
if ("undefined" != typeof document) {
for (var i = {}, a = document.cookie ? document.cookie.split("; ") : [], o = 0; o < a.length; o++) {
var s = a[o].split("="), l = s.slice(1).join("=");
n || '"' !== l.charAt(0) || (l = l.slice(1, -1));
try {
var c = t(s[0]);
if (l = (r.read || r)(l, c) || t(l), n) try {
l = JSON.parse(l)
} catch (e) {
}
if (i[c] = l, e === c) break
} catch (e) {
}
}
return e ? i[e] : i
}
}
return i.set = a, i.get = function (e) {
return o(e, !1)
}, i.getJSON = function (e) {
return o(e, !0)
}, i.remove = function (t, n) {
a(t, "", e(n, {expires: -1}))
}, i.defaults = {}, i.withConverter = n, i
}(function () {
})
})
}, function (e, t) {
(function (t) {
e.exports = t
}).call(t, {})
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r, i, a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
r = window, i = function () {
return function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {exports: {}, id: r, loaded: !1};
return e[r].call(i.exports, i, i.exports, n), i.loaded = !0, i.exports
}
return n.m = e, n.c = t, n.p = "", n(0)
}([function (e, t, n) {
e.exports = n(1)
}, function (e, t, n) {
var r = n(2), i = n(3), a = n(5), o = n(6);
function s(e) {
var t = new a(e), n = i(a.prototype.request, t);
return r.extend(n, a.prototype, t), r.extend(n, t), n
}
var l = s(o);
l.Axios = a, l.create = function (e) {
return s(r.merge(o, e))
}, l.Cancel = n(23), l.CancelToken = n(24), l.isCancel = n(20), l.all = function (e) {
return Promise.all(e)
}, l.spread = n(25), e.exports = l, e.exports.default = l
}, function (e, t, n) {
var r = n(3), i = n(4), o = Object.prototype.toString;
function s(e) {
return "[object Array]" === o.call(e)
}
function l(e) {
return null !== e && "object" === (void 0 === e ? "undefined" : a(e))
}
function c(e) {
return "[object Function]" === o.call(e)
}
function u(e, t) {
if (null !== e && void 0 !== e) if ("object" === (void 0 === e ? "undefined" : a(e)) || s(e) || (e = [e]), s(e)) for (var n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e); else for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.call(null, e[i], i, e)
}
e.exports = {
isArray: s, isArrayBuffer: function (e) {
return "[object ArrayBuffer]" === o.call(e)
}, isBuffer: i, isFormData: function (e) {
return "undefined" != typeof FormData && e instanceof FormData
}, isArrayBufferView: function (e) {
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer
}, isString: function (e) {
return "string" == typeof e
}, isNumber: function (e) {
return "number" == typeof e
}, isObject: l, isUndefined: function (e) {
return void 0 === e
}, isDate: function (e) {
return "[object Date]" === o.call(e)
}, isFile: function (e) {
return "[object File]" === o.call(e)
}, isBlob: function (e) {
return "[object Blob]" === o.call(e)
}, isFunction: c, isStream: function (e) {
return l(e) && c(e.pipe)
}, isURLSearchParams: function (e) {
return "undefined" != typeof URLSearchParams && e instanceof URLSearchParams
}, isStandardBrowserEnv: function () {
return ("undefined" == typeof navigator || "ReactNative" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document
}, forEach: u, merge: function e() {
var t = {};
function n(n, r) {
"object" === a(t[r]) && "object" === (void 0 === n ? "undefined" : a(n)) ? t[r] = e(t[r], n) : t[r] = n
}
for (var r = 0, i = arguments.length; r < i; r++) u(arguments[r], n);
return t
}, extend: function (e, t, n) {
return u(t, function (t, i) {
e[i] = n && "function" == typeof t ? r(t, n) : t
}), e
}, trim: function (e) {
return e.replace(/^\s*/, "").replace(/\s*$/, "")
}
}
}, function (e, t) {
e.exports = function (e, t) {
return function () {
for (var n = new Array(arguments.length), r = 0; r < n.length; r++) n[r] = arguments[r];
return e.apply(t, n)
}
}
}, function (e, t) {
function n(e) {
return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
}
e.exports = function (e) {
return null != e && (n(e) || function (e) {
return "function" == typeof e.readFloatLE && "function" == typeof e.slice && n(e.slice(0, 0))
}(e) || !!e._isBuffer)
}
}, function (e, t, n) {
var r = n(6), i = n(2), a = n(17), o = n(18);
function s(e) {
this.defaults = e, this.interceptors = {request: new a, response: new a}
}
s.prototype.request = function (e) {
"string" == typeof e && (e = i.merge({url: arguments[0]}, arguments[1])), (e = i.merge(r, this.defaults, {method: "get"}, e)).method = e.method.toLowerCase();
var t = [o, void 0], n = Promise.resolve(e);
for (this.interceptors.request.forEach(function (e) {
t.unshift(e.fulfilled, e.rejected)
}), this.interceptors.response.forEach(function (e) {
t.push(e.fulfilled, e.rejected)
}); t.length;) n = n.then(t.shift(), t.shift());
return n
}, i.forEach(["delete", "get", "head", "options"], function (e) {
s.prototype[e] = function (t, n) {
return this.request(i.merge(n || {}, {method: e, url: t}))
}
}), i.forEach(["post", "put", "patch"], function (e) {
s.prototype[e] = function (t, n, r) {
return this.request(i.merge(r || {}, {method: e, url: t, data: n}))
}
}), e.exports = s
}, function (e, t, n) {
var r = n(2), i = n(7), a = {"Content-Type": "application/x-www-form-urlencoded"};
function o(e, t) {
!r.isUndefined(e) && r.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t)
}
var s, l = {
adapter: ("undefined" != typeof XMLHttpRequest ? s = n(8) : "undefined" != typeof process && (s = n(8)), s),
transformRequest: [function (e, t) {
if (i(t, "Content-Type"), r.isFormData(e) || r.isArrayBuffer(e) || r.isBuffer(e) || r.isStream(e) || r.isFile(e) || r.isBlob(e)) return e;
if (r.isArrayBufferView(e)) return e.buffer;
if (r.isURLSearchParams(e)) return o(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString();
if (r.isObject(e)) {
if ("application/json" === t["Content-Type"]) return o(t, "application/json;charset=utf-8"), JSON.stringify(e);
o(t, "application/x-www-form-urlencoded;charset=utf-8");
var n = new Array;
for (var a in e) n.push(a + "=" + encodeURI(e[a]));
return n.join("&")
}
return e
}],
transformResponse: [function (e) {
if ("string" == typeof e) try {
e = JSON.parse(e)
} catch (e) {
}
return e
}],
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
validateStatus: function (e) {
return e >= 200 && e < 300
}
};
l.headers = {common: {Accept: "application/json, text/plain, */*"}}, r.forEach(["delete", "get", "head"], function (e) {
l.headers[e] = {}
}), r.forEach(["post", "put", "patch"], function (e) {
l.headers[e] = r.merge(a)
}), e.exports = l
}, function (e, t, n) {
var r = n(2);
e.exports = function (e, t) {
r.forEach(e, function (n, r) {
r !== t && r.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[r])
})
}
}, function (e, t, n) {
var r = n(2), i = n(9), a = n(12), o = n(13), s = n(14), l = n(10),
c = "undefined" != typeof window && window.btoa && window.btoa.bind(window) || n(15);
e.exports = function (e) {
return new Promise(function (t, u) {
var d = e.data, h = e.headers;
r.isFormData(d) && delete h["Content-Type"];
var p = new XMLHttpRequest, f = "onreadystatechange", m = !1;
if (window.XMLHttpRequest || "undefined" == typeof window || !window.XDomainRequest || "withCredentials" in p || s(e.url) || (p = new window.XDomainRequest, f = "onload", m = !0, p.onprogress = function () {
}, p.ontimeout = function () {
}), e.auth) {
var v = e.auth.username || "", g = e.auth.password || "";
h.Authorization = "Basic " + c(v + ":" + g)
}
if (p.open(e.method.toUpperCase(), a(e.url, e.params, e.paramsSerializer), !0), p.timeout = e.timeout, p[f] = function () {
if (p && (4 === p.readyState || m) && (0 !== p.status || p.responseURL && 0 === p.responseURL.indexOf("file:"))) {
var n = "getAllResponseHeaders" in p ? o(p.getAllResponseHeaders()) : null, r = {
data: e.responseType && "text" !== e.responseType ? p.response : p.responseText,
status: 1223 === p.status ? 204 : p.status,
statusText: 1223 === p.status ? "No Content" : p.statusText,
headers: n,
config: e,
request: p
};
i(t, u, r), p = null
}
}, p.onerror = function () {
u(l("Network Error", e, null, p)), p = null
}, p.ontimeout = function () {
u(l("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", p)), p = null
}, r.isStandardBrowserEnv()) {
var y = n(16),
b = (e.withCredentials || s(e.url)) && e.xsrfCookieName ? y.read(e.xsrfCookieName) : void 0;
b && (h[e.xsrfHeaderName] = b)
}
if ("setRequestHeader" in p && r.forEach(h, function (e, t) {
void 0 === d && "content-type" === t.toLowerCase() ? delete h[t] : p.setRequestHeader(t, e)
}), e.withCredentials && (p.withCredentials = !0), e.responseType) try {
p.responseType = e.responseType
} catch (t) {
if ("json" !== e.responseType) throw t
}
"function" == typeof e.onDownloadProgress && p.addEventListener("progress", e.onDownloadProgress), "function" == typeof e.onUploadProgress && p.upload && p.upload.addEventListener("progress", e.onUploadProgress), e.cancelToken && e.cancelToken.promise.then(function (e) {
p && (p.abort(), u(e), p = null)
}), void 0 === d && (d = null), p.send(d)
})
}
}, function (e, t, n) {
var r = n(10);
e.exports = function (e, t, n) {
var i = n.config.validateStatus;
n.status && i && !i(n.status) ? t(r("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n)
}
}, function (e, t, n) {
var r = n(11);
e.exports = function (e, t, n, i, a) {
var o = new Error(e);
return r(o, t, n, i, a)
}
}, function (e, t) {
e.exports = function (e, t, n, r, i) {
return e.config = t, n && (e.code = n), e.request = r, e.response = i, e
}
}, function (e, t, n) {
var r = n(2);
function i(e) {
return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]")
}
e.exports = function (e, t, n) {
if (!t) return e;
var a;
if (n) a = n(t); else if (r.isURLSearchParams(t)) a = t.toString(); else {
var o = [];
r.forEach(t, function (e, t) {
null !== e && void 0 !== e && (r.isArray(e) && (t += "[]"), r.isArray(e) || (e = [e]), r.forEach(e, function (e) {
r.isDate(e) ? e = e.toISOString() : r.isObject(e) && (e = JSON.stringify(e)), o.push(i(t) + "=" + i(e))
}))
}), a = o.join("&")
}
return a && (e += (-1 === e.indexOf("?") ? "?" : "&") + a), e
}
}, function (e, t, n) {
var r = n(2),
i = ["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"];
e.exports = function (e) {
var t, n, a, o = {};
return e ? (r.forEach(e.split("\n"), function (e) {
if (a = e.indexOf(":"), t = r.trim(e.substr(0, a)).toLowerCase(), n = r.trim(e.substr(a + 1)), t) {
if (o[t] && i.indexOf(t) >= 0) return;
o[t] = "set-cookie" === t ? (o[t] ? o[t] : []).concat([n]) : o[t] ? o[t] + ", " + n : n
}
}), o) : o
}
}, function (e, t, n) {
var r = n(2);
e.exports = r.isStandardBrowserEnv() ? function () {
var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
function i(e) {
var r = e;
return t && (n.setAttribute("href", r), r = n.href), n.setAttribute("href", r), {
href: n.href,
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
host: n.host,
search: n.search ? n.search.replace(/^\?/, "") : "",
hash: n.hash ? n.hash.replace(/^#/, "") : "",
hostname: n.hostname,
port: n.port,
pathname: "/" === n.pathname.charAt(0) ? n.pathname : "/" + n.pathname
}
}
return e = i(window.location.href), function (t) {
var n = r.isString(t) ? i(t) : t;
return n.protocol === e.protocol && n.host === e.host
}
}() : function () {
return !0
}
}, function (e, t) {
var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function r() {
this.message = "String contains an invalid character"
}
r.prototype = new Error, r.prototype.code = 5, r.prototype.name = "InvalidCharacterError", e.exports = function (e) {
for (var t, i, a = String(e), o = "", s = 0, l = n; a.charAt(0 | s) || (l = "=", s % 1); o += l.charAt(63 & t >> 8 - s % 1 * 8)) {
if ((i = a.charCodeAt(s += .75)) > 255) throw new r;
t = t << 8 | i
}
return o
}
}, function (e, t, n) {
var r = n(2);
e.exports = r.isStandardBrowserEnv() ? {
write: function (e, t, n, i, a, o) {
var s = [];
s.push(e + "=" + encodeURIComponent(t)), r.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), r.isString(i) && s.push("path=" + i), r.isString(a) && s.push("domain=" + a), !0 === o && s.push("secure"), document.cookie = s.join("; ")
}, read: function (e) {
var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : null
}, remove: function (e) {
this.write(e, "", Date.now() - 864e5)
}
} : {
write: function () {
}, read: function () {
return null
}, remove: function () {
}
}
}, function (e, t, n) {
var r = n(2);
function i() {
this.handlers = []
}
i.prototype.use = function (e, t) {
return this.handlers.push({fulfilled: e, rejected: t}), this.handlers.length - 1
}, i.prototype.eject = function (e) {
this.handlers[e] && (this.handlers[e] = null)
}, i.prototype.forEach = function (e) {
r.forEach(this.handlers, function (t) {
null !== t && e(t)
})
}, e.exports = i
}, function (e, t, n) {
var r = n(2), i = n(19), a = n(20), o = n(6), s = n(21), l = n(22);
function c(e) {
e.cancelToken && e.cancelToken.throwIfRequested()
}
e.exports = function (e) {
return c(e), e.baseURL && !s(e.url) && (e.url = l(e.baseURL, e.url)), e.headers = e.headers || {}, e.data = i(e.data, e.headers, e.transformRequest), e.headers = r.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers || {}), r.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (t) {
delete e.headers[t]
}), (e.adapter || o.adapter)(e).then(function (t) {
return c(e), t.data = i(t.data, t.headers, e.transformResponse), t
}, function (t) {
return a(t) || (c(e), t && t.response && (t.response.data = i(t.response.data, t.response.headers, e.transformResponse))), Promise.reject(t)
})
}
}, function (e, t, n) {
var r = n(2);
e.exports = function (e, t, n) {
return r.forEach(n, function (n) {
e = n(e, t)
}), e
}
}, function (e, t) {
e.exports = function (e) {
return !(!e || !e.__CANCEL__)
}
}, function (e, t) {
e.exports = function (e) {
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)
}
}, function (e, t) {
e.exports = function (e, t) {
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
}
}, function (e, t) {
function n(e) {
this.message = e
}
n.prototype.toString = function () {
return "Cancel" + (this.message ? ": " + this.message : "")
}, n.prototype.__CANCEL__ = !0, e.exports = n
}, function (e, t, n) {
var r = n(23);
function i(e) {
if ("function" != typeof e) throw new TypeError("executor must be a function.");
var t;
this.promise = new Promise(function (e) {
t = e
});
var n = this;
e(function (e) {
n.reason || (n.reason = new r(e), t(n.reason))
})
}
i.prototype.throwIfRequested = function () {
if (this.reason) throw this.reason
}, i.source = function () {
var e;
return {
token: new i(function (t) {
e = t
}), cancel: e
}
}, e.exports = i
}, function (e, t) {
e.exports = function (e) {
return function (t) {
return e.apply(null, t)
}
}
}])
}, r.axios = i(), t.axios = axios
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.transparent = function (e) {
var t = document.createElement("canvas"), n = t.getContext("2d"), r = new Image, i = null,
a = new Promise(function (e) {
i = e
});
return r.onload = function () {
t.width = this.width, t.height = this.height, n.drawImage(r, 0, 0, this.width, this.height);
for (var a = n.getImageData(0, 0, 1, 1).data, o = n.getImageData(0, this.height - 1, 1, 1).data, s = (n.getImageData(this.width - 1, this.height - 1, 1, 1).data, n.getImageData(this.width - 1, 0, 1, 1).data), l = [a, o, s, s], c = !0, u = 0; u < l.length; u++) {
var d = l[u];
if (!(d[0] > 225 && d[1] > 225 && d[2] > 225 && d[3] > 225)) {
c = !1;
break
}
}
if (c) {
for (var h = 0; h < this.width; h++) for (var p = 0; p < this.height; p++) {
var f = n.getImageData(h, p, 1, 1), m = f.data;
m[0] > 225 && m[1] > 225 && m[2] > 225 && m[3] > 225 && (f.data[0] = 0, f.data[1] = 0, f.data[2] = 0, f.data[3] = 0, n.putImageData(f, h, p))
}
i(t.toDataURL())
} else i(e)
}, r.src = e, a
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.cryptAPICtrl = t.cryptAPISig = void 0;
var r = n(40), i = function () {
this.kg = new r.KG("KG_Crypt_COM_API.CryptAPICtrl.1", "FD5FA7DB-CBF7-4804-8147DE5A56CC8ADF"), this.promise = this.kg.init()
};
i.prototype = {
getCert: function (e) {
var t = this.kg, n = (0, r.createCapability)(), i = this;
return this.getCtnArray(e).then(function (r) {
i.begin(e).then(function (e) {
return t.invoke("KGCryptExportKey", 6, 1, 0)
}).then(function (e) {
t.invoke("KGCryptDestroyKey").then(function () {
return t.invoke("KGCryptFinalize", 0)
}).then(function () {
n.resolve(e)
})
})
}), n.promise
}, begin: function (e) {
var t = this.kg, n = (0, r.createCapability)();
return this.getCtnArray(e).then(function (n) {
return t.invoke("KGCryptInitialize", e, n[0], 1, 0)
}).then(function () {
return t.invoke("KGCryptGetUserKey", 2)
}).then(function (e) {
0 == e ? n.resolve(2) : t.invoke("KGCryptGetUserKey", 1).then(function (e) {
0 == e ? n.resolve(1) : n.resolve(-1)
})
}), n.promise
}, sig: function (e, t) {
var n = this.kg, i = (0, r.createCapability)();
return n.invoke("KGCryptCreateHash", 32772).then(function () {
return n.invoke("KGCryptSetHashValue", t, t.length)
}).then(function () {
return n.time = 45e3, n.invoke("KGCryptSignHash", e, 0)
}).then(function (e) {
n.invoke("KGCryptDestroyHash").then(function () {
"none" === e ? i.reject() : i.resolve(e)
})
}), i.promise
}, exportCert: function () {
return this.kg.invoke("KGCryptExportKey", 0, 1, 0)
}, end: function () {
var e = this.kg, t = (0, r.createCapability)();
return e.invoke("KGCryptFinalize", 0).then(function () {
t.resolve(0)
}), t.promise
}, setKeyPwd: function (e) {
void 0 === e && (e = "");
var t = function (e) {
for (var t = "", n = 0; n < e.length; n++) t += e.charCodeAt(n).toString(16);
return t
}(e) + "00";
return this.kg.invoke("KGCryptSetPin", t, t.length, 32)
}, getCtnArray: function (e) {
var t = this.kg, n = this, i = (0, r.createCapability)();
return t.invoke("KGCryptInitialize", e, "", 1, -268435424).then(function () {
return t.invoke("KGCryptGetContainers", 0)
}).then(function (e) {
t.invoke("KGCryptFinalize", 0).then(function () {
n.end().then(function () {
i.resolve(e.split("$n"))
})
})
}), i.promise
}
};
t.cryptAPISig = function (e, t, n) {
var a = new i, o = (0, r.createCapability)(), s = {result: !1};
return Promise.all([a.promise]).then(function () {
return a.begin(e)
}).then(function (e) {
if (o.promise.then(function () {
a.end()
}, function () {
a.end()
}), -1 == e) return s.message = "请插入密钥盘或者密钥盘中不存在证书!", void o.resolve(s);
(null == t ? Promise.resolve(0) : a.setKeyPwd(t)).then(function (t) {
if (0 != t) return s.message = "密钥盘密码错误或密钥盘被锁!", void o.resolve(s);
a.exportCert().then(function (t) {
if ("none" == t) return s.message = "获取签名证书失败!", void o.resolve(s);
var i = (0, r.createCapability)();
!function t(n, r) {
var l = n[r];
a.sig(e, l.needSigMessage).then(function (e) {
if (l.sigData = e, !l.sigData) return s.message = "签名失败!", void o.resolve(s);
r == n.length - 1 ? i.resolve(n) : t(n, r + 1)
}, function () {
s.warnning = "签名失败!", o.resolve(s)
})
}(n, 0), i.promise.then(function (e) {
s.result = !0, s.message = {cert: t, sigedData: e}, o.resolve(s)
})
})
})
}), o.promise
}, t.cryptAPICtrl = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KGPdfViewerWebApp = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = n(23), a = n(57), o = n(58), s = n(39), l = n(155), c = S(n(159)), u = n(160), d = n(24), h = n(161),
p = n(162), f = n(163), m = n(5), v = n(93), g = S(n(15)), y = S(n(32)), b = S(n(88)), w = S(n(2));
function S(e) {
return e && e.__esModule ? e : {default: e}
}
var _ = "#$~%kinggrid%~$#", k = {
PDFViewerApplication: null,
adaptContainer: [],
passwordPrompt: null,
selectSealPrompt: null,
alertPrompt: null,
tipPrompt: null,
confirmOverlay: null,
url: null,
documentId: null,
fileType: "PDF",
cert: null,
userId: null,
userCode: null,
imgTag: null,
softType: 0,
sealOrigin: 0,
sealType: "PT",
certOrigin: 0,
stampType: 0,
imageTransparent: !1,
capability: null,
mobile: 0,
pdfPwd: "",
needTipFileSize: 1536,
readOnly: !1,
multipleStamp: !0,
hideDeleteNode: !1,
allowFollow: !1,
additionText: !0,
additionTextConfig: {},
additionTextDefaultConfig: {
presetTexts: [],
color: "000",
fontSize: 18,
timeFontSize: 18,
maxLength: 200,
font: "宋体",
textPosition: "right_bottom",
timePosition: "right_bottom",
timeFormat: "YYYY年MM月DD日",
loaction: "fixed",
percentY: 50,
defaultText: "",
isSelect: !1
},
useCaptcha: !1,
pagingSeal: !0,
textToSeal: !1,
textToSealDefault: {
textToSealText: "中共北京市委转文",
indicateSealText: "领导",
textToSealNum: "123456",
indicateSealNum: "1234",
color: "#2c2cff",
visibleType: "MarkHandwrite",
textToSealType: "textToSeal",
indicateSealType: "indicateSeal",
invariantSealType: "invariantSeal",
invariantSealImgPath: "./images/yfs.png"
},
annotation: !1,
annotationDefaultConfig: {
mode: "text",
height: 360,
width: 720,
minHeight: 200,
minWidth: 640,
font: "宋体",
size: "24",
color: "black",
line: "5",
callback: null,
wrapSize: null,
editable: !0,
extend: null,
annotationSuccess: null,
annotationQueueSuccess: null
},
annotationConfig: {},
openAnnotationPanel: function () {
return window.KGPdfViewerWebApp.PDFViewerApplication.KG_Annotation.show()
},
annotationVisibleType: null,
disableSignaturePad: !1,
clientCode: "",
clientErrorConfig: [],
prepareStamp: null,
indicateSeal: !1,
indicateSealDefaultConfig: {authorName: null, name: "领导", number: "", color: "#088ED7"},
indicateSealConfig: {},
indicateSealSuccess: function (e) {
},
textToSealCb: function () {
},
exportKGAnnotations: function (e) {
console.log(e)
},
exportKGAnnotationList: function () {
var e = this.PDFViewerApplication.kgAnnotationViewer, t = e.annotationList, n = e.formatSealsData(), r = void 0;
return null != this.annotationVisibleType ? r = this.annotationVisibleType : this.textToSealDefault.visibleType && (r = this.textToSealDefault.visibleType), r ? t.concat(n).filter(function (e) {
try {
var t = JSON.parse(e.annotInfo);
return !(!t || !t.hasOwnProperty("customType")) && t.customType.toString() === r
} catch (e) {
return !1
}
}).sort(function (e, t) {
return Number(e.page || e.pageNo) - Number(t.page || t.pageNo)
}) : []
},
navigateToKGAnnotation: function (e, t, n) {
var r = this.PDFViewerApplication.pdfViewer, a = r.getPageView(Number(e) - 1), o = a.viewport.viewBox[3],
s = [{num: e, gen: 0}, {name: "XYZ"}, t, o - n, 0];
r.scrollPageIntoView({pageNumber: e, destArray: s}), a.onAfterDraw = function () {
for (var e = a.annotationLayer.div.getElementsByTagName("section"), r = void 0, i = 0; i < e.length; i++) {
var o = Math.round((0, d.getNumbOfPx)(e[i].style.left)), s = Math.round((0, d.getNumbOfPx)(e[i].style.top));
if (o >= Math.round(t) - 3 && o <= Math.round(t) + 3 && s >= Math.round(n) - 3 && s <= Math.round(n) + 3) {
r = e[i];
break
}
}
r && (0, l.setBorder)(r), a.onAfterDraw = null
}, a.destroy(), a.renderingState = i.RenderingStates.INITIAL, a.draw()
},
exportKGBookmarks: function () {
var e = this.PDFViewerApplication.pdfOutlineViewer.outline, t = [];
return null != e && function e(t) {
for (var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], r = 0; r < t.length; r++) n[r] = {}, n[r].title = t[r].title, n[r].data = JSON.stringify({dest: t[r].dest}), n[r].children = [], t[r].items.length && e(t[r].items, n[r].children)
}(e, t), t
},
navigateToKGBookmark: function (e) {
var t = JSON.parse(e).dest;
this.PDFViewerApplication.pdfLinkService.navigateTo(t)
},
useNFSSystem: !1,
showPrintBtn: !1,
watermark: !1,
addWatermarkSuccess: function () {
console.log("添加水印成功~")
},
secretSeal: !1,
secretSealImg: "./images/secret-seal.png",
disableTextAnnotation: !1,
downlaod: !1,
fjrs: null,
appCode: "",
scanStamp: !1,
getQrCodeBase64Image: function (e) {
console.log(e)
},
filterSealNames: null,
useTextWidget: !1,
disableRotate: !0,
btnPositionConfig: {
toolbar: ["stamp"],
sidebar: ["prepareStamp", "indicateSeal", "signature", "download", "scanStamp", "textToSeal", "exportAnnotations", "docSave", "docSaveAs", "print", "watermark", "annotation", "openLocalFile", "docSign", "iWebAuthScan", "iWebAuthUkey", "Ukey"]
},
themeColor: "#1890ff",
setThemeColorStyle: function () {
var e, t, n, r = void 0, i = void 0, a = void 0, o = void 0;
if (r = this.themeColor.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i)) 6 === r[1].length ? (i = parseInt(r[1].substr(0, 2), 16), a = parseInt(r[1].substr(2, 2), 16), o = parseInt(r[1].substr(4, 2), 16)) : (i = parseInt(r[1].charAt(0) + r[1].charAt(0), 16), a = parseInt(r[1].charAt(1) + r[1].charAt(1), 16), o = parseInt(r[1].charAt(2) + r[1].charAt(2), 16)); else if (r = this.themeColor.match(/^\W*rgba?\(([^)]*)\)\W*$/i)) {
var s = r[1].split(","), l = void 0, c = void 0, u = void 0;
s.length >= 3 && (l = s[0].match(/^\s*(\d*)(\.\d+)?\s*$/)) && (c = s[1].match(/^\s*(\d*)(\.\d+)?\s*$/)) && (u = s[2].match(/^\s*(\d*)(\.\d+)?\s*$/)) && (i = parseFloat((l[1] || "0") + (l[2] || "")), a = parseFloat((c[1] || "0") + (c[2] || "")), o = parseFloat((u[1] || "0") + (u[2] || "")))
}
if (t = "rgba(" + (i = Math.max(0, Math.min(255, i))) + ", " + (a = Math.max(0, Math.min(255, a))) + ", " + (o = Math.max(0, Math.min(255, o))) + ", .2)", n = "rgba(" + i + ", " + a + ", " + o + ", .7)", !(e = "rgb(" + i + ", " + a + ", " + o + ")")) throw Error("颜色格式不正确");
var d = document.createElement("style");
d.type = "text/css", d.innerHTML = "\n #KG_CertValidityOverlay .certDays {\n color: " + e + ";\n }\n\n .layui-laydate .layui-laydate-header i:hover,\n .layui-laydate .layui-laydate-header span:hover {\n color: " + e + ";\n }\n\n .layui-laydate .layui-laydate-content .layui-this {\n background-color: " + e + " !important;\n }\n\n .kg_checkbox_wrapper.kg_checkbox_wrapper-checked:before {\n color: " + e + ";\n }\n\n .kg_radio_wrapper.kg_radio_wrapper-checked:before {\n color: " + e + ";\n }\n\n .thumbnail.selected > .thumbnailSelectionRing > .thumbnailImage {\n box-shadow: 0 0 0 2px " + e + ";\n }\n\n #loadingBar .progress {\n background-color: " + e + ";\n }\n\n #toolbarSidebar .toolbarButton.toggled {\n border-bottom: 2px solid " + e + ";\n background-color: " + t + ";\n }\n\n .toolbarButton:hover,\n .toolbarButton:focus,\n .toolbarButton:hover:active,\n .splitToolbarButton.toggled > .toolbarButton.toggled,\n .toolbarButton.toggled:hover:active {\n color: " + e + ";\n }\n\n .secondaryToolbarButton:hover,\n .secondaryToolbarButton:focus,\n .secondaryToolbarButton.toggled,\n .secondaryToolbarButton:hover:active,\n .secondaryToolbarButton.toggled:hover:active {\n color: " + e + ";\n }\n\n .dropdownToolbarButton:hover,\n .dropdownToolbarButton:focus,\n #pageNumber:hover,\n #pageNumber:focus {\n border: 1px solid " + e + ";\n }\n\n #sidebarContainer .toolbarButton.toggled:hover:active,\n .outlineItemToggler:hover,\n .outlineItemToggler:hover + a,\n .outlineItemToggler:hover ~ .outlineItems,\n .outlineItem > a:hover,\n .annotationItem > a:hover,\n .attachmentsItem > button:hover {\n color: " + e + ";\n }\n\n .KG_VerifySealPrompt_Tab:hover {\n color: " + e + ";\n }\n\n .KG_VerifySealPrompt_Tab.active {\n color: " + e + ";\n border-bottom: 2px solid " + e + ";\n }\n\n .KG_VerifySealPrompt_Tip_Copy {\n color: " + e + ";\n }\n\n .KG_VerifySealPrompt_Tip_Copy:hover {\n color: " + n + ";\n }\n\n .kg_productInfo_copyright > p > a:hover {\n color: " + e + ";\n }\n\n #kgTextToSealOverlay .kgdialog .tab .selected {\n color: " + e + ";\n }\n\n #documentPropertiesOverlay #fileType {\n color: " + e + ";\n border: 2px solid " + e + ";\n }\n\n .KG_GuideTip_NeverShow:hover {\n color: " + e + ";\n }\n\n .toolbarField:hover {\n border-color: " + e + ";\n }\n\n .toolbarField:focus {\n border-color: " + e + ";\n }\n\n .btn:hover,\n .btn:focus {\n color: " + e + ";\n border-color: " + e + ";\n }\n\n .btn-primary {\n background-color: " + e + ";\n border-color: " + e + ";\n }\n\n .btn-primary:hover,\n .btn-primary:focus {\n color: #fff;\n background-color: " + n + ";\n border-color: " + n + ";\n }\n\n .btn-border-primary {\n color: " + e + ";\n border-color: " + e + ";\n }\n\n .btn-text-primary {\n color: " + e + ";\n }\n\n .btn-text-primary:hover,\n .btn-text-primary:focus {\n background-color: " + t + ";\n }\n\n #kg-seal-left:hover, #kg-seal-right:hover {\n color: " + e + ";\n }\n\n .kgInput:hover, .kgInput:focus {\n border: 1px solid " + e + ";\n }\n\n #sign-msg-thick.active, #sign-msg-thick:hover {\n color: " + e + ";\n }\n\n #sign-msg-thick-drop {\n border: 2px solid " + e + ";\n }\n\n .kg_progress_active {\n background-color: " + e + ";\n }\n ", document.getElementsByTagName("head").item(0).appendChild(d)
},
surreadPrint: !1,
setSurreadPrintConfig: function (e) {
if (!this.PDFViewerApplication.KG_SurreadPrint) throw new Error("[打印控制组件异常] 未初始化");
this.PDFViewerApplication.KG_SurreadPrint.combineConfig(e)
},
getSurreadPrintConfig: function () {
if (!this.PDFViewerApplication.KG_SurreadPrint) throw new Error("[打印控制组件异常] 未初始化");
var e = this.surreadPrint;
return {
customParam: e.customParam,
print: e.print,
watermark: e.watermark,
showPannel: e.showPannel,
printerList: e.printerList
}
},
setAppCode: function (e) {
var t = this;
e && (this.appCode = e);
var n = new v.iWebAssist;
return n.promise.then(function () {
return n.setParamByName("APPCODE", t.appCode)
})
},
language: "zh-CN",
checkFile: !1,
algorithmType: {cloud: "RSA", key: null},
verifyChainInfo: !1,
openLocalFile: !1,
uploadLocalFileUrl: null,
uploadLocalFileSuccess: function (e) {
console.log("Upload success: ", e)
},
stampSuccess: function (e) {
},
deleteSealSuccess: function () {
},
externalSign: null,
externalGetSeals: null,
externalStampSeal: null,
externalVerifyOnLoad: null,
externalVerifySeal: null,
externalUnit: "px",
externalSeals: null,
sealPreLocation: null,
renderExternalSealsComplete: function (e) {
console.log(e)
},
externalDeleteSeal: function (e, t) {
this.PDFViewerApplication.KG_NoServer.deleteSeal(e, t)
},
disableDelete: !1,
license: null,
version: null,
selectedSeal: null,
isCa3: !1,
isUrlDoc: !1,
currentView: "",
iWebAuth: {scan: !1, uKey: !1},
getCurrentView: function () {
return this.currentView.split("#")[1]
},
setCurrentView: function (e) {
this.PDFViewerApplication.setInitialView(e)
},
getConfirmPrompt: function () {
if (null == this.confirmPrompt) {
var e = this.PDFViewerApplication;
this.confirmPrompt = new c.default(e, e.overlayManager)
}
return this.confirmPrompt
},
getPasswordPrompt: function () {
if (null == this.passwordPrompt) {
var e = this.PDFViewerApplication;
this.passwordPrompt = new u.KGPasswordPrompt(e.appConfig.kgpasswordOverlay, e.overlayManager, e.l10n)
}
return this.passwordPrompt
},
getSelectSealPrompt: function () {
if (null == this.selectSealPrompt) {
var e = this.PDFViewerApplication;
this.selectSealPrompt = new h.SelectSealPrompt(e.appConfig.selectSealOverlay, e.overlayManager, e.l10n)
}
return this.selectSealPrompt
},
getAlertPrompt: function () {
if (null == this.alertPrompt) {
var e = this.PDFViewerApplication;
this.alertPrompt = new p.AlertPrompt(e.appConfig.alertPromptOverlay, e.overlayManager, e.l10n)
}
return this.alertPrompt
},
getTipPrompt: function () {
if (null == this.tipPrompt) {
var e = this.PDFViewerApplication;
this.tipPrompt = new f.KGTipPrompt(null, e.overlayManager, e.l10n)
}
return this.tipPrompt
},
setUrl: function (e) {
this.url = e
},
getUrl: function () {
return this.url
},
open: function (e, t) {
var n = this;
this.setDocumentId(encodeURIComponent(e)), this.setFileType(t), this.pdfPwd = "";
var r = this.isUrlDoc ? e : this.getDocTypeUrl() + "&action=download&documentId=" + encodeURIComponent(e) + "&t=" + (new Date).getTime();
this.PDFViewerApplication.open(r).then(function () {
n.openDocSuccess(), !0 !== n.textToSeal && null == window.KGPdfViewerWebApp.annotationVisibleType || 0 !== n.docType || n.PDFViewerApplication.kgAnnotationViewer.init()
})
},
repairFileAndOpen: function () {
var e = this,
t = this.isUrlDoc ? this.documentId : this.getDocTypeUrl() + "&action=download&repairPdf=true&documentId=" + encodeURIComponent(this.documentId) + "&t=" + (new Date).getTime();
this.PDFViewerApplication.open(t).then(function () {
e.openDocSuccess(), !0 !== e.textToSeal && null == window.KGPdfViewerWebApp.annotationVisibleType || 0 !== e.docType || e.PDFViewerApplication.kgAnnotationViewer.init()
})
},
openDocSuccess: function () {
console.log("打开文档成功~")
},
getDocTypeUrl: function () {
var e = this.url;
return e.indexOf("?") > -1 ? e += "&" : e += "?", e + "docType=" + this.docType
},
setFileType: function (e) {
this.fileType = e ? e.toUpperCase() : this.fileType.toUpperCase(), "PDF" !== this.fileType && "OFD" !== this.fileType && (this.fileType = "PDF"), this.docType = "OFD" === this.fileType ? 1 : 0, "OFD" === this.fileType && (this.textToSeal = !1)
},
getFileType: function () {
return this.fileType
},
getPdfPwd: function () {
return this.encryptPWd ? this.aesEncrypt(this.pdfPwd) : this.pdfPwd
},
setDocumentId: function (e) {
this.documentId = e
},
setSealOrigin: function (e) {
this.sealOrigin = e
},
getSealOrigin: function () {
return this.sealOrigin
},
getNumPages: function () {
return this.PDFViewerApplication.pdfDocument.numPages
},
stamp: function () {
this.PDFViewerApplication.pdfStamp.stamp()
},
SCSJTT_getFirstSealFromServer: function (e, t) {
this.PDFViewerApplication.pdfStamp.SCSJTT_getFirstSealFromServer(e, t)
},
stampOfXY: function (e, t, n, r, i) {
this.PDFViewerApplication.pdfStamp.stampOfXY(e, t, n, r, i)
},
stampOfText: function (e, t, n, r) {
this.PDFViewerApplication.pdfStamp.stampOfText(e, t, n, r)
},
getUserBeforeSign: function (e) {
var t = {
action: "getUser",
password: this.encryptPWd ? this.aesEncrypt(e) : e,
keySN: this.userId,
userCode: this.userCode,
isEncrypt: this.encryptPWd,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin,
appCode: this.appCode
};
return a.myaxios.post(this.url, t)
},
transformSignatureToGmSeal: function (e) {
var t = this, n = {
action: "getSealData",
keySN: e.keySN,
imgdata: e.imgdata.split(",")[1],
imgExt: e.imgExt,
signName: e.signName,
width: (0, m.pxCovertToMM)(e.width),
height: (0, m.pxCovertToMM)(e.height),
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
return a.myaxios.post(this.url, n).then(function (n) {
if (n.data.status) {
var r = n.data, i = r.sealData, a = r.version;
return e.version = a, e.sealData = i, Promise.resolve(e)
}
return t.getTipPrompt().close(), Promise.reject(n.data.message)
})
},
addSeal: function (e, t) {
var n = this, i = this.certOrigin, o = this.sealType, s = this.fileType, l = this.stampType, c = e.sealdata,
u = e.capability, d = this.getTipPrompt();
switch (this.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
var h = this.iWebAuth.scan || this.iWebAuth.uKey,
p = "string" == typeof this.algorithmType ? this.algorithmType : this.algorithmType.cloud;
h && (p = window.KGPdfViewerWebApp.PDFViewerApplication.KG_IWebAuth.algorithmType);
var f = {
action: "stampSeal",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
stampType: this.stampType,
certOrigin: window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer ? 1 : this.certOrigin,
seals: c,
sealType: o,
clientCode: this.clientCode,
isWebAuth: h,
appCode: this.appCode,
algorithmType: p,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin,
unifySealPlatformV2: window.KGPdfViewerWebApp.unifySealPlatformV2
};
if (window.KGPdfViewerWebApp.unifySealPlatformV2) {
var v = this.PDFViewerApplication.KG_ScanStamp_V2, g = v.code, y = v.token;
f.code = g, f.token = y
}
!0 === this.useCaptcha && (f.captcha = e.captcha), this.scanStamp && "scan" == this.systemStampMode && (f.scanStamp = !0, f.userToken = this.PDFViewerApplication.KG_ScanStamp.userToken, f.qrcodeId = this.PDFViewerApplication.KG_ScanStamp.scanId, f.qrCodeUserUid = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserUid, f.qrCodeUserName = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserName, f.scanSealType = this.PDFViewerApplication.KG_ScanStamp.sealType), f.isUkey = this.isUkey && "ukey" == this.systemStampMode;
var b = this.PDFViewerApplication, w = b.pdfStamp, S = b.pdfDocument,
_ = this.isLoadComplete() ? [S.getDownloadInfo(), u.resolve] : [Promise.resolve({}), w.renderSignatureSeals],
k = r(_, 2), x = k[0], P = k[1];
x.then(function (e) {
if (e.length && (length / 1024 > n.needTipFileSize || 1 == n.certOrigin)) switch (n.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
("OFD" === s || "PDF" === s && 2 === l) && (f.seals = (0, m.sortClass)(f.seals, ["esid"])), a.myaxios.post(n.getDocTypeUrl(), f).then(function (e) {
(0, m.closeOverlay)().then(function () {
var r = e.data;
if (r.status) {
if (n.annotation) {
var a = n.PDFViewerApplication.KG_Annotation, o = a.defaultConfig, s = a.userInput, l = a.extendValue,
c = a.isAnnotation, h = a.annotQueue;
c && o.annotationSuccess && !h && (o.annotationSuccess(s, l), n.PDFViewerApplication.KG_Annotation.resetAnnotationExtendValue())
}
if (1 == i) {
var p = r.sigObj;
switch (n.capability = u, n.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
t(p, {textPositions: r.textPositions})
} else {
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) {
var f = r.sigObj;
switch (n.capability = u, n.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
t(f, {textPositions: r.textPositions})
}
P({status: !0, textPositions: r.textPositions, successPassBackParameter: r.successPassBackParameter})
}
} else n.PDFViewerApplication.KGAlertPrompt.open(r.message), P({status: !1})
})
}).catch(function () {
P({status: !1})
})
})
},
addOFDSeal: function (e) {
var t = this, n = (0, m.sortClass)(e.sealdata, ["esid"]), i = e.capability;
this.capability = i;
var l = this.PDFViewerApplication, c = l.pdfStamp, u = l.pdfDocument, d = l.KG_UkeyStamp,
h = c.pdfStampSeal.keyPwd || this.getPasswordPrompt().pwd || d.password, p = this, f = c.tempSeals,
v = this.getTipPrompt(),
g = this.isLoadComplete() ? [u.getDownloadInfo(), i.resolve] : [Promise.resolve({}), c.renderSignatureSeals],
y = r(g, 2), b = y[0], w = y[1];
b.then(function (e) {
if (e.length && (length / 1024 > t.needTipFileSize || "1" === t.certOrigin.toString())) switch (t.PDFViewerApplication.l10n._lang) {
case"zh-TW":
v.open("正在進行簽章加蓋...");
break;
case"en-US":
v.open("Signing and stamping...");
break;
default:
v.open("正在进行签章加盖...")
}
var r = function (e) {
return (0, m.closeOverlay)().then(function () {
return t.PDFViewerApplication.KGAlertPrompt.open(e)
}).then(function () {
w({status: !1}), t.sigError()
})
};
!function e(t) {
var i = n[t][0].esid, l = {certOrigin: p.certOrigin, cert: p.cert, seals: [n[t]], sealType: p.sealType};
p.fjrs && p.fjrs.isServer && (l = {
certOrigin: 1,
cert: p.PDFViewerApplication.KG_FJRS.sealListInfo[0].certBase64,
seals: n[t],
sealType: 1
});
var c = {
action: "stampSeal",
documentId: p.documentId,
pdfPwd: p.getPdfPwd(),
stampType: p.stampType,
certOrigin: l.certOrigin,
cert: l.cert,
seals: l.seals,
sealType: l.sealType,
isEncrypt: p.encryptPWd,
isSM: p.isSM && "OFD" == p.fileType,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin,
appCode: window.KGPdfViewerWebApp.appCode
};
a.myaxios.post(p.getDocTypeUrl(), c).then(function (a) {
var l = a.data, c = l.status, u = l.sigObj, d = l.message, v = l.textPositions;
if (c && u) {
if (p.multipleStamp) {
var g = !0, y = !1, b = void 0;
try {
for (var S, _ = f[Symbol.iterator](); !(g = (S = _.next()).done); g = !0) {
var k = S.value;
k.sealData.esid == i && (k.ofdStampSuccess = !0)
}
} catch (e) {
y = !0, b = e
} finally {
try {
!g && _.return && _.return()
} finally {
if (y) throw b
}
}
}
var x = function (e) {
var r = e.signedData, i = e.cert, a = e.sealType, o = e.toSignData, s = e.signDirPath, l = !1;
return t >= n.length - 1 && (l = !0), p.reWriteSigData(r, i, {textPositions: v}, a, o, s, l)
}, P = function () {
++t < n.length ? e(t) : w({status: !0, textPositions: v})
};
!0 === p.useNFSSystem ? (0, o.NFSSign)(h, p.keySN, u, x, P, r) : null != p.externalSign ? (0, m.externalSign)(u, x, P, r) : 2 == p.stampType && "PDF" == p.fileType ? (0, s.pdfSM2RegionSign)(h, p.keySN, u, x, P, r) : (0, s.ofdSign)(h, p.keySN, u, x, P, r)
} else (0, m.closeOverlay)().then(function () {
return r(d || "加盖印章出现错误,中止操作")
})
})
}(0)
})
},
modifyText: function (e) {
var t = this, n = {action: "FilltextField", documentId: this.documentId, fileType: this.fileType, data: e};
a.myaxios.post(this.getDocTypeUrl(), n).then(function (e) {
(0, m.closeOverlay)().then(function () {
var n = e.data;
n.status || t.PDFViewerApplication.KGAlertPrompt.open(n.message)
})
})
},
reWriteSigData: function (e, t, n, r, i, o) {
var s = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6],
l = this.iWebAuth.scan || this.iWebAuth.uKey, c = {
action: "reWriteSigData",
documentId: this.documentId,
keySN: this.keySN || this.userId,
pdfPwd: this.getPdfPwd(),
clientCode: this.clientCode,
stampType: this.stampType,
isWebAuth: l,
cert: t ? g.default.stringify(y.default.parse(t)) : null,
isEncrypt: this.encryptPWd,
isSM: this.isSM && "OFD" == this.fileType
};
null != this.externalSign && (c.externalSign = !0), "OFD" === this.fileType ? c.data = [{
sealType: r,
toSignData: i,
signDirPath: o,
signData: e
}] : c.data = e;
var u = this, d = this.PDFViewerApplication.pdfStamp,
h = this.isLoadComplete() ? u.capability.resolve : d.renderSignatureSeals;
return a.myaxios.post(this.getDocTypeUrl(), c).then(function (e) {
var t = e.data;
t.status ? s && ((0, m.closeOverlay)(), h({
status: !0,
textPositions: n.textPositions,
successPassBackParameter: t.successPassBackParameter
})) : ((0, m.closeOverlay)(), u.PDFViewerApplication.KGAlertPrompt.open(t.message), h({status: !1}))
}).catch(function () {
h({status: !1})
})
},
sigError: function () {
var e = this, t = {
action: "reWriteSigData",
clientCode: this.clientCode,
documentId: this.documentId,
stampType: this.stampType,
error: !0
};
e.getTipPrompt().close(), a.myaxios.post(this.getDocTypeUrl(), t).then(function (t) {
var n = t.data;
e.capability.resolve(!1), n.status || e.app.KGAlertPrompt.open(n.message)
})
},
deleteSeal: function (e, t, n, r, i, o) {
var s = {
action: "deleteSeal",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
keySN: this.userId,
userCode: this.userCode,
certOrigin: this.certOrigin,
page: e,
x: t,
y: n,
isEncrypt: this.encryptPWd,
isSM: this.isSM && "OFD" == this.fileType,
appCode: this.appCode,
unifySealPlatformV2: this.unifySealPlatformV2
};
if (this.PDFViewerApplication.KG_FJRS && this.PDFViewerApplication.KG_FJRS.delKeySN && (s.keySN = this.PDFViewerApplication.KG_FJRS.delKeySN), !0 === this.useCaptcha ? s.captcha = r : s.password = r, this.unifySealPlatformV2) {
var l = this.PDFViewerApplication.KG_ScanStamp_V2, c = l.code, u = l.token;
s.code = c, s.token = u
}
return i && o && (s.rand = i, s.signedBase64 = o), !window.KGPdfViewerWebApp.stampModel && this.scanStamp && (s.scanStamp = !0, s.userToken = this.PDFViewerApplication.KG_ScanStamp.userToken, s.qrcodeId = this.PDFViewerApplication.KG_ScanStamp.scanId, s.qrCodeUserUid = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserUid, s.qrCodeUserName = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserName), a.myaxios.post(this.getDocTypeUrl(), s)
},
verifySeal: function (e, t, n, r, i) {
var o = this.certOrigin;
i && ("1" === i ? o = 1 : "2" === i && (o = 0));
var s = {
action: "verifySeal",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
certOrigin: o,
isScanStamp: this.scanStamp,
page: e,
x: t,
y: n,
isEncrypt: this.encryptPWd,
isSM: this.isSM && "OFD" == this.fileType,
isUkey: this.isUkey
};
window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs && (s.isfjrs = !0), a.myaxios.post(this.getDocTypeUrl(), s).then(function (e) {
r(e.data)
})
},
verifySealOnLoad: function (e, t, n) {
var r = {
action: "verifySealOnLoad",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
page: e,
indRefNumber: t,
isEncrypt: this.encryptPWd
};
a.myaxios.post(this.getDocTypeUrl(), r).then(function (e) {
n(e.data)
})
},
checkLastone: function (e, t, n) {
var r = this;
this.cancelCheckLastOne && this.cancelCheckLastOne();
var i = a.axios.CancelToken, o = {action: "checkLastone", documentId: this.documentId, page: e, x: t, y: n};
return this.disableDelete ? Promise.resolve({status: !1}) : "OFD" === this.fileType || 1 == this.stampType || 2 == this.stampType || 1 == this.scanStamp || this.PDFViewerApplication.KG_FJRS ? a.axios.post(this.getDocTypeUrl(), (0, m.transformData)(o), {
cancelToken: new i(function (e) {
r.cancelCheckLastOne = e
}), withCredentials: !0, headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}
}).then(function (e) {
return e.data
}).catch(function (e) {
e instanceof a.axios.Cancel ? console.log("取消请求") : r.PDFViewerApplication.KGAlertPrompt.open(e.message)
}) : Promise.resolve({status: !0})
},
transparentImg: function (e) {
var t = {action: "imageToTransparence", imagedata: e};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
},
getAnnotationList: function () {
var e = {action: "getAnnotsList", documentId: this.documentId};
return a.myaxios.post(this.getDocTypeUrl(), e).then(function (e) {
return e.data
})
},
addWatermark: function (e) {
var t = this, n = {action: "addWatermark", documentId: this.documentId};
for (var r in e) n[r] = e[r];
return a.myaxios.post(this.getDocTypeUrl(), n).then(function (e) {
return e.data.status && t.addWatermarkSuccess(), e.data
})
},
saveAnnotations: function (e) {
if (!(arguments.length > 1 && void 0 !== arguments[1] && arguments[1])) {
var t = {action: "improtAnnots", documentId: this.documentId, annotsData: e, saveAs: !1};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
}
var n = document.getElementById("saveAnnotations");
n && n.parentNode.removeChild(n);
var r = document.createElement("form");
r.id = "saveAnnotations", r.method = "POST", r.action = this.getDocTypeUrl(), r.style.display = "none", document.body.appendChild(r);
var i = document.createElement("input");
i.name = "action", i.value = "improtAnnots", r.appendChild(i);
var o = document.createElement("input");
o.name = "documentId", o.value = this.documentId, r.appendChild(o);
var s = document.createElement("input");
s.name = "annotsData", s.value = e, r.appendChild(s);
var l = document.createElement("input");
l.name = "saveAs", l.value = "true", r.appendChild(l), r.submit()
},
getLicenseInfo: function () {
return a.myaxios.post(this.getDocTypeUrl(), {action: "getLicenseInfo"}).then(function (e) {
return e.data
})
},
elecSigModeCheckFile: function () {
if (this.checkFile && 0 == this.stampType && 0 == this.docType) {
var e = {action: "elecSigModeCheckFile", documentId: this.documentId};
return a.myaxios.post(this.getDocTypeUrl(), e).then(function (e) {
return e.data
})
}
return Promise.resolve({status: !0})
},
verifyAllSeal: function (e, t, n) {
var r = {
action: "verifyAllSeal",
documentId: this.documentId,
saveType: t,
fileUrl: e,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
}, i = {result: {validCount: 0, invalidCount: 0}, errorCode: "", errorMessage: ""};
a.myaxios.post(this.getDocTypeUrl(), r).then(function (e) {
if (e.data.status) {
for (var t = [], n = e.data.signInfoArray, r = function (e) {
var r = !1, a = !1, o = n[e], s = o.effectiveness, l = o.newHash, c = o.sigData;
t.push(new Promise(function (e) {
if (r = s) {
if (l && c) {
var t = new v.iWebAssist({cilentType: "0"});
return Promise.resolve(t.promise).then(function () {
return t.verifySignMessage(l, c)
}).then(function (t) {
t && (a = !!t.result), e({sealEffectiveness: r, signEffectiveness: a})
})
}
e({sealEffectiveness: r, signEffectiveness: a = !0})
} else e({sealEffectiveness: r})
}).then(function (e) {
var t = e.sealEffectiveness, n = e.signEffectiveness;
t && n ? i.result.validCount++ : i.result.invalidCount++
}))
}, a = 0; a < n.length; a++) r(a);
return Promise.all(t)
}
var o = e.data.message;
return Promise.reject(o || "程序异常,验证失败")
}).then(function () {
n(i)
}).catch(function (e) {
console.log(e)
})
},
getSealArray: async function(e,t){
var r = {
action: "verifyAllSeal",
documentId: this.documentId,
saveType: t,
fileUrl: e,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
let res;
await a.myaxios.post(this.getDocTypeUrl(), r).then(function(e) {
res = e;
})
return res;
},
getQrCodeImage: function (e, t, n) {
var r = {
action: "getQrCodeImage",
scanSealType: t,
esid: n,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
switch (e) {
case"stamp":
r.way = "1";
break;
case"delete":
r.way = "2"
}
return a.myaxios.post(this.getDocTypeUrl(), r).then(function (e) {
return e.data
})
},
getQrCodeToken: function (e) {
var t = {action: "getQrCodeToken", qrcodeId: e, stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
},
exitSession: function (e) {
var t = {action: "exitSession", userToken: e};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
},
certExpiryVerify: function (e, t) {
var n = {action: "certExpiryVerify", cert: e, days: t};
return a.myaxios.post(this.getDocTypeUrl(), n).then(function (e) {
return e.data && 1 == e.data.status ? e.data : Promise.reject({message: e.data.message})
})
},
customVerifyOption: null,
defaultVerifyOptionByOFD: {
seal: {
_map: {
sealID: {value: "sealID", title: "印章序列"},
signDate: {value: "signDate", title: "签章时间"},
signName: {value: "sealName", title: "签名名称"},
unitName: {value: "sealVid", title: "授权单位"},
userName: {value: "userName", title: "用户名称"},
validStart: {value: "validStart", title: "起始时间"},
validEnd: {value: "validEnd", title: "截止时间"}
}, _show: ["unitName", "userName", "signName", "sealID", "signDate", "validStart", "validEnd"]
},
cert: {
_map: {
issuerDN: {value: "issuerDN", title: "证书签发者"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["serialNumber", "subjectDN", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
tsa: {
tsaCert: {
_map: {
issuerDN: {value: "issuerDN", title: "时间戳机构"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["subjectDN", "serialNumber", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
_map: {
tsaTime: {value: "tsaTime", title: "签名时间"},
tsaEffectiveness: {value: "tsaEffectiveness", title: "时间戳验证"}
},
_show: ["tsaTime"]
},
chain: {},
_map: {
seal: {value: "seal", title: "签章信息"},
cert: {value: "cert", title: "证书信息"},
tsa: {value: "tsaInfo", title: "时间戳"},
chain: {value: "chain", title: "区块链"}
}
},
defaultVerifyOptionByPDF: {
seal: {
_map: {
appName: {value: "appName", title: "应用程序"},
signDateTime: {value: "signDateTime", title: "签章时间"},
signName: {value: "signName", title: "签名名称"},
signSN: {value: "signSN", title: "印章标识"},
sealValidStart: {value: "sealValidStart", title: "开始时间"},
sealValidEnd: {value: "sealValidEnd", title: "结束时间"}
}, _show: ["appName", "signSN", "signName", "sealValidStart", "sealValidEnd", "signDateTime"]
},
cert: {
_map: {
issuerDN: {value: "issuerDN", title: "证书签发者"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["serialNumber", "subjectDN", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
tsa: {
tsaCert: {
_map: {
issuerDN: {value: "issuerDN", title: "时间戳机构"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["subjectDN", "serialNumber", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
_map: {
tsaTime: {value: "tsaTime", title: "时间戳时间"},
tsaEffectiveness: {value: "tsaEffectiveness", title: "时间戳验证"}
},
_show: ["tsaTime"]
},
chain: {},
_map: {
seal: {value: "seal", title: "签章信息"},
cert: {value: "cert", title: "证书信息"},
tsa: {value: "tsaInfo", title: "时间戳"},
chain: {value: "chain", title: "区块链"}
}
},
paginSealDefaultConfig: {
beginPage: 1,
range: "allPage",
setting: 1,
firstPagePercent: 50,
otherPageNum: 3,
averagePageNum: 2
},
paginSealConfig: null,
singlePageSeal: !1,
continuityRange: null,
customScanDialog: {information: ['打开"码上办事APP"', '进入"电子印章服务",点击右上角扫码按钮'], imageName: "kg_extend_img.png"},
password: "",
pwdDefaultConfig: {defaultPwd: null, disable: !1, tips: null, tipsColor: "#868686", type: null, keepRemember: !1},
watermarkConfig: {
text: "金格科技",
file: "",
font: "黑体",
size: 32,
color: "c9c9c9",
rotate: 45,
opacity: 80,
isTiled: !1,
density: 100,
vertical: "middle",
horizontal: "center"
},
previewWatermark: null,
getAuthCode: function (e, t) {
e(null)
},
encryptPWd: !1,
aesEncrypt: function (e) {
return b.default.encrypt(w.default.enc.Utf8.parse(e), w.default.enc.Utf8.parse("AaBbCcDdEeFfGgH1"), {
iv: w.default.enc.Utf8.parse(_),
mode: w.default.mode.CBC,
padding: w.default.pad.Pkcs7
}).ciphertext.toString()
},
aesDecrypt: function (e) {
var t = w.default.enc.Hex.parse(e), n = w.default.enc.Base64.stringify(t);
return w.default.AES.decrypt(n, w.default.enc.Utf8.parse("AaBbCcDdEeFfGgH1"), {
iv: w.default.enc.Utf8.parse(_),
mode: w.default.mode.CBC,
padding: w.default.pad.Pkcs7
}).toString(w.default.enc.Utf8).toString()
},
globalAnnotation: null,
addDocSign: function (e) {
var t = {action: "addAnnot", documentId: this.documentId, annots: e};
return a.myaxios.post(this.getDocTypeUrl(), t)
},
deleteDocSign: function (e, t, n, r, i, o) {
var s = {
action: "deleteAnnot",
documentId: this.documentId,
page: e,
x: t,
y: n,
authorName: o || this.globalAnnotation.author
}, l = this;
return a.myaxios.post(this.getDocTypeUrl(), s).then(function (e) {
var t = e.data;
(0, m.closeOverlay)().then(function () {
t.status ? l.deleteDocSignOnCanvas(r, i) : l.PDFViewerApplication.KGAlertPrompt.open(t.message)
})
})
},
deleteDocSignOnCanvas: function (e, t) {
var n = e.getAttribute("data-annotation-id"), r = t.pdfPage;
if (r.newDocSigns[n] ? delete r.newDocSigns[n] : (r.delAnnotions || (r.delAnnotions = {}), r.delAnnotions[n] = !0, r.reloadOperatorList = !0), 1 != t.renderingState) {
var i = t.div, a = i.querySelector(".annotationLayer");
e.parentNode == a && a.removeChild(e), t.deleteStampCallback = function () {
var e = i.querySelector(".canvasWrapper"), n = i.querySelector(".textLayer");
e && i.removeChild(e), n && i.removeChild(n);
var a = window.KGPdfViewerWebApp.PDFViewerApplication.pdfThumbnailViewer.getThumbnail(r.pageIndex);
a.renderingState = 0, a.setImage(t)
}, t.renderingState = 0, t.renderingQueue.renderView(t)
} else t.reRenderWait = !0
},
certFromKey: !1,
getExternalToken: null,
isLoadComplete: function () {
return !!window.KGPdfViewerWebApp.documentLoaded
},
enableButtons: function () {
[].concat(function (e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
return Array.from(e)
}(document.querySelectorAll(".kg_disabled"))).forEach(function (e) {
e.removeAttribute("disabled"), e.classList.remove("kg_disabled")
})
},
chainStamp: !0,
postEncrypt: !1,
cancelStampCallback: function () {
},
isSM: !1,
isUkey: !1,
systemStampMode: null,
stampModel: null,
rangeChunkSize: 1048576,
repairJpegConfig: {size: 0, opacity: 75},
repairJpegXObjectByIE: function (e) {
var t = e.width, n = e.height, r = e.callback, i = window.KGPdfViewerWebApp.repairJpegConfig, a = i.size,
o = i.opacity;
if ((0, m.isIE)() && a) {
var s = (0, m.pxConversionMm)(t), l = (0, m.pxConversionMm)(n), c = 10 * a;
(s < c || l < c) && r && r(o / 100)
}
},
stampMask: null,
downloadDoc: function () {
var e = window.KGPdfViewerWebApp, t = e.url, n = e.documentId;
(0, m.download)(t, n)
},
stampSystemOrigin: 1,
unifySealPlatformV2: !1,
fingerPrint: null
};
window.KGPdfViewerWebApp = k, window.exportKGBookmarks = k.exportKGBookmarks.bind(window.KGPdfViewerWebApp), window.navigateToKGBookmarks = k.navigateToKGBookmark.bind(window.KGPdfViewerWebApp), window.exportKGAnnotationList = k.exportKGAnnotationList.bind(window.KGPdfViewerWebApp), window.navigateToKGAnnotation = k.navigateToKGAnnotation.bind(window.KGPdfViewerWebApp), window.setAppCode = k.setAppCode.bind(window.KGPdfViewerWebApp), window.getAuthCode = k.getAuthCode.bind(window.KGPdfViewerWebApp), null != k.externalSign && (window.KGPdfViewerWebApp.externalSignCallback = window.KGPdfViewerWebApp.externalSign = k.externalSign.bind(window.KGPdfViewerWebApp)), window.verifyAllSeal = k.verifyAllSeal.bind(window.KGPdfViewerWebApp),window.getSealArray = k.getSealArray.bind(window.KGPdfViewerWebApp), t.KGPdfViewerWebApp = k
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KGAnnotationViewer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.setBorder = s;
var i = n(23), a = n(94), o = n(24);
function s(e) {
for (var t = document.getElementsByClassName("stampAnnotation"), n = 0; n < t.length; n++) t[n].style.border && (t[n].style.border = "");
e && "SECTION" === e.nodeName && (e.style.border = "1px dashed #000")
}
var l = function () {
function e(t) {
var n = t.app, r = t.container, i = t.button;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = n, this.container = r, this.button = i, this.annotationList = [], !0 === window.KGPdfViewerWebApp.textToSeal || null != window.KGPdfViewerWebApp.annotationVisibleType ? this.app.pdfViewer.container.addEventListener("click", s) : this.button.style.display = "none"
}
return r(e, [{
key: "init", value: function () {
var e = this;
window.KGPdfViewerWebApp.getAnnotationList().then(function (t) {
t && t instanceof Array == !0 ? e.annotationList = t.map(function (e) {
return e.x = e.X, e.y = e.Y, e.page = e.pageNo, delete e.X, delete e.Y, delete e.pageNo, e
}) : e.annotationList = [], e.renderList()
})
}
}, {
key: "renderList", value: function () {
var e = this;
this.container.innerHTML = "";
var t = this.formatSealsData(), n = void 0;
null != window.KGPdfViewerWebApp.annotationVisibleType ? n = window.KGPdfViewerWebApp.annotationVisibleType : window.KGPdfViewerWebApp.textToSealDefault.visibleType && (n = window.KGPdfViewerWebApp.textToSealDefault.visibleType), (n ? this.annotationList.concat(t).filter(function (e) {
try {
var t = JSON.parse(e.annotInfo);
return !(!t || !t.hasOwnProperty("customType")) && t.customType.toString() === n
} catch (e) {
return !1
}
}).sort(function (e, t) {
return Number(e.page || e.pageNo) - Number(t.page || t.pageNo)
}) : []).forEach(function (t) {
var n = document.createElement("div");
n.setAttribute("class", "annotationItem");
var r = document.createElement("a"), a = Number(t.page || t.pageNo);
r.title = r.innerText = "第" + a + "页 " + t.authorName + "\n" + t.createTime;
var l = e.app.pdfViewer, c = l.getPageView(a - 1), u = c.viewport.viewBox[3] - t.y,
d = [{num: a, gen: 0}, {name: "XYZ"}, t.x, u, 0];
r.onclick = function () {
l.scrollPageIntoView({pageNumber: a, destArray: d}), c.onAfterDraw = function () {
for (var e = c.annotationLayer.div.getElementsByTagName("section"), n = void 0, r = 0; r < e.length; r++) {
var i = Math.round((0, o.getNumbOfPx)(e[r].style.left)), a = Math.round(t.x),
l = Math.round((0, o.getNumbOfPx)(e[r].style.top)), u = Math.round(t.y);
if (i >= a - 3 && i <= a + 3 && l >= u - 3 && l <= u + 3) {
n = e[r];
break
}
}
n && s(n), c.onAfterDraw = null
}, c.destroy(), c.renderingState = i.RenderingStates.INITIAL, c.draw(), l.update()
}, n.appendChild(r), e.container.appendChild(n)
})
}
}, {
key: "formatSealsData", value: function () {
var e = this.app.KGTextToSeal ? (0, a.arrayDeepCopy)(this.app.KGTextToSeal.seals) : [];
return e.forEach(function (e) {
e.x = e.left, e.y = e.top, e.authorName = window.KGPdfViewerWebApp.userId, delete e.createTime, delete e.imgData, delete e.height, delete e.width, delete e.section, delete e.top, delete e.left
}), e
}
}]), e
}();
t.KGAnnotationViewer = l
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
return e.webpackPolyfill || (e.deprecate = function () {
}, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", {
enumerable: !0,
get: function () {
return e.l
}
}), Object.defineProperty(e, "id", {
enumerable: !0, get: function () {
return e.i
}
}), e.webpackPolyfill = 1), e
}
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return e.defineLocale("zh-cn", {
months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
weekdaysMin: "日_一_二_三_四_五_六".split("_"),
longDateFormat: {
LT: "HH:mm",
LTS: "HH:mm:ss",
L: "YYYY/MM/DD",
LL: "YYYY年M月D日",
LLL: "YYYY年M月D日Ah点mm分",
LLLL: "YYYY年M月D日ddddAh点mm分",
l: "YYYY/M/D",
ll: "YYYY年M月D日",
lll: "YYYY年M月D日 HH:mm",
llll: "YYYY年M月D日dddd HH:mm"
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour: function (e, t) {
return 12 === e && (e = 0), "凌晨" === t || "早上" === t || "上午" === t ? e : "下午" === t || "晚上" === t ? e + 12 : e >= 11 ? e : e + 12
},
meridiem: function (e, t, n) {
var r = 100 * e + t;
return r < 600 ? "凌晨" : r < 900 ? "早上" : r < 1130 ? "上午" : r < 1230 ? "中午" : r < 1800 ? "下午" : "晚上"
},
calendar: {
sameDay: "[今天]LT",
nextDay: "[明天]LT",
nextWeek: "[下]ddddLT",
lastDay: "[昨天]LT",
lastWeek: "[上]ddddLT",
sameElse: "L"
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
ordinal: function (e, t) {
switch (t) {
case"d":
case"D":
case"DDD":
return e + "日";
case"M":
return e + "月";
case"w":
case"W":
return e + "周";
default:
return e
}
},
relativeTime: {
future: "%s内",
past: "%s前",
s: "几秒",
ss: "%d 秒",
m: "1 分钟",
mm: "%d 分钟",
h: "1 小时",
hh: "%d 小时",
d: "1 天",
dd: "%d 天",
M: "1 个月",
MM: "%d 个月",
y: "1 年",
yy: "%d 年"
},
week: {dow: 1, doy: 4}
})
}, "object" === s(t) && void 0 !== e ? o(n(60)) : (i = [n(60)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s, l, c, u, d, h, p, f, m, v, g, y,
b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = window.layui && layui.define, s = {
getPath: (i = document.currentScript ? document.currentScript.src : function () {
for (var e, t = document.scripts, n = t.length - 1, r = n; r > 0; r--) if ("interactive" === t[r].readyState) {
e = t[r].src;
break
}
return e || t[n].src
}(), i.substring(0, i.lastIndexOf("/") + 1)), getStyle: function (e, t) {
var n = e.currentStyle ? e.currentStyle : window.getComputedStyle(e, null);
return n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"](t)
}, link: function (e, t, n) {
if (l.path) {
var r = document.getElementsByTagName("head")[0], i = document.createElement("link");
"string" == typeof t && (n = t);
var a = "layuicss-" + (n || e).replace(/\.|\//g, ""), o = 0;
i.rel = "stylesheet", i.href = l.path + e, i.id = a, document.getElementById(a) || r.appendChild(i), "function" == typeof t && function e() {
if (++o > 80) return window.console && console.error("laydate.css: Invalid");
1989 === parseInt(s.getStyle(document.getElementById(a), "width")) ? t() : setTimeout(e, 100)
}()
}
}
}, l = {
v: "5.0.9",
config: {},
index: window.laydate && window.laydate.v ? 1e5 : 0,
path: s.getPath,
set: function (e) {
return this.config = g.extend({}, this.config, e), this
},
ready: function (e) {
var t = (o ? "modules/laydate/" : "theme/") + "default/laydate.css?v=" + l.v;
return o ? layui.addcss(t, e, "laydate") : s.link(t, e, "laydate"), this
}
}, c = "layui-this", u = "laydate-disabled", d = "开始日期超出了结束日期<br>建议重新选择", h = [100, 2e5], p = "layui-laydate-list", f = "layui-laydate-hint", m = ".laydate-btns-confirm", v = function (e) {
var t = this;
t.index = ++l.index, t.config = g.extend({}, t.config, l.config, e), l.ready(function () {
t.init()
})
}, g = function (e) {
return new y(e)
}, (y = function (e) {
for (var t = 0, n = "object" === (void 0 === e ? "undefined" : b(e)) ? [e] : (this.selector = e, document.querySelectorAll(e || null)); t < n.length; t++) this.push(n[t])
}).prototype = [], y.prototype.constructor = y, g.extend = function () {
var e = 1, t = arguments, n = function e(t, n) {
for (var r in t = t || (n.constructor === Array ? [] : {}), n) t[r] = n[r] && n[r].constructor === Object ? e(t[r], n[r]) : n[r];
return t
};
for (t[0] = "object" === b(t[0]) ? t[0] : {}; e < t.length; e++) "object" === b(t[e]) && n(t[0], t[e]);
return t[0]
}, g.ie = (a = navigator.userAgent.toLowerCase(), !!(window.ActiveXObject || "ActiveXObject" in window) && ((a.match(/msie\s(\d+)/) || [])[1] || "11")), g.stope = function (e) {
(e = e || window.event).stopPropagation ? e.stopPropagation() : e.cancelBubble = !0
}, g.each = function (e, t) {
var n;
if ("function" != typeof t) return this;
if ((e = e || []).constructor === Object) {
for (n in e) if (t.call(e[n], n, e[n])) break
} else for (n = 0; n < e.length && !t.call(e[n], n, e[n]); n++) ;
return this
}, g.digit = function (e, t, n) {
var r = "";
e = String(e), t = t || 2;
for (var i = e.length; i < t; i++) r += "0";
return e < Math.pow(10, t) ? r + (0 | e) : e
}, g.elem = function (e, t) {
var n = document.createElement(e);
return g.each(t || {}, function (e, t) {
n.setAttribute(e, t)
}), n
}, y.addStr = function (e, t) {
return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), g.each(t, function (t, n) {
new RegExp("\\b" + n + "\\b").test(e) || (e = e + " " + n)
}), e.replace(/^\s|\s$/, "")
}, y.removeStr = function (e, t) {
return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), g.each(t, function (t, n) {
var r = new RegExp("\\b" + n + "\\b");
r.test(e) && (e = e.replace(r, ""))
}), e.replace(/\s+/, " ").replace(/^\s|\s$/, "")
}, y.prototype.find = function (e) {
var t = this, n = 0, r = [], i = "object" === (void 0 === e ? "undefined" : b(e));
return this.each(function (a, o) {
for (var s = i ? [e] : o.querySelectorAll(e || null); n < s.length; n++) r.push(s[n]);
t.shift()
}), i || (t.selector = (t.selector ? t.selector + " " : "") + e), g.each(r, function (e, n) {
t.push(n)
}), t
}, y.prototype.each = function (e) {
return g.each.call(this, this, e)
}, y.prototype.addClass = function (e, t) {
return this.each(function (n, r) {
r.className = y[t ? "removeStr" : "addStr"](r.className, e)
})
}, y.prototype.removeClass = function (e) {
return this.addClass(e, !0)
}, y.prototype.hasClass = function (e) {
var t = !1;
return this.each(function (n, r) {
new RegExp("\\b" + e + "\\b").test(r.className) && (t = !0)
}), t
}, y.prototype.attr = function (e, t) {
var n = this;
return void 0 === t ? function () {
if (n.length > 0) return n[0].getAttribute(e)
}() : n.each(function (n, r) {
r.setAttribute(e, t)
})
}, y.prototype.removeAttr = function (e) {
return this.each(function (t, n) {
n.removeAttribute(e)
})
}, y.prototype.html = function (e) {
return this.each(function (t, n) {
n.innerHTML = e
})
}, y.prototype.val = function (e) {
return this.each(function (t, n) {
n.value = e
})
}, y.prototype.append = function (e) {
return this.each(function (t, n) {
"object" === (void 0 === e ? "undefined" : b(e)) ? n.appendChild(e) : n.innerHTML = n.innerHTML + e
})
}, y.prototype.remove = function (e) {
return this.each(function (t, n) {
e ? n.removeChild(e) : n.parentNode.removeChild(n)
})
}, y.prototype.on = function (e, t) {
return this.each(function (n, r) {
r.attachEvent ? r.attachEvent("on" + e, function (e) {
e.target = e.srcElement, t.call(r, e)
}) : r.addEventListener(e, t, !1)
})
}, y.prototype.off = function (e, t) {
return this.each(function (n, r) {
r.detachEvent ? r.detachEvent("on" + e, t) : r.removeEventListener(e, t, !1)
})
}, v.isLeapYear = function (e) {
return e % 4 == 0 && e % 100 != 0 || e % 400 == 0
}, v.prototype.config = {
type: "date",
range: !1,
format: "yyyy-MM-dd",
value: null,
min: "1900-1-1",
max: "2099-12-31",
trigger: "focus",
show: !1,
showBottom: !0,
btns: ["clear", "now", "confirm"],
lang: "cn",
theme: "default",
position: null,
calendar: !1,
mark: {},
zIndex: null,
done: null,
change: null
}, v.prototype.lang = function () {
var e = {
cn: {
weeks: ["日", "一", "二", "三", "四", "五", "六"],
time: ["时", "分", "秒"],
timeTips: "选择时间",
startTime: "开始时间",
endTime: "结束时间",
dateTips: "返回日期",
month: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],
tools: {confirm: "确定", clear: "清空", now: "现在"}
},
en: {
weeks: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
time: ["Hours", "Minutes", "Seconds"],
timeTips: "Select Time",
startTime: "Start Time",
endTime: "End Time",
dateTips: "Select Date",
month: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
tools: {confirm: "Confirm", clear: "Clear", now: "Now"}
}
};
return e[this.config.lang] || e.cn
}, v.prototype.init = function () {
var e = this, t = e.config, n = "yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s", r = "static" === t.position,
i = {year: "yyyy", month: "yyyy-MM", date: "yyyy-MM-dd", time: "HH:mm:ss", datetime: "yyyy-MM-dd HH:mm:ss"};
t.elem = g(t.elem), t.eventElem = g(t.eventElem), t.elem[0] && (!0 === t.range && (t.range = "-"), t.format === i.date && (t.format = i[t.type]), e.format = t.format.match(new RegExp(n + "|.", "g")) || [], e.EXP_IF = "", e.EXP_SPLIT = "", g.each(e.format, function (t, r) {
var i = new RegExp(n).test(r) ? "\\d{" + (new RegExp(n).test(e.format[0 === t ? t + 1 : t - 1] || "") ? /^yyyy|y$/.test(r) ? 4 : r.length : /^yyyy$/.test(r) ? "1,4" : /^y$/.test(r) ? "1,308" : "1,2") + "}" : "\\" + r;
e.EXP_IF = e.EXP_IF + i, e.EXP_SPLIT = e.EXP_SPLIT + "(" + i + ")"
}), e.EXP_IF = new RegExp("^" + (t.range ? e.EXP_IF + "\\s\\" + t.range + "\\s" + e.EXP_IF : e.EXP_IF) + "$"), e.EXP_SPLIT = new RegExp("^" + e.EXP_SPLIT + "$", ""), e.isInput(t.elem[0]) || "focus" === t.trigger && (t.trigger = "click"), t.elem.attr("lay-key") || (t.elem.attr("lay-key", e.index), t.eventElem.attr("lay-key", e.index)), t.mark = g.extend({}, t.calendar && "cn" === t.lang ? {
"0-1-1": "元旦",
"0-2-14": "情人",
"0-3-8": "妇女",
"0-3-12": "植树",
"0-4-1": "愚人",
"0-5-1": "劳动",
"0-5-4": "青年",
"0-6-1": "儿童",
"0-9-10": "教师",
"0-9-18": "国耻",
"0-10-1": "国庆",
"0-12-25": "圣诞"
} : {}, t.mark), g.each(["min", "max"], function (e, n) {
var r = [], i = [];
if ("number" == typeof t[n]) {
var a = t[n], o = (new Date).getTime(), s = new Date(a ? a < 864e5 ? o + 864e5 * a : a : o);
r = [s.getFullYear(), s.getMonth() + 1, s.getDate()], a < 864e5 || (i = [s.getHours(), s.getMinutes(), s.getSeconds()])
} else r = (t[n].match(/\d+-\d+-\d+/) || [""])[0].split("-"), i = (t[n].match(/\d+:\d+:\d+/) || [""])[0].split(":");
t[n] = {
year: 0 | r[0] || (new Date).getFullYear(),
month: r[1] ? (0 | r[1]) - 1 : (new Date).getMonth(),
date: 0 | r[2] || (new Date).getDate(),
hours: 0 | i[0],
minutes: 0 | i[1],
seconds: 0 | i[2]
}
}), e.elemID = "layui-laydate" + t.elem.attr("lay-key"), (t.show || r) && e.render(), r || e.events(), t.value && (t.value.constructor === Date ? e.setValue(e.parse(0, e.systemDate(t.value))) : e.setValue(t.value)))
}, v.prototype.render = function () {
var e, t, n = this.config, r = this.lang(), i = "static" === n.position, a = this.elem = g.elem("div", {
id: this.elemID,
class: ["layui-laydate", n.range ? " layui-laydate-range" : "", i ? " layui-laydate-static" : "", n.theme && "default" !== n.theme && !/^#/.test(n.theme) ? " laydate-theme-" + n.theme : ""].join("")
}), o = this.elemMain = [], s = this.elemHeader = [], l = this.elemCont = [], c = this.table = [],
u = this.footer = g.elem("div", {class: "layui-laydate-footer"});
if (n.zIndex && (a.style.zIndex = n.zIndex), g.each(new Array(2), function (e) {
if (!n.range && e > 0) return !0;
var t, i = g.elem("div", {class: "layui-laydate-header"}),
a = [(t = g.elem("i", {class: "layui-icon laydate-icon laydate-prev-y"}), t.innerHTML = "&#xe65a;", t), function () {
var e = g.elem("i", {class: "layui-icon laydate-icon laydate-prev-m"});
return e.innerHTML = "&#xe603;", e
}(), function () {
var e = g.elem("div", {class: "laydate-set-ym"}), t = g.elem("span"), n = g.elem("span");
return e.appendChild(t), e.appendChild(n), e
}(), function () {
var e = g.elem("i", {class: "layui-icon laydate-icon laydate-next-m"});
return e.innerHTML = "&#xe602;", e
}(), function () {
var e = g.elem("i", {class: "layui-icon laydate-icon laydate-next-y"});
return e.innerHTML = "&#xe65b;", e
}()], u = g.elem("div", {class: "layui-laydate-content"}), d = g.elem("table"), h = g.elem("thead"),
p = g.elem("tr");
g.each(a, function (e, t) {
i.appendChild(t)
}), h.appendChild(p), g.each(new Array(6), function (e) {
var t = d.insertRow(0);
g.each(new Array(7), function (n) {
if (0 === e) {
var i = g.elem("th");
i.innerHTML = r.weeks[n], p.appendChild(i)
}
t.insertCell(n)
})
}), d.insertBefore(h, d.children[0]), u.appendChild(d), o[e] = g.elem("div", {class: "layui-laydate-main laydate-main-list-" + e}), o[e].appendChild(i), o[e].appendChild(u), s.push(a), l.push(u), c.push(d)
}), g(u).html((e = [], t = [], "datetime" === n.type && e.push('<span lay-type="datetime" class="laydate-btns-time">' + r.timeTips + "</span>"), g.each(n.btns, function (e, a) {
var o = r.tools[a] || "btn";
n.range && "now" === a || (i && "clear" === a && (o = "cn" === n.lang ? "重置" : "Reset"), t.push('<span lay-type="' + a + '" class="laydate-btns-' + a + '">' + o + "</span>"))
}), e.push('<div class="laydate-footer-btns">' + t.join("") + "</div>"), e.join(""))), g.each(o, function (e, t) {
a.appendChild(t)
}), n.showBottom && a.appendChild(u), /^#/.test(n.theme)) {
var d = g.elem("style"),
h = ["#{{id}} .layui-laydate-header{background-color:{{theme}};}", "#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g, this.elemID).replace(/{{theme}}/g, n.theme);
"styleSheet" in d ? (d.setAttribute("type", "text/css"), d.styleSheet.cssText = h) : d.innerHTML = h, g(a).addClass("laydate-theme-molv"), a.appendChild(d)
}
this.remove(v.thisElemDate), i ? n.elem.append(a) : (document.body.appendChild(a), this.position()), this.checkDate().calendar(), this.changeEvent(), v.thisElemDate = this.elemID, "function" == typeof n.ready && n.ready(g.extend({}, n.dateTime, {month: n.dateTime.month + 1}))
}, v.prototype.remove = function (e) {
this.config;
var t = g("#" + (e || this.elemID));
return t.hasClass("layui-laydate-static") || this.checkDate(function () {
t.remove()
}), this
}, v.prototype.position = function () {
var e = this.config, t = (this.bindElem || e.elem[0]).getBoundingClientRect(), n = this.elem.offsetWidth,
r = this.elem.offsetHeight, i = function (e) {
return e = e ? "scrollLeft" : "scrollTop", document.body[e] | document.documentElement[e]
}, a = function (e) {
return document.documentElement[e ? "clientWidth" : "clientHeight"]
}, o = t.left, s = t.bottom;
o + n + 5 > a("width") && (o = a("width") - n - 5), s + r + 5 > a() && (s = t.top > r ? t.top - r : a() - r, s -= 10), e.position && (this.elem.style.position = e.position), this.elem.style.left = o + ("fixed" === e.position ? 0 : i(1)) + "px", this.elem.style.top = s + ("fixed" === e.position ? 0 : i()) + "px"
}, v.prototype.hint = function (e) {
var t = this, n = (t.config, g.elem("div", {class: f}));
n.innerHTML = e || "", g(t.elem).find("." + f).remove(), t.elem.appendChild(n), clearTimeout(t.hinTimer), t.hinTimer = setTimeout(function () {
g(t.elem).find("." + f).remove()
}, 3e3)
}, v.prototype.getAsYM = function (e, t, n) {
return n ? t-- : t++, t < 0 && (t = 11, e--), t > 11 && (t = 0, e++), [e, t]
}, v.prototype.systemDate = function (e) {
var t = e || new Date;
return {
year: t.getFullYear(),
month: t.getMonth(),
date: t.getDate(),
hours: e ? e.getHours() : 0,
minutes: e ? e.getMinutes() : 0,
seconds: e ? e.getSeconds() : 0
}
}, v.prototype.checkDate = function (e) {
var t, n, r = this, i = (new Date, r.config), a = i.dateTime = i.dateTime || r.systemDate(),
o = r.bindElem || i.elem[0],
s = (r.isInput(o), r.isInput(o) ? o.value : "static" === i.position ? "" : o.innerHTML), c = function (e) {
e.year > h[1] && (e.year = h[1], n = !0), e.month > 11 && (e.month = 11, n = !0), e.hours > 23 && (e.hours = 0, n = !0), e.minutes > 59 && (e.minutes = 0, e.hours++, n = !0), e.seconds > 59 && (e.seconds = 0, e.minutes++, n = !0), t = l.getEndDate(e.month + 1, e.year), e.date > t && (e.date = t, n = !0)
}, u = function (e, t, a) {
var o = ["startTime", "endTime"];
t = (t.match(r.EXP_SPLIT) || []).slice(1), a = a || 0, i.range && (r[o[a]] = r[o[a]] || {}), g.each(r.format, function (s, l) {
var c = parseFloat(t[s]);
t[s].length < l.length && (n = !0), /yyyy|y/.test(l) ? (c < h[0] && (c = h[0], n = !0), e.year = c) : /MM|M/.test(l) ? (c < 1 && (c = 1, n = !0), e.month = c - 1) : /dd|d/.test(l) ? (c < 1 && (c = 1, n = !0), e.date = c) : /HH|H/.test(l) ? (c < 1 && (c = 0, n = !0), e.hours = c, i.range && (r[o[a]].hours = c)) : /mm|m/.test(l) ? (c < 1 && (c = 0, n = !0), e.minutes = c, i.range && (r[o[a]].minutes = c)) : /ss|s/.test(l) && (c < 1 && (c = 0, n = !0), e.seconds = c, i.range && (r[o[a]].seconds = c))
}), c(e)
};
return "limit" === e ? (c(a), r) : ("string" == typeof (s = s || i.value) && (s = s.replace(/\s+/g, " ").replace(/^\s|\s$/g, "")), r.startState && !r.endState && (delete r.startState, r.endState = !0), "string" == typeof s && s ? r.EXP_IF.test(s) ? i.range ? (s = s.split(" " + i.range + " "), r.startDate = r.startDate || r.systemDate(), r.endDate = r.endDate || r.systemDate(), i.dateTime = g.extend({}, r.startDate), g.each([r.startDate, r.endDate], function (e, t) {
u(t, s[e], e)
})) : u(a, s) : (r.hint("日期格式不合法<br>必须遵循下述格式:<br>" + (i.range ? i.format + " " + i.range + " " + i.format : i.format) + "<br>已为你重置"), n = !0) : s && s.constructor === Date ? i.dateTime = r.systemDate(s) : (i.dateTime = r.systemDate(), delete r.startState, delete r.endState, delete r.startDate, delete r.endDate, delete r.startTime, delete r.endTime), c(a), n && s && r.setValue(i.range ? r.endDate ? r.parse() : "" : r.parse()), e && e(), r)
}, v.prototype.mark = function (e, t) {
var n, r = this.config;
return g.each(r.mark, function (e, r) {
var i = e.split("-");
i[0] != t[0] && 0 != i[0] || i[1] != t[1] && 0 != i[1] || i[2] != t[2] || (n = r || t[2])
}), n && e.html('<span class="laydate-day-mark">' + n + "</span>"), this
}, v.prototype.limit = function (e, t, n, r) {
var i, a = this, o = a.config, s = {}, l = o[n > 41 ? "endDate" : "dateTime"], c = g.extend({}, l, t || {});
return g.each({now: c, min: o.min, max: o.max}, function (e, t) {
var n;
s[e] = a.newDate(g.extend({year: t.year, month: t.month, date: t.date}, (n = {}, g.each(r, function (e, r) {
n[r] = t[r]
}), n))).getTime()
}), i = s.now < s.min || s.now > s.max, e && e[i ? "addClass" : "removeClass"](u), i
}, v.prototype.calendar = function (e) {
var t, n, r, i = this, a = i.config, o = e || a.dateTime, s = new Date, u = i.lang(),
d = "date" !== a.type && "datetime" !== a.type, p = e ? 1 : 0, f = g(i.table[p]).find("td"),
v = g(i.elemHeader[p][2]).find("span");
if (o.year < h[0] && (o.year = h[0], i.hint("最低只能支持到公元" + h[0] + "年")), o.year > h[1] && (o.year = h[1], i.hint("最高只能支持到公元" + h[1] + "年")), i.firstDate || (i.firstDate = g.extend({}, o)), s.setFullYear(o.year, o.month, 1), t = s.getDay(), n = l.getEndDate(o.month || 12, o.year), r = l.getEndDate(o.month + 1, o.year), g.each(f, function (e, s) {
var l = [o.year, o.month], u = 0;
(s = g(s)).removeAttr("class"), e < t ? (u = n - t + e, s.addClass("laydate-day-prev"), l = i.getAsYM(o.year, o.month, "sub")) : e >= t && e < r + t ? (u = e - t, a.range || u + 1 === o.date && s.addClass(c)) : (u = e - r - t, s.addClass("laydate-day-next"), l = i.getAsYM(o.year, o.month)), l[1]++, l[2] = u + 1, s.attr("lay-ymd", l.join("-")).html(l[2]), i.mark(s, l).limit(s, {
year: l[0],
month: l[1] - 1,
date: l[2]
}, e)
}), g(v[0]).attr("lay-ym", o.year + "-" + (o.month + 1)), g(v[1]).attr("lay-ym", o.year + "-" + (o.month + 1)), "cn" === a.lang ? (g(v[0]).attr("lay-type", "year").html(o.year + "年"), g(v[1]).attr("lay-type", "month").html(o.month + 1 + "月")) : (g(v[0]).attr("lay-type", "month").html(u.month[o.month]), g(v[1]).attr("lay-type", "year").html(o.year)), d && (a.range && (e ? i.endDate = i.endDate || {
year: o.year + ("year" === a.type ? 1 : 0),
month: o.month + ("month" === a.type ? 0 : -1)
} : i.startDate = i.startDate || {
year: o.year,
month: o.month
}, e && (i.listYM = [[i.startDate.year, i.startDate.month + 1], [i.endDate.year, i.endDate.month + 1]], i.list(a.type, 0).list(a.type, 1), "time" === a.type ? i.setBtnStatus("时间", g.extend({}, i.systemDate(), i.startTime), g.extend({}, i.systemDate(), i.endTime)) : i.setBtnStatus(!0))), a.range || (i.listYM = [[o.year, o.month + 1]], i.list(a.type, 0))), a.range && !e) {
var y = i.getAsYM(o.year, o.month);
i.calendar(g.extend({}, o, {year: y[0], month: y[1]}))
}
return a.range || i.limit(g(i.footer).find(m), null, 0, ["hours", "minutes", "seconds"]), a.range && e && !d && i.stampRange(), i
}, v.prototype.list = function (e, t) {
var n = this, r = n.config, i = r.dateTime, a = n.lang(),
o = r.range && "date" !== r.type && "datetime" !== r.type, s = g.elem("ul", {
class: p + " " + {
year: "laydate-year-list",
month: "laydate-month-list",
time: "laydate-time-list"
}[e]
}), l = n.elemHeader[t], d = g(l[2]).find("span"), h = n.elemCont[t || 0], f = g(h).find("." + p)[0],
v = "cn" === r.lang, y = v ? "年" : "", b = n.listYM[t] || {}, w = ["hours", "minutes", "seconds"],
S = ["startTime", "endTime"][t];
if (b[0] < 1 && (b[0] = 1), "year" === e) {
var _, k = _ = b[0] - 7;
k < 1 && (k = _ = 1), g.each(new Array(15), function (e) {
var i = g.elem("li", {"lay-ym": _}), a = {year: _};
_ == b[0] && g(i).addClass(c), i.innerHTML = _ + y, s.appendChild(i), _ < n.firstDate.year ? (a.month = r.min.month, a.date = r.min.date) : _ >= n.firstDate.year && (a.month = r.max.month, a.date = r.max.date), n.limit(g(i), a, t), _++
}), g(d[v ? 0 : 1]).attr("lay-ym", _ - 8 + "-" + b[1]).html(k + y + " - " + (_ - 1 + y))
} else if ("month" === e) g.each(new Array(12), function (e) {
var i = g.elem("li", {"lay-ym": e}), o = {year: b[0], month: e};
e + 1 == b[1] && g(i).addClass(c), i.innerHTML = a.month[e] + (v ? "月" : ""), s.appendChild(i), b[0] < n.firstDate.year ? o.date = r.min.date : b[0] >= n.firstDate.year && (o.date = r.max.date), n.limit(g(i), o, t)
}), g(d[v ? 0 : 1]).attr("lay-ym", b[0] + "-" + b[1]).html(b[0] + y); else if ("time" === e) {
var x = function () {
g(s).find("ol").each(function (e, r) {
g(r).find("li").each(function (r, i) {
n.limit(g(i), [{hours: r}, {hours: n[S].hours, minutes: r}, {
hours: n[S].hours,
minutes: n[S].minutes,
seconds: r
}][e], t, [["hours"], ["hours", "minutes"], ["hours", "minutes", "seconds"]][e])
})
}), r.range || n.limit(g(n.footer).find(m), n[S], 0, ["hours", "minutes", "seconds"])
};
r.range ? n[S] || (n[S] = {hours: 0, minutes: 0, seconds: 0}) : n[S] = i, g.each([24, 60, 60], function (e, t) {
var r = g.elem("li"), i = ["<p>" + a.time[e] + "</p><ol>"];
g.each(new Array(t), function (t) {
i.push("<li" + (n[S][w[e]] === t ? ' class="' + c + '"' : "") + ">" + g.digit(t, 2) + "</li>")
}), r.innerHTML = i.join("") + "</ol>", s.appendChild(r)
}), x()
}
if (f && h.removeChild(f), h.appendChild(s), "year" === e || "month" === e) g(n.elemMain[t]).addClass("laydate-ym-show"), g(s).find("li").on("click", function () {
var a = 0 | g(this).attr("lay-ym");
if (!g(this).hasClass(u)) {
if (0 === t) i[e] = a, o && (n.startDate[e] = a), n.limit(g(n.footer).find(m), null, 0); else if (o) n.endDate[e] = a; else {
var l = "year" === e ? n.getAsYM(a, b[1] - 1, "sub") : n.getAsYM(b[0], a, "sub");
g.extend(i, {year: l[0], month: l[1]})
}
"year" === r.type || "month" === r.type ? (g(s).find("." + c).removeClass(c), g(this).addClass(c), "month" === r.type && "year" === e && (n.listYM[t][0] = a, o && (n[["startDate", "endDate"][t]].year = a), n.list("month", t))) : (n.checkDate("limit").calendar(), n.closeList()), n.setBtnStatus(), r.range || n.done(null, "change"), g(n.footer).find(".laydate-btns-time").removeClass(u)
}
}); else {
var P = g.elem("span", {class: "laydate-time-text"}), C = function () {
g(s).find("ol").each(function (e) {
var t = this, r = g(t).find("li");
t.scrollTop = 30 * (n[S][w[e]] - 2), t.scrollTop <= 0 && r.each(function (e, n) {
if (!g(this).hasClass(u)) return t.scrollTop = 30 * (e - 2), !0
})
})
}, A = g(l[2]).find(".laydate-time-text");
C(), P.innerHTML = r.range ? [a.startTime, a.endTime][t] : a.timeTips, g(n.elemMain[t]).addClass("laydate-time-show"), A[0] && A.remove(), l[2].appendChild(P), g(s).find("ol").each(function (e) {
var t = this;
g(t).find("li").on("click", function () {
var a = 0 | this.innerHTML;
g(this).hasClass(u) || (r.range ? n[S][w[e]] = a : i[w[e]] = a, g(t).find("." + c).removeClass(c), g(this).addClass(c), x(), C(), (n.endDate || "time" === r.type) && n.done(null, "change"), n.setBtnStatus())
})
})
}
return n
}, v.prototype.listYM = [], v.prototype.closeList = function () {
var e = this;
e.config, g.each(e.elemCont, function (t, n) {
g(this).find("." + p).remove(), g(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")
}), g(e.elem).find(".laydate-time-text").remove()
}, v.prototype.setBtnStatus = function (e, t, n) {
var r, i = this.config, a = g(this.footer).find(m);
i.range && "date" !== i.type && "time" !== i.type && (t = t || this.startDate, n = n || this.endDate, r = this.newDate(t).getTime() > this.newDate(n).getTime(), this.limit(null, t) || this.limit(null, n) ? a.addClass(u) : a[r ? "addClass" : "removeClass"](u), e && r && this.hint("string" == typeof e ? d.replace(/日期/g, e) : d))
}, v.prototype.parse = function (e, t) {
var n = this.config,
r = t || (e ? g.extend({}, this.endDate, this.endTime) : n.range ? g.extend({}, this.startDate, this.startTime) : n.dateTime),
i = this.format.concat();
return g.each(i, function (e, t) {
/yyyy|y/.test(t) ? i[e] = g.digit(r.year, t.length) : /MM|M/.test(t) ? i[e] = g.digit(r.month + 1, t.length) : /dd|d/.test(t) ? i[e] = g.digit(r.date, t.length) : /HH|H/.test(t) ? i[e] = g.digit(r.hours, t.length) : /mm|m/.test(t) ? i[e] = g.digit(r.minutes, t.length) : /ss|s/.test(t) && (i[e] = g.digit(r.seconds, t.length))
}), n.range && !e ? i.join("") + " " + n.range + " " + this.parse(1) : i.join("")
}, v.prototype.newDate = function (e) {
return e = e || {}, new Date(e.year || 1, e.month || 0, e.date || 1, e.hours || 0, e.minutes || 0, e.seconds || 0)
}, v.prototype.setValue = function (e) {
var t = this.config, n = this.bindElem || t.elem[0], r = this.isInput(n) ? "val" : "html";
return "static" === t.position || g(n)[r](e || ""), this
}, v.prototype.stampRange = function () {
var e, t, n = this, r = n.config, i = g(n.elem).find("td");
if (r.range && !n.endDate && g(n.footer).find(m).addClass(u), n.endDate) {
if (e = n.newDate({
year: n.startDate.year,
month: n.startDate.month,
date: n.startDate.date
}).getTime(), t = n.newDate({
year: n.endDate.year,
month: n.endDate.month,
date: n.endDate.date
}).getTime(), e > t) return n.hint(d);
g.each(i, function (r, i) {
var a = g(i).attr("lay-ymd").split("-"), o = n.newDate({year: a[0], month: a[1] - 1, date: a[2]}).getTime();
g(i).removeClass("laydate-selected " + c), o !== e && o !== t || g(i).addClass(g(i).hasClass("laydate-day-prev") || g(i).hasClass("laydate-day-next") ? "laydate-selected" : c), o > e && o < t && g(i).addClass("laydate-selected")
})
}
}, v.prototype.done = function (e, t) {
var n = this.config, r = g.extend({}, this.startDate ? g.extend(this.startDate, this.startTime) : n.dateTime),
i = g.extend({}, g.extend(this.endDate, this.endTime));
return g.each([r, i], function (e, t) {
"month" in t && g.extend(t, {month: t.month + 1})
}), e = e || [this.parse(), r, i], "function" == typeof n[t || "done"] && n[t || "done"].apply(n, e), this
}, v.prototype.choose = function (e) {
var t = this, n = t.config, r = n.dateTime, i = g(t.elem).find("td"), a = e.attr("lay-ymd").split("-"),
o = function (e) {
new Date, e && g.extend(r, a), n.range && (t.startDate ? g.extend(t.startDate, a) : t.startDate = g.extend({}, a, t.startTime), t.startYMD = a)
};
if (a = {year: 0 | a[0], month: (0 | a[1]) - 1, date: 0 | a[2]}, !e.hasClass(u)) if (n.range) {
if (g.each(["startTime", "endTime"], function (e, n) {
t[n] = t[n] || {hours: 0, minutes: 0, seconds: 0}
}), t.endState) o(), delete t.endState, delete t.endDate, t.startState = !0, i.removeClass(c + " laydate-selected"), e.addClass(c); else if (t.startState) {
if (e.addClass(c), t.endDate ? g.extend(t.endDate, a) : t.endDate = g.extend({}, a, t.endTime), t.newDate(a).getTime() < t.newDate(t.startYMD).getTime()) {
var s = g.extend({}, t.endDate, {
hours: t.startDate.hours,
minutes: t.startDate.minutes,
seconds: t.startDate.seconds
});
g.extend(t.endDate, t.startDate, {
hours: t.endDate.hours,
minutes: t.endDate.minutes,
seconds: t.endDate.seconds
}), t.startDate = s
}
n.showBottom || t.done(), t.stampRange(), t.endState = !0, t.done(null, "change")
} else e.addClass(c), o(), t.startState = !0;
g(t.footer).find(m)[t.endDate ? "removeClass" : "addClass"](u)
} else "static" === n.position ? (o(!0), t.calendar().done().done(null, "change")) : "date" === n.type ? (o(!0), t.setValue(t.parse()).remove().done()) : "datetime" === n.type && (o(!0), t.calendar().done(null, "change"))
}, v.prototype.tool = function (e, t) {
var n = this, r = n.config, i = r.dateTime, a = "static" === r.position, o = {
datetime: function () {
g(e).hasClass(u) || (n.list("time", 0), r.range && n.list("time", 1), g(e).attr("lay-type", "date").html(n.lang().dateTips))
}, date: function () {
n.closeList(), g(e).attr("lay-type", "datetime").html(n.lang().timeTips)
}, clear: function () {
n.setValue("").remove(), a && (g.extend(i, n.firstDate), n.calendar()), r.range && (delete n.startState, delete n.endState, delete n.endDate, delete n.startTime, delete n.endTime), n.done(["", {}, {}])
}, now: function () {
var e = new Date;
g.extend(i, n.systemDate(), {
hours: e.getHours(),
minutes: e.getMinutes(),
seconds: e.getSeconds()
}), n.setValue(n.parse()).remove(), a && n.calendar(), n.done()
}, confirm: function () {
if (r.range) {
if (!n.endDate) return n.hint("请先选择日期范围");
if (g(e).hasClass(u)) return n.hint("time" === r.type ? d.replace(/日期/g, "时间") : d)
} else if (g(e).hasClass(u)) return n.hint("不在有效日期或时间范围内");
n.done(), n.setValue(n.parse()).remove()
}
};
o[t] && o[t]()
}, v.prototype.change = function (e) {
var t = this, n = t.config, r = n.dateTime, i = n.range && ("year" === n.type || "month" === n.type),
a = t.elemCont[e || 0], o = t.listYM[e], s = function (s) {
var l = ["startDate", "endDate"][e], c = g(a).find(".laydate-year-list")[0],
u = g(a).find(".laydate-month-list")[0];
return c && (o[0] = s ? o[0] - 15 : o[0] + 15, t.list("year", e)), u && (s ? o[0]-- : o[0]++, t.list("month", e)), (c || u) && (g.extend(r, {year: o[0]}), i && (t[l].year = o[0]), n.range || t.done(null, "change"), t.setBtnStatus(), n.range || t.limit(g(t.footer).find(m), {year: o[0]})), c || u
};
return {
prevYear: function () {
s("sub") || (r.year--, t.checkDate("limit").calendar(), n.range || t.done(null, "change"))
}, prevMonth: function () {
var e = t.getAsYM(r.year, r.month, "sub");
g.extend(r, {year: e[0], month: e[1]}), t.checkDate("limit").calendar(), n.range || t.done(null, "change")
}, nextMonth: function () {
var e = t.getAsYM(r.year, r.month);
g.extend(r, {year: e[0], month: e[1]}), t.checkDate("limit").calendar(), n.range || t.done(null, "change")
}, nextYear: function () {
s() || (r.year++, t.checkDate("limit").calendar(), n.range || t.done(null, "change"))
}
}
}, v.prototype.changeEvent = function () {
var e = this;
e.config, g(e.elem).on("click", function (e) {
g.stope(e)
}), g.each(e.elemHeader, function (t, n) {
g(n[0]).on("click", function (n) {
e.change(t).prevYear()
}), g(n[1]).on("click", function (n) {
e.change(t).prevMonth()
}), g(n[2]).find("span").on("click", function (n) {
var r = g(this), i = r.attr("lay-ym"), a = r.attr("lay-type");
i && (i = i.split("-"), e.listYM[t] = [0 | i[0], 0 | i[1]], e.list(a, t), g(e.footer).find(".laydate-btns-time").addClass(u))
}), g(n[3]).on("click", function (n) {
e.change(t).nextMonth()
}), g(n[4]).on("click", function (n) {
e.change(t).nextYear()
})
}), g.each(e.table, function (t, n) {
g(n).find("td").on("click", function () {
e.choose(g(this))
})
}), g(e.footer).find("span").on("click", function () {
var t = g(this).attr("lay-type");
e.tool(this, t)
})
}, v.prototype.isInput = function (e) {
return /input|textarea/.test(e.tagName.toLocaleLowerCase())
}, v.prototype.events = function () {
var e = this, t = e.config, n = function (n, r) {
n.on(t.trigger, function () {
r && (e.bindElem = this), e.render()
})
};
t.elem[0] && !t.elem[0].eventHandler && (n(t.elem, "bind"), n(t.eventElem), g(document).on("click", function (n) {
n.target !== t.elem[0] && n.target !== t.eventElem[0] && n.target !== g(t.closeStop)[0] && e.remove()
}).on("keydown", function (t) {
13 === t.keyCode && g("#" + e.elemID)[0] && e.elemID === v.thisElem && (t.preventDefault(), g(e.footer).find(m)[0].click())
}), g(window).on("resize", function () {
if (!e.elem || !g(".layui-laydate")[0]) return !1;
e.position()
}), t.elem[0].eventHandler = !0)
}, l.render = function (e) {
var t = new v(e);
return function () {
var e = this;
return {
hint: function (t) {
e.hint.call(e, t)
}, config: e.config
}
}.call(t)
}, l.getEndDate = function (e, t) {
var n = new Date;
return n.setFullYear(t || n.getFullYear(), e || n.getMonth() + 1, 1), new Date(n.getTime() - 864e5).getDate()
}, window.lay = window.lay || g, o ? (l.ready(), layui.define(function (e) {
l.path = layui.cache.dir, e("laydate", l)
})) : void 0 === (r = function () {
return l
}.call(t, n, t, e)) || (e.exports = r)
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.appConfig.kgConfirmOverlay.overlayName, this.container = t.appConfig.kgConfirmOverlay.container, this.okButton = t.appConfig.kgConfirmOverlay.okButton, this.cancelButton = t.appConfig.kgConfirmOverlay.cancelButton, this.okCallback = null, this.cancelCallback = null, this.overlayManager = n, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0)
}
return r(e, [{
key: "setContent", value: function (e) {
document.getElementById(this.overlayName).querySelector("p").innerHTML = e
}
}, {
key: "open", value: function () {
this.overlayManager.open(this.overlayName)
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.app.KG_ScanStamp && e.app.KG_ScanStamp.clearSealData(), e.cancelCallback && e.cancelCallback()
})
}
}, {
key: "ok", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.okCallback && e.okCallback()
})
}
}, {
key: "setOKCallback", value: function (e) {
this.okCallback = null != e ? e : null, this.okButton.onclick = this.ok.bind(this)
}
}, {
key: "setCancelCallback", value: function (e) {
this.cancelCallback = null != e ? e : null, this.cancelButton.onclick = this.close.bind(this)
}
}]), e
}();
t.default = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KGPasswordPrompt = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = s(n(15)), a = s(n(32)), o = n(5);
function s(e) {
return e && e.__esModule ? e : {default: e}
}
var l = function () {
function e(t, n, r) {
var i = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.overlayName, this.container = t.container, this.label = t.label, this.input = t.input, this.rememberPwd = document.getElementById("rememberPwd"), this.rememberPwdWrapper = this.container.querySelector(".kg_checkbox_wrapper"), this.rememberPwdWrapper.onclick = this.onRememberPwdWrapperClick.bind(this), this.pwd = null, this.submitButton = t.submitButton, this.cancelButton = t.cancelButton, this.overlayManager = n, this.l10n = r, this.tipMsg = document.getElementById("kg_tip_msg");
var a = window.KGPdfViewerWebApp, s = a.pwdConfig, l = a.pwdDefaultConfig;
this.pwdConfig = (0, o.mergerConfig)(l, s), this.updateCallback = null, this.submitButton.addEventListener("click", this.verify.bind(this), !1), this.cancelButton.addEventListener("click", this.close.bind(this)), this.input.addEventListener("keydown", function (e) {
i.input.classList.remove("KG_Input_Error"), i.container.querySelector(".kg_error_msg").style.visibility = "hidden", 13 === e.keyCode && i.verify()
}), this.container.getElementsByTagName("form")[0].addEventListener("submit", function (e) {
e.preventDefault()
}), this.closeBtn = this.container.querySelector(".kg_dialog_close"), this.closeBtn.addEventListener("click", this.close.bind(this)), !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) && (this.input.onblur = function (e) {
setTimeout(function () {
if ("INPUT" !== document.activeElement.tagName) {
var e = "pc";
/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) ? e = "ios" : /(Android)/i.test(navigator.userAgent) && (e = "android"), "ios" === e && document.activeElement.scrollIntoViewIfNeeded(!0)
}
}, 100)
}), this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0)
}
return r(e, [{
key: "onRememberPwdWrapperClick", value: function (e) {
this.rememberPwd.checked = !this.rememberPwd.checked, this.rememberPwd.checked ? this.rememberPwdWrapper.classList.add("kg_checkbox_wrapper-checked") : this.rememberPwdWrapper.classList.remove("kg_checkbox_wrapper-checked")
}
}, {
key: "open", value: function (e, t) {
var n = this;
return this.certValidity = e || !1, this.overlayManager.open(this.overlayName).then(function () {
n.pwd = n.getRememberedPwd(t);
var e = n.pwdConfig, r = e.defaultPwd, i = e.keepRemember, a = window.KGPdfViewerWebApp, o = a.password,
s = a.sealOrigin;
n.setTipMsg(n.pwdConfig), i && (n.rememberPwd.checked = !0, n.rememberPwdWrapper.classList.add("kg_checkbox_wrapper-checked")), (r || o) && 0 == s && (n.pwd = r || o), n.pwd ? (n.input.value = n.pwd, n.rememberPwd.checked = !0, n.rememberPwdWrapper.classList.add("kg_checkbox_wrapper-checked"), n.verify()) : (n.input.value = "", n.input.focus())
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.pwd || (e.rememberPwd.checked = !1, e.rememberPwdWrapper.classList.remove("kg_checkbox_wrapper-checked"), (0, o.deleteCookieAndStorage)("KG_Remember"), e.input.classList.remove("KG_Input_Error"), e.container.querySelector(".kg_error_msg").style.visibility = "hidden")
})
}
}, {
key: "verify", value: function () {
var e = this, t = this.input.value;
t && t.length > 0 ? this.overlayManager.close(this.overlayName).then(function () {
switch (e.l10n._lang) {
case"zh-TW":
window.KGPdfViewerWebApp.getTipPrompt().open("正在驗證密碼...");
break;
case"en-US":
window.KGPdfViewerWebApp.getTipPrompt().open("Verifying password...");
break;
default:
window.KGPdfViewerWebApp.getTipPrompt().open("正在验证密码...")
}
(0, o.functionalJudgment)("certValidity") && e.certValidity ? new Promise(function (e) {
window.KGPdfViewerWebApp.PDFViewerApplication.KG_CertValidity.verify(t, e)
}).then(function () {
e.updateCallback(t)
}) : e.updateCallback(t)
}) : (this.input.classList.add("KG_Input_Error"), this.container.querySelector(".kg_error_msg").style.visibility = "visible", this.input.focus())
}
}, {
key: "setUpdateCallback", value: function (e) {
this.updateCallback = e
}
}, {
key: "remember", value: function (e) {
if (this.pwd) this.rememberPwd.checked || this.clearRememberedPwd(); else if (this.rememberPwd.checked) {
var t = window.KGPdfViewerWebApp.userId;
window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs && "delete" === e && (t = window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN);
var n = window.KGPdfViewerWebApp.userCode, r = this.input.value,
s = t ? "userId=" + t + ";password=" + r : "userCode=" + n + ";password=" + r,
l = i.default.stringify(a.default.parse(s));
(0, o.setCookieOrStorage)("KG_Remember", l, {expires: 7})
}
}
}, {
key: "getRememberedPwd", value: function (e) {
var t = (0, o.getCookieOrStorage)("KG_Remember"), n = a.default.stringify(i.default.parse(t)),
r = n.split(";password=")[0].split("userId=")[1], s = n.split(";password=")[0].split("userCode=")[1],
l = n.split(";password=")[1];
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs) {
if ("add" === e) {
if (r === window.KGPdfViewerWebApp.userId || s === window.KGPdfViewerWebApp.userCode) return l
} else if ("delete" === e && (r === window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN || s === window.KGPdfViewerWebApp.userCode)) return l
} else if (r === window.KGPdfViewerWebApp.userId || s === window.KGPdfViewerWebApp.userCode) return l;
return !1
}
}, {
key: "clearRememberedPwd", value: function () {
(0, o.deleteCookieAndStorage)("KG_Remember"), this.rememberPwd.checked = !1, this.rememberPwdWrapper.classList.remove("kg_checkbox_wrapper-checked")
}
}, {
key: "setTipMsg", value: function (e) {
var t = e.tips, n = e.tipsColor;
t && (this.tipMsg.style.display = "block", this.tipMsg.innerHTML = t, this.tipMsg.style.color = n)
}
}]), e
}();
t.KGPasswordPrompt = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.SelectSealPrompt = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(5), a = n(41), o = n(39);
var s = function () {
function e(t, n, r) {
var a = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.overlayName, this.container = t.container, this.submitButton = t.submitButton, this.cancelButton = t.cancelButton, this.img = t.img, this.sealLeft = t.sealLeft, this.sealRight = t.sealRight, this.kgSealIdx = document.getElementById("kg-seal-idx"), this.kgSealTotalNumb = document.getElementById("kg-seal-totalNumb"), this.continuityStamp = document.getElementById("continuity-stamp"), this.continuityRange = document.getElementById("continuity-range"), this.continuityRange.onblur = i.scrollToResizeScreen, this.img.oncontextmenu = function (e) {
e.preventDefault()
}, this.img.onmousedown = function (e) {
e.preventDefault()
}, this.additionText = document.getElementById("addition-text"), this.showAdditionConfig = document.getElementById("show-addition-config"), this.pagingSealWrapper = document.getElementById("paging-seal-wrapper"), this.additionTextWrapper = document.getElementById("addition-text-wrapper"), this.noSealsWrapper = document.getElementById("kg_no_seals_wrapper"), this.sealsWrapper = document.getElementById("kg_seals_wrapper"), this.fileType = window.KGPdfViewerWebApp.fileType, this.stampType = window.KGPdfViewerWebApp.stampType, this.pagingSeal = document.getElementById("paging-seal"), this.showPagingSealConfig = document.getElementById("paging-seal-config"), this.closeBtn = this.container.querySelector(".kg_dialog_close"), this.close = this.close.bind(this), this.closeBtn.addEventListener("click", function () {
return a.close(!0)
}), this.overlayManager = n, this.l10n = r, this.updateCallback = null, this.reason = null, this.seals = null, this.sealIdx = 0, this.isQfz = !1, this.sigWithDifferentCert = !0, this.verify = this.verify.bind(this), this.clientVerify = this.clientVerify.bind(this), this.displaySealsWapper = this.displaySealsWapper.bind(this), this.submitButton.addEventListener("click", function () {
a.clientVerify().then(function (e) {
e && a.verify()
})
}, !1), this.cancelButton.addEventListener("click", function () {
var e = window.KGPdfViewerWebApp.PDFViewerApplication, t = e.pdfStamp, n = e.pagesCount, r = e.pdfViewer,
i = e.KGStampConfirm;
if (null != t) if (t.tempSeals.length) {
for (var o = 1; o < n; o++) {
var s = r.getPageView(o - 1).pdfPage.tempStamps;
for (var l in s) s.hasOwnProperty(l) && (s[l].querySelector(".deleteTempStampSection").style.display = "block")
}
i && i.show()
} else t.isStamp && t.cancelStamp();
a.deleteAllOriginImgData(), a.pagingSeal.checked && a.onPagingSealWrapperClick(), a.close(!0)
}), this.sealLeft.addEventListener("click", this.left.bind(this)), this.sealRight.addEventListener("click", this.right.bind(this)), this.overlayManager.register(this.overlayName, this.container, this.close, !1), this.hideStampBtnFunList = [], this.continuityStampWrapper = document.getElementById("continuity-stamp-wrapper"), this.KG_StampContinuity = document.getElementById("KG_StampContinuity");
var o = this.continuityStampWrapper.querySelector(".KG_StampContinuity_Tip");
this.KG_StampContinuity.addEventListener("mouseover", function () {
o.style.opacity = 1
}), this.KG_StampContinuity.addEventListener("mouseout", function () {
o.style.opacity = 0
}), window.KGPdfViewerWebApp.prepareStamp ? (this.continuityStampWrapper.setAttribute("hidden", !0), this.hideStampBtnFunList.push(function () {
a.continuityStampWrapper.setAttribute("hidden", !0)
})) : this.continuityStampWrapper.onclick = this.onContinuityStampWrapperClick.bind(this), null != window.KGPdfViewerWebApp.externalGetSeals && (this.continuityStampWrapper.setAttribute("hidden", !0), this.pagingSealWrapper.setAttribute("hidden", !0), this.additionTextWrapper.setAttribute("hidden", !0), this.hideStampBtnFunList.push(function () {
a.continuityStampWrapper.setAttribute("hidden", !0), a.pagingSealWrapper.setAttribute("hidden", !0), a.additionTextWrapper.setAttribute("hidden", !0)
})), window.KGPdfViewerWebApp.PDFViewerApplication.KG_SealPreLocation && (this.continuityStampWrapper.setAttribute("hidden", !0), this.pagingSealWrapper.setAttribute("hidden", !0), this.additionTextWrapper.setAttribute("hidden", !0), this.hideStampBtnFunList.push(function () {
a.continuityStampWrapper.setAttribute("hidden", !0), a.pagingSealWrapper.setAttribute("hidden", !0), a.additionTextWrapper.setAttribute("hidden", !0)
})), this.additionTextWrapper.onclick = this.onAdditionTextWrapperClick.bind(this), "OFD" === this.fileType || 2 == this.stampType ? this.additionTextWrapper.style.display = "none" : this.showAdditionConfig.onclick = function () {
var e = "origin" in a.seals[a.sealIdx] ? a.seals[a.sealIdx].origin.imgdata : a.seals[a.sealIdx].imgdata,
t = "origin" in a.seals[a.sealIdx] ? a.seals[a.sealIdx].origin.height : a.seals[a.sealIdx].height,
n = "origin" in a.seals[a.sealIdx] ? a.seals[a.sealIdx].origin.width : a.seals[a.sealIdx].width,
r = a.seals[a.sealIdx].imgExt, i = a.seals[a.sealIdx].selectSealInfo ? a.seals[a.sealIdx].selectSealInfo : {
textValue: "",
timePosition: window.KGPdfViewerWebApp.additionTextConfig.timePosition,
textPosition: window.KGPdfViewerWebApp.additionTextConfig.textPosition,
timeSize: window.KGPdfViewerWebApp.additionTextConfig.timeFontSize,
textSize: window.KGPdfViewerWebApp.additionTextConfig.fontSize,
color: window.KGPdfViewerWebApp.additionTextConfig.color,
font: window.KGPdfViewerWebApp.additionTextConfig.font,
percentY: window.KGPdfViewerWebApp.additionTextConfig.percentY
};
window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig.open(e, n, t, r, i)
}, this.pagingSealWrapper.onclick = this.onPagingSealWrapperClick.bind(this), 1 === window.KGPdfViewerWebApp.PDFViewerApplication.pagesCount ? this.pagingSealWrapper.style.display = "none" : (this.KGPagingSeal = window.KGPdfViewerWebApp.PDFViewerApplication.KGPagingSeal, this.KGPagingSeal ? this.showPagingSealConfig.onclick = function () {
var e = a.seals[a.sealIdx];
a.KGPagingSeal.open(e)
} : window.KGPdfViewerWebApp.prepareStamp && (this.showPagingSealConfig.onclick = function () {
a.KGPagingSeal = window.KGPdfViewerWebApp.PDFViewerApplication.KGPagingSeal;
var e = a.seals[a.sealIdx];
a.KGPagingSeal.open(e)
}))
}
return r(e, [{
key: "onContinuityStampWrapperClick", value: function (e) {
e && e.target.id === this.continuityRange.id || (this.continuityStamp.checked = !this.continuityStamp.checked, this.continuityStamp.checked ? (this.continuityStampWrapper.classList.add("kg_checkbox_wrapper-checked"), this.pagingSeal.checked && this.onPagingSealWrapperClick()) : this.continuityStampWrapper.classList.remove("kg_checkbox_wrapper-checked"))
}
}, {
key: "onAdditionTextWrapperClick", value: function (e) {
if (!e || e.target.id !== this.showAdditionConfig.id) {
this.additionText.checked = !this.additionText.checked;
var t = window.KGPdfViewerWebApp.additionTextConfig.isSelect;
if (this.additionText.checked) this.additionTextWrapper.classList.add("kg_checkbox_wrapper-checked"), this.pagingSeal.checked && this.onPagingSealWrapperClick(), this.showAdditionConfig.style.display = "block", this.saveOriginImgData(), this.showAdditionConfig.click(), this.seals[this.sealIdx].isSelect = !0; else this.additionTextWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.showAdditionConfig.style.display = "none", this.deleteOriginImgData(), t && (this.seals[this.sealIdx].imgdata = this.seals[this.sealIdx].origin.imgdata, this.seals[this.sealIdx].width = this.seals[this.sealIdx].origin.width, this.seals[this.sealIdx].height = this.seals[this.sealIdx].origin.height), this.img.src = this.seals[this.sealIdx].imgdata, this.seals[this.sealIdx].isSelect = !1, window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig.init()
}
}
}, {
key: "onPagingSealWrapperClick", value: function (e) {
e && e.target.id === this.showPagingSealConfig.id || (this.pagingSeal.checked = !this.pagingSeal.checked, this.pagingSeal.checked ? (this.pagingSealWrapper.classList.add("kg_checkbox_wrapper-checked"), this.continuityStamp.checked && this.onContinuityStampWrapperClick(), this.additionText.checked && this.deleteAllOriginImgData(), window.KGPdfViewerWebApp.additionTextConfig.isSelect && this.additionText.checked && this.onAdditionTextWrapperClick(), this.showPagingSealConfig.style.display = "block", this.showPagingSealConfig.click()) : (this.pagingSealWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.seals[this.sealIdx].hasOwnProperty("qfzSeal") && delete this.seals[this.sealIdx].qfzSeal, this.showPagingSealConfig.style.display = "none"))
}
}, {
key: "displaySealsWapper", value: function () {
this.seals.length ? (this.sealsWrapper.removeAttribute("hidden"), this.submitButton.removeAttribute("disabled"), this.noSealsWrapper.setAttribute("hidden", !0)) : (this.noSealsWrapper.removeAttribute("hidden"), this.sealsWrapper.setAttribute("hidden", !0), this.submitButton.setAttribute("disabled", !0))
}
}, {
key: "init", value: function () {
if (this.seals.length) {
if (this.sealIdx = 0, this.sealLeft.setAttribute("disabled", !0), this.kgSealIdx.innerHTML = "1", this.kgSealTotalNumb.innerHTML = this.seals.length, this.continuityRange.value = "1-" + window.KGPdfViewerWebApp.getNumPages(), 1 === this.seals.length ? this.sealRight.setAttribute("disabled", !0) : this.sealRight.removeAttribute("disabled"), this.seals[0].isSecretSeal) this.continuityStampWrapper.setAttribute("hidden", !0), this.pagingSealWrapper.setAttribute("hidden", !0), this.additionTextWrapper.setAttribute("hidden", !0); else {
this.continuityStampWrapper.removeAttribute("hidden"), this.pagingSealWrapper.removeAttribute("hidden"), this.additionTextWrapper.removeAttribute("hidden");
for (var e = 0, t = this.hideStampBtnFunList.length; e < t; e++) this.hideStampBtnFunList[e]()
}
this.img.src = this.seals[this.sealIdx].imgdata, this.additionTextCheckedAndAdditionConfigDisplay()
}
}
}, {
key: "open", value: function () {
var e = this;
this.overlayManager.open(this.overlayName).then(function () {
e.init()
})
}
}, {
key: "close", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
this.overlayManager._active.indexOf(this.overlayName) > -1 && this.overlayManager.close(this.overlayName).then(function () {
e && window.KGPdfViewerWebApp.cancelStampCallback()
})
}
}, {
key: "verify", value: function (e) {
e && e.preventDefault(), e && e.stopPropagation();
var t = void 0, n = void 0;
null != window.KGPdfViewerWebApp.continuityRange && (t = window.KGPdfViewerWebApp.continuityRange.beginPage, n = window.KGPdfViewerWebApp.continuityRange.endPage);
var r = window.KGPdfViewerWebApp.getNumPages();
(!t || t <= 0) && (t = 1), (!n || n > r) && (n = r);
var i = t + "-" + (n || r), a = this.continuityRange.value || i || "1-" + r;
if (/^\d+-\d+$/.test(a)) {
var o = a.split("-"), s = parseInt(o[0]), l = parseInt(o[1]);
if (s > l) {
var c = l;
return l = s, void (s = c)
}
s <= 0 && (s = 1), l > window.KGPdfViewerWebApp.getNumPages() && (l = window.KGPdfViewerWebApp.getNumPages());
var u = {};
for (var d in this.seals[this.sealIdx]) this.seals[this.sealIdx].hasOwnProperty(d) && (u[d] = this.seals[this.sealIdx][d]);
this.close();
var h = {
seal: u,
isContinuityStampCheck: this.continuityStamp.checked,
isStampOfQfz: this.pagingSeal.checked,
continuityRange: s + "-" + l
};
if (this.isQfz = this.pagingSeal.checked, this.deleteAllOriginImgData(), this.pagingSeal.checked && this.onPagingSealWrapperClick(), window.KGPdfViewerWebApp.stampMask) document.getElementById("KG_StampMask").setAttribute("style", "pointer-events: none");
return this.updateCallback(h)
}
this.continuityRange.focus()
}
}, {
key: "clientVerify", value: function () {
var e = this;
return new Promise(function (t) {
var n = void 0, r = window.KGPdfViewerWebApp, a = r.isSM, s = r.fileType, l = r.cilentSeals,
c = r.PDFViewerApplication.KGAlertPrompt;
if (a && "OFD" == s) {
var u = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp.pdfStampSeal.keyPwd, d = l[e.sealIdx];
(0, o.WebKGVerify)(d, "", u, function (e) {
n = e
}, function (e) {
return (0, i.closeOverlay)().then(function () {
return c.open(e)
})
}).then(function () {
t(n)
})
} else t(!0)
})
}
}, {
key: "left", value: function () {
if (this.sealIdx > 0) {
if (this.sealIdx--, this.kgSealIdx.innerHTML = this.sealIdx + 1, this.deleteAllOriginImgData(), this.additionTextCheckedAndAdditionConfigDisplay(), "PDF" === this.fileType) {
var e = window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig;
e && e.init()
}
this.pagingSeal.checked && this.onPagingSealWrapperClick(), this.img.src = this.seals[this.sealIdx].imgdata, this.sealRight.removeAttribute("disabled")
}
this.sealIdx <= 0 && this.sealLeft.setAttribute("disabled", !0)
}
}, {
key: "right", value: function () {
if (this.sealIdx < this.seals.length - 1) {
if (this.sealIdx++, this.kgSealIdx.innerHTML = this.sealIdx + 1, this.deleteAllOriginImgData(), this.additionTextCheckedAndAdditionConfigDisplay(), "PDF" === this.fileType) {
var e = window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig;
e && e.init()
}
this.pagingSeal.checked && this.onPagingSealWrapperClick(), this.img.src = this.seals[this.sealIdx].imgdata, this.sealLeft.removeAttribute("disabled")
}
this.sealIdx >= this.seals.length - 1 && this.sealRight.setAttribute("disabled", !0)
}
}, {
key: "setSeals", value: function (e) {
var t = window.KGPdfViewerWebApp.additionTextConfig.isSelect, n = window.KGPdfViewerWebApp.additionText;
this.seals = t && n ? this.sealsAddTextAndSaveOriginSeals(e) : e, this.displaySealsWapper()
}
}, {
key: "updateSeals", value: function (e) {
this.setSeals(e), this.init(), e.length && (this.continuityStamp.checked = !1, this.continuityStampWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.pagingSeal.checked = !1, this.pagingSealWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.seals[this.sealIdx].hasOwnProperty("qfzSeal") && delete this.seals[this.sealIdx].qfzSeal, this.showPagingSealConfig.style.display = "none")
}
}, {
key: "sealsAddTextAndSaveOriginSeals", value: function (e) {
for (var t = window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig, n = function (n) {
e[n].origin = {};
var r = new Image, i = new Image;
i.onload = function () {
t.imgExt = e[n].imgExt, t.sealImg = i, t.xRadio = e[n].width / r.width, t.yRadio = e[n].height / r.height;
var a = t.drawText();
e[n].imgdata = a.data, e[n].width = a.width, e[n].height = a.height
}, r.src = e[n].imgdata, r.onload = function () {
var t = e[n].imgdata;
i.src = t, e[n].origin.imgdata = t, e[n].origin.width = e[n].width, e[n].origin.height = e[n].height, e[n].isSelect = !0
}
}, r = 0; r < e.length; r++) n(r);
return e
}
}, {
key: "additionTextCheckedAndAdditionConfigDisplay", value: function () {
window.KGPdfViewerWebApp.additionTextConfig.isSelect && (this.seals[this.sealIdx].isSelect ? this.additionText.parentNode.classList.add("kg_checkbox_wrapper-checked") : this.additionText.parentNode.classList.remove("kg_checkbox_wrapper-checked"), this.showAdditionConfig.style.display = this.seals[this.sealIdx].isSelect ? "block" : "none", this.additionText.checked = !!this.seals[this.sealIdx].isSelect)
}
}, {
key: "setUpdateCallback", value: function (e, t) {
this.updateCallback = e, this.reason = t
}
}, {
key: "saveOriginImgData", value: function () {
window.KGPdfViewerWebApp.additionTextConfig.isSelect || (this.seals[this.sealIdx].origin = {
imgdata: this.seals[this.sealIdx].imgdata,
width: this.seals[this.sealIdx].width,
height: this.seals[this.sealIdx].height
})
}
}, {
key: "deleteOriginImgData", value: function () {
if (!window.KGPdfViewerWebApp.additionTextConfig.isSelect) {
for (var e in this.seals[this.sealIdx].origin) this.seals[this.sealIdx].origin.hasOwnProperty(e) && (this.seals[this.sealIdx][e] = this.seals[this.sealIdx].origin[e]);
delete this.seals[this.sealIdx].origin
}
}
}, {
key: "deleteAllOriginImgData", value: function () {
if (!window.KGPdfViewerWebApp.additionTextConfig.isSelect) {
for (var e = 0; e < this.seals.length; e++) {
for (var t in this.seals[e].origin) this.seals[e].origin.hasOwnProperty(t) && (this.seals[e][t] = this.seals[e].origin[t]);
delete this.seals[e].origin
}
this.additionText.checked && this.onAdditionTextWrapperClick()
}
}
}, {
key: "pagingSealNoSelectSealPrompt", value: function (e) {
var t = this, n = window.KGPdfViewerWebApp.PDFViewerApplication.KGPagingSeal;
this.pagingSeal.checked = !0, this.continuityStamp.checked = !1, this.capability = (0, a.createCapability)(), n.noSelectSealPrompt(e), this.capability.promise.then(function () {
t.verify(), t.pagingSeal.checked = !1
})
}
}, {
key: "continuitySealNoSelectSealPrompt", value: function () {
this.continuityStamp.checked = !0, this.pagingSeal.checked = !1, this.verify(), this.continuityStamp.checked = !1
}
}, {
key: "singleSealNoSelectSealPrompt", value: function () {
this.continuityStamp.checked = !1, this.pagingSeal.checked = !1, this.verify()
}
}]), e
}();
t.SelectSealPrompt = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_AlertPrompt = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.overlayName = n.overlayName, this.container = n.container, this.close = this.close.bind(this), this.createDom = this.createDom.bind(this), this.init = this.init.bind(this), this.createDom(), this.init(), this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.close, !1), this.closeCallback = null
}
return r(e, [{
key: "createDom", value: function () {
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.container.appendChild(e);
var t = document.createElement("div");
t.classList.add("kg_dialog_title"), t.setAttribute("data-l10n-id", "alert_title"), e.appendChild(t), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", e.appendChild(this.closeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.container.appendChild(n), this.content = document.createElement("p"), this.content.classList.add("KG_AlertPrompt_Content"), n.appendChild(this.content);
var r = document.createElement("div");
r.classList.add("KG_Form_Footer"), n.appendChild(r), this.okBtn = document.createElement("button"), this.okBtn.setAttribute("data-l10n-id", "password_ok"), this.okBtn.classList.add("btn"), this.okBtn.classList.add("btn-primary"), r.appendChild(this.okBtn), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
this.okBtn.addEventListener("click", this.close), this.closeBtn.addEventListener("click", this.close)
}
}, {
key: "open", value: function (e) {
var t = this;
return window.KGPdfViewerWebApp.getTipPrompt().close(), this.overlayManager.open(this.overlayName).then(function () {
var n = window.KGPdfViewerWebApp.clientErrorConfig.filter(function (t) {
return e.indexOf(t.errCode) > -1
})[0];
n ? (t.content.innerHTML = n.errText || e, t.closeCallback = n.errCallback) : t.content.innerHTML = e
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.closeCallback && (e.closeCallback(), e.closeCallback = null)
})
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = "kgTipOverlay", this.container = document.getElementById("kgTipOverlay"), this.kgTipMsg = document.getElementById("kgTipMsg"), this.overlayManager = n, this.l10n = r, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0).then(function () {
})
}
return r(e, [{
key: "open", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
t.kgTipMsg.querySelector("span").innerHTML = e
})
}
}, {
key: "reset", value: function (e) {
this.kgTipMsg.querySelector("span").innerHTML = e
}
}, {
key: "close", value: function () {
var e = this;
if (this.overlayManager.active.indexOf(this.overlayName) > -1) return this.overlayManager.close(this.overlayName).then(function () {
e.kgTipMsg.querySelector("span").innerHTML = ""
})
}
}]), e
}();
t.KGTipPrompt = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_ModalFactory = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.close = this.close.bind(this), this.createDom = this.createDom.bind(this), this.config = r, this.overlayName = this.config.overlayName, this.overlayManager = n, this.register(this.overlayName), this.createDom(), this.overlayManager.register(this.overlayName, this.container, this.close, !1)
}
return r(e, [{
key: "register", value: function (e) {
if (document.getElementById(e)) throw new Error(e + "已存在")
}
}, {
key: "createDom", value: function () {
var e = this;
this.overlayContainer = document.createElement("div"), this.overlayContainer.classList.add("KG_OverlayContainer"), this.overlayContainer.classList.add("hidden"), this.container = document.createElement("div"), this.container.setAttribute("id", this.overlayName), this.container.classList.add("container"), this.container.classList.add("hidden"), this.overlayContainer.appendChild(this.container), document.getElementById("outerContainer").appendChild(this.overlayContainer);
var t = document.createElement("div");
t.classList.add("kg_dialog_header"), this.container.appendChild(t);
var n = document.createElement("div");
n.classList.add("kg_dialog_title"), n.setAttribute("data-l10n-id", "alert_title"), t.appendChild(n), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", this.closeBtn.addEventListener("click", this.close), t.appendChild(this.closeBtn);
var r = document.createElement("div");
r.classList.add("dialog"), this.container.appendChild(r);
var i = (this.config.width || 280) + "px";
t.style.width = i, r.style.width = i, this.content = document.createElement("p"), this.content.classList.add("KG_CustomModal_Content"), r.appendChild(this.content);
var a = document.createElement("div");
a.classList.add("KG_Form_Footer"), r.appendChild(a), this.config.buttons.map(function (t) {
var n = document.createElement("button");
n.innerHTML = t.content, n.classList.add("btn"), n.classList.add("custom_btn"), "primary" == t.type && n.classList.add("btn-primary");
n.addEventListener("click", function () {
t.callback(), e.close()
}), a.appendChild(n)
}), this.app.l10n.translate(this.container)
}
}, {
key: "open", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
t.content.innerHTML = e || t.config.message
})
}
}, {
key: "close", value: function () {
this.overlayManager.close(this.overlayName)
}
}]), e
}()
}, function (module, exports, __w_pdfjs_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {value: !0}), exports.KG_Watermark = void 0;
var _createClass = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
exports.renderWaterMark = renderWaterMark;
var _pdf_rendering_queue = __w_pdfjs_require__(23), _utils = __w_pdfjs_require__(5),
_request = __w_pdfjs_require__(59);
function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var rotateOptions = [{label: "旋转45°", value: 45}, {label: "水平", value: 0}, {
label: "旋转-45°",
value: -45
}, {label: "自定义", value: "custom"}],
verticalOptions = [{label: "顶部对齐", value: "top"}, {label: "居中", value: "middle"}, {
label: "底部对齐",
value: "bottom"
}, {label: "自定义", value: "custom"}],
horizontalOptions = [{label: "左对齐", value: "left"}, {label: "居中", value: "center"}, {
label: "右对齐",
value: "right"
}, {label: "自定义", value: "custom"}];
function getDistance(e) {
var t = {x: 0, y: 0}, n = e.rotate, r = n * Math.PI / 180, i = void 0, a = void 0;
"text" === e.source && (i = (0, _utils.computeTextWdith)(e.text, e.fontSize) / e.density, a = e.fontSize / e.density);
"file" === e.source && (i = e.fileWidth / e.density, a = e.fileHeight / e.density);
var o = Math.sqrt(Math.pow(i, 2) + Math.pow(a, 2)), s = Math.atan(a / i), l = 0, c = 0;
return 0 === n || 180 === n ? (c = a, l = i) : 90 === n || 270 === n ? (c = i, l = a) : 0 < n && n < 90 ? (c = o * Math.abs(Math.sin(r + s)), l = o * Math.abs(Math.cos(r + s))) : 90 < n && n < 180 ? (c = o * Math.abs(Math.sin(Math.PI - r + s)), l = o * Math.abs(Math.cos(Math.PI - r + s))) : 180 < n && n < 270 ? (c = o * Math.abs(Math.sin(r - Math.PI + s)), l = o * Math.abs(Math.cos(r - Math.PI + s))) : 270 < n && n < 360 && (c = o * Math.abs(Math.sin(2 * Math.PI - r + s)), l = o * Math.abs(Math.cos(2 * Math.PI - r + s))), t.x = l, t.y = c, t
}
function getXYPositions(e, t, n, r, i, a) {
for (var o = {x: [], y: []}, s = e, l = e; !((s -= n) < 0);) o.x.push(s);
for (o.x.push(e); !((l += n) > i);) o.x.push(l);
for (var c = t, u = t; !((c += r) > a);) o.y.push(c);
for (o.y.push(t); !((u -= r) < 0);) o.y.push(u);
return o
}
function renderWaterMark(e, t, n, r, i, a, o) {
var s = document.createElement("canvas");
s.width = r, s.height = i;
var l = s.getContext("2d"), c = s.width / 2, u = s.height / 2;
return l.translate(s.width / 2, s.height / 2), l.rotate(e.rotate * Math.PI / 180), l.translate(-s.width / 2, -s.height / 2), l.globalAlpha = e.opacity, new Promise(function (o) {
if ("text" === e.source && e.text) l.textAlign = "center", l.fillStyle = e.color, l.font = e.fontSize * n + "px " + e.font, l.fillText(e.text, c, u), o(); else if ("file" === e.source && e.file) {
var s = new Image;
s.onload = function () {
var t = s.width * n, r = s.height * n;
e.fileWidth = s.width, e.fileHeight = s.height, l.drawImage(s, 0, 0, s.width, s.height, c - t / 2, u - r / 2, t, r), o()
}, s.src = e.file
} else if (a) {
t.width = r, t.height = i, t.getContext("2d").drawImage(a.canvas, 0, 0, a.canvas.width, a.canvas.height, 0, 0, r, i)
}
}).then(function () {
var l = s.toDataURL("png", 1);
return new Promise(function (s) {
var c = new Image;
c.onload = function () {
var l = t.getContext("2d");
a && (t.width = r, t.height = i, l.drawImage(a.canvas, 0, 0, a.canvas.width, a.canvas.height, 0, 0, r, i));
var u = r / 2, d = i / 2, h = [];
if ("tile" === e.fullscreen) {
var p, f, m = getDistance(e), v = m.x, g = m.y;
p = f = v > g ? v : g;
for (var y = getXYPositions(r / 2, i / 2, p * n, f * n, r, i), b = 0; b < y.x.length; b++) for (var w = 0; w < y.y.length; w++) l.drawImage(c, 0, 0, c.width, c.height, y.x[b] - c.width / 2, y.y[w] - c.height / 2, c.width, c.height), "text" === e.source && o && h.push((0, _utils.createTextLayerElement)(e.text, y.x[b], y.y[w], e.fontSize, e.font, e.rotate, n))
} else {
var S = e.position.x * n, _ = e.position.y * n;
l.drawImage(c, 0, 0, c.width, c.height, u - c.width / 2 + S, d - c.height / 2 + _, c.width, c.height), "text" === e.source && o && h.push((0, _utils.createTextLayerElement)(e.text, u + S, d + _, e.fontSize, e.font, e.rotate, n))
}
s(h)
}, c.src = l
})
})
}
var KG_Watermark = exports.KG_Watermark = function () {
function KG_Watermark(e, t, n) {
_classCallCheck(this, KG_Watermark), this.app = e, this.overlayName = t.overlayName, this.container = t.container, this.toolbarBtn = t.toolbarBtn, this.secondaryToolbarBtn = t.secondaryToolbarBtn, this.overlayManager = n, this.fontList = [], this.fileBase64 = "", this.watermarkConfig = (0, _utils.mergerConfig)(window.KGPdfViewerWebApp.watermarkConfig, window.KGPdfViewerWebApp.previewWatermark), this.open = this.open.bind(this), this.getFontList = this.getFontList.bind(this), this.getWaterMarkConfig = this.getWaterMarkConfig.bind(this), this.drawPreview = this.drawPreview.bind(this), this.disableText = this.disableText.bind(this), this.disableFile = this.disableFile.bind(this), this.disableDensity = this.disableDensity.bind(this), this.disablePosition = this.disablePosition.bind(this), this.deleteWatermarkFromDocument = this.deleteWatermarkFromDocument.bind(this), this.renderWatermarkOnDocument = this.renderWatermarkOnDocument.bind(this), this.onOk = this.onOk.bind(this), this.close = this.close.bind(this), this.overlayManager.register(this.overlayName, this.container, this.close, !0), this.createDom = this.createDom.bind(this), this.createDom(), this.init = this.init.bind(this), this.init(), this.reset = this.reset.bind(this)
}
return _createClass(KG_Watermark, [{
key: "disableText", value: function (e) {
this.textInput.classList.remove("KG_Input_Error"), this.textInput.disabled = e, this.textInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.fontSelect.disabled = e, this.fontSelect.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.fontSizeInput.disabled = e, this.fontSizeInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.colorInput.disabled = e, this.colorInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.colorInput.jscolor.showOnClick = !e
}
}, {
key: "disableFile", value: function (e) {
this.fileNameInput.classList.remove("KG_Input_Error"), this.fileNameInput.disabled = e, this.fileNameInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.fileUploadBtn.disabled = e, this.fileUploadBtn.classList[e ? "add" : "remove"]("KG_Btn_Disabled")
}
}, {
key: "disableDensity", value: function (e) {
this.densityInput.disabled = e, this.densityInput.classList[e ? "add" : "remove"]("KG_Input_Disabled")
}
}, {
key: "disablePosition", value: function (e) {
this.verticalSelect.disabled = e, this.verticalSelect.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.verticalCustomInput.disabled = e, this.verticalCustomInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.horizontalSelect.disabled = e, this.horizontalSelect.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.horizontalCustomInput.disabled = e, this.horizontalCustomInput.classList[e ? "add" : "remove"]("KG_Input_Disabled")
}
}, {
key: "createDom", value: function () {
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.container.appendChild(e);
var t = document.createElement("div");
t.classList.add("kg_dialog_title"), t.setAttribute("data-l10n-id", "watermark_title"), e.appendChild(t), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", e.appendChild(this.closeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.container.appendChild(n), this.iframe = document.createElement("iframe"), this.iframe.style.display = "none", this.iframe.name = "KG_Watermark_iframe", n.appendChild(this.iframe);
var r = document.createElement("div");
r.classList.add("KG_Clearfix"), n.appendChild(r);
var i = document.createElement("div");
i.classList.add("KG_Watermark_ConfigContainer"), r.appendChild(i);
var a = document.createElement("fieldset");
a.classList.add("KG_Form_Fieldset"), i.appendChild(a);
var o = document.createElement("legend");
o.setAttribute("data-l10n-id", "watermark_source"), o.classList.add("KG_Form_Legend"), a.appendChild(o), this.textContainer = document.createElement("div"), this.textContainer.classList.add("KG_Form_Item"), this.textContainer.classList.add("kg_radio_wrapper"), a.appendChild(this.textContainer);
var s = document.createElement("label");
s.setAttribute("data-l10n-id", "watermark_text"), s.classList.add("KG_Form_Label"), this.textContainer.appendChild(s), this.textRadio = document.createElement("input"), this.textRadio.type = "radio", this.textRadio.name = "source", this.textRadio.value = "text", this.textContainer.appendChild(this.textRadio), this.textInput = document.createElement("input"), this.textInput.classList.add("kgInput"), this.textInput.autocomplete = "off", this.textInput.type = "text", this.textInput.style.marginLeft = "11px", this.textInput.style.width = "calc(100% - 119px)", this.textContainer.appendChild(this.textInput);
var l = document.createElement("div");
l.classList.add("KG_Form_Item"), a.appendChild(l);
var c = document.createElement("label");
c.setAttribute("data-l10n-id", "watermark_font"), c.classList.add("KG_Form_Label"), l.appendChild(c), this.fontSelect = document.createElement("select"), this.fontSelect.classList.add("kgInput"), l.appendChild(this.fontSelect);
var u = document.createElement("div");
u.classList.add("KG_Form_Item"), a.appendChild(u);
var d = document.createElement("label");
d.setAttribute("data-l10n-id", "watermark_fontSize"), d.classList.add("KG_Form_Label"), u.appendChild(d), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = 12, this.fontSizeInput.classList.add("kgInput"), u.appendChild(this.fontSizeInput);
var h = document.createElement("div");
h.classList.add("KG_Form_Item"), a.appendChild(h);
var p = document.createElement("label");
p.setAttribute("data-l10n-id", "watermark_fontColor"), p.classList.add("KG_Form_Label"), h.appendChild(p), this.colorInput = document.createElement("input"), this.colorInput.type = "text", this.colorInput.classList.add("kgInput"), this.colorInput.classList.add("jscolor"), this.colorInput.jscolor = new jscolor(this.colorInput), h.appendChild(this.colorInput), this.fileContainer = document.createElement("div"), this.fileContainer.classList.add("KG_Form_Item"), this.fileContainer.classList.add("kg_radio_wrapper"), a.appendChild(this.fileContainer);
var f = document.createElement("label");
f.setAttribute("data-l10n-id", "watermark_uploadFile"), f.classList.add("KG_Form_Label"), this.fileContainer.appendChild(f), this.fileRadio = document.createElement("input"), this.fileRadio.type = "radio", this.fileRadio.name = "source", this.fileRadio.value = "file", this.fileContainer.appendChild(this.fileRadio), this.fileNameInput = document.createElement("input"), this.fileNameInput.classList.add("kgInput"), this.fileNameInput.readOnly = !0, this.fileNameInput.type = "text", this.fileNameInput.style.marginLeft = "11px", "en-US" === this.app.l10n._lang ? this.fileNameInput.style.width = "calc(100% - 191px)" : this.fileNameInput.style.width = "calc(100% - 195px)", this.fileContainer.appendChild(this.fileNameInput), this.fileUploadBtn = document.createElement("button"), this.fileUploadBtn.setAttribute("data-l10n-id", "watermark_uploadBtn"), this.fileUploadBtn.classList.add("btn"), this.fileUploadBtn.classList.add("btn-primary"), this.fileUploadBtn.type = "button", this.fileUploadBtn.style.marginLeft = "12px", "en-US" === this.app.l10n._lang ? this.fileUploadBtn.style.width = "74px" : this.fileUploadBtn.style.width = "64px", this.fileContainer.appendChild(this.fileUploadBtn), this.fileForm = document.createElement("form"), this.fileForm.setAttribute("enctype", "multipart/form-data");
var m = window.KGPdfViewerWebApp.getDocTypeUrl(), v = window.KGPdfViewerWebApp.documentId,
g = (new Date).getTime();
this.fileForm.setAttribute("action", m + "&action=imageToBase64&documentId=" + v + "&t=" + g), this.fileForm.style.display = "none", this.fileForm.target = this.iframe.name, this.fileForm.method = "POST", this.fileContainer.appendChild(this.fileForm), this.fileInput = document.createElement("input"), this.fileInput.name = "file", this.fileInput.type = "file", this.fileInput.accept = "image/*", this.fileForm.appendChild(this.fileInput);
var y = document.createElement("fieldset");
y.classList.add("KG_Form_Fieldset"), i.appendChild(y);
var b = document.createElement("legend");
b.setAttribute("data-l10n-id", "watermark_exterior"), b.classList.add("KG_Form_Legend"), y.appendChild(b);
var w = document.createElement("div");
w.classList.add("KG_Form_Item"), y.appendChild(w);
var S = document.createElement("label");
S.setAttribute("data-l10n-id", "watermark_rotate"), S.classList.add("KG_Form_Label"), w.appendChild(S), this.rotateSelect = document.createElement("select"), this.rotateSelect.classList.add("kgInput"), w.appendChild(this.rotateSelect);
for (var _ = 0; _ < rotateOptions.length; _++) {
var k = document.createElement("option");
k.setAttribute("data-l10n-id", "watermark_rotate_option_" + rotateOptions[_].value), k.value = rotateOptions[_].value, this.rotateSelect.appendChild(k)
}
this.rotateCustomInput = document.createElement("input"), this.rotateCustomInput.classList.add("kgInput"), this.rotateCustomInput.type = "number", this.rotateCustomInput.style.marginLeft = "6px", this.rotateCustomInput.style.display = "none", w.appendChild(this.rotateCustomInput), this.rotateUnit = document.createElement("span"), this.rotateUnit.innerHTML = "°", this.rotateUnit.style.marginLeft = "6px", this.rotateUnit.style.display = "none", w.appendChild(this.rotateUnit);
var x = document.createElement("div");
x.classList.add("KG_Form_Item"), y.appendChild(x);
var P = document.createElement("label");
P.setAttribute("data-l10n-id", "watermark_opacity"), P.classList.add("KG_Form_Label"), x.appendChild(P), this.opacityInput = document.createElement("input"), this.opacityInput.classList.add("kgInput"), this.opacityInput.type = "number", this.opacityInput.min = 0, this.opacityInput.max = 100, x.appendChild(this.opacityInput);
var C = document.createElement("span");
C.innerHTML = "%", C.style.marginLeft = "6px", x.appendChild(C);
var A = document.createElement("fieldset");
A.classList.add("KG_Form_Fieldset"), i.appendChild(A);
var T = document.createElement("legend");
T.setAttribute("data-l10n-id", "watermark_position"), T.classList.add("KG_Form_Legend"), A.appendChild(T), this.fullScreenContainer = document.createElement("div"), this.fullScreenContainer.classList.add("KG_Form_Item"), this.fullScreenContainer.classList.add("kg_checkbox_wrapper"), A.appendChild(this.fullScreenContainer);
var E = document.createElement("label");
E.setAttribute("data-l10n-id", "watermark_tiled"), E.classList.add("KG_Form_Label"), this.fullScreenContainer.appendChild(E), this.fullScreenCheckBox = document.createElement("input"), this.fullScreenCheckBox.type = "checkbox", this.fullScreenCheckBox.classList.add("KG_CheckBox"), this.fullScreenContainer.appendChild(this.fullScreenCheckBox);
var D = document.createElement("div");
D.classList.add("KG_Form_Item"), A.appendChild(D);
var I = document.createElement("label");
I.setAttribute("data-l10n-id", "watermark_density"), I.classList.add("KG_Form_Label"), D.appendChild(I), this.densityInput = document.createElement("input"), this.densityInput.classList.add("kgInput"), this.densityInput.type = "number", this.densityInput.min = 1, this.densityInput.max = 100, D.appendChild(this.densityInput);
var L = document.createElement("div");
L.classList.add("KG_Form_Item"), A.appendChild(L);
var O = document.createElement("label");
O.setAttribute("data-l10n-id", "watermark_vertical"), O.classList.add("KG_Form_Label"), L.appendChild(O), this.verticalSelect = document.createElement("select"), this.verticalSelect.classList.add("kgInput"), L.appendChild(this.verticalSelect);
for (var M = 0; M < verticalOptions.length; M++) {
var N = document.createElement("option");
N.setAttribute("data-l10n-id", "watermark_vertical_option_" + verticalOptions[M].value), N.value = verticalOptions[M].value, this.verticalSelect.appendChild(N)
}
this.verticalCustomInput = document.createElement("input"), this.verticalCustomInput.classList.add("kgInput"), this.verticalCustomInput.type = "number", this.verticalCustomInput.style.marginLeft = "6px", this.verticalCustomInput.style.display = "none", L.appendChild(this.verticalCustomInput), this.verticalUnit = document.createElement("span"), this.verticalUnit.innerHTML = "px", this.verticalUnit.style.marginLeft = "6px", this.verticalUnit.style.display = "none", L.appendChild(this.verticalUnit);
var R = document.createElement("div");
R.classList.add("KG_Form_Item"), A.appendChild(R);
var W = document.createElement("label");
W.setAttribute("data-l10n-id", "watermark_horizontal"), W.classList.add("KG_Form_Label"), R.appendChild(W), this.horizontalSelect = document.createElement("select"), this.horizontalSelect.classList.add("kgInput"), R.appendChild(this.horizontalSelect);
for (var V = 0; V < horizontalOptions.length; V++) {
var F = document.createElement("option");
F.setAttribute("data-l10n-id", "watermark_horizontal_option_" + horizontalOptions[V].value), F.value = horizontalOptions[V].value, this.horizontalSelect.appendChild(F)
}
this.horizontalCustomInput = document.createElement("input"), this.horizontalCustomInput.classList.add("kgInput"), this.horizontalCustomInput.type = "number", this.horizontalCustomInput.style.marginLeft = "6px", this.horizontalCustomInput.style.display = "none", R.appendChild(this.horizontalCustomInput), this.horizontalUnit = document.createElement("span"), this.horizontalUnit.innerHTML = "px", this.horizontalUnit.style.marginLeft = "6px", this.horizontalUnit.style.display = "none", R.appendChild(this.horizontalUnit);
var G = document.createElement("div");
G.classList.add("KG_Watermark_PreviewContainer"), r.appendChild(G);
var B = document.createElement("fieldset");
B.classList.add("KG_Form_Fieldset"), G.appendChild(B);
var K = document.createElement("legend");
K.setAttribute("data-l10n-id", "watermark_preview"), K.classList.add("KG_Form_Legend"), B.appendChild(K), this.previewCanvas = document.createElement("canvas"), B.appendChild(this.previewCanvas);
var j = document.createElement("div");
j.classList.add("KG_Form_Footer"), n.appendChild(j), this.cancelBtn = document.createElement("button"), this.cancelBtn.setAttribute("data-l10n-id", "password_cancel"), this.cancelBtn.classList.add("btn"), j.appendChild(this.cancelBtn), this.okBtn = document.createElement("button"), this.okBtn.setAttribute("data-l10n-id", "password_ok"), this.okBtn.classList.add("btn"), this.okBtn.classList.add("btn-primary"), this.okBtn.style.marginLeft = "15px", j.appendChild(this.okBtn), this.app.l10n.translate(this.container)
}
}, {
key: "reset", value: function () {
var e = this.watermarkConfig, t = e.text, n = (e.file, e.font), r = e.size, i = e.color, a = e.rotate,
o = e.opacity, s = e.isTiled, l = e.density, c = e.vertical, u = e.horizontal;
this.textRadio.checked = !0, this.textContainer.classList.add("kg_radio_wrapper-checked"), this.fileContainer.classList.remove("kg_radio_wrapper-checked"), this.disableText(!1), this.disableFile(!0), this.textInput.value = t, this.fontSelect.value = this.fontList[0].title || n, this.fontSizeInput.value = r, this.colorInput.jscolor.fromString(i), this.fileForm.reset(), this.fileNameInput.value = "", this.fileBase64 = "", -1 != [45, 0, -45].indexOf(a) ? (this.rotateSelect.value = a, this.rotateCustomInput.style.display = "none") : (this.rotateSelect.value = "custom", this.rotateCustomInput.style.display = "inline", this.rotateUnit.style.display = "inline"), this.rotateCustomInput.value = +a, this.opacityInput.value = +o, this.fullScreenCheckBox.checked = s || !1, s ? (this.fullScreenContainer.classList.add("kg_checkbox_wrapper-checked"), this.disablePosition(!1), this.disablePosition(!0)) : (this.fullScreenContainer.classList.remove("kg_checkbox_wrapper-checked"), this.disableDensity(!0), this.disablePosition(!1)), this.densityInput.value = +l, -1 != ["top", "middle", "bottom"].indexOf(c) ? (this.verticalSelect.value = c, this.verticalCustomInput.value = 0, this.verticalCustomInput.style.display = "none", this.verticalUnit.style.display = "none") : (this.verticalSelect.value = "custom", this.verticalCustomInput.value = +c, this.verticalCustomInput.style.display = "inline", this.verticalUnit.style.display = "inline"), -1 != ["left", "center", "right"].indexOf(u) ? (this.horizontalSelect.value = u, this.horizontalCustomInput.value = 0, this.horizontalCustomInput.style.display = "none", this.horizontalUnit.style.display = "none") : (this.horizontalSelect.value = "custom", this.horizontalCustomInput.value = +u, this.horizontalCustomInput.style.display = "inline", this.horizontalUnit.style.display = "inline")
}
}, {
key: "init", value: function init() {
var _this = this, _window$KGPdfViewerWe = window.KGPdfViewerWebApp.btnPositionConfig,
toolbar = _window$KGPdfViewerWe.toolbar, sidebar = _window$KGPdfViewerWe.sidebar;
toolbar.indexOf("watermark") > -1 && (this.toolbarBtn.removeAttribute("hidden"), this.toolbarBtn.addEventListener("click", this.open)), sidebar.indexOf("watermark") > -1 && (this.secondaryToolbarBtn.removeAttribute("hidden"), this.secondaryToolbarBtn.addEventListener("click", this.open)), this.textContainer.addEventListener("click", function (e) {
e.currentTarget.querySelector('input[type="radio"]').value === _this.textRadio.value && (_this.textRadio.checked = !0, _this.textContainer.classList.add("kg_radio_wrapper-checked"), _this.fileContainer.classList.remove("kg_radio_wrapper-checked"), _this.disableFile(!0), _this.disableText(!1), _this.drawPreview())
}), this.textInput.addEventListener("input", function (e) {
_this.textInput.classList.remove("KG_Input_Error"), _this.drawPreview()
}), this.fontSelect.addEventListener("change", function (e) {
!0 === _this.textRadio.checked && _this.drawPreview()
}), this.fontSizeInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.fontSizeInput.value = defaultFontSize), t <= 12 && (_this.fontSizeInput.value = 12), !0 === _this.textRadio.checked && _this.drawPreview()
}), this.colorInput.addEventListener("change", function (e) {
!0 === _this.textRadio.checked && _this.drawPreview()
}), this.fileContainer.addEventListener("click", function (e) {
e.currentTarget.querySelector('input[type="radio"]').value === _this.fileRadio.value && (_this.fileRadio.checked = !0, _this.textContainer.classList.remove("kg_radio_wrapper-checked"), _this.fileContainer.classList.add("kg_radio_wrapper-checked"), _this.disableFile(!1), _this.disableText(!0), _this.drawPreview())
}), this.fileUploadBtn.addEventListener("click", function (e) {
_this.fileNameInput.classList.remove("KG_Input_Error"), _this.fileInput.click()
}), this.fileInput.addEventListener("change", function (e) {
var KGAlertPrompt = _this.app.KGAlertPrompt;
KGAlertPrompt.closeCallback = function () {
return _this.overlayManager.open(_this.overlayName)
}, new Promise(function (resolve) {
if ("function" == typeof FileReader && _this.fileInput.files) {
var file = _this.fileInput.files[0];
if (!/image\/\w+/.test(file.type)) {
switch (_this.app.l10n._lang) {
case"zh-TW":
KGAlertPrompt.open("請上傳圖片文件!");
break;
case"en-US":
KGAlertPrompt.open("Please upload an image file!");
break;
default:
KGAlertPrompt.open("请上传图片文件!")
}
return
}
var reader = new FileReader;
reader.onload = function (e) {
_this.fileBase64 = e.target.result, resolve(file.name)
}, reader.readAsDataURL(file)
} else {
var value = e.target.value, fileName = value.split("\\")[value.split("\\").length - 1],
fileType = fileName.split(".")[fileName.split(".").length - 1].toLocaleLowerCase();
if (-1 === ["jpg", "jpeg", "gif", "svg", "png"].indexOf(fileType)) {
switch (_this.app.l10n._lang) {
case"zh-TW":
KGAlertPrompt.open("請上傳壹個圖片文件。");
break;
case"en-US":
KGAlertPrompt.open("Please upload an image file.");
break;
default:
KGAlertPrompt.open("请上传一个图片文件。")
}
return
}
_this.fileForm.submit();
var times = 0, timer = setInterval(function () {
times++;
var iframeBody = _this.iframe.contentWindow.document.body, response = void 0;
if (response = iframeBody.childNodes.length > 0 ? iframeBody.childNodes[0].innerHTML : iframeBody.innerHTML, response) {
var result = eval("(" + response + ")");
result && result.status && (_this.fileBase64 = "data:image/" + fileType + ";base64," + result.dataBase64), clearInterval(timer), _this.iframe.contentWindow.document.body.innerHTML = "", resolve(fileName)
}
if (times >= 8) {
switch (_this.app.l10n._lang) {
case"zh-TW":
KGAlertPrompt.open("圖片文件轉換失敗。");
break;
case"en-US":
KGAlertPrompt.open("Image file conversion failed.");
break;
default:
tipPrompt.open("图片文件转换失败。")
}
clearInterval(timer)
}
}, 500)
}
}).then(function (e) {
_this.fileNameInput.value = e, !0 === _this.fileRadio.checked && _this.drawPreview()
}).finally(function () {
_this.fileForm.reset()
})
}), this.rotateSelect.addEventListener("change", function (e) {
"custom" === e.target.value ? (_this.rotateCustomInput.style.display = "inline", _this.rotateUnit.style.display = "inline") : (_this.rotateCustomInput.style.display = "none", _this.rotateUnit.style.display = "none"), _this.drawPreview()
}), this.rotateCustomInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.rotateCustomInput.value = defaultRotate), _this.drawPreview()
}), this.opacityInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.opacityInput.value = defaultOpacity), t < 0 && (_this.opacityInput.value = 0), t > 100 && (_this.opacityInput.value = 100), _this.drawPreview()
}), this.fullScreenContainer.addEventListener("click", function (e) {
_this.fullScreenCheckBox.checked = !_this.fullScreenCheckBox.checked, _this.fullScreenCheckBox.checked ? (_this.fullScreenContainer.classList.add("kg_checkbox_wrapper-checked"), _this.disableDensity(!1), _this.disablePosition(!0)) : (_this.fullScreenContainer.classList.remove("kg_checkbox_wrapper-checked"), _this.disableDensity(!0), _this.disablePosition(!1)), _this.drawPreview()
}), this.densityInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) ? _this.densityInput.value = defaultDensity : t <= 0 ? _this.densityInput.value = 1 : t > 100 && (_this.densityInput.value = 100), _this.drawPreview()
}), this.verticalSelect.addEventListener("change", function (e) {
_this.verticalCustomInput.style.display = "custom" === e.target.value ? "inline" : "none", _this.verticalUnit.style.display = "custom" === e.target.value ? "inline" : "none", _this.drawPreview()
}), this.verticalCustomInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.verticalCustomInput.value = 0), _this.drawPreview()
}), this.horizontalSelect.addEventListener("change", function (e) {
_this.horizontalCustomInput.style.display = "custom" === e.target.value ? "inline" : "none", _this.horizontalUnit.style.display = "custom" === e.target.value ? "inline" : "none", _this.drawPreview()
}), this.horizontalCustomInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.horizontalCustomInput.value = 0), _this.drawPreview()
}), this.okBtn.addEventListener("click", this.onOk), this.cancelBtn.addEventListener("click", this.close), this.closeBtn.addEventListener("click", this.close)
}
}, {
key: "open", value: function () {
var e = this;
return this.app.secondaryToolbar.close(), this.getFontList().then(function () {
return e.overlayManager.open(e.overlayName)
}).then(function () {
var t = e.app.KGWatermarkConfirm;
t.container.classList.contains("hidden") ? e.reset() : t.hide(), e.drawPreview()
}).catch(function () {
e.app.KGPdfViewerWebApp.getTipPrompt().close()
})
}
}, {
key: "close", value: function () {
var e = this;
return this.overlayManager.close(this.overlayName).then(function () {
e.watermarkTime && e.deleteWatermarkFromDocument()
})
}
}, {
key: "getFontList", value: function () {
var e = this;
if (0 === this.fontList.length) {
var t = window.KGPdfViewerWebApp.getTipPrompt();
switch (this.app.l10n._lang) {
case"zh-TW":
t.open("正在獲取字體...");
break;
case"en-US":
t.open("Getting fonts...");
break;
default:
t.open("正在获取字体...")
}
return (0, _request.getFontList)().then(function (n) {
var r = [];
for (var i in e.fontSelect.innerHTML = "", n) if ("status" !== i) {
r.push({title: i, value: n[i]});
var a = document.createElement("option");
a.value = i, a.innerHTML = i, e.fontSelect.appendChild(a)
}
return e.fontList = r, t.close(), Promise.resolve()
})
}
return Promise.resolve()
}
}, {
key: "drawPreview", value: function () {
if (!(document.body.clientWidth < 720)) {
var e = this.app.pdfViewer.getPageView(this.app.page - 1), t = e.viewport.scale, n = e.width / t,
r = e.height / t, i = .5 * n, a = .5 * r;
return renderWaterMark(this.getWaterMarkConfig(n, r), this.previewCanvas, .5, i, a, e, !1)
}
}
}, {
key: "getWaterMarkConfig", value: function (e, t) {
var n = {};
this.textRadio.checked && (n.source = "text"), this.fileRadio.checked && (n.source = "file"), "text" === n.source && (n.text = (0, _utils.trim)(this.textInput.value), n.font = this.fontSelect.value || this.watermarkConfig.font, n.fontName = this.fontList.filter(function (e) {
return e.title === n.font
})[0].value, n.fontSize = Number(this.fontSizeInput.value), n.fontSize <= 0 && (n.fontSize = defaultFontSize), n.color = this.colorInput.style.backgroundColor), "file" === n.source && (n.file = this.fileBase64);
var r = this.rotateSelect.value;
if (n.rotate = "custom" === r ? Number(this.rotateCustomInput.value) % 360 : Number(r) % 360, n.rotate < 0 && (n.rotate = 360 + n.rotate), n.rotate = 0 !== n.rotate ? 360 - n.rotate : 0, n.opacity = Number(this.opacityInput.value) / 100, n.fullscreen = this.fullScreenCheckBox.checked ? "tile" : "no", "no" === n.fullscreen) {
n.position = {x: 0, y: 0};
var i = this.verticalSelect.value;
"custom" === i ? n.position.y = Number(this.verticalCustomInput.value) : "top" === i ? n.position.y = -t / 2 + 20 : "bottom" === i ? n.position.y = t / 2 - 20 : "middle" === i && (n.position.y = 0);
var a = this.horizontalSelect.value;
"custom" === a ? n.position.x = Number(this.horizontalCustomInput.value) : "left" === a ? n.position.x = -e / 2 + 20 : "right" === a ? n.position.x = e / 2 - 20 : "center" === a && (n.position.x = 0), n.leftBottomPosition = (0, _utils.leftTopTransformToLeftBottom)({
x: e / 2 + n.position.x,
y: t / 2 + n.position.y
}, t)
} else n.density = Number(this.densityInput.value), n.density <= 0 && (n.density = 1), n.density = n.density / 100;
return n
}
}, {
key: "onOk", value: function () {
var e = this, t = this.app.KGAlertPrompt;
if (t.closeCallback = function () {
return e.overlayManager.open(e.overlayName)
}, !this.textRadio.checked || this.textInput.value) {
if (!this.fileRadio.checked || this.fileBase64) {
for (var n = this.app.pagesCount, r = {}, i = 0; i < n; i++) {
var a = this.app.pdfViewer.getPageView(i), o = a.viewport.scale, s = a.width / o, l = a.height / o,
c = this.getWaterMarkConfig(s, l);
0 === i ? ("text" === c.source && (r.text = c.text, r.color = c.color.slice(4, -1).split(", ").join(","), r.fontName = c.fontName, r.fontSize = c.fontSize), "file" === c.source && (r.file = c.file.split("base64,")[c.file.split("base64,").length - 1]), "tile" === c.fullscreen && (r.density = c.density), "no" === c.fullscreen && (r.leftBottomPosition = [c.leftBottomPosition]), r.source = c.source, r.fullscreen = c.fullscreen, r.opacity = c.opacity, r.rotate = 0 !== c.rotate ? 360 - c.rotate : 0) : "no" === c.fullscreen && r.leftBottomPosition.push(c.leftBottomPosition)
}
var u = window.KGPdfViewerWebApp.getTipPrompt(), d = this.app.KGWatermarkConfirm;
return this.close().then(function () {
return e.watermarkTime = (new Date).getTime(), e.renderWatermarkOnDocument()
}).then(function () {
return new Promise(function (t) {
d.show(), d.okCallback = function () {
switch (e.app.l10n._lang) {
case"zh-TW":
u.open("正在添加水印...");
break;
case"en-US":
u.open("Adding watermark...");
break;
default:
u.open("正在添加水印...")
}
t(window.KGPdfViewerWebApp.addWatermark(r))
}, d.closeCallback = function () {
e.deleteWatermarkFromDocument(), t({status: !0})
}
})
}).then(function (t) {
if (u.overlayManager.active.indexOf("kgTipOverlay") > -1 && u.close(), !0 === t.status) d.hide(); else {
if (t.message) return Promise.reject(t.message);
switch (e.app.l10n._lang) {
case"zh-TW":
return Promise.reject("添加水印失敗,請聯系管理員處理。");
case"en-US":
return Promise.reject("Failed to add watermark, please contact the administrator。");
default:
return Promise.reject("添加水印失败,请联系管理员处理。")
}
}
}).catch(function (e) {
t.open(e)
}).finally(function () {
e.watermarkTime = null
})
}
switch (t.closeCallback = function () {
return e.overlayManager.open(e.overlayName).then(function () {
e.fileNameInput.classList.add("KG_Input_Error"), e.fileNameInput.focus()
})
}, this.app.l10n._lang) {
case"zh-TW":
t.open("水印文件不能為空。");
break;
case"en-US":
t.open("Watermark file cannot be empty.");
break;
default:
t.open("水印文件不能为空。")
}
} else switch (t.closeCallback = function () {
return e.overlayManager.open(e.overlayName).then(function () {
e.textInput.classList.add("KG_Input_Error"), e.textInput.focus()
})
}, this.app.l10n._lang) {
case"zh-TW":
t.open("水印文本不能為空。");
break;
case"en-US":
t.open("Watermark text cannot be empty.");
break;
default:
t.open("水印文本不能为空。")
}
}
}, {
key: "deleteWatermarkFromDocument", value: function () {
var e = this;
if (this.watermarkTime) {
for (var t = this.app.pagesCount, n = function (t) {
var n = e.app.pdfViewer.getPageView(t), r = n.canvas;
delete n.pdfPage.newWatermark[e.watermarkTime], r && (n.deleteStampCallback = function () {
var t = n.div.querySelector(".canvasWrapper"), r = n.div.querySelector(".textLayer");
t && n.div.removeChild(t), r && n.div.removeChild(r);
var i = e.app.pdfThumbnailViewer.getThumbnail(n.pdfPage.pageIndex);
i.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL, i.setImage(n)
}, n.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL, n.renderingQueue.renderView(n))
}, r = 0; r < t; r++) n(r);
this.watermarkTime = null
}
}
}, {
key: "renderWatermarkOnDocument", value: function () {
var e = this;
if (this.watermarkTime) {
for (var t = [], n = !!PDFJS.disableTextLayer || window.navigator.userAgent.indexOf("MSIE 9.0") > 0, r = this.app.pagesCount, i = function (r) {
var i = e.app.pdfViewer.getPageView(r), a = i.canvas, o = i.viewport.scale, s = i.width / o,
l = i.height / o, c = e.getWaterMarkConfig(s, l);
for (var u in null == i.pdfPage.newWatermark && (i.pdfPage.newWatermark = {}), i.pdfPage.newWatermark[e.watermarkTime] = {}, c) i.pdfPage.newWatermark[e.watermarkTime][u] = c[u];
if (3 == i.renderingState) {
var d = a.width / a.offsetWidth;
t.push(renderWaterMark(c, a, o * d, a.width, a.height, null, !n).then(function (e) {
return (0, _utils.renderTextLayerElements)(i, e)
}))
}
}, a = 0; a < r; a++) i(a);
return Promise.all(t)
}
}
}, {
key: "renderWatermarkOnlyWeb", value: function () {
var e = this;
return this.fontList = [{title: "黑体", value: "SIMHEI.TTF"}, {title: "楷体", value: "SIMKAI.TTF"}, {
title: "宋体",
value: "SIMSUN.TTC"
}, {
title: "微软雅黑",
value: "msyh.ttf"
}], this.reset(), this.watermarkTime = (new Date).getTime(), this.renderWatermarkOnDocument().then(function () {
e.watermarkTime = null, e.fontList = []
})
}
}]), KG_Watermark
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFNodeStream = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(1), a = n(61);
function o(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}
function s(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function l(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var c = require("fs"), u = require("http"), d = require("https"), h = require("url"), p = function () {
function e(t) {
l(this, e), this.options = t, this.source = t.source, this.url = h.parse(this.source.url), this.isHttp = "http:" === this.url.protocol || "https:" === this.url.protocol, this.isFsUrl = "file:" === this.url.protocol || !this.url.host, this.httpHeaders = this.isHttp && this.source.httpHeaders || {}, this._fullRequest = null, this._rangeRequestReaders = []
}
return r(e, [{
key: "getFullReader", value: function () {
return (0, i.assert)(!this._fullRequest), this._fullRequest = this.isFsUrl ? new b(this) : new g(this), this._fullRequest
}
}, {
key: "getRangeReader", value: function (e, t) {
var n = this.isFsUrl ? new w(this, e, t) : new y(this, e, t);
return this._rangeRequestReaders.push(n), n
}
}, {
key: "cancelAllRequests", value: function (e) {
this._fullRequest && this._fullRequest.cancel(e), this._rangeRequestReaders.slice(0).forEach(function (t) {
t.cancel(e)
})
}
}]), e
}(), f = function () {
function e(t) {
l(this, e), this._url = t.url, this._done = !1, this._errored = !1, this._reason = null, this.onProgress = null, this._contentLength = t.source.length, this._loaded = 0, this._disableRange = t.options.disableRange || !1, this._rangeChunkSize = t.source.rangeChunkSize, this._rangeChunkSize || this._disableRange || (this._disableRange = !0), this._isStreamingSupported = !t.source.disableStream, this._isRangeSupported = !t.options.disableRange, this._readableStream = null, this._readCapability = (0, i.createPromiseCapability)(), this._headersCapability = (0, i.createPromiseCapability)()
}
return r(e, [{
key: "read", value: function () {
var e = this;
return this._readCapability.promise.then(function () {
if (e._done) return Promise.resolve({value: void 0, done: !0});
if (e._errored) return Promise.reject(e._reason);
var t = e._readableStream.read();
if (null === t) return e._readCapability = (0, i.createPromiseCapability)(), e.read();
e._loaded += t.length, e.onProgress && e.onProgress({loaded: e._loaded, total: e._contentLength});
var n = new Uint8Array(t).buffer;
return Promise.resolve({value: n, done: !1})
})
}
}, {
key: "cancel", value: function (e) {
this._readableStream ? this._readableStream.destroy(e) : this._error(e)
}
}, {
key: "_error", value: function (e) {
this._errored = !0, this._reason = e, this._readCapability.resolve()
}
}, {
key: "_setReadableStream", value: function (e) {
var t = this;
this._readableStream = e, e.on("readable", function () {
t._readCapability.resolve()
}), e.on("end", function () {
e.destroy(), t._done = !0, t._readCapability.resolve()
}), e.on("error", function (e) {
t._error(e)
}), !this._isStreamingSupported && this._isRangeSupported && this._error(new i.AbortException("streaming is disabled")), this._errored && this._readableStream.destroy(this._reason)
}
}, {
key: "headersReady", get: function () {
return this._headersCapability.promise
}
}, {
key: "contentLength", get: function () {
return this._contentLength
}
}, {
key: "isRangeSupported", get: function () {
return this._isRangeSupported
}
}, {
key: "isStreamingSupported", get: function () {
return this._isStreamingSupported
}
}]), e
}(), m = function () {
function e(t) {
l(this, e), this._url = t.url, this._done = !1, this._errored = !1, this._reason = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = (0, i.createPromiseCapability)(), this._isStreamingSupported = !t.source.disableStream
}
return r(e, [{
key: "read", value: function () {
var e = this;
return this._readCapability.promise.then(function () {
if (e._done) return Promise.resolve({value: void 0, done: !0});
if (e._errored) return Promise.reject(e._reason);
var t = e._readableStream.read();
if (null === t) return e._readCapability = (0, i.createPromiseCapability)(), e.read();
e._loaded += t.length, e.onProgress && e.onProgress({loaded: e._loaded});
var n = new Uint8Array(t).buffer;
return Promise.resolve({value: n, done: !1})
})
}
}, {
key: "cancel", value: function (e) {
this._readableStream ? this._readableStream.destroy(e) : this._error(e)
}
}, {
key: "_error", value: function (e) {
this._errored = !0, this._reason = e, this._readCapability.resolve()
}
}, {
key: "_setReadableStream", value: function (e) {
var t = this;
this._readableStream = e, e.on("readable", function () {
t._readCapability.resolve()
}), e.on("end", function () {
e.destroy(), t._done = !0, t._readCapability.resolve()
}), e.on("error", function (e) {
t._error(e)
}), this._errored && this._readableStream.destroy(this._reason)
}
}, {
key: "isStreamingSupported", get: function () {
return this._isStreamingSupported
}
}]), e
}();
function v(e, t) {
return {
protocol: e.protocol,
auth: e.auth,
host: e.hostname,
port: e.port,
path: e.path,
method: "GET",
headers: t
}
}
var g = function (e) {
function t(e) {
l(this, t);
var n = o(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e)), r = function (t) {
n._headersCapability.resolve(), n._setReadableStream(t);
var r = (0, a.validateRangeRequestCapabilities)({
getResponseHeader: function (e) {
return n._readableStream.headers[e.toLowerCase()]
}, isHttp: e.isHttp, rangeChunkSize: n._rangeChunkSize, disableRange: n._disableRange
}), i = r.allowRangeRequests, o = r.suggestedLength;
i && (n._isRangeSupported = !0), n._contentLength = o
};
return n._request = null, "http:" === n._url.protocol ? n._request = u.request(v(n._url, e.httpHeaders), r) : n._request = d.request(v(n._url, e.httpHeaders), r), n._request.on("error", function (e) {
n._errored = !0, n._reason = e, n._headersCapability.reject(e)
}), n._request.end(), n
}
return s(t, f), t
}(), y = function (e) {
function t(e, n, r) {
l(this, t);
var i = o(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
for (var a in i._httpHeaders = {}, e.httpHeaders) {
var s = e.httpHeaders[a];
void 0 !== s && (i._httpHeaders[a] = s)
}
return i._httpHeaders.Range = "bytes=" + n + "-" + (r - 1), i._request = null, "http:" === i._url.protocol ? i._request = u.request(v(i._url, i._httpHeaders), function (e) {
i._setReadableStream(e)
}) : i._request = d.request(v(i._url, i._httpHeaders), function (e) {
i._setReadableStream(e)
}), i._request.on("error", function (e) {
i._errored = !0, i._reason = e
}), i._request.end(), i
}
return s(t, m), t
}(), b = function (e) {
function t(e) {
l(this, t);
var n = o(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e)), r = decodeURI(n._url.path);
return c.lstat(r, function (e, t) {
if (e) return n._errored = !0, n._reason = e, void n._headersCapability.reject(e);
n._contentLength = t.size, n._setReadableStream(c.createReadStream(r)), n._headersCapability.resolve()
}), n
}
return s(t, f), t
}(), w = function (e) {
function t(e, n, r) {
l(this, t);
var i = o(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return i._setReadableStream(c.createReadStream(decodeURI(i._url.path), {start: n, end: r - 1})), i
}
return s(t, m), t
}();
t.PDFNodeStream = p
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFFetchStream = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(1), a = n(61);
function o(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
function s(e, t) {
return {method: "GET", headers: e, mode: "cors", credentials: t ? "include" : "same-origin", redirect: "follow"}
}
var l = function () {
function e(t) {
o(this, e), this.options = t, this.source = t.source, this.isHttp = /^https?:/i.test(this.source.url), this.httpHeaders = this.isHttp && this.source.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = []
}
return r(e, [{
key: "getFullReader", value: function () {
return (0, i.assert)(!this._fullRequestReader), this._fullRequestReader = new c(this), this._fullRequestReader
}
}, {
key: "getRangeReader", value: function (e, t) {
var n = new u(this, e, t);
return this._rangeRequestReaders.push(n), n
}
}, {
key: "cancelAllRequests", value: function (e) {
this._fullRequestReader && this._fullRequestReader.cancel(e), this._rangeRequestReaders.slice(0).forEach(function (t) {
t.cancel(e)
})
}
}]), e
}(), c = function () {
function e(t) {
var n = this;
for (var r in o(this, e), this._stream = t, this._reader = null, this._loaded = 0, this._withCredentials = t.source.withCredentials, this._contentLength = this._stream.source.length, this._headersCapability = (0, i.createPromiseCapability)(), this._disableRange = this._stream.options.disableRange, this._rangeChunkSize = this._stream.source.rangeChunkSize, this._rangeChunkSize || this._disableRange || (this._disableRange = !0), this._isRangeSupported = !this._stream.options.disableRange, this._isStreamingSupported = !this._stream.source.disableStream, this._headers = new Headers, this._stream.httpHeaders) {
var l = this._stream.httpHeaders[r];
void 0 !== l && this._headers.append(r, l)
}
var c = this._stream.source.url;
this._withCredentials = !0;
var u = s(this._headers, this._withCredentials);
fetch(c, u).then(function (e) {
if (!(0, a.validateResponseStatus)(e.status)) throw(0, a.createResponseStatusError)(e.status, c);
n._reader = e.body.getReader(), n._headersCapability.resolve();
var t = (0, a.validateRangeRequestCapabilities)({
getResponseHeader: function (t) {
return e.headers.get(t)
}, isHttp: n._stream.isHttp, rangeChunkSize: n._rangeChunkSize, disableRange: n._disableRange
}), r = t.allowRangeRequests, o = t.suggestedLength;
n._contentLength = o, n._isRangeSupported = r, !n._isStreamingSupported && n._isRangeSupported && n.cancel(new i.AbortException("streaming is disabled"))
}).catch(this._headersCapability.reject), this.onProgress = null
}
return r(e, [{
key: "read", value: function () {
var e = this;
return this._headersCapability.promise.then(function () {
return e._reader.read().then(function (t) {
var n = t.value, r = t.done;
if (r) return Promise.resolve({value: n, done: r});
e._loaded += n.byteLength, e.onProgress && e.onProgress({loaded: e._loaded, total: e._contentLength});
var i = new Uint8Array(n).buffer;
return Promise.resolve({value: i, done: !1})
})
})
}
}, {
key: "cancel", value: function (e) {
this._reader && this._reader.cancel(e)
}
}, {
key: "headersReady", get: function () {
return this._headersCapability.promise
}
}, {
key: "contentLength", get: function () {
return this._contentLength
}
}, {
key: "isRangeSupported", get: function () {
return this._isRangeSupported
}
}, {
key: "isStreamingSupported", get: function () {
return this._isStreamingSupported
}
}]), e
}(), u = function () {
function e(t, n, r) {
var l = this;
for (var c in o(this, e), this._stream = t, this._reader = null, this._loaded = 0, this._withCredentials = t.source.withCredentials, this._readCapability = (0, i.createPromiseCapability)(), this._isStreamingSupported = !t.source.disableStream, this._headers = new Headers, this._stream.httpHeaders) {
var u = this._stream.httpHeaders[c];
void 0 !== u && this._headers.append(c, u)
}
var d = n + "-" + (r - 1);
this._headers.append("Range", "bytes=" + d);
var h = this._stream.source.url;
this._withCredentials = !0;
var p = s(this._headers, this._withCredentials);
fetch(h, p).then(function (e) {
if (!(0, a.validateResponseStatus)(e.status)) throw(0, a.createResponseStatusError)(e.status, h);
l._readCapability.resolve(), l._reader = e.body.getReader()
}), this.onProgress = null
}
return r(e, [{
key: "read", value: function () {
var e = this;
return this._readCapability.promise.then(function () {
return e._reader.read().then(function (t) {
var n = t.value, r = t.done;
if (r) return Promise.resolve({value: n, done: r});
e._loaded += n.byteLength, e.onProgress && e.onProgress({loaded: e._loaded});
var i = new Uint8Array(n).buffer;
return Promise.resolve({value: i, done: !1})
})
})
}
}, {
key: "cancel", value: function (e) {
this._reader && this._reader.cancel(e)
}
}, {
key: "isStreamingSupported", get: function () {
return this._isStreamingSupported
}
}]), e
}();
t.PDFFetchStream = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.NetworkManager = t.PDFNetworkStream = void 0;
var r, i = n(1), a = n(61), o = n(25), s = (r = o) && r.__esModule ? r : {default: r};
function l(e, t) {
this.url = e, t = t || {}, this.isHttp = /^https?:/i.test(e), this.httpHeaders = this.isHttp && t.httpHeaders || {}, this.withCredentials = t.withCredentials || !1, this.getXhr = t.getXhr || function () {
return new XMLHttpRequest
}, this.currXhrId = 0, this.pendingRequests = Object.create(null), this.loadedRequests = Object.create(null)
}
function c(e) {
var t = e.response;
return "string" != typeof t ? t : (0, i.stringToBytes)(t).buffer
}
var u = function () {
try {
var e = new XMLHttpRequest;
return e.open("GET", s.default.location.href), e.responseType = "moz-chunked-arraybuffer", "moz-chunked-arraybuffer" === e.responseType
} catch (e) {
return !1
}
}();
function d(e) {
this._options = e;
var t = e.source;
this._manager = new l(t.url, {
httpHeaders: t.httpHeaders,
withCredentials: t.withCredentials
}), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = []
}
function h(e, t) {
this._manager = e;
var n = t.source, r = {
onHeadersReceived: this._onHeadersReceived.bind(this),
onProgressiveData: n.disableStream ? null : this._onProgressiveData.bind(this),
onDone: this._onDone.bind(this),
onError: this._onError.bind(this),
onProgress: this._onProgress.bind(this)
};
this._url = n.url, this._fullRequestId = e.requestFull(r), this._headersReceivedCapability = (0, i.createPromiseCapability)(), this._disableRange = t.disableRange || !1, this._contentLength = n.length, this._rangeChunkSize = n.rangeChunkSize, this._rangeChunkSize || this._disableRange || (this._disableRange = !0), this._isStreamingSupported = !1, this._isRangeSupported = !1, this._cachedChunks = [], this._requests = [], this._done = !1, this._storedError = void 0, this.onProgress = null
}
function p(e, t, n) {
this._manager = e;
var r = {onDone: this._onDone.bind(this), onProgress: this._onProgress.bind(this)};
this._requestId = e.requestRange(t, n, r), this._requests = [], this._queuedChunk = null, this._done = !1, this.onProgress = null, this.onClosed = null
}
l.prototype = {
requestRange: function (e, t, n) {
var r = {begin: e, end: t};
for (var i in n) r[i] = n[i];
return this.request(r)
}, requestFull: function (e) {
return this.request(e)
}, request: function (e) {
var t = this.getXhr(), n = this.currXhrId++, r = this.pendingRequests[n] = {xhr: t};
for (var i in t.open("GET", this.url), t.withCredentials = this.withCredentials, this.httpHeaders) {
var a = this.httpHeaders[i];
void 0 !== a && t.setRequestHeader(i, a)
}
if (this.isHttp && "begin" in e && "end" in e) {
var o = e.begin + "-" + (e.end - 1);
t.setRequestHeader("Range", "bytes=" + o), r.expectedStatus = 206
} else r.expectedStatus = 200;
return u && !!e.onProgressiveData ? (t.responseType = "moz-chunked-arraybuffer", r.onProgressiveData = e.onProgressiveData, r.mozChunked = !0) : t.responseType = "arraybuffer", e.onError && (t.onerror = function (n) {
e.onError(t.status)
}), t.onreadystatechange = this.onStateChange.bind(this, n), t.onprogress = this.onProgress.bind(this, n), r.onHeadersReceived = e.onHeadersReceived, r.onDone = e.onDone, r.onError = e.onError, r.onProgress = e.onProgress, t.send(null), n
}, onProgress: function (e, t) {
var n = this.pendingRequests[e];
if (n) {
if (n.mozChunked) {
var r = c(n.xhr);
n.onProgressiveData(r)
}
var i = n.onProgress;
i && i(t)
}
}, onStateChange: function (e, t) {
var n = this.pendingRequests[e];
if (n) {
var r = n.xhr;
if (r.readyState >= 2 && n.onHeadersReceived && (n.onHeadersReceived(), delete n.onHeadersReceived), 4 === r.readyState && e in this.pendingRequests) if (delete this.pendingRequests[e], 0 === r.status && this.isHttp) n.onError && n.onError(r.status); else {
var i = r.status || 200;
if (200 === i && 206 === n.expectedStatus || i === n.expectedStatus) {
this.loadedRequests[e] = !0;
var a = c(r);
if (206 === i) {
var o = r.getResponseHeader("Content-Range"), s = /bytes (\d+)-(\d+)\/(\d+)/.exec(o),
l = parseInt(s[1], 10);
n.onDone({begin: l, chunk: a})
} else n.onProgressiveData ? n.onDone(null) : a ? n.onDone({
begin: 0,
chunk: a
}) : n.onError && n.onError(r.status)
} else n.onError && n.onError(r.status)
}
}
}, hasPendingRequests: function () {
for (var e in this.pendingRequests) return !0;
return !1
}, getRequestXhr: function (e) {
return this.pendingRequests[e].xhr
}, isStreamingRequest: function (e) {
return !!this.pendingRequests[e].onProgressiveData
}, isPendingRequest: function (e) {
return e in this.pendingRequests
}, isLoadedRequest: function (e) {
return e in this.loadedRequests
}, abortAllRequests: function () {
for (var e in this.pendingRequests) this.abortRequest(0 | e)
}, abortRequest: function (e) {
var t = this.pendingRequests[e].xhr;
delete this.pendingRequests[e], t.abort()
}
}, d.prototype = {
_onRangeRequestReaderClosed: function (e) {
var t = this._rangeRequestReaders.indexOf(e);
t >= 0 && this._rangeRequestReaders.splice(t, 1)
}, getFullReader: function () {
return (0, i.assert)(!this._fullRequestReader), this._fullRequestReader = new h(this._manager, this._options), this._fullRequestReader
}, getRangeReader: function (e, t) {
var n = new p(this._manager, e, t);
return n.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(n), n
}, cancelAllRequests: function (e) {
this._fullRequestReader && this._fullRequestReader.cancel(e), this._rangeRequestReaders.slice(0).forEach(function (t) {
t.cancel(e)
})
}
}, h.prototype = {
_onHeadersReceived: function () {
var e = this._fullRequestId, t = this._manager.getRequestXhr(e), n = (0, a.validateRangeRequestCapabilities)({
getResponseHeader: function (e) {
return t.getResponseHeader(e)
}, isHttp: this._manager.isHttp, rangeChunkSize: this._rangeChunkSize, disableRange: this._disableRange
}), r = n.allowRangeRequests, i = n.suggestedLength;
this._contentLength = i || this._contentLength, r && (this._isRangeSupported = !0);
var o = this._manager;
o.isStreamingRequest(e) ? this._isStreamingSupported = !0 : this._isRangeSupported && o.abortRequest(e), this._headersReceivedCapability.resolve()
}, _onProgressiveData: function (e) {
this._requests.length > 0 ? this._requests.shift().resolve({value: e, done: !1}) : this._cachedChunks.push(e)
}, _onDone: function (e) {
e && this._onProgressiveData(e.chunk), this._done = !0, this._cachedChunks.length > 0 || (this._requests.forEach(function (e) {
e.resolve({value: void 0, done: !0})
}), this._requests = [])
}, _onError: function (e) {
var t = this._url, n = (0, a.createResponseStatusError)(e, t);
this._storedError = n, this._headersReceivedCapability.reject(n), this._requests.forEach(function (e) {
e.reject(n)
}), this._requests = [], this._cachedChunks = []
}, _onProgress: function (e) {
this.onProgress && this.onProgress({
loaded: e.loaded,
total: e.lengthComputable ? e.total : this._contentLength
})
}, get isRangeSupported() {
return this._isRangeSupported
}, get isStreamingSupported() {
return this._isStreamingSupported
}, get contentLength() {
return this._contentLength
}, get headersReady() {
return this._headersReceivedCapability.promise
}, read: function () {
if (this._storedError) return Promise.reject(this._storedError);
if (this._cachedChunks.length > 0) {
var e = this._cachedChunks.shift();
return Promise.resolve({value: e, done: !1})
}
if (this._done) return Promise.resolve({value: void 0, done: !0});
var t = (0, i.createPromiseCapability)();
return this._requests.push(t), t.promise
}, cancel: function (e) {
this._done = !0, this._headersReceivedCapability.reject(e), this._requests.forEach(function (e) {
e.resolve({value: void 0, done: !0})
}), this._requests = [], this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null
}
}, p.prototype = {
_close: function () {
this.onClosed && this.onClosed(this)
}, _onDone: function (e) {
var t = e.chunk;
this._requests.length > 0 ? this._requests.shift().resolve({value: t, done: !1}) : this._queuedChunk = t;
this._done = !0, this._requests.forEach(function (e) {
e.resolve({value: void 0, done: !0})
}), this._requests = [], this._close()
}, _onProgress: function (e) {
!this.isStreamingSupported && this.onProgress && this.onProgress({loaded: e.loaded})
}, get isStreamingSupported() {
return !1
}, read: function () {
if (null !== this._queuedChunk) {
var e = this._queuedChunk;
return this._queuedChunk = null, Promise.resolve({value: e, done: !1})
}
if (this._done) return Promise.resolve({value: void 0, done: !0});
var t = (0, i.createPromiseCapability)();
return this._requests.push(t), t.promise
}, cancel: function (e) {
this._done = !0, this._requests.forEach(function (e) {
e.resolve({value: void 0, done: !0})
}), this._requests = [], this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close()
}
}, t.PDFNetworkStream = d, t.NetworkManager = l
}])
}), function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {i: r, l: !1, exports: {}};
return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports
}
n.m = e, n.c = t, n.d = function (e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: r})
}, n.n = function (e) {
var t = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return n.d(t, "a", t), t
}, n.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 189)
}([function (e, t, n) {
"use strict";
var r = n(3), i = n(13), a = n(18), o = n(19), s = n(26), l = function e(t, n, l) {
var c, u, d, h, p = t & e.F, f = t & e.G, m = t & e.P, v = t & e.B,
g = f ? r : t & e.S ? r[n] || (r[n] = {}) : (r[n] || {}).prototype, y = f ? i : i[n] || (i[n] = {}),
b = y.prototype || (y.prototype = {});
for (c in f && (l = n), l) d = ((u = !p && g && void 0 !== g[c]) ? g : l)[c], h = v && u ? s(d, r) : m && "function" == typeof d ? s(Function.call, d) : d, g && o(g, c, d, t & e.U), y[c] != d && a(y, c, h), m && b[c] != d && (b[c] = d)
};
r.core = i, l.F = 1, l.G = 2, l.S = 4, l.P = 8, l.B = 16, l.W = 32, l.U = 64, l.R = 128, e.exports = l
}, function (e, t, n) {
"use strict";
var r = n(5);
e.exports = function (e) {
if (!r(e)) throw TypeError(e + " is not an object!");
return e
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.pxCovertToMM = t.mmCovertToPx = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
t.scrollToResizeScreen = function () {
if (window.navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
var e = void 0, t = void 0;
t = setInterval(function () {
e = document.documentElement.scrollTop || document.body.scrollTop, e -= 1, window.scrollTo(0, e), e += 1, window.scrollTo(0, e), clearInterval(t)
}, 100)
}
}, t.computeTextWdith = function (e, t, n) {
if (n) {
var r = document.createElement("canvas"), i = r.getContext("2d");
return i.font = t + "px " + n, i.measureText(e).width
}
return t * e.length
}, t.closeOverlay = function () {
var e = window.KGPdfViewerWebApp.PDFViewerApplication.overlayManager;
if (e._active.length) {
var t = [];
return e._active.forEach(function (n) {
t.push(e.close(n))
}), Promise.all(t)
}
return Promise.resolve()
}, t.createTextLayerElement = function (e, t, n, r, i, a, o) {
var s = document.createElement("div"), l = Math.sin((360 - a) * Math.PI / 180),
c = Math.cos((360 - a) * Math.PI / 180);
return s.innerText = e, s.style.left = t - r * l / 2 + "px", s.style.top = n - r * c / 2 + "px", s.style.fontSize = r * o + "px", s.style.fontFamily = i, s.style.transform = "rotate(" + a + "deg) translate(-50%, -50%)", s
}, t.renderTextLayerElements = function (e, t) {
var n = e.textLayer;
if (n) {
var r = n.textLayerDiv;
if (r) for (var i = r.querySelector("endOfContent"), a = 0; a < t.length; a++) r.insertBefore(t[a], i)
}
}, t.leftTopTransformToLeftBottom = function (e, t) {
return {x: e.x, y: t - e.y}
}, t.trim = function (e) {
return e.replace(/^\s*/, "").replace(/\s*$/, "")
}, t.unique = function (e) {
for (var t = 0; t < e.length; t++) for (var n = t + 1; n < e.length; n++) e[t] === e[n] && (e.splice(n, 1), n--);
return e
}, t.getDom = function (e, t, n) {
for (var r = [], i = document.getElementsByTagName(e), a = 0; a < i.length; a++) n === i[a].getAttribute(t) && r.push(i[a]);
return r
}, t.deepCopy = function e(t, n) {
var n = n || {};
for (var i in t) if ("object" == r(t[i])) {
var a = Array.isArray(t[i]);
n[i] = 1 == a ? [] : {}, e(t[i], n[i])
} else n[i] = t[i];
return n
}, t.deleteSessionItem = function (e) {
sessionStorage.removeItem(e)
}, t.getSessionItem = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = sessionStorage.getItem(e);
if (n) return t ? s.default.decrypt(n, c).toString(a.default) : n;
return null
}, t.setSessionItem = function (e, t) {
arguments.length > 2 && void 0 !== arguments[2] && arguments[2] ? sessionStorage.setItem(e, s.default.encrypt(t, c).toString()) : sessionStorage.setItem(e, t)
}, t.deleteCookieAndStorage = function (e) {
o.default.remove(e), localStorage.removeItem(e)
}, t.getCookieOrStorage = function (e) {
var t = o.default.get(e), n = localStorage.getItem(e);
return t || (n || "")
}, t.setCookieOrStorage = function (e, t, n) {
o.default.set(e, t, n), o.default.get(e) || localStorage.setItem(e, t)
}, t.randomString = function (e) {
e = e || 32;
for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", n = "", r = 0; r < e; r++) n += t.charAt(Math.floor(Math.random() * t.length));
return n
}, t.functionalJudgment = function (e) {
var t = window.KGPdfViewerWebApp, n = t.textToSeal, r = t.prepareStamp, i = t.readOnly, a = t.fileType,
o = t.additionText, s = t.pagingSeal, l = t.sealOrigin, c = t.certOrigin, u = t.multipleStamp, d = t.useCaptcha,
h = t.disableSignaturePad, p = t.fjrs, f = t.mobile, m = t.download, v = t.watermark, g = t.showPrintBtn,
y = t.verifyChainInfo, b = t.annotation, w = t.stampType, S = t.sealType, _ = t.scanStamp, k = t.openLocalFile,
x = t.secretSeal, P = t.indicateSeal, C = t.useTextWidget, A = t.isUrlDoc, T = t.sealPreLocation,
E = t.globalAnnotation, D = t.iWebAuth, I = t.isUkey, L = t.stampSystemOrigin, O = t.unifySealPlatformV2,
M = t.fingerPrint;
switch (e) {
case"stamp":
return A || !n && !r && !i;
case"prepareStamp":
return r && !i;
case"additionText":
return o && !r && "PDF" === a;
case"captcha":
return d && !r;
case"pagingSeal":
return s;
case"openLocalFile":
return k && window.FormData;
case"stampConfirm":
return u && !r;
case"signature":
return !(A || !(0 === l && 0 === c && ("PT" === S && 0 === w || "GM" === S && 2 === w || "OFD" === a) || 1 === l && 1 === c && ("GM" === S && 2 === w || "OFD" === a) || -1 === c) || d || i || n || h || null != p || r || _);
case"download":
return m && !i;
case"fjrs":
return !i && !r && null != p;
case"scanStamp":
return !i && !r && _ && 1 === L && !O;
case"textToSeal":
return n && !r && !i && 0 === f;
case"watermark":
return v && !i;
case"print":
return g || n && 0 === f && !i;
case"blockChain":
return y;
case"certValidity":
return 2 == w && "GB" == S && "1" == l && "1" == c;
case"annotation":
return b;
case"secretSeal":
return x && "1" == l && "1" == c;
case"indicateSeal":
return P;
case"textConfirm":
return C;
case"sealPreLocation":
return null != T;
case"docSignConfirm":
return !!E;
case"iWebAuth":
return D.scan || D.uKey;
case"isUkey":
return I;
case"unifySealPlatformV2":
return O;
case"fingerPrint":
return !!M;
default:
return !1
}
}, t.convertRGB = function (e) {
for (var t = "", n = 0; n < 3; n++) {
var r = parseInt(e[n]), i = "0123456789ABCDEF", a = "", o = r % 16;
a = i.substr(o, 1), t += i.substr(o = (r - o) / 16, 1) + a
}
return t
}, t.convertHex = function (e) {
function t(e, t, n, r) {
return parseInt(e.slice(t, n), r)
}
e = function (e) {
var t = [], n = e;
if (3 == e.length) {
for (var r = 0; r < 3; r++) t[r] = e.slice(r, r + 1) + e.slice(r, r + 1);
n = t.join("")
}
return n
}(e);
for (var n = [], r = 0; r < 3; r++) n[r] = t(e, 2 * r, 2 * r + 2, 16);
return n
}, t.hexToRgb = function (e) {
var t = e.toLowerCase();
if (/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) {
if (4 === t.length) {
for (var n = "#", r = 1; r < 4; r += 1) n += t.slice(r, r + 1).concat(t.slice(r, r + 1));
t = n
}
for (var i = [], r = 1; r < 7; r += 2) i.push(parseInt("0x" + t.slice(r, r + 2)));
return {rgb: "rgb(" + i.join(",") + ")", rgbArr: i}
}
return t
}, t.IsFontExist = function (e) {
if ("" == e) return "";
var t = document.createElement("span"), n = "测试文字";
t.style.fontSize = "72px", t.innerHTML = n;
var r = document.getElementsByTagName("body")[0];
r.appendChild(t), t.style.fontFamily = n;
var i = t.offsetWidth, a = t.offsetHeight;
t.style.fontFamily = e + "," + n;
var o = t.offsetWidth != i || t.offsetHeight != a;
return r.removeChild(t), !!o
}, t.toTransparentImg = function (e) {
var t = [255, 255, 255, 255], n = null, r = t[0], i = t[1], a = t[2], o = t[3], s = void 0, l = void 0, c = void 0,
u = void 0, d = document.createElement("canvas"), h = d.getContext("2d"), p = e.width, f = e.height;
d.width = p, d.height = f, h.drawImage(e, 0, 0), n = h.getImageData(0, 0, p, f);
for (var m = 0; m < n.data.length; m += 4) {
s = n.data[m], l = n.data[m + 1], c = n.data[m + 2], u = n.data[m + 3];
var v = Math.sqrt(Math.pow(s - r, 2) + Math.pow(l - i, 2) + Math.pow(c - a, 2) + Math.pow(u - o, 2));
v <= 60 && (n.data[m] = 0, n.data[m + 1] = 0, n.data[m + 2] = 0, n.data[m + 3] = 0)
}
return h.putImageData(n, 0, 0), d.toDataURL("image/png")
}, t.externalSign = function (e, t, n, r) {
if (null == window.KGPdfViewerWebApp.externalSign || "function" != typeof window.KGPdfViewerWebApp.externalSign) r("外部签名接口未定义"); else {
for (var o = [], s = function (t) {
var n = e[t].needSigMessage;
0 == window.KGPdfViewerWebApp.stampType && (n = i.default.stringify(a.default.parse(n))), o.push(new Promise(function (e) {
return window.KGPdfViewerWebApp.externalSign(n, e)
}))
}, l = 0; l < e.length; l++) s(l);
Promise.all(o).then(function (n) {
for (var r = [], i = void 0, a = 0; a < n.length; a++) {
var o = n[a], s = o.cert, l = o.signedData, c = o.message;
if (!s || !l) {
i = {message: c || "外部接口签名失败"};
break
}
0 == window.KGPdfViewerWebApp.stampType ? e[a].certSignMsg = l : e[a].sigedData = l;
var u = {cert: s, signedData: [e[a]]};
r.push(t(u))
}
return i ? Promise.reject(i) : Promise.all(r)
}).then(function () {
n && n()
}).catch(function (e) {
r(e.message || "外部接口签名失败")
})
}
}, t.mergerConfig = function (e, t) {
for (var n in t) !0 === t.hasOwnProperty(n) && (e[n] = t[n]);
return e
}, t.flatten = function (e) {
var t = {};
return function e(n, r) {
if (Object(r) !== r) n && (t[n] = r); else if (Array.isArray(r)) {
for (var i = 0, a = r.length; i < a; i++) e(n + "[" + i + "]", r[i]);
0 === r.length && n && (t[n] = [])
} else {
var o = !0;
for (var s in r) o = !1, e((n ? n + "." : n) + s, r[s]);
o && n && (t[n] = {})
}
}("", e), t
}, t.titleCase = function (e) {
return e.slice(0, 1).toUpperCase() + e.slice(1)
}, t.isMobile = function () {
var e = navigator.userAgent.toLowerCase(), t = "ipad" == e.match(/ipad/i), n = "iphone" == e.match(/iphone/i),
r = "ipod" == e.match(/ipd/i), i = "android" == e.match(/android/i), a = "blackberry" == e.match(/blackberry/i),
o = "symbianos" == e.match(/symbianos/i);
return !!(t || n || r || i || a || o)
}, t.parseCilentSealImgData = function (e) {
var t = e.substring(0, 65), n = e.substring(65);
return i.default.stringify(i.default.parse(n, t))
}, t.closest = function (e, t) {
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
Element.prototype.closest || (Element.prototype.closest = function (e) {
var t = this;
if (!document.documentElement.contains(t)) return null;
do {
if (!t.matches) return null;
if (t.matches(e)) return t;
t = t.parentNode
} while (null !== t);
return null
});
return e.closest(t)
}, t._deepClone = function e(t) {
var n = void 0;
if ("object" === (void 0 === t ? "undefined" : r(t))) for (var i in n = Array.isArray(t) ? [] : {}, t) t.hasOwnProperty(i) && ("object" !== r(t[i]) ? n[i] = t[i] : n[i] = e(t[i])); else n = t;
return n
}, t.sortClass = function (e, t) {
return n = e, r = function (e) {
var n = e;
return t.forEach(function (e) {
n = n[e]
}), n
}, i = {}, n.forEach(function (e) {
var t = JSON.stringify(r(e));
i[t] = i[t] || [], i[t].push(e)
}), Object.keys(i).map(function (e) {
return i[e]
});
var n, r, i
}, t.removePrototype = function (e) {
var t = Object.create(null);
for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
return t
}, t.transformData = function (e) {
var t = window.KGPdfViewerWebApp, n = t.aesEncrypt, r = t.postEncrypt, i = void 0 !== r && r, a = void 0,
o = Object.create(null);
a = i ? n(JSON.stringify(e)) : e;
return o.isEncrypt = i, o.data = a, o
}, t.getXYPoint = function (e, t) {
var n = void 0, r = void 0, i = void 0, a = void 0, o = u(e, t);
switch (o) {
case"left-top":
i = e.left / t.width, a = e.top / t.height, n = t.width * a, r = t.height * i;
break;
case"right-top":
i = (t.width - e.left - e.width) / t.width, a = e.top / t.height, n = t.width * a, r = (t.height - e.width) * (1 - i);
break;
case"left-bottom":
i = e.left / t.width, a = (t.height - e.top - e.height) / t.height, n = (t.width - e.height) * (1 - a), r = t.height * i;
break;
case"right-bottom":
i = (t.width - e.left - e.width) / t.width, a = (t.height - e.top - e.height) / t.height, n = (t.width - e.height) * (1 - a), r = (t.height - e.width) * (1 - i)
}
return {XYType: o, r_top: n, r_left: r, xsacle: i, ysacle: a}
}, t.getXYPoint_diffentSize = function (e) {
var t = e.tempSeal, n = e.hRatio, r = e.wRatio, i = void 0, a = void 0;
switch (t.XYType) {
case"left-top":
i = t.top * n, a = t.left * r;
break;
case"right-top":
i = t.top * n, a = t.left * r + t.width * r - t.width;
break;
case"left-bottom":
i = t.top * n + t.height * n - t.height, a = t.left * r;
break;
case"right-bottom":
i = t.top * n + t.height * n - t.height, a = t.left * r + t.width * r - t.width
}
return {d_top: i, d_left: a}
}, t.isIE = function () {
return navigator.userAgent.indexOf("Trident") >= 0
}, t.pxConversionMm = function (e) {
return e / d()[0] * 25.4
}, t.mmConversionPx = function (e) {
return e / 25.4 * d()[0]
}, t.proxyFunction = function (e, t, n) {
Function.prototype.before || (Function.prototype.before = function (e) {
var t = this;
return function () {
var n = e.apply(this, arguments);
return n && t.apply(this, arguments)
}
});
Function.prototype.after || (Function.prototype.after = function (e) {
var t = this;
return function () {
return t.apply(this, arguments), e.apply(this, arguments)
}
});
return t[e](n)
}, t.download = function (e, t) {
(function (e) {
return new Promise(function (t) {
var n = new XMLHttpRequest;
n.open("GET", e, !0), n.responseType = "blob", n.onload = function () {
200 === n.status && t(n.response)
}, n.send()
})
})(e + "?docType=0&action=download&documentId=" + t + "&t=" + (new Date).getTime()).then(function (e) {
!function (e) {
if (window.navigator.msSaveBlob) return window.navigator.msSaveBlob(e, decodeURIComponent(t));
var n = document.createElement("a");
n.href = window.URL.createObjectURL(e), n.download = decodeURIComponent(t), (document.body || document.documentElement).appendChild(n), n.click(), n.parentNode.removeChild(n)
}(e)
})
}, t.limitQueueFn = function (e, t, n) {
var r = 0, i = 0, a = new Array(e.length).fill(0);
return new Promise(function (o, s) {
for (var l = 0; l < t; l++) c();
function c() {
new Promise(function (t, i) {
var a = e[r];
r++, t(n(a))
}).then(function (t) {
a[i] = t, i++, r < e.length ? c() : o(a)
})
}
})
};
var i = l(n(17)), a = l(n(34)), o = l(n(382)), s = l(n(171));
function l(e) {
return e && e.__esModule ? e : {default: e}
}
var c = "+97]4Up@<ZS3(#V0y55-Z-e0";
t.mmCovertToPx = function (e) {
return Math.round(e / (1 / (720 / 254)))
}, t.pxCovertToMM = function (e) {
return Math.round(e * (1 / (720 / 254)))
};
var u = function (e, t) {
var n = "";
return n += e.left + e.width / 2 < t.width / 2 ? "left" : "right", n += "-", n += e.top + e.height / 2 < t.height / 2 ? "top" : "bottom"
};
function d() {
var e = new Array;
if (window.screen.deviceXDPI) e[0] = window.screen.deviceXDPI, e[1] = window.screen.deviceYDPI; else {
var t = document.createElement("DIV");
t.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden", document.body.appendChild(t), e[0] = parseInt(t.offsetWidth), e[1] = parseInt(t.offsetHeight), t.parentNode.removeChild(t)
}
return e
}
}, function (e, t, n) {
"use strict";
var r = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = r)
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
try {
return !!e()
} catch (e) {
return !0
}
}
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
e.exports = function (e) {
return "object" === (void 0 === e ? "undefined" : r(e)) ? null !== e : "function" == typeof e
}
}, function (e, t, n) {
"use strict";
var r = n(64)("wks"), i = n(45), a = n(3).Symbol, o = "function" == typeof a;
(e.exports = function (e) {
return r[e] || (r[e] = o && a[e] || (o ? a : i)("Symbol." + e))
}).store = r
}, function (e, t, n) {
"use strict";
var r = n(28), i = Math.min;
e.exports = function (e) {
return e > 0 ? i(r(e), 9007199254740991) : 0
}
}, function (e, t, n) {
"use strict";
e.exports = !n(4)(function () {
return 7 != Object.defineProperty({}, "a", {
get: function () {
return 7
}
}).a
})
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.waitOnEventOrTimeout = t.WaitOnType = t.localized = t.animationStarted = t.normalizeWheelEventDelta = t.binarySearchFirstItem = t.watchScroll = t.scrollIntoView = t.getOutputScale = t.approximateFraction = t.roundToDivide = t.getVisibleElements = t.parseQueryString = t.noContextMenuHandler = t.getPDFFileNameFromURL = t.ProgressBar = t.EventBus = t.NullL10n = t.mozL10n = t.RendererType = t.PresentationModeState = t.cloneObj = t.isValidRotation = t.VERTICAL_PADDING = t.SCROLLBAR_PADDING = t.MAX_AUTO_SCALE = t.UNKNOWN_SCALE = t.MAX_SCALE = t.MIN_SCALE = t.DEFAULT_SCALE = t.DEFAULT_SCALE_VALUE = t.CSS_UNITS = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, a = n(14);
function o(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var s = {
get: function (e, t, n) {
return Promise.resolve(function (e, t) {
return t ? e.replace(/\{\{\s*(\w+)\s*\}\}/g, function (e, n) {
return n in t ? t[n] : "{{" + n + "}}"
}) : e
}(n, t))
}, translate: function (e) {
return Promise.resolve()
}
};
function l(e, t) {
var n = 0, r = e.length - 1;
if (0 === e.length || !t(e[r])) return e.length;
if (t(e[n])) return n;
for (; n < r;) {
var i = n + r >> 1;
t(e[i]) ? r = i : n = i + 1
}
return n
}
a.PDFJS.disableFullscreen = void 0 !== a.PDFJS.disableFullscreen && a.PDFJS.disableFullscreen, a.PDFJS.useOnlyCssZoom = void 0 !== a.PDFJS.useOnlyCssZoom && a.PDFJS.useOnlyCssZoom, a.PDFJS.maxCanvasPixels = void 0 === a.PDFJS.maxCanvasPixels ? 16777216 : a.PDFJS.maxCanvasPixels, a.PDFJS.disableHistory = void 0 !== a.PDFJS.disableHistory && a.PDFJS.disableHistory, a.PDFJS.disableTextLayer = void 0 !== a.PDFJS.disableTextLayer && a.PDFJS.disableTextLayer, a.PDFJS.ignoreCurrentPositionOnZoom = void 0 !== a.PDFJS.ignoreCurrentPositionOnZoom && a.PDFJS.ignoreCurrentPositionOnZoom, a.PDFJS.locale = void 0 === a.PDFJS.locale && "undefined" != typeof navigator ? navigator.language : a.PDFJS.locale;
var c = {EVENT: "event", TIMEOUT: "timeout"};
var u = new Promise(function (e) {
window.requestAnimationFrame(e)
}), d = Promise.resolve(), h = function () {
function e() {
o(this, e), this._listeners = Object.create(null)
}
return r(e, [{
key: "on", value: function (e, t) {
var n = this._listeners[e];
n || (n = [], this._listeners[e] = n), n.push(t)
}
}, {
key: "off", value: function (e, t) {
var n = this._listeners[e], r = void 0;
!n || (r = n.indexOf(t)) < 0 || n.splice(r, 1)
}
}, {
key: "dispatch", value: function (e) {
var t = this._listeners[e];
if (t && 0 !== t.length) {
var n = Array.prototype.slice.call(arguments, 1);
t.slice(0).forEach(function (e) {
e.apply(null, n)
})
}
}
}]), e
}();
var p = function () {
function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.height, i = n.width,
a = n.units;
o(this, e), this.visible = !0, this.div = document.querySelector(t + " .progress"), this.bar = this.div.parentNode, this.height = r || 100, this.width = i || 100, this.units = a || "%", this.div.style.height = this.height + this.units, this.percent = 0
}
return r(e, [{
key: "_updateBar", value: function () {
if (this._indeterminate) return this.div.classList.add("indeterminate"), void (this.div.style.width = this.width + this.units);
this.div.classList.remove("indeterminate");
var e = this.width * this._percent / 100;
this.div.style.width = e + this.units
}
}, {
key: "setWidth", value: function (e) {
if (e) {
var t = e.parentNode.offsetWidth - e.offsetWidth;
t > 0 && this.bar.setAttribute("style", "width: calc(100% - " + t + "px);")
}
}
}, {
key: "hide", value: function () {
this.visible && (window.KGPdfViewerWebApp.documentLoaded = !0, this.visible = !1, this.bar.classList.add("hidden"), document.body.classList.remove("loadingInProgress"))
}
}, {
key: "show", value: function () {
this.visible || (this.visible = !0, document.body.classList.add("loadingInProgress"), this.bar.classList.remove("hidden"))
}
}, {
key: "percent", get: function () {
return this._percent
}, set: function (e) {
var t, n, r;
this._indeterminate = isNaN(e), this._percent = (t = e, n = 0, r = 100, Math.min(Math.max(t, n), r)), this._updateBar()
}
}]), e
}();
t.CSS_UNITS = 96 / 72, t.DEFAULT_SCALE_VALUE = "auto", t.DEFAULT_SCALE = 1, t.MIN_SCALE = .25, t.MAX_SCALE = 10, t.UNKNOWN_SCALE = 0, t.MAX_AUTO_SCALE = 1.25, t.SCROLLBAR_PADDING = 40, t.VERTICAL_PADDING = 5, t.isValidRotation = function (e) {
return Number.isInteger(e) && e % 90 == 0
}, t.cloneObj = function (e) {
var t = Object.create(null);
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
return t
}, t.PresentationModeState = {UNKNOWN: 0, NORMAL: 1, CHANGING: 2, FULLSCREEN: 3}, t.RendererType = {
CANVAS: "canvas",
SVG: "svg"
}, t.mozL10n = void 0, t.NullL10n = s, t.EventBus = h, t.ProgressBar = p, t.getPDFFileNameFromURL = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "document.pdf";
if (function (e) {
for (var t = 0, n = e.length; t < n && "" === e[t].trim();) t++;
return "data:" === e.substr(t, 5).toLowerCase()
}(e)) return console.warn('getPDFFileNameFromURL: ignoring "data:" URL for performance reasons.'), t;
var n = /[^\/?#=]+\.(pdf|ofd)\b(?!.*\.(pdf|ofd)\b)/i,
r = /^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e),
i = n.exec(r[1]) || n.exec(r[2]) || n.exec(r[3]);
if (i && -1 !== (i = i[0]).indexOf("%")) try {
i = n.exec(decodeURIComponent(i))[0]
} catch (e) {
}
return i || t
}, t.noContextMenuHandler = function (e) {
e.preventDefault()
}, t.parseQueryString = function (e) {
for (var t = e.split("&"), n = Object.create(null), r = 0, i = t.length; r < i; ++r) {
var a = t[r].split("="), o = a[0].toLowerCase(), s = a.length > 1 ? a[1] : null;
n[decodeURIComponent(o)] = decodeURIComponent(s)
}
return n
}, t.getVisibleElements = function (e, t) {
for (var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = e.scrollTop, i = r + e.clientHeight, a = e.scrollLeft, o = a + e.clientWidth, s = [], c = void 0, u = void 0, d = void 0, h = void 0, p = void 0, f = void 0, m = 0 === t.length ? 0 : l(t, function (e) {
var t = e.div;
return t.offsetTop + t.clientTop + t.clientHeight > r
}), v = t.length; m < v && (d = (u = (c = t[m]).div).offsetTop + u.clientTop, h = u.clientHeight, !(d > i)); m++) (f = u.offsetLeft + u.clientLeft) + u.clientWidth < a || f > o || (p = 100 * (h - (Math.max(0, r - d) + Math.max(0, d + h - i))) / h | 0, s.push({
id: c.id,
x: f,
y: d,
view: c,
percent: p
}));
var g = s[0], y = s[s.length - 1];
return n && s.sort(function (e, t) {
var n = e.percent - t.percent;
return Math.abs(n) > .001 ? -n : e.id - t.id
}), {first: g, last: y, views: s}
}, t.roundToDivide = function (e, t) {
var n = e % t;
return 0 === n ? e : Math.round(e - n + t)
}, t.approximateFraction = function (e) {
if (Math.floor(e) === e) return [e, 1];
var t = 1 / e;
if (t > 8) return [1, 8];
if (Math.floor(t) === t) return [1, t];
for (var n = e > 1 ? t : e, r = 0, i = 1, a = 1, o = 1; ;) {
var s = r + a, l = i + o;
if (l > 8) break;
n <= s / l ? (a = s, o = l) : (r = s, i = l)
}
return n - r / i < a / o - n ? n === e ? [r, i] : [i, r] : n === e ? [a, o] : [o, a]
}, t.getOutputScale = function (e) {
var t = (window.devicePixelRatio || 1) / (e.webkitBackingStorePixelRatio || e.mozBackingStorePixelRatio || e.msBackingStorePixelRatio || e.oBackingStorePixelRatio || e.backingStorePixelRatio || 1);
return {sx: t, sy: t, scaled: 1 !== t}
}, t.scrollIntoView = function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = e.offsetParent;
if (r) {
for (var i = e.offsetTop + e.clientTop, a = e.offsetLeft + e.clientLeft; r.clientHeight === r.scrollHeight || n && "hidden" === getComputedStyle(r).overflow;) if (r.dataset._scaleY && (i /= r.dataset._scaleY, a /= r.dataset._scaleX), i += r.offsetTop, a += r.offsetLeft, !(r = r.offsetParent)) return;
t && (void 0 !== t.top && (i += t.top), void 0 !== t.left && (a += t.left, r.scrollLeft = a)), r.scrollTop = i
} else console.error("offsetParent is not set -- cannot scroll")
}, t.watchScroll = function (e, t) {
var n = function (n) {
i || (i = window.requestAnimationFrame(function () {
i = null;
var n = e.scrollTop, a = r.lastY;
n !== a && (r.down = n > a), r.lastY = n, t(r)
}))
}, r = {down: !0, lastY: e.scrollTop, _eventHandler: n}, i = null;
return e.addEventListener("scroll", n, !0), r
}, t.binarySearchFirstItem = l, t.normalizeWheelEventDelta = function (e) {
var t = Math.sqrt(e.deltaX * e.deltaX + e.deltaY * e.deltaY), n = Math.atan2(e.deltaY, e.deltaX);
return -.25 * Math.PI < n && n < .75 * Math.PI && (t = -t), 0 === e.deltaMode ? t /= 900 : 1 === e.deltaMode && (t /= 30), t
}, t.animationStarted = u, t.localized = d, t.WaitOnType = c, t.waitOnEventOrTimeout = function (e) {
var t = e.target, n = e.name, r = e.delay, o = void 0 === r ? 0 : r;
if ("object" !== (void 0 === t ? "undefined" : i(t)) || !n || "string" != typeof n || !(Number.isInteger(o) && o >= 0)) return Promise.reject(new Error("waitOnEventOrTimeout - invalid paramaters."));
var s = (0, a.createPromiseCapability)();
function l(e) {
t instanceof h ? t.off(n, u) : t.removeEventListener(n, u), p && clearTimeout(p), s.resolve(e)
}
var u = l.bind(null, c.EVENT);
t instanceof h ? t.on(n, u) : t.addEventListener(n, u);
var d = l.bind(null, c.TIMEOUT), p = setTimeout(d, o);
return s.promise
}
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(126), a = n(30), o = Object.defineProperty;
t.f = n(8) ? Object.defineProperty : function (e, t, n) {
if (r(e), t = a(t, !0), r(n), i) try {
return o(e, t, n)
} catch (e) {
}
if ("get" in n || "set" in n) throw TypeError("Accessors not supported!");
return "value" in n && (e[t] = n.value), e
}
}, function (e, t, n) {
"use strict";
var r = n(31);
e.exports = function (e) {
return Object(r(e))
}
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function () {
var e = e || function (e, t) {
var n;
"undefined" != typeof window && window.crypto && (n = window.crypto), !n && "undefined" != typeof window && window.msCrypto && (n = window.msCrypto), !n && "undefined" != typeof global && global.crypto && (n = global.crypto);
var r = function () {
if (n) {
if ("function" == typeof n.getRandomValues) try {
return n.getRandomValues(new Uint32Array(1))[0]
} catch (e) {
}
if ("function" == typeof n.randomBytes) try {
return n.randomBytes(4).readInt32LE()
} catch (e) {
}
}
throw new Error("Native crypto module could not be used to get secure random number.")
}, i = Object.create || function () {
function e() {
}
return function (t) {
var n;
return e.prototype = t, n = new e, e.prototype = null, n
}
}(), a = {}, o = a.lib = {}, s = o.Base = {
extend: function (e) {
var t = i(this);
return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
t.$super.init.apply(this, arguments)
}), t.init.prototype = t, t.$super = this, t
}, create: function () {
var e = this.extend();
return e.init.apply(e, arguments), e
}, init: function () {
}, mixIn: function (e) {
for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]);
e.hasOwnProperty("toString") && (this.toString = e.toString)
}, clone: function () {
return this.init.prototype.extend(this)
}
}, l = o.WordArray = s.extend({
init: function (e, t) {
e = this.words = e || [], this.sigBytes = void 0 != t ? t : 4 * e.length
}, toString: function (e) {
return (e || u).stringify(this)
}, concat: function (e) {
var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes;
if (this.clamp(), r % 4) for (var a = 0; a < i; a++) {
var o = n[a >>> 2] >>> 24 - a % 4 * 8 & 255;
t[r + a >>> 2] |= o << 24 - (r + a) % 4 * 8
} else for (a = 0; a < i; a += 4) t[r + a >>> 2] = n[a >>> 2];
return this.sigBytes += i, this
}, clamp: function () {
var t = this.words, n = this.sigBytes;
t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4)
}, clone: function () {
var e = s.clone.call(this);
return e.words = this.words.slice(0), e
}, random: function (e) {
for (var t = [], n = 0; n < e; n += 4) t.push(r());
return new l.init(t, e)
}
}), c = a.enc = {}, u = c.Hex = {
stringify: function (e) {
for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) {
var a = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
r.push((a >>> 4).toString(16)), r.push((15 & a).toString(16))
}
return r.join("")
}, parse: function (e) {
for (var t = e.length, n = [], r = 0; r < t; r += 2) n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - r % 8 * 4;
return new l.init(n, t / 2)
}
}, d = c.Latin1 = {
stringify: function (e) {
for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) {
var a = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
r.push(String.fromCharCode(a))
}
return r.join("")
}, parse: function (e) {
for (var t = e.length, n = [], r = 0; r < t; r++) n[r >>> 2] |= (255 & e.charCodeAt(r)) << 24 - r % 4 * 8;
return new l.init(n, t)
}
}, h = c.Utf8 = {
stringify: function (e) {
try {
return decodeURIComponent(escape(d.stringify(e)))
} catch (e) {
throw new Error("Malformed UTF-8 data")
}
}, parse: function (e) {
return d.parse(unescape(encodeURIComponent(e)))
}
}, p = o.BufferedBlockAlgorithm = s.extend({
reset: function () {
this._data = new l.init, this._nDataBytes = 0
}, _append: function (e) {
"string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes
}, _process: function (t) {
var n, r = this._data, i = r.words, a = r.sigBytes, o = this.blockSize, s = a / (4 * o),
c = (s = t ? e.ceil(s) : e.max((0 | s) - this._minBufferSize, 0)) * o, u = e.min(4 * c, a);
if (c) {
for (var d = 0; d < c; d += o) this._doProcessBlock(i, d);
n = i.splice(0, c), r.sigBytes -= u
}
return new l.init(n, u)
}, clone: function () {
var e = s.clone.call(this);
return e._data = this._data.clone(), e
}, _minBufferSize: 0
}), f = (o.Hasher = p.extend({
cfg: s.extend(), init: function (e) {
this.cfg = this.cfg.extend(e), this.reset()
}, reset: function () {
p.reset.call(this), this._doReset()
}, update: function (e) {
return this._append(e), this._process(), this
}, finalize: function (e) {
return e && this._append(e), this._doFinalize()
}, blockSize: 16, _createHelper: function (e) {
return function (t, n) {
return new e.init(n).finalize(t)
}
}, _createHmacHelper: function (e) {
return function (t, n) {
return new f.HMAC.init(e, n).finalize(t)
}
}
}), a.algo = {});
return a
}(Math);
return e
}, "object" === s(t) ? e.exports = t = o() : (i = [], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r = e.exports = {version: "2.6.11"};
"number" == typeof __e && (__e = r)
}, function (e, t, n) {
"use strict";
var r;
r = "undefined" != typeof window && window["pdfjs-dist/build/pdf"] ? window["pdfjs-dist/build/pdf"] : require("../build/pdf.js"), e.exports = r
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
if ("function" != typeof e) throw TypeError(e + " is not a function!");
return e
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFRenderingQueue = t.RenderingStates = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(37), a = n(184), o = n(2);
var s = {INITIAL: 0, RUNNING: 1, PAUSED: 2, FINISHED: 3}, l = function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.pdfViewer = null, this.pdfThumbnailViewer = null, this.onIdle = null, this.highestPriorityPage = null, this.idleTimeout = null, this.printing = !1, this.isThumbnailViewEnabled = !1
}
return r(e, [{
key: "setViewer", value: function (e) {
this.pdfViewer = e
}
}, {
key: "setThumbnailViewer", value: function (e) {
this.pdfThumbnailViewer = e
}
}, {
key: "isHighestPriority", value: function (e) {
return this.highestPriorityPage === e.renderingId
}
}, {
key: "renderHighestPriority", value: function (e) {
this.idleTimeout && (clearTimeout(this.idleTimeout), this.idleTimeout = null), this.pdfViewer.forceRendering(e) || this.pdfThumbnailViewer && this.isThumbnailViewEnabled && this.pdfThumbnailViewer.forceRendering() || this.printing || this.onIdle && (this.idleTimeout = setTimeout(this.onIdle.bind(this), 3e4))
}
}, {
key: "getHighestPriority", value: function (e, t, n) {
var r = e.views, i = r.length;
if (0 === i) return !1;
for (var a = 0; a < i; ++a) {
var o = r[a].view;
if (!this.isViewFinished(o)) return o
}
if (n) {
var s = e.last.id;
if (t[s] && !this.isViewFinished(t[s])) return t[s]
} else {
var l = e.first.id - 2;
if (t[l] && !this.isViewFinished(t[l])) return t[l]
}
return null
}
}, {
key: "isViewFinished", value: function (e) {
return e.renderingState === s.FINISHED
}
}, {
key: "renderView", value: function (e) {
var t = this;
switch (e.renderingState) {
case s.FINISHED:
return !1;
case s.PAUSED:
this.highestPriorityPage = e.renderingId, e.resume();
break;
case s.RUNNING:
this.highestPriorityPage = e.renderingId;
break;
case s.INITIAL:
this.highestPriorityPage = e.renderingId;
var n = function () {
if (t.renderHighestPriority(), null != e.canvas) {
var n = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth), r = e.pdfPage.newStamps;
for (var s in r) {
var l = (I = r[s]).querySelector("img"), c = I.style.width, u = I.style.height,
d = c.substring(0, c.length - 2) * n, h = u.substring(0, u.length - 2) * n, p = I.style.left,
f = I.style.top, m = p.substring(0, p.length - 2) * n, v = f.substring(0, f.length - 2) * n;
(L = e.canvas.getContext("2d")).globalCompositeOperation = "multiply", "multiply" !== L.globalCompositeOperation && (L.globalAlpha = .75), L.drawImage(l, m, v, d, h)
}
for (var g = e.pdfPage.textToSeals, y = 0; y < g.length; y++) {
var b = g[y].section, w = b.querySelector("img"), S = (0, i.getNumbOfPx)(b.style.width) * n,
_ = (0, i.getNumbOfPx)(b.style.height) * n, k = ((0, i.getNumbOfPx)(b.style.left) + 1) * n,
x = ((0, i.getNumbOfPx)(b.style.top) + 1) * n, P = e.canvas.getContext("2d");
P.globalCompositeOperation = "multiply", "multiply" !== P.globalCompositeOperation && (P.globalAlpha = .75), P.drawImage(w, k, x, S, _)
}
var C = e.pdfPage.newWatermark;
for (var A in C) {
var T = C[A];
(0, a.renderWaterMark)(T, e.canvas, n, e.canvas.width, e.canvas.height, null, !0).then(function (t) {
(0, o.renderTextLayerElements)(e, t)
})
}
var E = e.pdfPage.newDocSigns;
for (var D in E) {
var I, L;
l = (I = E[D]).querySelector("img"), c = I.style.width, u = I.style.height, d = c.substring(0, c.length - 2) * n, h = u.substring(0, u.length - 2) * n, p = I.style.left, f = I.style.top, m = p.substring(0, p.length - 2) * n, v = f.substring(0, f.length - 2) * n;
(L = e.canvas.getContext("2d")).globalCompositeOperation = "source-over", (L = e.canvas.getContext("2d")).drawImage(l, m, v, d, h)
}
}
e.deleteStampCallback && (e.deleteStampCallback(), e.deleteStampCallback = null), e.reRenderWait && (e.destroy(), e.renderingState = 0, e.renderingQueue.renderView(e), e.reRenderWait = !1)
};
e.draw().then(n, n)
}
return !0
}
}]), e
}();
t.RenderingStates = s, t.PDFRenderingQueue = l
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return function () {
var t = e, n = t.lib.WordArray;
t.enc.Base64 = {
stringify: function (e) {
var t = e.words, n = e.sigBytes, r = this._map;
e.clamp();
for (var i = [], a = 0; a < n; a += 3) for (var o = (t[a >>> 2] >>> 24 - a % 4 * 8 & 255) << 16 | (t[a + 1 >>> 2] >>> 24 - (a + 1) % 4 * 8 & 255) << 8 | t[a + 2 >>> 2] >>> 24 - (a + 2) % 4 * 8 & 255, s = 0; s < 4 && a + .75 * s < n; s++) i.push(r.charAt(o >>> 6 * (3 - s) & 63));
var l = r.charAt(64);
if (l) for (; i.length % 4;) i.push(l);
return i.join("")
}, parse: function (e, t) {
for (var r = e.length, i = (t = t || this._map, []), a = 0; a < t.length; a++) i[t.charCodeAt(a)] = a;
var o = t.charAt(64);
if (o) {
var s = e.indexOf(o);
-1 !== s && (r = s)
}
return function (e, t, r) {
for (var i = [], a = 0, o = 0; o < t; o++) if (o % 4) {
var s = r[e.charCodeAt(o - 1)] << o % 4 * 2, l = r[e.charCodeAt(o)] >>> 6 - o % 4 * 2, c = s | l;
i[a >>> 2] |= c << 24 - a % 4 * 8, a++
}
return n.create(i, a)
}(e, r, i)
}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}
}(), e.enc.Base64
}, "object" === s(t) ? e.exports = t = o(n(12)) : (i = [n(12)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(44);
e.exports = n(8) ? function (e, t, n) {
return r.f(e, t, i(1, n))
} : function (e, t, n) {
return e[t] = n, e
}
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(18), a = n(22), o = n(45)("src"), s = n(193), l = ("" + s).split("toString");
n(13).inspectSource = function (e) {
return s.call(e)
}, (e.exports = function (e, t, n, s) {
var c = "function" == typeof n;
c && (a(n, "name") || i(n, "name", t)), e[t] !== n && (c && (a(n, o) || i(n, o, e[t] ? "" + e[t] : l.join(String(t)))), e === r ? e[t] = n : s ? e[t] ? e[t] = n : i(e, t, n) : (delete e[t], i(e, t, n)))
})(Function.prototype, "toString", function () {
return "function" == typeof this && this[o] || s.call(this)
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(4), a = n(31), o = /"/g, s = function (e, t, n, r) {
var i = String(a(e)), s = "<" + t;
return "" !== n && (s += " " + n + '="' + String(r).replace(o, "&quot;") + '"'), s + ">" + i + "</" + t + ">"
};
e.exports = function (e, t) {
var n = {};
n[e] = t(s), r(r.P + r.F * i(function () {
var t = ""[e]('"');
return t !== t.toLowerCase() || t.split('"').length > 3
}), "String", n)
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.axios = t.myaxios = void 0;
var r = n(2), i = n(176), a = i.axios.create({
withCredentials: !0,
headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}
}), o = {
post: function (e, t) {
var n = {};
return n.promise = new Promise(function (e, t) {
n.resolve = e, n.reject = t
}), a.post(e, (0, r.transformData)(t)).then(function (e) {
n.resolve(e)
}).catch(function (e) {
(0, r.closeOverlay)().then(function () {
var t = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt;
null != e.response ? t.open("请求异常,状态码:" + e.response.status) : t.open("网络连接异常:" + e.message)
}), n.reject()
}), n.promise
}
};
t.myaxios = o, t.axios = i.axios
}, function (e, t, n) {
"use strict";
var r = {}.hasOwnProperty;
e.exports = function (e, t) {
return r.call(e, t)
}
}, function (e, t, n) {
"use strict";
var r = n(65), i = n(31);
e.exports = function (e) {
return r(i(e))
}
}, function (e, t, n) {
"use strict";
var r = n(66), i = n(44), a = n(23), o = n(30), s = n(22), l = n(126), c = Object.getOwnPropertyDescriptor;
t.f = n(8) ? c : function (e, t) {
if (e = a(e), t = o(t, !0), l) try {
return c(e, t)
} catch (e) {
}
if (s(e, t)) return i(!r.f.call(e, t), e[t])
}
}, function (e, t, n) {
"use strict";
var r = n(22), i = n(11), a = n(92)("IE_PROTO"), o = Object.prototype;
e.exports = Object.getPrototypeOf || function (e) {
return e = i(e), r(e, a) ? e[a] : "function" == typeof e.constructor && e instanceof e.constructor ? e.constructor.prototype : e instanceof Object ? o : null
}
}, function (e, t, n) {
"use strict";
var r = n(15);
e.exports = function (e, t, n) {
if (r(e), void 0 === t) return e;
switch (n) {
case 1:
return function (n) {
return e.call(t, n)
};
case 2:
return function (n, r) {
return e.call(t, n, r)
};
case 3:
return function (n, r, i) {
return e.call(t, n, r, i)
}
}
return function () {
return e.apply(t, arguments)
}
}
}, function (e, t, n) {
"use strict";
var r = {}.toString;
e.exports = function (e) {
return r.call(e).slice(8, -1)
}
}, function (e, t, n) {
"use strict";
var r = Math.ceil, i = Math.floor;
e.exports = function (e) {
return isNaN(e = +e) ? 0 : (e > 0 ? i : r)(e)
}
}, function (e, t, n) {
"use strict";
var r = n(4);
e.exports = function (e, t) {
return !!e && r(function () {
t ? e.call(null, function () {
}, 1) : e.call(null)
})
}
}, function (e, t, n) {
"use strict";
var r = n(5);
e.exports = function (e, t) {
if (!r(e)) return e;
var n, i;
if (t && "function" == typeof (n = e.toString) && !r(i = n.call(e))) return i;
if ("function" == typeof (n = e.valueOf) && !r(i = n.call(e))) return i;
if (!t && "function" == typeof (n = e.toString) && !r(i = n.call(e))) return i;
throw TypeError("Can't convert object to primitive value")
}
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
if (void 0 == e) throw TypeError("Can't call method on " + e);
return e
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(13), a = n(4);
e.exports = function (e, t) {
var n = (i.Object || {})[e] || Object[e], o = {};
o[e] = t(n), r(r.S + r.F * a(function () {
n(1)
}), "Object", o)
}
}, function (e, t, n) {
"use strict";
var r = n(26), i = n(65), a = n(11), o = n(7), s = n(109);
e.exports = function (e, t) {
var n = 1 == e, l = 2 == e, c = 3 == e, u = 4 == e, d = 6 == e, h = 5 == e || d, p = t || s;
return function (t, s, f) {
for (var m, v, g = a(t), y = i(g), b = r(s, f, 3), w = o(y.length), S = 0, _ = n ? p(t, w) : l ? p(t, 0) : void 0; w > S; S++) if ((h || S in y) && (v = b(m = y[S], S, g), e)) if (n) _[S] = v; else if (v) switch (e) {
case 3:
return !0;
case 5:
return m;
case 6:
return S;
case 2:
_.push(m)
} else if (u) return !1;
return d ? -1 : c || u ? u : _
}
}
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return e.enc.Utf8
}, "object" === s(t) ? e.exports = t = o(n(12)) : (i = [n(12)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
if (n(8)) {
var i = n(39), a = n(3), o = n(4), s = n(0), l = n(81), c = n(118), u = n(26), d = n(51), h = n(44), p = n(18),
f = n(53), m = n(28), v = n(7), g = n(157), y = n(47), b = n(30), w = n(22), S = n(58), _ = n(5), k = n(11),
x = n(106), P = n(48), C = n(25), A = n(49).f, T = n(108), E = n(45), D = n(6), I = n(33), L = n(71), O = n(68),
M = n(111), N = n(60), R = n(76), W = n(50), V = n(110), F = n(146), G = n(10), B = n(24), K = G.f, j = B.f,
z = a.RangeError, U = a.TypeError, q = a.Uint8Array, H = Array.prototype, Y = c.ArrayBuffer, X = c.DataView,
J = I(0), Q = I(2), $ = I(3), Z = I(4), ee = I(5), te = I(6), ne = L(!0), re = L(!1), ie = M.values, ae = M.keys,
oe = M.entries, se = H.lastIndexOf, le = H.reduce, ce = H.reduceRight, ue = H.join, de = H.sort, he = H.slice,
pe = H.toString, fe = H.toLocaleString, me = D("iterator"), ve = D("toStringTag"), ge = E("typed_constructor"),
ye = E("def_constructor"), be = l.CONSTR, we = l.TYPED, Se = l.VIEW, _e = I(1, function (e, t) {
return Ae(O(e, e[ye]), t)
}), ke = o(function () {
return 1 === new q(new Uint16Array([1]).buffer)[0]
}), xe = !!q && !!q.prototype.set && o(function () {
new q(1).set({})
}), Pe = function (e, t) {
var n = m(e);
if (n < 0 || n % t) throw z("Wrong offset!");
return n
}, Ce = function (e) {
if (_(e) && we in e) return e;
throw U(e + " is not a typed array!")
}, Ae = function (e, t) {
if (!(_(e) && ge in e)) throw U("It is not a typed array constructor!");
return new e(t)
}, Te = function (e, t) {
return Ee(O(e, e[ye]), t)
}, Ee = function (e, t) {
for (var n = 0, r = t.length, i = Ae(e, r); r > n;) i[n] = t[n++];
return i
}, De = function (e, t, n) {
K(e, t, {
get: function () {
return this._d[n]
}
})
}, Ie = function (e) {
var t, n, r, i, a, o, s = k(e), l = arguments.length, c = l > 1 ? arguments[1] : void 0, d = void 0 !== c,
h = T(s);
if (void 0 != h && !x(h)) {
for (o = h.call(s), r = [], t = 0; !(a = o.next()).done; t++) r.push(a.value);
s = r
}
for (d && l > 2 && (c = u(c, arguments[2], 2)), t = 0, n = v(s.length), i = Ae(this, n); n > t; t++) i[t] = d ? c(s[t], t) : s[t];
return i
}, Le = function () {
for (var e = 0, t = arguments.length, n = Ae(this, t); t > e;) n[e] = arguments[e++];
return n
}, Oe = !!q && o(function () {
fe.call(new q(1))
}), Me = function () {
return fe.apply(Oe ? he.call(Ce(this)) : Ce(this), arguments)
}, Ne = {
copyWithin: function (e, t) {
return F.call(Ce(this), e, t, arguments.length > 2 ? arguments[2] : void 0)
}, every: function (e) {
return Z(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, fill: function (e) {
return V.apply(Ce(this), arguments)
}, filter: function (e) {
return Te(this, Q(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0))
}, find: function (e) {
return ee(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, findIndex: function (e) {
return te(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, forEach: function (e) {
J(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, indexOf: function (e) {
return re(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, includes: function (e) {
return ne(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, join: function (e) {
return ue.apply(Ce(this), arguments)
}, lastIndexOf: function (e) {
return se.apply(Ce(this), arguments)
}, map: function (e) {
return _e(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, reduce: function (e) {
return le.apply(Ce(this), arguments)
}, reduceRight: function (e) {
return ce.apply(Ce(this), arguments)
}, reverse: function () {
for (var e, t = Ce(this).length, n = Math.floor(t / 2), r = 0; r < n;) e = this[r], this[r++] = this[--t], this[t] = e;
return this
}, some: function (e) {
return $(Ce(this), e, arguments.length > 1 ? arguments[1] : void 0)
}, sort: function (e) {
return de.call(Ce(this), e)
}, subarray: function (e, t) {
var n = Ce(this), r = n.length, i = y(e, r);
return new (O(n, n[ye]))(n.buffer, n.byteOffset + i * n.BYTES_PER_ELEMENT, v((void 0 === t ? r : y(t, r)) - i))
}
}, Re = function (e, t) {
return Te(this, he.call(Ce(this), e, t))
}, We = function (e) {
Ce(this);
var t = Pe(arguments[1], 1), n = this.length, r = k(e), i = v(r.length), a = 0;
if (i + t > n) throw z("Wrong length!");
for (; a < i;) this[t + a] = r[a++]
}, Ve = {
entries: function () {
return oe.call(Ce(this))
}, keys: function () {
return ae.call(Ce(this))
}, values: function () {
return ie.call(Ce(this))
}
}, Fe = function (e, t) {
return _(e) && e[we] && "symbol" != (void 0 === t ? "undefined" : r(t)) && t in e && String(+t) == String(t)
}, Ge = function (e, t) {
return Fe(e, t = b(t, !0)) ? h(2, e[t]) : j(e, t)
}, Be = function (e, t, n) {
return !(Fe(e, t = b(t, !0)) && _(n) && w(n, "value")) || w(n, "get") || w(n, "set") || n.configurable || w(n, "writable") && !n.writable || w(n, "enumerable") && !n.enumerable ? K(e, t, n) : (e[t] = n.value, e)
};
be || (B.f = Ge, G.f = Be), s(s.S + s.F * !be, "Object", {
getOwnPropertyDescriptor: Ge,
defineProperty: Be
}), o(function () {
pe.call({})
}) && (pe = fe = function () {
return ue.call(this)
});
var Ke = f({}, Ne);
f(Ke, Ve), p(Ke, me, Ve.values), f(Ke, {
slice: Re, set: We, constructor: function () {
}, toString: pe, toLocaleString: Me
}), De(Ke, "buffer", "b"), De(Ke, "byteOffset", "o"), De(Ke, "byteLength", "l"), De(Ke, "length", "e"), K(Ke, ve, {
get: function () {
return this[we]
}
}), e.exports = function (e, t, n, r) {
var c = e + ((r = !!r) ? "Clamped" : "") + "Array", u = "get" + e, h = "set" + e, f = a[c], m = f || {},
y = f && C(f), b = !f || !l.ABV, w = {}, k = f && f.prototype, x = function (e, n) {
K(e, n, {
get: function () {
return function (e, n) {
var r = e._d;
return r.v[u](n * t + r.o, ke)
}(this, n)
}, set: function (e) {
return function (e, n, i) {
var a = e._d;
r && (i = (i = Math.round(i)) < 0 ? 0 : i > 255 ? 255 : 255 & i), a.v[h](n * t + a.o, i, ke)
}(this, n, e)
}, enumerable: !0
})
};
b ? (f = n(function (e, n, r, i) {
d(e, f, c, "_d");
var a, o, s, l, u = 0, h = 0;
if (_(n)) {
if (!(n instanceof Y || "ArrayBuffer" == (l = S(n)) || "SharedArrayBuffer" == l)) return we in n ? Ee(f, n) : Ie.call(f, n);
a = n, h = Pe(r, t);
var m = n.byteLength;
if (void 0 === i) {
if (m % t) throw z("Wrong length!");
if ((o = m - h) < 0) throw z("Wrong length!")
} else if ((o = v(i) * t) + h > m) throw z("Wrong length!");
s = o / t
} else s = g(n), a = new Y(o = s * t);
for (p(e, "_d", {b: a, o: h, l: o, e: s, v: new X(a)}); u < s;) x(e, u++)
}), k = f.prototype = P(Ke), p(k, "constructor", f)) : o(function () {
f(1)
}) && o(function () {
new f(-1)
}) && R(function (e) {
new f, new f(null), new f(1.5), new f(e)
}, !0) || (f = n(function (e, n, r, i) {
var a;
return d(e, f, c), _(n) ? n instanceof Y || "ArrayBuffer" == (a = S(n)) || "SharedArrayBuffer" == a ? void 0 !== i ? new m(n, Pe(r, t), i) : void 0 !== r ? new m(n, Pe(r, t)) : new m(n) : we in n ? Ee(f, n) : Ie.call(f, n) : new m(g(n))
}), J(y !== Function.prototype ? A(m).concat(A(y)) : A(m), function (e) {
e in f || p(f, e, m[e])
}), f.prototype = k, i || (k.constructor = f));
var T = k[me], E = !!T && ("values" == T.name || void 0 == T.name), D = Ve.values;
p(f, ge, !0), p(k, we, c), p(k, Se, !0), p(k, ye, f), (r ? new f(1)[ve] == c : ve in k) || K(k, ve, {
get: function () {
return c
}
}), w[c] = f, s(s.G + s.W + s.F * (f != m), w), s(s.S, c, {BYTES_PER_ELEMENT: t}), s(s.S + s.F * o(function () {
m.of.call(f, 1)
}), c, {
from: Ie,
of: Le
}), "BYTES_PER_ELEMENT" in k || p(k, "BYTES_PER_ELEMENT", t), s(s.P, c, Ne), W(c), s(s.P + s.F * xe, c, {set: We}), s(s.P + s.F * !E, c, Ve), i || k.toString == pe || (k.toString = pe), s(s.P + s.F * o(function () {
new f(1).slice()
}), c, {slice: Re}), s(s.P + s.F * (o(function () {
return [1, 2].toLocaleString() != new f([1, 2]).toLocaleString()
}) || !o(function () {
k.toLocaleString.call([1, 2])
})), c, {toLocaleString: Me}), N[c] = E ? T : D, i || E || p(k, me, D)
}
} else e.exports = function () {
}
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(153), a = n(0), o = n(64)("metadata"), s = o.store || (o.store = new (n(117))), l = function (e, t, n) {
var r = s.get(e);
if (!r) {
if (!n) return;
s.set(e, r = new i)
}
var a = r.get(t);
if (!a) {
if (!n) return;
r.set(t, a = new i)
}
return a
};
e.exports = {
store: s, map: l, has: function (e, t, n) {
var r = l(t, n, !1);
return void 0 !== r && r.has(e)
}, get: function (e, t, n) {
var r = l(t, n, !1);
return void 0 === r ? void 0 : r.get(e)
}, set: function (e, t, n, r) {
l(n, r, !0).set(e, t)
}, keys: function (e, t) {
var n = l(e, t, !1), r = [];
return n && n.forEach(function (e, t) {
r.push(t)
}), r
}, key: function (e) {
return void 0 === e || "symbol" == (void 0 === e ? "undefined" : r(e)) ? e : String(e)
}, exp: function (e) {
a(a.S, "Reflect", e)
}
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.convertScreenToViewportPoint = t.getNumbOfPx = t.getPath = t.CustomStyle = t.PDFStamp = void 0;
var r, i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, a = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), o = n(16), s = n(381), l = n(177), c = n(55), u = n(62), d = n(69),
h = (r = d) && r.__esModule ? r : {default: r}, p = n(70), f = n(2), m = n(183);
var v = function () {
var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null);
function n() {
}
return n.getProp = function (n, r) {
if (1 === arguments.length && "string" == typeof t[n]) return t[n];
var i, a, o = (r = r || document.documentElement).style;
if ("string" == typeof o[n]) return t[n] = n;
a = n.charAt(0).toUpperCase() + n.slice(1);
for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof o[i = e[s] + a]) return t[n] = i;
return t[n] = "undefined"
}, n.setProp = function (e, t, n) {
var r = this.getProp(e);
"undefined" !== r && (t.style[r] = n)
}, n
}();
function g(e) {
var t = e.path;
if (!t) {
t = [];
var n = e.target;
for (t.push(n); n.parentNode;) n = n.parentNode, t.push(n)
}
return t
}
function y(e) {
return parseFloat(e.substring(0, e.length - 2))
}
function b(e, t) {
for (var n = g(e), r = 0; r < n.length; r++) {
var i = n[r], a = i.id, o = i.className;
if (a && o) if (-1 != a.indexOf("pageContainer") && "page" === o) {
for (var s = n[r++]; "viewerContainer" != s.id;) s = n[r++];
var l = a.substring(13), c = window.hightMap.get(l);
if (!c) {
c = 0;
for (var u = 1; u < l; u++) {
c += document.getElementById("pageContainer" + u).clientHeight + 12
}
window.hightMap.set(l, c)
}
var d = e.clientY, h = e.clientX;
if (null == d) {
var p = e.touches[0];
h = p.clientX, d = p.clientY
}
var f = s.scrollTop + (d - 48) - (c + 10), m = s.scrollLeft + h, v = y(i.style.width), b = s.clientWidth;
return {node: i, pageNumber: l, pageX: b >= v ? m - (b - v) / 2 : m, pageY: f}
}
}
return null
}
window.hightMap = {
set: function (e, t) {
this[e] = t
}, get: function (e) {
return this[e]
}, contains: function (e) {
return null != this[e]
}, remove: function (e) {
delete this[e]
}, removeAll: function () {
for (var e in this) "function" != typeof this[e] && delete this[e]
}
};
var w = function () {
function e(e, t, n) {
if (this.isStamp = !1, this.toolbarButton = e, this.secondaryToolbarButton = t, this.app = n, this.sidebar = n.pdfSidebar, this.fileType = window.KGPdfViewerWebApp.fileType, this.seal = null, this.capability = null, this.touchstartEvent = null, this.pdfStampSeal = new s.PDFStampSeal(l.KGPdfViewerWebApp), this.stampMobileTip = document.getElementById("stamp-mobile-tip"), this.stampMobieCancel = document.getElementById("stamp-mobile-cancel"), this.isContinuityStampCheck = !1, this.continuityRange = null, this.isStampOfQfz = !1, this.tempSeals = [], this.stampSealType = "default", this.renderSignatureSeals = this.renderSignatureSeals.bind(this), this.selectSign = null, this.removeSignBtn = document.getElementById("docSignRemove"), this.selectSealData = null, !window.KGPdfViewerWebApp.chainStamp) {
var r = this;
this.continuityStampModal = new m.KG_ModalFactory(this.app, this.app.overlayManager, {
overlayName: "KG_CustomModalOverlay",
message: "印章改变位置,拖动在指定位置",
width: 320,
buttons: [{
content: "当前签章", callback: function () {
delete r.selectSealData.lastSelected
}, type: "primary"
}, {
content: "全局签章", callback: function () {
var e = void 0, t = void 0, n = r.selectSealData, i = n.lastSelected, a = i.index, o = i.scale,
s = i.tempStampSections, l = n.extraPosition[a], c = l.left, u = l.top, h = l.xsacle, p = l.ysacle,
m = l.XYType;
n.top = u, n.left = c, n.xsacle = h, n.ysacle = p, n.XYType = m, s.map(function (r) {
var i = Object.values(r)[0], a = i.isRotate, s = i.isDiffentSize, l = i.ratio, h = i.page;
if (a) {
var p = (0, f.getXYPoint)(n, {width: h.height / o, height: h.width / o}), m = p.r_left, v = p.r_top;
e = v, t = m
} else e = u, t = c;
if (s) {
var g = (0, f.getXYPoint_diffentSize)({wRatio: l.wRatio, hRatio: l.hRatio, tempSeal: n}), y = g.d_top,
b = g.d_left;
e = y, t = b
}
(0, d.setSectionStyle)(i, o, t, e)
}), delete n.lastSelected, n.extraPosition = Object.create(null)
}
}]
})
}
this.initStampPosition(), this.init()
}
return e.prototype = {
init: function () {
var e = this, t = this;
function n(e, n) {
e.preventDefault(), e.stopPropagation(), t.app.secondaryToolbar.close();
var r = window.KGPdfViewerWebApp.getSelectSealPrompt();
if ((t.tempSeals.length || t.isStamp) && null !== r.seals && r.seals.length > 0) {
t.isStamp = !1, t.app.KGStampConfirm.hide(), r.open();
for (var i = 1; i < t.app.pagesCount; i++) {
var a = t.app.pdfViewer.getPageView(i - 1).pdfPage.tempStamps;
for (var o in a) if (a.hasOwnProperty(o)) {
var s = a[o].querySelector(".deleteTempStampSection");
s && (s.style.display = "none");
var l = a[o].querySelector(".scaleTempStampSection");
l && (l.style.display = "none")
}
}
document.body.style.cursor = "default", document.onmousemove = null
} else t.stamp(n)
}
window.KGPdfViewerWebApp.elecSigModeCheckFile().then(function (t) {
t.status || e.app.KGAlertPrompt.open(t.message);
var r = window.KGPdfViewerWebApp.btnPositionConfig, i = r.toolbar, a = void 0 === i ? [] : i, o = r.sidebar,
s = void 0 === o ? [] : o;
if ((0, f.functionalJudgment)("secretSeal")) {
var l = e.app.appConfig.KG_SecretSeal, c = l.button, u = l.secondaryButton;
a.indexOf("stamp") > -1 && (c.removeAttribute("hidden"), t.status ? c.onclick = function (e) {
return n(e, "secret")
} : c.setAttribute("disabled", !0)), s.indexOf("stamp") > -1 && (u.removeAttribute("hidden"), t.status ? u.onclick = function (e) {
return n(e, "secret")
} : u.setAttribute("disabled", !0))
} else a.indexOf("stamp") > -1 && !window.KGPdfViewerWebApp.isUrlDoc && !window.KGPdfViewerWebApp.scanStamp && !window.KGPdfViewerWebApp.unifySealPlatformV2 && (e.toolbarButton.removeAttribute("hidden"), t.status ? e.toolbarButton.onclick = n : e.toolbarButton.setAttribute("disabled", !0)), s.indexOf("stamp") > -1 && !window.KGPdfViewerWebApp.isUrlDoc && !window.KGPdfViewerWebApp.scanStamp && !window.KGPdfViewerWebApp.unifySealPlatformV2 && (e.secondaryToolbarButton.removeAttribute("hidden"), t.status ? e.secondaryToolbarButton.onclick = n : e.secondaryToolbarButton.setAttribute("disabled", !0)), 2 == window.KGPdfViewerWebApp.stampSystemOrigin && (e.secondaryToolbarButton.removeAttribute("hidden"), t.status ? e.secondaryToolbarButton.onclick = n : e.secondaryToolbarButton.setAttribute("disabled", !0), document.getElementById("secondaryKgSignature").setAttribute("hidden", !0));
"0" === window.KGPdfViewerWebApp.mobile.toString() ? (document.oncontextmenu = e.onDocumentContextmenu.bind(e), document.addEventListener("click", e.onDocumentClick.bind(e))) : (document.ontouchstart = e.onDocumentTouchStart.bind(e), document.ontouchmove = e.onDocumentTouchMove.bind(e), document.ontouchend = e.onDocumentTouchEnd.bind(e))
})
}, onDocumentClick: function (e) {
0 === e.button && ((0, u.removeStampMenu)(), this.documentClick(e)), this.editDocSign(e)
}, onDocumentContextmenu: function (e) {
if (this.isStamp) if (e && (e.preventDefault(), e.stopPropagation()), this.tempSeals.length) {
this.app.KGStampConfirm.show(), this.tempSeals.forEach(function (e) {
e.eventRegister()
});
for (var t = 1; t <= this.app.pagesCount; t++) {
var n = this.app.pdfViewer.getPageView(t - 1).pdfPage.tempStamps;
for (var r in n) if (n.hasOwnProperty(r)) {
var i = n[r].querySelector(".deleteTempStampSection");
i && (i.style.display = "block");
var a = n[r].querySelector(".scaleTempStampSection");
a && (a.style.display = "block")
}
}
} else this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData();
this.cancelStamp()
}, onDocumentTouchStart: function (e) {
this.isStamp && (this.touchstartEvent = e), this.editDocSign(e)
}, onDocumentTouchMove: function () {
this.touchstartEvent = null
}, onDocumentTouchEnd: function (e) {
null != this.touchstartEvent ? this.documentClick(this.touchstartEvent) : "rightMenu" !== e.target.parentNode.id && (0, u.removeStampMenu)()
}, addStamp: function (e, t) {
var n = (0, f.deepCopy)(e);
n.sealdata.forEach(function (e, t) {
delete e.qfzSeal
}), t && t.removeAttribute("class"), this.cancelStamp(), this.capability.resolve(n)
}, setSealData: function (e) {
this.seal = e.seal, this.isContinuityStampCheck = e.isContinuityStampCheck, this.isStampOfQfz = e.isStampOfQfz, this.continuityRange = e.continuityRange, this.getSealObjectCallback(e)
}, getSealObjectCallback: function (e) {
var t = this;
this.seal = e.seal, this.isContinuityStampCheck = e.isContinuityStampCheck, this.continuityRange = e.continuityRange, this.isStampOfQfz = e.isStampOfQfz, this.capability = this.pdfStampSeal.createAddSealPromise();
var n = this.app.KG_SealPreLocation;
!n || n.hasStamp ? (this.app.KGStampConfirm && this.app.KGStampConfirm.hide(), this.tempSeals.length && this.tempSeals.forEach(function (e) {
e.eventUnregister()
}), ("stamp" === this.stampPosition.mode || e.isContinuityStampCheck || e.isStampOfQfz) && ("1" === window.KGPdfViewerWebApp.mobile.toString() ? (this.stampMobileTip.style.display = "block", this.stampMobieCancel.addEventListener("click", function (e) {
t.stampMobileTip.style.display = "none", t.tempSeals.length && t.app.KGStampConfirm.show(), t.cancelStamp()
}), this.isStamp = !0, document.ontouchstart = this.app.pdfStamp.onDocumentTouchStart.bind(this), document.ontouchmove = this.app.pdfStamp.onDocumentTouchMove.bind(this), document.ontouchend = this.app.pdfStamp.onDocumentTouchEnd.bind(this)) : (document.body.style.cursor = "move", this.stopMoveStamp || (document.onmousemove = function (e) {
t.isStamp = !0, t.movestamp(e, t)
})))) : n.isStamp || (n.deletePreSeal(), this.isStamp = !0, n.isStamp = !0, this.movestamp(void 0, this), this.documentClick())
}, documentClick: function (e) {
var t = this;
if (this.isStamp) {
var n = void 0;
if (e) n = b(e, this.sidebar); else {
var r = this.app, i = r.KG_SealPreLocation, a = r.pdfViewer;
if (i) {
var o = i.seal.page;
n = {node: a.getPageView(o - 1).div, pageNumber: o}
}
}
if (n) {
window.KGPdfViewerWebApp.allowFollow && window.KGPdfViewerWebApp.multipleStamp || (this.isStamp = !1, document.body.style.cursor = "default", document.onmousemove = null);
var s = n, l = s.node, u = s.pageNumber;
"1" === window.KGPdfViewerWebApp.mobile.toString() && (this.stampMobileTip.style.display = "none", this.movestamp(e, this));
var p = document.getElementById(l.id + "stamp");
if (p) {
var m = this.app.pdfViewer, v = this.seal;
if (v.left = y(p.style.left), v.top = y(p.style.top), v.width = y(p.style.width), v.height = y(p.style.height), this.isContinuityStampCheck) {
v.isContinuityStampCheck = !0, v.page = this.continuityRange;
var g = (T = m.getPageView(u - 1)).viewport.scale, w = (T.width, T.height / g), S = T.div,
_ = parseInt(getComputedStyle(S).width), k = parseInt(getComputedStyle(S).height),
x = (0, f.getXYPoint)(v, {width: _ / g, height: k / g}), P = x.XYType, C = x.xsacle, A = x.ysacle;
x.r_left, x.r_top;
v.XYType = P, v.xsacle = C, v.ysacle = A, v.actionPageInfo = (0, f.removePrototype)({
width: _,
height: k,
direction: k > _ ? "vertical" : "horizontal"
})
} else if (this.isStampOfQfz) {
var T;
w = (T = m.getPageView(u - 1)).height / T.viewport.scale;
v.bottom = w - v.top - v.height, v.isStampOfQfz = !0, v.pageAttr.bottom = v.bottom;
var E = v.top + v.height;
v.pageAttr.top = E, v.qfzSeal.forEach(function (e) {
e.top = v.top, e.width *= v.height / e.height, e.height = v.height
}), delete v.isContinuityStampCheck, delete v.xsacle, delete v.ysacle, delete v.left, delete v.top, delete v.bottom
} else v.page = u, v.hasOwnProperty("isContinuityStampCheck") && delete v.isContinuityStampCheck, v.hasOwnProperty("xsacle") && delete v.xsacle, v.hasOwnProperty("ysacle") && delete v.ysacle;
var D = (0, c.createCapability)();
if (window.KGPdfViewerWebApp.multipleStamp) v.isStampOfQfz || (v.currentPage = u), this.tempSeals.push(new h.default(p, v)), this.tempSeals.length && (this.app.KGStampConfirm.show(), this.app.KGStampConfirm.sealDatas = this.tempSeals.map(function (e) {
return e.sealData
}), this.app.KGStampConfirm.capability = D, window.KGPdfViewerWebApp.allowFollow && "1" !== window.KGPdfViewerWebApp.mobile.toString() || this.onDocumentContextmenu()); else {
if (v.isStampOfQfz) {
for (var I = 0; I < v.qfzSeal.length; I++) {
var L = v.qfzSeal[I];
L.sealdata = [], L.sealdata[0] = {
left: L.left,
width: L.width,
imgdata: L.imgdata
}, delete L.left, delete L.width, delete L.imgdata;
var O = p.cloneNode(!0);
O.setAttribute("id", p.id + "-" + L.page);
var M = m.getPageView(L.page - 1), N = M.viewport, R = M.annotationLayer, W = N.scale,
V = M.width / W;
O.style.width = L.sealdata[0].width + "px", O.style.height = L.height + "px", L.sealdata[0].left = V - L.sealdata[0].width, (0, d.setSectionStyle)(O, W, L.sealdata[0].left, L.top), O.querySelector("img").src = L.sealdata[0].imgdata, L.section = O, Object.defineProperty(L, "section", {enumerable: !1}), R && (R.div || (R.div = document.createElement("div"), R.div.className = "annotationLayer", M.div.appendChild(R.div)), R.div.appendChild(O))
}
p.parentNode.removeChild(p)
}
!0 === window.KGPdfViewerWebApp.useCaptcha ? (this.app.KGCaptcha.okCallback = function (e) {
t.addStamp({sealdata: [v], capability: D, captcha: e})
}, this.app.KGCaptcha.cancelCallback = function () {
t.isStamp = !0, t.cancelStamp()
}, this.app.KGCaptcha.open(v.phone)) : this.addStamp({sealdata: [v], capability: D})
}
D.promise.then(this.renderSignatureSeals)
}
}
}
}, renderSignatureSeals: function (e) {
var t = this, n = e.status, r = e.message, i = e.successPassBackParameter, a = this.app.pdfViewer;
if (this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData(), n) {
if (window.KGPdfViewerWebApp.multipleStamp) {
var o = this.tempSeals.concat();
if ("OFD" === self.fileType && window.KGPdfViewerWebApp.multipleStamp && "1" === window.KGPdfViewerWebApp.sealOrigin.toString() && (o = o.filter(function (e) {
return e.ofdStampSuccess
})), !o || !o.length) return;
if ("OFD" === window.KGPdfViewerWebApp.fileType || 2 == window.KGPdfViewerWebApp.stampType) (0, f.sortClass)(o, ["sealData", "esid"]).forEach(function (e) {
var n = void 0;
e.forEach(function (e, r) {
if (0 === r && (n = e.section.getAttribute("data-annotation-id")), e.sealData.isStampOfQfz) {
var i = e.section.getAttribute("data-annotation-id");
t.app.appConfig.viewerContainer.querySelectorAll('section[data-annotation-id="' + i + '"]').forEach(function (e) {
e.setAttribute("data-annotation-id", n)
})
} else e.section.setAttribute("data-annotation-id", n)
})
});
var s = o[0].section.getAttribute("data-annotation-id");
o.forEach(function (e, n) {
e.section.removeAttribute("class");
var r = function (e) {
e.removeAttribute("class");
var t = e.querySelector(".deleteTempStampSection");
t && e.removeChild(t);
var n = e.querySelector(".scaleTempStampSection");
n && e.removeChild(n)
};
if (r(e.section), e.sealData.isContinuityStampCheck) for (var i = e.sealData.page.split("-"), o = parseInt(i[0]), l = parseInt(i[1]), c = e.sealData._tempStampkey, u = o; u <= l; u++) {
for (var d = a.getPageView(u - 1), h = d.pdfPage.tempStamps, p = null, f = Object.keys(h), m = 0; m <= f.length; m++) {
var v = f[m];
if (-1 != v.indexOf(c)) {
p = h[v].cloneNode(!0);
break
}
}
if (!p) return;
r(p), p.id = n + "-" + s + "-" + u;
var g = e.section.getAttribute("data-annotation-id");
if (p.setAttribute("data-annotation-id", g), 1 === window.KGPdfViewerWebApp.stampType) 0 == window.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert && p.setAttribute("data-annotation-id", s);
t.updatePageView(d, p)
} else if (e.sealData.isStampOfQfz) for (var y = 0; y < e.sealData.qfzSeal.length; y++) {
var b = e.sealData.qfzSeal[y], w = e.section.id + "-" + b.page, S = a.getPageView(b.page - 1),
_ = S.pdfPage.tempStamps[w];
_.removeAttribute("class");
var k = _.querySelector(".deleteTempStampSection");
k && _.removeChild(k);
var x = _.querySelector(".scaleTempStampSection");
x && _.removeChild(x), _.id = n + "-" + s + "-" + y + "-" + b.page, t.updatePageView(S, _)
} else {
var P = a.getPageView(Number(e.sealData.page) - 1), C = e.section.cloneNode(!0);
if (C.id = n + "-" + s, 1 === window.KGPdfViewerWebApp.stampType) 0 == window.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert && C.setAttribute("data-annotation-id", s);
t.updateUI(P, C);
var A = P.annotationLayer;
A && (A.div || (A.div = document.createElement("div"), A.div.className = "annotationLayer", P.div.appendChild(A.div)), A.div.appendChild(C))
}
}), this.clearTempSeals(!1)
} else {
section.className = "";
var l = section.getAttribute("data-annotation-id");
if (self.isContinuityStampCheck) {
var c = self.continuityRange.split("-"), u = parseInt(c[0]), d = parseInt(c[1]),
h = section.cloneNode(!0);
section.parentNode.removeChild(section);
for (var p = u; p <= d; p++) {
var m = h.cloneNode(!0);
m.setAttribute("id", p + "-" + l);
var g = a.getPageView(p - 1), y = g.width / g.viewport.scale * xsacle,
b = g.height / g.viewport.scale * ysacle;
m.style.left = y + "px", m.style.top = b + "px", v.setProp("transformOrigin", m, -1 * y + "px " + -1 * b + "px"), self.updatePageView(g, m)
}
} else if (self.isStampOfQfz) for (var w = 0; w < sealdata.qfzSeal.length; w++) {
var S = sealdata.qfzSeal[w], _ = a.getPageView(S.page - 1);
S.section.removeAttribute("class"), S.section.id = S.page + "-" + l, this.updatePageView(_, S.section)
} else {
var k = a.getPageView(pageNumber - 1);
section.id = l, self.updateUI(k, section), window.KGPdfViewerWebApp.isUrlDoc && (i || (i = {}), i.section = section)
}
}
var x = this.app.KG_SealPreLocation;
x && !x.hasStamp && (x.hasStamp = !0, window.KGPdfViewerWebApp.multipleStamp = x.previewMultipleStampConfig), window.KGPdfViewerWebApp.stampSuccess && (!window.KGPdfViewerWebApp.fjrs || window.KGPdfViewerWebApp.fjrs && !window.KGPdfViewerWebApp.isServer) && window.KGPdfViewerWebApp.stampSuccess(i)
} else {
this.removeStampNode(), window.hightMap.removeAll(), window.KGPdfViewerWebApp.multipleStamp && (this.cancelStamp(), this.clearTempSeals(!0)), null != window.KGPdfViewerWebApp.externalStampSeal && window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(r || "调用外部接口加盖签章失败!")
}
}, updatePageView: function (e, t) {
var n = t, r = e.pdfPage, i = e.annotationLayer;
if (i) if (2 !== e.renderingState) {
if (1 === e.renderingState) return e.reRenderWait = !0, void (r.newStamps[n.id] = n);
i.div || (i.div = document.createElement("div"), i.div.className = "annotationLayer", e.div.appendChild(i.div)), i.div.appendChild(n), this.updateUI(e, n)
} else r.newStamps[n.id] = n; else r.newStamps[n.id] = n
}, updateUI: function (e, t) {
var n = e.pdfPage, r = t.style.width, i = t.style.height, a = y(t.style.left), s = y(t.style.top), l = y(r),
c = y(i), d = t.querySelector("img");
d.style.display = "none";
var h = (0, u.createSealNode)(n, e, t, r, i);
if (t.appendChild(h), n.newStamps[t.id] = t, void 0 !== e.canvas) {
var p = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth), f = a * p, m = s * p,
v = e.canvas.getContext("2d");
v.globalCompositeOperation = "multiply", "multiply" !== v.globalCompositeOperation && (v.globalAlpha = .85);
var g = this;
d.onload = function () {
v.drawImage(d, f, m, l * p, c * p);
var t = g.app.pdfThumbnailViewer.getThumbnail(n.pageIndex);
t.renderingState = o.RenderingStates.INITIAL, t.setImage(e)
}, d.src = d.src
}
}, stamp: function (e) {
var t = this;
this.pdfStampSeal.getSealObjet(e).then(function (e) {
var n = e.isStampOfQfz, r = e.isContinuityStampCheck;
if (n || r) return t.stampDefault(e);
var i = t.stampPosition, a = i.page, o = i.pos, s = i.text;
switch (i.mode) {
case"stamp":
t.stampDefault(e);
break;
case"stampOfXY":
t.stampOfXY(a, o.x, o.y, e.seal);
break;
case"stampOfText":
t.stampOfText(a, s, e.seal)
}
})
}, SCSJTT_getFirstSealFromServer: function (e, t) {
this.pdfStampSeal.SCSJTT_getFirstSealFromServer(e, t)
}, movestamp: function (e, t) {
if (!t.stopMoveStamp) {
var n = void 0, r = this.app, i = r.KG_SealPreLocation, a = r.pdfViewer;
if (e) n = b(e, this.sidebar); else if (i) {
var o = i.seal, s = o.page, l = o.left, c = o.top, u = o.width, d = o.height;
n = {
node: a.getPageView(s - 1).div,
pageNumber: s,
pageX: (l + u / 2) * a.currentScale * 96 / 72,
pageY: (c + d / 2) * a.currentScale * 96 / 72
}
}
if (n) {
var h = n, f = h.node, m = h.pageNumber, g = h.pageX, y = h.pageY;
f.style.overflow = "hidden";
var w = t.app.pdfViewer.getPageView(m - 1), S = w.annotationLayer;
S.div || (S.div = document.createElement("div"), S.div.className = "annotationLayer", f.appendChild(S.div));
var _ = w.viewport.scale;
if (g > 0 && y > 0 || i) {
var k = document.getElementById(f.id + "stamp"), x = g / _ - t.seal.width / 2,
P = y / _ - t.seal.height / 2, C = (new Date).getTime();
k ? (k.setAttribute("data-annotation-id", C), k.style.transform = "matrix(" + _ + ", 0, 0, " + _ + ", 0, 0)", k.style.left = x + "px", k.style.top = P + "px", v.setProp("transform", k, "matrix(" + _ + ", 0, 0, " + _ + ", 0, 0)"), v.setProp("transformOrigin", k, -1 * x + "px " + -1 * P + "px")) : (this.removeStampNode(), (k = this._createSection(this.seal, f.id + "stamp", C, "stamp", x, P, _)).querySelector("img").addEventListener("mousedown", p.eventPreventDefault), S.div.appendChild(k))
} else this.removeStampNode()
} else this.removeStampNode()
}
}, _createSection: function (e, t, n, r, i, a, o) {
var s = document.createElement("section");
s.setAttribute("data-annotation-id", n), s.id = t, s.className = r, s.style.width = e.width + "px", s.style.height = e.height + "px";
var l = document.createElement("img");
return l.src = e.imgdata, l.style.width = "100%", l.style.height = "100%", l.style.opacity = "0.8", s.appendChild(l), s.style.transform = "matrix(" + o + ", 0, 0, " + o + ", 0, 0)", s.style.left = i + "px", s.style.top = a + "px", v.setProp("transform", s, "matrix(" + o + ", 0, 0, " + o + ", 0, 0)"), v.setProp("transformOrigin", s, -1 * i + "px " + -1 * a + "px"), s
}, cancelStamp: function () {
this.stopMoveStamp = !1, this.stampSealType = "default", this.isStamp && (this.isStamp = !1, document.body.style.cursor = "default", document.onmousemove = null, this.removeStampNode(), window.hightMap.removeAll())
}, clearTempSeals: function () {
for (var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = this.app, n = t.pagesCount, r = t.pdfViewer, i = 1; i <= n; i++) {
var a = r.getPageView(i - 1), o = a.pdfPage.tempStamps, s = a.annotationLayer;
for (var l in o) if (o.hasOwnProperty(l)) {
if (s && s.div && document.getElementById(o[l].id)) {
var c = !1;
if (3 === l.split("-").length) o[l].getAttribute("class") || (c = !0);
(!c || c && e) && s.div.removeChild(o[l])
}
delete o[l]
}
}
this.tempSeals = []
}, removeStampNode: function () {
var e = document.getElementsByClassName("stamp");
0 !== e.length && e[0].parentNode.removeChild(e[0])
}, checkPageNum: function (e) {
var t = window.KGPdfViewerWebApp.getNumPages();
if (e || (e = "0-" + t), -1 !== e.indexOf(",")) return {
pages: e, chunk_pages: e.split(",").map(function (e) {
var t = e.split("-"), n = a(t, 2), r = n[0], i = n[1];
return [r, void 0 === i ? r : i].map(Number)
})
};
if (1 == e.length) {
if (e > t) return {pages: e, begin: e, end: e};
e = e + "-" + e
}
if (!/^\d+-\d+$/.test(e)) return {error: "页码格式不正确!"};
var n = e.split("-"), r = parseInt(n[0]), i = parseInt(n[1]);
if (r > i) {
var o = r;
r = i, i = o
}
return r < 1 && (r = 1), r > t && (r = t), i > t && (i = t), {pages: r + "-" + i, begin: r, end: i}
}, stampDefault: function (e) {
var t = this, n = {capability: this.pdfStampSeal.createAddSealPromise()};
for (var r in e) n[r] = e[r];
l.KGPdfViewerWebApp.selectedSeal ? l.KGPdfViewerWebApp.selectedSeal(e.seal).then(function (e) {
e && t.getSealObjectCallback(n)
}) : this.getSealObjectCallback(n)
}, stampOfXY: function (e, t, n, r, o) {
var s = this, l = this.checkPageNum(e), u = l.begin, d = l.end, h = l.chunk_pages, p = l.pages, f = l.error;
if (f) return this.app.KGAlertPrompt.open(f);
var m = this;
this.stopMoveStamp = !0, (r ? Promise.resolve({seal: r}) : this.pdfStampSeal.getSealObjet()).then(function (e) {
var r = e.seal, l = m.pdfStampSeal.createAddSealPromise(), f = null;
Array.isArray(r) ? f = r : ((f = r).left = t, f.top = n, f.page = p, f.isStampOfXY = !0);
var v = (0, c.createCapability)(), g = {sealdata: Array.isArray(r) ? f : [f], capability: v};
l.resolve(g), v.promise.then(function (e) {
var s = this;
if (e.status) if (o && o(), Array.isArray(r)) for (var l = function (e) {
var t = r[e], n = m.checkPageNum(t.page), i = n.begin, o = n.end, l = n.chunk_pages,
c = (n.pages, n.error);
if (c) return {v: s.app.KGAlertPrompt.open(c)};
var u = (new Date).getTime(), d = m.app.pdfViewer.getPageView(0), h = d.viewport.scale,
p = m._createSection(t, "", u, "", t.left, t.top, h), f = function (e, t) {
for (var n = window.KGPdfViewerWebApp.getNumPages(), r = e; r <= t; r++) {
if (r > n) return;
d = m.app.pdfViewer.getPageView(r - 1);
var i = p.cloneNode(!0);
i.id = (new Date).getTime() + "-" + b + 1, m.updatePageView(d, i)
}
};
l ? l.map(function (e) {
var t = a(e, 2), n = t[0], r = t[1];
f(n, r)
}) : f(i, o)
}, c = 0; c < r.length; c++) {
var p = l(c);
if ("object" === (void 0 === p ? "undefined" : i(p))) return p.v
} else {
var f = (new Date).getTime(), v = m.app.pdfViewer.getPageView(0), g = v.viewport.scale,
y = m._createSection(r, "", f, "", t, n, g), b = 0, w = function (e, t) {
for (var n = window.KGPdfViewerWebApp.getNumPages(), r = e; r <= t; r++) {
if (r > n) return;
v = m.app.pdfViewer.getPageView(r - 1);
var i = y.cloneNode(!0);
i.id = (new Date).getTime() + "-" + b++, m.updatePageView(v, i)
}
};
h ? h.map(function (e) {
var t = a(e, 2), n = t[0], r = t[1];
w(n, r)
}) : w(u, d)
}
}).finally(function () {
s.onDocumentContextmenu()
})
})
}, stampOfText: function (e, t, n, r) {
var i = this, a = this.checkPageNum(e), o = a.pages, s = a.error;
if (s) return this.app.KGAlertPrompt.open(s);
var l = this;
this.stopMoveStamp = !0, (n ? Promise.resolve({seal: n}) : this.pdfStampSeal.getSealObjet()).then(function (e) {
var n = e.seal, a = l.pdfStampSeal.createAddSealPromise(), s = null;
Array.isArray(n) ? s = n : ((s = n).page = o, s.isStampOfText = !0, s.text = t);
var u = (0, c.createCapability)(), d = {sealdata: Array.isArray(n) ? s : [s], capability: u};
a.resolve(d), u.promise.then(function (e) {
if (e.status) if (r && r(), Array.isArray(n)) for (var t = 0; t < n.length; t++) {
var i = n[t], a = l.checkPageNum(i.page), o = (a.begin, a.end, a.chunk_pages, a.pages, a.error);
if (o) return this.app.KGAlertPrompt.open(o);
for (var c = (new Date).getTime(), u = e.textPositions, d = 0; d < u.length; d++) {
var h = u[d], p = h.page, f = h.x - i.width / 2 + i.offsetX, m = h.y - i.height / 2 + i.offsetY,
v = l.app.pdfViewer.getPageView(p - 1), g = v.viewport.scale, y = (new Date).getTime() + "-" + d,
b = l._createSection(i, y, c, "", f, m, g);
l.updatePageView(v, b)
}
var w = e.successPassBackParameter;
window.KGPdfViewerWebApp.stampSuccess && window.KGPdfViewerWebApp.stampSuccess(w)
} else {
for (var S = (new Date).getTime(), _ = e.textPositions, k = 0; k < _.length; k++) {
var x = _[k], P = x.page, C = x.x - s.width / 2, A = x.y - s.height / 2,
T = l.app.pdfViewer.getPageView(P - 1), E = T.viewport.scale, D = (new Date).getTime() + "-" + k,
I = l._createSection(s, D, S, "", C, A, E);
l.updatePageView(T, I)
}
var L = e.successPassBackParameter;
window.KGPdfViewerWebApp.stampSuccess && window.KGPdfViewerWebApp.stampSuccess(L)
}
}).finally(function () {
i.onDocumentContextmenu()
})
})
}, editDocSign: function (e) {
var t, n, r, i = (0, f.closest)(e.target, "section");
if (i) {
var a = i.classList[0];
if (-1 == ["lineAnnotation", "circleAnnotation", "squareAnnotation"].indexOf(a)) return;
var o = window.KGPdfViewerWebApp, s = o.PDFViewerApplication, l = o.globalAnnotation,
c = o.deleteDocSignOnCanvas, u = (0, f.closest)(e.target, ".page"), d = Number(u.dataset.pageNumber),
h = s.pdfViewer.getPageView(d - 1);
if (this.selectSign == i) return;
var p = i.getAttribute("data-author") || "";
if ((l.author || "") != p) return s.KGAlertPrompt.open("您没有权限操作该批注!");
var m = (t = Array.prototype.slice.call(document.getElementsByClassName("lineAnnotation")), n = Array.prototype.slice.call(document.getElementsByClassName("circleAnnotation")), r = Array.prototype.slice.call(document.getElementsByClassName("squareAnnotation")), t.concat(n).concat(r));
m.map(function (e) {
e.style["pointer-events"] = "none"
}), i.style["pointer-events"] = "all";
var v = e.target;
"svg:svg" != v.tagName && "svg" != v.tagName || (v = v.firstChild);
var g = h.viewport.scale, y = parseInt(i.style.top);
d > 1 && (y += (u.offsetTop - 12) / g), c(i, h), this.app.KG_DocSign.editDocSign({
top: y,
left: parseInt(i.style.left),
editData: {
scale: g,
pageNumber: d,
pdfPageView: h,
shape: v.tagName,
section: i.cloneNode(!0),
element: v.cloneNode(!0),
strokeWidth: parseInt(v.getAttribute("stroke-width"))
}
}), m.map(function (e) {
e.style["pointer-events"] = "all"
})
}
}, initStampPosition: function () {
this.stampPosition = {mode: "stamp"};
var e = window.KGPdfViewerWebApp, t = e.stampPosition, n = e.fileType;
t && "PDF" == n && (this.stampPosition = Object.assign({}, t), this.stampPosition.pos && (this.stampPosition.mode = "stampOfXY"), !this.stampPosition.pos && this.stampPosition.text && (this.stampPosition.mode = "stampOfText"))
}
}, e
}();
t.PDFStamp = w, t.CustomStyle = v, t.getPath = g, t.getNumbOfPx = y, t.convertScreenToViewportPoint = b
}, function (e, t, n) {
"use strict";
var r = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",
i = "[" + r + "][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",
a = new RegExp("^" + i + "$");
t.isExist = function (e) {
return void 0 !== e
}, t.isEmptyObject = function (e) {
return 0 === Object.keys(e).length
}, t.merge = function (e, t, n) {
if (t) for (var r = Object.keys(t), i = r.length, a = 0; a < i; a++) e[r[a]] = "strict" === n ? [t[r[a]]] : t[r[a]]
}, t.getValue = function (e) {
return t.isExist(e) ? e : ""
}, t.buildOptions = function (e, t, n) {
var r = {};
if (!e) return t;
for (var i = 0; i < n.length; i++) void 0 !== e[n[i]] ? r[n[i]] = e[n[i]] : r[n[i]] = t[n[i]];
return r
}, t.isName = function (e) {
var t = a.exec(e);
return !(null === t || void 0 === t)
}, t.getAllMatches = function (e, t) {
for (var n = [], r = t.exec(e); r;) {
for (var i = [], a = r.length, o = 0; o < a; o++) i.push(r[o]);
n.push(i), r = t.exec(e)
}
return n
}, t.nameRegexp = i
}, function (e, t, n) {
"use strict";
e.exports = !1
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(45)("meta"), a = n(5), o = n(22), s = n(10).f, l = 0, c = Object.isExtensible || function () {
return !0
}, u = !n(4)(function () {
return c(Object.preventExtensions({}))
}), d = function (e) {
s(e, i, {value: {i: "O" + ++l, w: {}}})
}, h = e.exports = {
KEY: i, NEED: !1, fastKey: function (e, t) {
if (!a(e)) return "symbol" == (void 0 === e ? "undefined" : r(e)) ? e : ("string" == typeof e ? "S" : "P") + e;
if (!o(e, i)) {
if (!c(e)) return "F";
if (!t) return "E";
d(e)
}
return e[i].i
}, getWeak: function (e, t) {
if (!o(e, i)) {
if (!c(e)) return !0;
if (!t) return !1;
d(e)
}
return e[i].w
}, onFreeze: function (e) {
return u && h.NEED && c(e) && !o(e, i) && d(e), e
}
}
}, function (e, t, n) {
"use strict";
var r = n(6)("unscopables"), i = Array.prototype;
void 0 == i[r] && n(18)(i, r, {}), e.exports = function (e) {
i[r][e] = !0
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.getOfdSealsByTG = t.WebKGVerify = t.getCertByScanStamp = t.pdfSM2RegionSign = t.deleteOfdSeal = t.ofdSign = t.getOfdSeals = t.getCert = t.getKeySN = t.KG_OFD = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(43), o = n(2), s = u(n(17)), l = u(n(34)), c = n(86);
function u(e) {
return e && e.__esModule ? e : {default: e}
}
var d = function () {
function e() {
var t = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.kg = new a.KG("ISIGNATURESERVER.iSignatureServerCtrl.1", "2015DB05-ABB5-4924-A66FA88D7919C782");
var n = (0, a.createCapability)();
this.promise = n.promise;
var r = window.KGPdfViewerWebApp.appCode;
this.kg.init().then(function () {
t.kg.invoke("SetParamByName", "APPCODE", r).then(n.resolve)
})
}
return i(e, [{
key: "WebOpenKey", value: function (e) {
var t = this;
return this.kg.invoke("WebOpenKey", e).then(function (e) {
return e && "none" !== e && "0" !== e.toString() ? Promise.resolve(e) : t.WebGetLastErrorMsg("开启密钥盘失败")
})
}
}, {
key: "WebCloseKey", value: function (e) {
return this.kg.invoke("WebCloseKey", e)
}
}, {
key: "WebGetKeyCount", value: function () {
var e = this;
return this.kg.invoke("WebGetKeyCount", "").then(function (t) {
return isNaN(Number(t)) || 1 !== Number(t) ? Number(t) > 1 ? Promise.reject({message: "插入了太多的密钥盘"}) : -1 === Number(t) ? e.WebGetLastErrorMsg("授权已过期") : Promise.reject({message: "没有插入密钥盘"}) : Promise.resolve()
})
}
}, {
key: "WebKeyIsNotAdmin", value: function (e) {
var t = this;
return this.kg.invoke("WebKeyIsAdmin", e).then(function (e) {
return "false" === e || !1 === e ? Promise.resolve() : t.WebGetLastErrorMsg("没有检测到用户密钥盘")
})
}
}, {
key: "WebSign", value: function (e, t) {
var n = this;
return this.kg.invoke("WebSign", e, t).then(function (e) {
return e ? Promise.resolve(e) : n.WebGetLastErrorMsg("数据签名失败")
})
}
}, {
key: "WebVerifyPin", value: function (e, t) {
var n = this;
return this.kg.invoke("WebVerifyPin", e, t).then(function (e) {
return e && "0" === e ? Promise.resolve() : (window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), n.WebGetLastErrorMsg("密钥盘密码错误"))
})
}
}, {
key: "WebSetAlgoFlag", value: function () {
var e = this, t = window.KGPdfViewerWebApp.algorithmType.key;
if (null != t) {
var n = "sm2" === t.toLowerCase(), r = "rsa" === t.toLowerCase(), i = n ? 0 : r ? 1 : null;
return null != i ? this.kg.invoke("WebSetAlgoFlag", i).then(function (t) {
return t ? Promise.resolve() : e.WebGetLastErrorMsg("获取证书失败")
}) : Promise.resolve()
}
return Promise.resolve()
}
}, {
key: "WebGetSignCertByContainerName", value: function (e) {
var t = this, n = window.KGPdfViewerWebApp.adaptContainer;
return this.kg.invoke("WebGetCertByContainerName", e, 0, "").then(function (e) {
if (e.result) {
if (e.data = e.data.filter(function (e) {
return 2 == e.certAlgo && 0 == e.certExpiration
}), 0 === e.data.length) return Promise.reject({message: "没有有效的证书"});
for (var i = [], a = function (t) {
if (0 !== (i = e.data.filter(function (e) {
return e.containername === n[t]
})).length) return {v: Promise.resolve(i[0].cert)}
}, o = 0; o < n.length; o++) {
var s = a(o);
if ("object" === (void 0 === s ? "undefined" : r(s))) return s.v
}
return Promise.resolve(e.data[0].cert)
}
return t.WebGetLastErrorMsg()
})
}
}, {
key: "WebGetFirstCert", value: function (e) {
var t = this;
return this.kg.invoke("WebGetCertData", e, 0).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取证书失败")
})
}
}, {
key: "WebGetCertData", value: function (e) {
return 0 !== window.KGPdfViewerWebApp.adaptContainer.length ? this.WebGetSignCertByContainerName(e) : this.WebGetFirstCert(e)
}
}, {
key: "WebGetSealCount", value: function (e) {
var t = this;
return this.kg.invoke("WebGetSealCount", e).then(function (e) {
return !isNaN(Number(e)) && Number(e) >= 1 ? Promise.resolve(Number(e)) : t.WebGetLastErrorMsg("密钥盘中不存在印章")
})
}
}, {
key: "WebGetSealCount_TG", value: function (e) {
return this.kg.invoke("WebGetSealCount", e).then(function (e) {
return !isNaN(Number(e)) && Number(e) >= 1 ? Promise.resolve(Number(e)) : Promise.reject({
seals: [],
status: !1
})
})
}
}, {
key: "WebGetSealData", value: function (e) {
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return this.kg.invoke("WebGetSealData", e, n).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取印章失败(印章索引:" + n + "")
})
}
}, {
key: "WebGetKeySerialNumber", value: function (e) {
var t = this;
return this.kg.invoke("WebGetKeySerialNumber", e).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取密钥盘序列号失败")
})
}
}, {
key: "WebGetKeyUnit", value: function (e) {
var t = this;
return this.kg.invoke("WebGetKeyUnit", e).then(function (e) {
return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取用章单位失败")
})
}
}, {
key: "WebGetLastErrorMsg", value: function (e) {
return this.kg.invoke("WebGetLastErrorMsg").then(function (t) {
return t && "none" !== t ? Promise.reject({
message: t.value || t,
defaultMsg: e
}) : Promise.reject({message: e, defaultMsg: e})
})
}
}, {
key: "WebKGVerify", value: function (e, t, n) {
var r = this;
return this.kg.invoke("WebKGVerify", e, t, n).then(function (e) {
var t = "true" == e;
return t ? Promise.resolve(t) : r.WebGetLastErrorMsg("程序异常")
})
}
}]), e
}();
t.KG_OFD = d, t.getKeySN = function () {
var e = new d;
return e.promise.then(function () {
return e.WebGetKeyCount()
}).then(function () {
return e.WebOpenKey(0)
}).then(function (t) {
return e.WebGetKeySerialNumber(t)
})
}, t.getCert = function (e, t, n, r) {
var i = new d, a = void 0;
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(a)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return t(e)
}).then(function (e) {
n && n(e)
}).catch(function (e) {
var t = e.message;
return r(t), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}, t.getOfdSeals = function (e, t, n, r) {
var i = new d, a = void 0, o = void 0, s = void 0, l = void 0;
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(e)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebGetKeySerialNumber(a)
}).then(function (e) {
return o = e, (0, c.verifyKeySn)(e)
}).then(function () {
return i.WebGetKeyUnit(a)
}).then(function (e) {
return s = e, i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return l = e, i.WebGetSealCount(a)
}).then(function (e) {
for (var t = [], n = 0; n < e; n++) t.push(i.WebGetSealData(a, n));
return Promise.all(t)
}).then(function (e) {
if (!e || 0 === e.length) return i.WebGetLastErrorMsg("获取印章失败");
var n = {
action: "handleCilentSeal",
keySN: o,
unitName: s,
stampType: window.KGPdfViewerWebApp.stampType,
seals: e
};
return window.KGPdfViewerWebApp.cilentSeals = e, t && t(n)
}).then(function (e) {
var t = e.data;
n && n(t, l, o)
}).catch(function (e) {
return e && r && r({message: e.message, defaultMsg: e.defaultMsg}), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}, t.ofdSign = function (e, t, n, r, i, a) {
var o = new d, s = void 0, l = void 0;
o.promise.then(function () {
return o.WebGetKeyCount()
}).then(function () {
return o.WebOpenKey(0)
}).then(function (e) {
return s = e, o.WebKeyIsNotAdmin(e)
}).then(function () {
return o.WebVerifyPin(s, e)
}).then(function () {
return 1 == window.KGPdfViewerWebApp.sealOrigin ? o.WebGetKeySerialNumber(s).then(function (e) {
return t !== e ? Promise.reject({message: "密钥盘已更换"}) : Promise.resolve()
}) : Promise.resolve()
}).then(function () {
return o.WebSetAlgoFlag()
}).then(function () {
return o.WebGetCertData(s)
}).then(function (e) {
l = e;
for (var t = [], r = 0; r < n.length; r++) t.push(o.WebSign(s, n[r].toSignData));
return Promise.all(t)
}).then(function (e) {
for (var t = [], i = 0; i < e.length; i++) {
var a = {
signedData: e[i],
cert: l,
sealType: n[i].sealType,
toSignData: n[i].toSignData,
signDirPath: n[i].signDirPath
};
t.push(r(a))
}
return Promise.all(t)
}).catch(function (e) {
var t = e.message;
return a && a(t), Promise.resolve()
}).then(function () {
return null != s ? o.WebCloseKey(s) : Promise.resolve()
}).then(function () {
i && i()
})
}, t.deleteOfdSeal = function (e, t, n) {
var r = new d, i = void 0, a = (0, o.randomString)();
r.promise.then(function () {
return r.WebGetKeyCount()
}).then(function () {
return r.WebOpenKey(0)
}).then(function (e) {
return i = e, r.WebKeyIsNotAdmin(e)
}).then(function () {
return r.WebVerifyPin(i, e)
}).then(function () {
return r.WebGetKeySerialNumber(i)
}).then(function (e) {
return (0, c.verifyKeySn)(e)
}).then(function () {
return r.WebSetAlgoFlag()
}).then(function () {
var e = s.default.stringify(l.default.parse(a));
return r.WebSign(i, e)
}).then(function (e) {
return t(a, e)
}).catch(function (e) {
return e && n && n(e.message || e.defaultMsg || e), Promise.resolve()
}).then(function () {
if (null != i) return r.WebCloseKey(i)
})
}, t.pdfSM2RegionSign = function (e, t, n, r, i, a) {
var o = new d, s = void 0, l = void 0;
o.promise.then(function () {
return o.WebGetKeyCount()
}).then(function () {
return o.WebOpenKey(0)
}).then(function (e) {
return s = e, o.WebKeyIsNotAdmin(e)
}).then(function () {
return o.WebVerifyPin(s, e)
}).then(function () {
return 1 == window.KGPdfViewerWebApp.sealOrigin ? o.WebGetKeySerialNumber(s).then(function (e) {
return t !== e ? Promise.reject({message: "密钥盘已更换"}) : Promise.resolve()
}) : Promise.resolve()
}).then(function () {
return o.WebSetAlgoFlag()
}).then(function () {
return o.WebGetCertData(s)
}).then(function (e) {
l = e;
for (var t = [], r = 0; r < n.length; r++) t.push(o.WebSign(s, n[r].needSigMessage));
return Promise.all(t)
}).then(function (e) {
for (var t = [], i = 0; i < n.length; i++) {
n[i].sigedData = e[i];
var a = {cert: l, signedData: [n[i]]};
t.push(r(a))
}
return Promise.all(t)
}).catch(function (e) {
var t = e.message;
return a && a(t), Promise.resolve()
}).then(function () {
return null != s ? o.WebCloseKey(s) : Promise.resolve()
}).then(function () {
i && i()
})
}, t.getCertByScanStamp = function (e, t, n, r) {
var i = new d, a = void 0, o = {token: t};
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(a)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return o.cert = e, i.WebSign(a, t)
}).then(function (e) {
o.signData = e, n(o)
}).catch(function (e) {
var t = e.message;
return r(t), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}, t.WebKGVerify = function (e, t, n, r, i) {
var a = new d, o = void 0;
return a.promise.then(function () {
return a.WebGetKeyCount()
}).then(function () {
return a.WebOpenKey(0)
}).then(function (e) {
return o = e, a.WebKeyIsNotAdmin(e)
}).then(function () {
return a.WebVerifyPin(o, n)
}).then(function () {
return a.WebKGVerify(e, t, o)
}).then(function (e) {
r && r(e)
}).catch(function (e) {
var t = e.message;
return i && i(t), Promise.resolve()
}).then(function () {
if (null != o) return a.WebCloseKey(o)
})
}, t.getOfdSealsByTG = function (e, t, n, r) {
var i = new d, a = void 0, o = void 0, s = void 0, l = void 0;
i.promise.then(function () {
return i.WebGetKeyCount()
}).then(function () {
return i.WebOpenKey(0)
}).then(function (e) {
return a = e, i.WebKeyIsNotAdmin(e)
}).then(function () {
return i.WebVerifyPin(a, e)
}).then(function () {
return i.WebGetKeySerialNumber(a)
}).then(function (e) {
return o = e, (0, c.verifyKeySn)(e)
}).then(function () {
return i.WebGetKeyUnit(a)
}).then(function (e) {
return s = e, i.WebSetAlgoFlag()
}).then(function () {
return i.WebGetCertData(a)
}).then(function (e) {
return l = e, i.WebGetSealCount_TG(a)
}).then(function (e) {
for (var t = [], n = 0; n < e; n++) t.push(i.WebGetSealData(a, n));
return Promise.all(t)
}).then(function (e) {
if (!e || 0 === e.length) return i.WebGetLastErrorMsg("获取印章失败");
var n = {
action: "handleCilentSeal",
keySN: o,
unitName: s,
stampType: window.KGPdfViewerWebApp.stampType,
seals: e
};
return window.KGPdfViewerWebApp.cilentSeals = e, t && t(n)
}).then(function (e) {
var t = e.data;
n && n(t, l, o)
}).catch(function (e) {
return e && r && r({message: e.message, defaultMsg: e.defaultMsg, status: e.status}), Promise.resolve()
}).then(function () {
if (null != a) return i.WebCloseKey(a)
})
}
}, function (module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {value: !0});
var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, _timeout = 6e4;
window.kgAlert = function (e) {
window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e)
}, window.kgAlert || (window.kgAlert = function (e) {
window.alert(e)
});
var createCapability = function () {
var e = {};
return e.promise = new Promise(function (t, n) {
e.resolve = t, e.reject = n
}), e
};
function createCORSRequest(e, t, n) {
var r = new XMLHttpRequest;
return "withCredentials" in r ? r.open(e, t, !0) : "undefined" != typeof XDomainRequest && (r = new XDomainRequest).open(e, t), r
}
var defaultOptions = {
url: "", method: "post", data: "", async: !0, callback: function (e) {
}, error: function () {
}
}, xhr = {
init: function (e) {
e.method = e.method || defaultOptions.method, e.async = e.async || defaultOptions.async, e.callback = e.callback || defaultOptions.callback, e.data = e.data || defaultOptions.data
}, ajax: function (e) {
this.init(e);
var t = new XMLHttpRequest;
"withCredentials" in xhr ? t.open(e.method, e.url, e.async) : "undefined" != typeof XDomainRequest ? (t = new XDomainRequest).open(e.method, e.url, e.async) : t.open(e.method, e.url, e.async), t.onload = function (e) {
}, t.ontimeout = function (e) {
}, t.onerror = function (e) {
}, xhr.send(e.data)
}, post: function () {
}, get: function (e) {
this.init(e)
}
}, KG = function (e, t) {
this.url = "https:" === window.location.protocol ? "https://local.kinggrid.com:9582" : "http://127.0.0.1:9581", this.progid = e, this.inter = t, this.caller = 0, this.time = _timeout
};
KG.prototype = {
init: function init() {
var disableTips = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], self = this,
capability = createCapability(), val = JSON.stringify({
GetInterface: {progid: this.progid, interface: this.inter},
usercode: window.KGPdfViewerWebApp.clientCode
}), xhr = createCORSRequest("POST", this.url + "/GetInterface", this);
return xhr.timeout = _timeout, window.KGPdfViewerWebApp.hasClientServer = !1, xhr.onload = function (e) {
if (window.KGPdfViewerWebApp.hasClientServer = !0, null == this.status || 200 === this.status || 304 === this.status || disableTips) {
var obj = eval("(" + this.responseText + ")");
"0" === obj.value.toString() || "none" === obj.value && !disableTips ? window.kgAlert(self.progid + "控件初始化失败!") : (self.caller = obj.value, capability.resolve())
} else window.kgAlert("签章客户端服务异常status = " + this.status)
}, xhr.ontimeout = function () {
disableTips || (window.kgAlert("签章客户端服务请求超时!"), window.KGPdfViewerWebApp.getTipPrompt().close())
}, xhr.onerror = function () {
disableTips || (window.kgAlert("签章客户端未安装或未启动!"), window.KGPdfViewerWebApp.getTipPrompt().close())
}, xhr.send("value=" + val), capability.promise
}, invoke: function invoke(method) {
var capability = createCapability(), self = this, params = [];
if (arguments.length >= 2) for (var i = 1; i < arguments.length; i++) {
var typeVal = _typeof(arguments[i]), value = null != arguments[i] ? arguments[i].toString() : "null",
data = null;
data = "boolean" === typeVal ? {type: "BOOL", value: value} : "number" === typeVal ? {
type: "LONG",
value: value
} : {type: "BSTR", value: value}, params.push(data)
}
var val = JSON.stringify({
MethodCall: {caller: this.caller, function: method, params: params},
usercode: window.KGPdfViewerWebApp.clientCode
}), xhr = createCORSRequest("POST", this.url + "/MethodCall", this);
return xhr.timeout = self.time, xhr.onload = function (e) {
if (self.time = _timeout, void 0 == this.status || 200 == this.status || 304 == this.status) {
var obj = eval("(" + this.responseText + ")");
capability.resolve(obj.value)
} else window.kgAlert("签章客户端服务异常status = " + this.status)
}, xhr.ontimeout = function (e) {
self.time = _timeout, window.kgAlert("签章客户端服务请求超时!"), window.KGPdfViewerWebApp.getTipPrompt().close()
}, xhr.onerror = function (e) {
window.kgAlert("签章客户端未安装或未启动!"), window.KGPdfViewerWebApp.getTipPrompt().close()
}, xhr.send("value=" + val), capability.promise
}, get: function get(property) {
var capability = createCapability(), self = this, val = JSON.stringify({
PropertyCall: {caller: this.caller, property: property},
usercode: window.KGPdfViewerWebApp.clientCode
}), xhr = createCORSRequest("POST", this.url + "/PropCall", this);
return xhr.timeout = self.time, xhr.onload = function (e) {
if (void 0 == this.status || 200 == this.status || 304 == this.status) {
var obj = eval("(" + this.responseText + ")");
capability.resolve(obj.value)
} else window.kgAlert("签章客户端服务异常status = " + this.status)
}, xhr.ontimeout = function (e) {
window.kgAlert("签章客户端服务请求超时!")
}, xhr.onerror = function (e) {
window.kgAlert("签章客户端未安装或未启动!")
}, xhr.send("value=" + val), capability.promise
}, put: function put(property, value) {
var self = this, typeVal = void 0 === value ? "undefined" : _typeof(value),
_value = void 0 != value ? value.toString() : "null", data = null;
data = "boolean" === typeVal ? {type: "BOOL", value: _value} : "number" === typeVal ? {
type: "LONG",
value: _value
} : {type: "BSTR", value: _value};
var val = JSON.stringify({
PropertyCallPut: {caller: self.caller, property: property, params: [data]},
usercode: window.KGPdfViewerWebApp.clientCode
}), capability = createCapability(), xhr = createCORSRequest("POST", this.url + "/PropCall", this);
return xhr.timeout = self.time, xhr.onload = function (e) {
if (200 == this.status && 304 == this.status) {
var obj = eval("(" + this.responseText + ")");
capability.resolve(obj.value)
} else window.kgAlert("签章客户端服务异常status=" + this.status)
}, xhr.ontimeout = function (e) {
window.kgAlert("签章客户端服务请求超时!")
}, xhr.onerror = function (e) {
window.kgAlert("签章客户端未安装或未启动!")
}, xhr.send("value=" + val), capability.promise
}, setUrl: function (e) {
this.url = e
}
}, exports.createCapability = createCapability, exports.KG = KG
}, function (e, t, n) {
"use strict";
e.exports = function (e, t) {
return {enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t}
}
}, function (e, t, n) {
"use strict";
var r = 0, i = Math.random();
e.exports = function (e) {
return "Symbol(".concat(void 0 === e ? "" : e, ")_", (++r + i).toString(36))
}
}, function (e, t, n) {
"use strict";
var r = n(128), i = n(93);
e.exports = Object.keys || function (e) {
return r(e, i)
}
}, function (e, t, n) {
"use strict";
var r = n(28), i = Math.max, a = Math.min;
e.exports = function (e, t) {
return (e = r(e)) < 0 ? i(e + t, 0) : a(e, t)
}
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(129), a = n(93), o = n(92)("IE_PROTO"), s = function () {
}, l = function () {
var e, t = n(90)("iframe"), r = a.length;
for (t.style.display = "none", n(94).appendChild(t), t.src = "javascript:", (e = t.contentWindow.document).open(), e.write("<script>document.F=Object<\/script>"), e.close(), l = e.F; r--;) delete l.prototype[a[r]];
return l()
};
e.exports = Object.create || function (e, t) {
var n;
return null !== e ? (s.prototype = r(e), n = new s, s.prototype = null, n[o] = e) : n = l(), void 0 === t ? n : i(n, t)
}
}, function (e, t, n) {
"use strict";
var r = n(128), i = n(93).concat("length", "prototype");
t.f = Object.getOwnPropertyNames || function (e) {
return r(e, i)
}
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(10), a = n(8), o = n(6)("species");
e.exports = function (e) {
var t = r[e];
a && t && !t[o] && i.f(t, o, {
configurable: !0, get: function () {
return this
}
})
}
}, function (e, t, n) {
"use strict";
e.exports = function (e, t, n, r) {
if (!(e instanceof t) || void 0 !== r && r in e) throw TypeError(n + ": incorrect invocation!");
return e
}
}, function (e, t, n) {
"use strict";
var r = n(26), i = n(144), a = n(106), o = n(1), s = n(7), l = n(108), c = {}, u = {},
d = e.exports = function (e, t, n, d, h) {
var p, f, m, v, g = h ? function () {
return e
} : l(e), y = r(n, d, t ? 2 : 1), b = 0;
if ("function" != typeof g) throw TypeError(e + " is not iterable!");
if (a(g)) {
for (p = s(e.length); p > b; b++) if ((v = t ? y(o(f = e[b])[0], f[1]) : y(e[b])) === c || v === u) return v
} else for (m = g.call(e); !(f = m.next()).done;) if ((v = i(m, y, f.value, t)) === c || v === u) return v
};
d.BREAK = c, d.RETURN = u
}, function (e, t, n) {
"use strict";
var r = n(19);
e.exports = function (e, t, n) {
for (var i in t) r(e, i, t[i], n);
return e
}
}, function (e, t, n) {
"use strict";
var r = n(5);
e.exports = function (e, t) {
if (!r(e) || e._t !== t) throw TypeError("Incompatible receiver, " + t + " required!");
return e
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.cryptAPISig = t.cryptAPICtrl = t.iWebAssistError = t.iWebAssist = t.createCapability = void 0;
var r = n(43), i = n(123), a = n(384);
t.createCapability = r.createCapability, t.iWebAssist = i.iWebAssist, t.iWebAssistError = i.iWebAssistError, t.cryptAPICtrl = a.cryptAPICtrl, t.cryptAPISig = a.cryptAPISig
}, function (e, t, n) {
"use strict";
(function (e) {
var r, i, a, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
a = function () {
var t, r;
function i() {
return t.apply(null, arguments)
}
function a(e) {
return e instanceof Array || "[object Array]" === Object.prototype.toString.call(e)
}
function s(e) {
return null != e && "[object Object]" === Object.prototype.toString.call(e)
}
function l(e) {
return void 0 === e
}
function c(e) {
return "number" == typeof e || "[object Number]" === Object.prototype.toString.call(e)
}
function u(e) {
return e instanceof Date || "[object Date]" === Object.prototype.toString.call(e)
}
function d(e, t) {
var n, r = [];
for (n = 0; n < e.length; ++n) r.push(t(e[n], n));
return r
}
function h(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}
function p(e, t) {
for (var n in t) h(t, n) && (e[n] = t[n]);
return h(t, "toString") && (e.toString = t.toString), h(t, "valueOf") && (e.valueOf = t.valueOf), e
}
function f(e, t, n, r) {
return It(e, t, n, r, !0).utc()
}
function m(e) {
return null == e._pf && (e._pf = {
empty: !1,
unusedTokens: [],
unusedInput: [],
overflow: -2,
charsLeftOver: 0,
nullInput: !1,
invalidMonth: null,
invalidFormat: !1,
userInvalidated: !1,
iso: !1,
parsedDateParts: [],
meridiem: null,
rfc2822: !1,
weekdayMismatch: !1
}), e._pf
}
function v(e) {
if (null == e._isValid) {
var t = m(e), n = r.call(t.parsedDateParts, function (e) {
return null != e
}),
i = !isNaN(e._d.getTime()) && t.overflow < 0 && !t.empty && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n);
if (e._strict && (i = i && 0 === t.charsLeftOver && 0 === t.unusedTokens.length && void 0 === t.bigHour), null != Object.isFrozen && Object.isFrozen(e)) return i;
e._isValid = i
}
return e._isValid
}
function g(e) {
var t = f(NaN);
return null != e ? p(m(t), e) : m(t).userInvalidated = !0, t
}
r = Array.prototype.some ? Array.prototype.some : function (e) {
for (var t = Object(this), n = t.length >>> 0, r = 0; r < n; r++) if (r in t && e.call(this, t[r], r, t)) return !0;
return !1
};
var y = i.momentProperties = [];
function b(e, t) {
var n, r, i;
if (l(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), l(t._i) || (e._i = t._i), l(t._f) || (e._f = t._f), l(t._l) || (e._l = t._l), l(t._strict) || (e._strict = t._strict), l(t._tzm) || (e._tzm = t._tzm), l(t._isUTC) || (e._isUTC = t._isUTC), l(t._offset) || (e._offset = t._offset), l(t._pf) || (e._pf = m(t)), l(t._locale) || (e._locale = t._locale), y.length > 0) for (n = 0; n < y.length; n++) l(i = t[r = y[n]]) || (e[r] = i);
return e
}
var w = !1;
function S(e) {
b(this, e), this._d = new Date(null != e._d ? e._d.getTime() : NaN), this.isValid() || (this._d = new Date(NaN)), !1 === w && (w = !0, i.updateOffset(this), w = !1)
}
function _(e) {
return e instanceof S || null != e && null != e._isAMomentObject
}
function k(e) {
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e)
}
function x(e) {
var t = +e, n = 0;
return 0 !== t && isFinite(t) && (n = k(t)), n
}
function P(e, t, n) {
var r, i = Math.min(e.length, t.length), a = Math.abs(e.length - t.length), o = 0;
for (r = 0; r < i; r++) (n && e[r] !== t[r] || !n && x(e[r]) !== x(t[r])) && o++;
return o + a
}
function C(e) {
!1 === i.suppressDeprecationWarnings && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + e)
}
function A(e, t) {
var n = !0;
return p(function () {
if (null != i.deprecationHandler && i.deprecationHandler(null, e), n) {
for (var r, a = [], s = 0; s < arguments.length; s++) {
if (r = "", "object" === o(arguments[s])) {
for (var l in r += "\n[" + s + "] ", arguments[0]) r += l + ": " + arguments[0][l] + ", ";
r = r.slice(0, -2)
} else r = arguments[s];
a.push(r)
}
C(e + "\nArguments: " + Array.prototype.slice.call(a).join("") + "\n" + (new Error).stack), n = !1
}
return t.apply(this, arguments)
}, t)
}
var T, E = {};
function D(e, t) {
null != i.deprecationHandler && i.deprecationHandler(e, t), E[e] || (C(t), E[e] = !0)
}
function I(e) {
return e instanceof Function || "[object Function]" === Object.prototype.toString.call(e)
}
function L(e, t) {
var n, r = p({}, e);
for (n in t) h(t, n) && (s(e[n]) && s(t[n]) ? (r[n] = {}, p(r[n], e[n]), p(r[n], t[n])) : null != t[n] ? r[n] = t[n] : delete r[n]);
for (n in e) h(e, n) && !h(t, n) && s(e[n]) && (r[n] = p({}, r[n]));
return r
}
function O(e) {
null != e && this.set(e)
}
i.suppressDeprecationWarnings = !1, i.deprecationHandler = null, T = Object.keys ? Object.keys : function (e) {
var t, n = [];
for (t in e) h(e, t) && n.push(t);
return n
};
var M = {};
function N(e, t) {
var n = e.toLowerCase();
M[n] = M[n + "s"] = M[t] = e
}
function R(e) {
return "string" == typeof e ? M[e] || M[e.toLowerCase()] : void 0
}
function W(e) {
var t, n, r = {};
for (n in e) h(e, n) && (t = R(n)) && (r[t] = e[n]);
return r
}
var V = {};
function F(e, t) {
V[e] = t
}
function G(e, t, n) {
var r = "" + Math.abs(e), i = t - r.length;
return (e >= 0 ? n ? "+" : "" : "-") + Math.pow(10, Math.max(0, i)).toString().substr(1) + r
}
var B = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
K = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, j = {}, z = {};
function U(e, t, n, r) {
var i = r;
"string" == typeof r && (i = function () {
return this[r]()
}), e && (z[e] = i), t && (z[t[0]] = function () {
return G(i.apply(this, arguments), t[1], t[2])
}), n && (z[n] = function () {
return this.localeData().ordinal(i.apply(this, arguments), e)
})
}
function q(e, t) {
return e.isValid() ? (t = H(t, e.localeData()), j[t] = j[t] || function (e) {
var t, n, r, i = e.match(B);
for (t = 0, n = i.length; t < n; t++) z[i[t]] ? i[t] = z[i[t]] : i[t] = (r = i[t]).match(/\[[\s\S]/) ? r.replace(/^\[|\]$/g, "") : r.replace(/\\/g, "");
return function (t) {
var r, a = "";
for (r = 0; r < n; r++) a += I(i[r]) ? i[r].call(t, e) : i[r];
return a
}
}(t), j[t](e)) : e.localeData().invalidDate()
}
function H(e, t) {
var n = 5;
function r(e) {
return t.longDateFormat(e) || e
}
for (K.lastIndex = 0; n >= 0 && K.test(e);) e = e.replace(K, r), K.lastIndex = 0, n -= 1;
return e
}
var Y = /\d/, X = /\d\d/, J = /\d{3}/, Q = /\d{4}/, $ = /[+-]?\d{6}/, Z = /\d\d?/, ee = /\d\d\d\d?/,
te = /\d\d\d\d\d\d?/, ne = /\d{1,3}/, re = /\d{1,4}/, ie = /[+-]?\d{1,6}/, ae = /\d+/, oe = /[+-]?\d+/,
se = /Z|[+-]\d\d:?\d\d/gi, le = /Z|[+-]\d\d(?::?\d\d)?/gi,
ce = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
ue = {};
function de(e, t, n) {
ue[e] = I(t) ? t : function (e, r) {
return e && n ? n : t
}
}
function he(e, t) {
return h(ue, e) ? ue[e](t._strict, t._locale) : new RegExp(pe(e.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (e, t, n, r, i) {
return t || n || r || i
})))
}
function pe(e) {
return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
}
var fe = {};
function me(e, t) {
var n, r = t;
for ("string" == typeof e && (e = [e]), c(t) && (r = function (e, n) {
n[t] = x(e)
}), n = 0; n < e.length; n++) fe[e[n]] = r
}
function ve(e, t) {
me(e, function (e, n, r, i) {
r._w = r._w || {}, t(e, r._w, r, i)
})
}
function ge(e, t, n) {
null != t && h(fe, e) && fe[e](t, n._a, n, e)
}
var ye = 0, be = 1, we = 2, Se = 3, _e = 4, ke = 5, xe = 6, Pe = 7, Ce = 8;
function Ae(e) {
return Te(e) ? 366 : 365
}
function Te(e) {
return e % 4 == 0 && e % 100 != 0 || e % 400 == 0
}
U("Y", 0, 0, function () {
var e = this.year();
return e <= 9999 ? "" + e : "+" + e
}), U(0, ["YY", 2], 0, function () {
return this.year() % 100
}), U(0, ["YYYY", 4], 0, "year"), U(0, ["YYYYY", 5], 0, "year"), U(0, ["YYYYYY", 6, !0], 0, "year"), N("year", "y"), F("year", 1), de("Y", oe), de("YY", Z, X), de("YYYY", re, Q), de("YYYYY", ie, $), de("YYYYYY", ie, $), me(["YYYYY", "YYYYYY"], ye), me("YYYY", function (e, t) {
t[ye] = 2 === e.length ? i.parseTwoDigitYear(e) : x(e)
}), me("YY", function (e, t) {
t[ye] = i.parseTwoDigitYear(e)
}), me("Y", function (e, t) {
t[ye] = parseInt(e, 10)
}), i.parseTwoDigitYear = function (e) {
return x(e) + (x(e) > 68 ? 1900 : 2e3)
};
var Ee, De = Ie("FullYear", !0);
function Ie(e, t) {
return function (n) {
return null != n ? (Oe(this, e, n), i.updateOffset(this, t), this) : Le(this, e)
}
}
function Le(e, t) {
return e.isValid() ? e._d["get" + (e._isUTC ? "UTC" : "") + t]() : NaN
}
function Oe(e, t, n) {
e.isValid() && !isNaN(n) && ("FullYear" === t && Te(e.year()) && 1 === e.month() && 29 === e.date() ? e._d["set" + (e._isUTC ? "UTC" : "") + t](n, e.month(), Me(n, e.month())) : e._d["set" + (e._isUTC ? "UTC" : "") + t](n))
}
function Me(e, t) {
if (isNaN(e) || isNaN(t)) return NaN;
var n, r = (t % (n = 12) + n) % n;
return e += (t - r) / 12, 1 === r ? Te(e) ? 29 : 28 : 31 - r % 7 % 2
}
Ee = Array.prototype.indexOf ? Array.prototype.indexOf : function (e) {
var t;
for (t = 0; t < this.length; ++t) if (this[t] === e) return t;
return -1
}, U("M", ["MM", 2], "Mo", function () {
return this.month() + 1
}), U("MMM", 0, 0, function (e) {
return this.localeData().monthsShort(this, e)
}), U("MMMM", 0, 0, function (e) {
return this.localeData().months(this, e)
}), N("month", "M"), F("month", 8), de("M", Z), de("MM", Z, X), de("MMM", function (e, t) {
return t.monthsShortRegex(e)
}), de("MMMM", function (e, t) {
return t.monthsRegex(e)
}), me(["M", "MM"], function (e, t) {
t[be] = x(e) - 1
}), me(["MMM", "MMMM"], function (e, t, n, r) {
var i = n._locale.monthsParse(e, r, n._strict);
null != i ? t[be] = i : m(n).invalidMonth = e
});
var Ne = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
Re = "January_February_March_April_May_June_July_August_September_October_November_December".split("_");
var We = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");
function Ve(e, t) {
var n;
if (!e.isValid()) return e;
if ("string" == typeof t) if (/^\d+$/.test(t)) t = x(t); else if (!c(t = e.localeData().monthsParse(t))) return e;
return n = Math.min(e.date(), Me(e.year(), t)), e._d["set" + (e._isUTC ? "UTC" : "") + "Month"](t, n), e
}
function Fe(e) {
return null != e ? (Ve(this, e), i.updateOffset(this, !0), this) : Le(this, "Month")
}
var Ge = ce;
var Be = ce;
function Ke() {
function e(e, t) {
return t.length - e.length
}
var t, n, r = [], i = [], a = [];
for (t = 0; t < 12; t++) n = f([2e3, t]), r.push(this.monthsShort(n, "")), i.push(this.months(n, "")), a.push(this.months(n, "")), a.push(this.monthsShort(n, ""));
for (r.sort(e), i.sort(e), a.sort(e), t = 0; t < 12; t++) r[t] = pe(r[t]), i[t] = pe(i[t]);
for (t = 0; t < 24; t++) a[t] = pe(a[t]);
this._monthsRegex = new RegExp("^(" + a.join("|") + ")", "i"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = new RegExp("^(" + i.join("|") + ")", "i"), this._monthsShortStrictRegex = new RegExp("^(" + r.join("|") + ")", "i")
}
function je(e) {
var t;
if (e < 100 && e >= 0) {
var n = Array.prototype.slice.call(arguments);
n[0] = e + 400, t = new Date(Date.UTC.apply(null, n)), isFinite(t.getUTCFullYear()) && t.setUTCFullYear(e)
} else t = new Date(Date.UTC.apply(null, arguments));
return t
}
function ze(e, t, n) {
var r = 7 + t - n;
return -((7 + je(e, 0, r).getUTCDay() - t) % 7) + r - 1
}
function Ue(e, t, n, r, i) {
var a, o, s = 1 + 7 * (t - 1) + (7 + n - r) % 7 + ze(e, r, i);
return s <= 0 ? o = Ae(a = e - 1) + s : s > Ae(e) ? (a = e + 1, o = s - Ae(e)) : (a = e, o = s), {
year: a,
dayOfYear: o
}
}
function qe(e, t, n) {
var r, i, a = ze(e.year(), t, n), o = Math.floor((e.dayOfYear() - a - 1) / 7) + 1;
return o < 1 ? r = o + He(i = e.year() - 1, t, n) : o > He(e.year(), t, n) ? (r = o - He(e.year(), t, n), i = e.year() + 1) : (i = e.year(), r = o), {
week: r,
year: i
}
}
function He(e, t, n) {
var r = ze(e, t, n), i = ze(e + 1, t, n);
return (Ae(e) - r + i) / 7
}
U("w", ["ww", 2], "wo", "week"), U("W", ["WW", 2], "Wo", "isoWeek"), N("week", "w"), N("isoWeek", "W"), F("week", 5), F("isoWeek", 5), de("w", Z), de("ww", Z, X), de("W", Z), de("WW", Z, X), ve(["w", "ww", "W", "WW"], function (e, t, n, r) {
t[r.substr(0, 1)] = x(e)
});
function Ye(e, t) {
return e.slice(t, 7).concat(e.slice(0, t))
}
U("d", 0, "do", "day"), U("dd", 0, 0, function (e) {
return this.localeData().weekdaysMin(this, e)
}), U("ddd", 0, 0, function (e) {
return this.localeData().weekdaysShort(this, e)
}), U("dddd", 0, 0, function (e) {
return this.localeData().weekdays(this, e)
}), U("e", 0, 0, "weekday"), U("E", 0, 0, "isoWeekday"), N("day", "d"), N("weekday", "e"), N("isoWeekday", "E"), F("day", 11), F("weekday", 11), F("isoWeekday", 11), de("d", Z), de("e", Z), de("E", Z), de("dd", function (e, t) {
return t.weekdaysMinRegex(e)
}), de("ddd", function (e, t) {
return t.weekdaysShortRegex(e)
}), de("dddd", function (e, t) {
return t.weekdaysRegex(e)
}), ve(["dd", "ddd", "dddd"], function (e, t, n, r) {
var i = n._locale.weekdaysParse(e, r, n._strict);
null != i ? t.d = i : m(n).invalidWeekday = e
}), ve(["d", "e", "E"], function (e, t, n, r) {
t[r] = x(e)
});
var Xe = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");
var Je = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");
var Qe = "Su_Mo_Tu_We_Th_Fr_Sa".split("_");
var $e = ce;
var Ze = ce;
var et = ce;
function tt() {
function e(e, t) {
return t.length - e.length
}
var t, n, r, i, a, o = [], s = [], l = [], c = [];
for (t = 0; t < 7; t++) n = f([2e3, 1]).day(t), r = this.weekdaysMin(n, ""), i = this.weekdaysShort(n, ""), a = this.weekdays(n, ""), o.push(r), s.push(i), l.push(a), c.push(r), c.push(i), c.push(a);
for (o.sort(e), s.sort(e), l.sort(e), c.sort(e), t = 0; t < 7; t++) s[t] = pe(s[t]), l[t] = pe(l[t]), c[t] = pe(c[t]);
this._weekdaysRegex = new RegExp("^(" + c.join("|") + ")", "i"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = new RegExp("^(" + l.join("|") + ")", "i"), this._weekdaysShortStrictRegex = new RegExp("^(" + s.join("|") + ")", "i"), this._weekdaysMinStrictRegex = new RegExp("^(" + o.join("|") + ")", "i")
}
function nt() {
return this.hours() % 12 || 12
}
function rt(e, t) {
U(e, 0, 0, function () {
return this.localeData().meridiem(this.hours(), this.minutes(), t)
})
}
function it(e, t) {
return t._meridiemParse
}
U("H", ["HH", 2], 0, "hour"), U("h", ["hh", 2], 0, nt), U("k", ["kk", 2], 0, function () {
return this.hours() || 24
}), U("hmm", 0, 0, function () {
return "" + nt.apply(this) + G(this.minutes(), 2)
}), U("hmmss", 0, 0, function () {
return "" + nt.apply(this) + G(this.minutes(), 2) + G(this.seconds(), 2)
}), U("Hmm", 0, 0, function () {
return "" + this.hours() + G(this.minutes(), 2)
}), U("Hmmss", 0, 0, function () {
return "" + this.hours() + G(this.minutes(), 2) + G(this.seconds(), 2)
}), rt("a", !0), rt("A", !1), N("hour", "h"), F("hour", 13), de("a", it), de("A", it), de("H", Z), de("h", Z), de("k", Z), de("HH", Z, X), de("hh", Z, X), de("kk", Z, X), de("hmm", ee), de("hmmss", te), de("Hmm", ee), de("Hmmss", te), me(["H", "HH"], Se), me(["k", "kk"], function (e, t, n) {
var r = x(e);
t[Se] = 24 === r ? 0 : r
}), me(["a", "A"], function (e, t, n) {
n._isPm = n._locale.isPM(e), n._meridiem = e
}), me(["h", "hh"], function (e, t, n) {
t[Se] = x(e), m(n).bigHour = !0
}), me("hmm", function (e, t, n) {
var r = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r)), m(n).bigHour = !0
}), me("hmmss", function (e, t, n) {
var r = e.length - 4, i = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r, 2)), t[ke] = x(e.substr(i)), m(n).bigHour = !0
}), me("Hmm", function (e, t, n) {
var r = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r))
}), me("Hmmss", function (e, t, n) {
var r = e.length - 4, i = e.length - 2;
t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r, 2)), t[ke] = x(e.substr(i))
});
var at, ot = Ie("Hours", !0), st = {
calendar: {
sameDay: "[Today at] LT",
nextDay: "[Tomorrow at] LT",
nextWeek: "dddd [at] LT",
lastDay: "[Yesterday at] LT",
lastWeek: "[Last] dddd [at] LT",
sameElse: "L"
},
longDateFormat: {
LTS: "h:mm:ss A",
LT: "h:mm A",
L: "MM/DD/YYYY",
LL: "MMMM D, YYYY",
LLL: "MMMM D, YYYY h:mm A",
LLLL: "dddd, MMMM D, YYYY h:mm A"
},
invalidDate: "Invalid date",
ordinal: "%d",
dayOfMonthOrdinalParse: /\d{1,2}/,
relativeTime: {
future: "in %s",
past: "%s ago",
s: "a few seconds",
ss: "%d seconds",
m: "a minute",
mm: "%d minutes",
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years"
},
months: Re,
monthsShort: We,
week: {dow: 0, doy: 6},
weekdays: Xe,
weekdaysMin: Qe,
weekdaysShort: Je,
meridiemParse: /[ap]\.?m?\.?/i
}, lt = {}, ct = {};
function ut(e) {
return e ? e.toLowerCase().replace("_", "-") : e
}
function dt(t) {
var r = null;
if (!lt[t] && void 0 !== e && e && e.exports) try {
r = at._abbr;
n(397), ht(r)
} catch (e) {
}
return lt[t]
}
function ht(e, t) {
var n;
return e && ((n = l(t) ? ft(e) : pt(e, t)) ? at = n : "undefined" != typeof console && console.warn && console.warn("Locale " + e + " not found. Did you forget to load it?")), at._abbr
}
function pt(e, t) {
if (null !== t) {
var n, r = st;
if (t.abbr = e, null != lt[e]) D("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."), r = lt[e]._config; else if (null != t.parentLocale) if (null != lt[t.parentLocale]) r = lt[t.parentLocale]._config; else {
if (null == (n = dt(t.parentLocale))) return ct[t.parentLocale] || (ct[t.parentLocale] = []), ct[t.parentLocale].push({
name: e,
config: t
}), null;
r = n._config
}
return lt[e] = new O(L(r, t)), ct[e] && ct[e].forEach(function (e) {
pt(e.name, e.config)
}), ht(e), lt[e]
}
return delete lt[e], null
}
function ft(e) {
var t;
if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return at;
if (!a(e)) {
if (t = dt(e)) return t;
e = [e]
}
return function (e) {
for (var t, n, r, i, a = 0; a < e.length;) {
for (t = (i = ut(e[a]).split("-")).length, n = (n = ut(e[a + 1])) ? n.split("-") : null; t > 0;) {
if (r = dt(i.slice(0, t).join("-"))) return r;
if (n && n.length >= t && P(i, n, !0) >= t - 1) break;
t--
}
a++
}
return at
}(e)
}
function mt(e) {
var t, n = e._a;
return n && -2 === m(e).overflow && (t = n[be] < 0 || n[be] > 11 ? be : n[we] < 1 || n[we] > Me(n[ye], n[be]) ? we : n[Se] < 0 || n[Se] > 24 || 24 === n[Se] && (0 !== n[_e] || 0 !== n[ke] || 0 !== n[xe]) ? Se : n[_e] < 0 || n[_e] > 59 ? _e : n[ke] < 0 || n[ke] > 59 ? ke : n[xe] < 0 || n[xe] > 999 ? xe : -1, m(e)._overflowDayOfYear && (t < ye || t > we) && (t = we), m(e)._overflowWeeks && -1 === t && (t = Pe), m(e)._overflowWeekday && -1 === t && (t = Ce), m(e).overflow = t), e
}
function vt(e, t, n) {
return null != e ? e : null != t ? t : n
}
function gt(e) {
var t, n, r, a, o, s = [];
if (!e._d) {
for (r = function (e) {
var t = new Date(i.now());
return e._useUTC ? [t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()] : [t.getFullYear(), t.getMonth(), t.getDate()]
}(e), e._w && null == e._a[we] && null == e._a[be] && function (e) {
var t, n, r, i, a, o, s, l;
if (null != (t = e._w).GG || null != t.W || null != t.E) a = 1, o = 4, n = vt(t.GG, e._a[ye], qe(Lt(), 1, 4).year), r = vt(t.W, 1), ((i = vt(t.E, 1)) < 1 || i > 7) && (l = !0); else {
a = e._locale._week.dow, o = e._locale._week.doy;
var c = qe(Lt(), a, o);
n = vt(t.gg, e._a[ye], c.year), r = vt(t.w, c.week), null != t.d ? ((i = t.d) < 0 || i > 6) && (l = !0) : null != t.e ? (i = t.e + a, (t.e < 0 || t.e > 6) && (l = !0)) : i = a
}
r < 1 || r > He(n, a, o) ? m(e)._overflowWeeks = !0 : null != l ? m(e)._overflowWeekday = !0 : (s = Ue(n, r, i, a, o), e._a[ye] = s.year, e._dayOfYear = s.dayOfYear)
}(e), null != e._dayOfYear && (o = vt(e._a[ye], r[ye]), (e._dayOfYear > Ae(o) || 0 === e._dayOfYear) && (m(e)._overflowDayOfYear = !0), n = je(o, 0, e._dayOfYear), e._a[be] = n.getUTCMonth(), e._a[we] = n.getUTCDate()), t = 0; t < 3 && null == e._a[t]; ++t) e._a[t] = s[t] = r[t];
for (; t < 7; t++) e._a[t] = s[t] = null == e._a[t] ? 2 === t ? 1 : 0 : e._a[t];
24 === e._a[Se] && 0 === e._a[_e] && 0 === e._a[ke] && 0 === e._a[xe] && (e._nextDay = !0, e._a[Se] = 0), e._d = (e._useUTC ? je : function (e, t, n, r, i, a, o) {
var s;
return e < 100 && e >= 0 ? (s = new Date(e + 400, t, n, r, i, a, o), isFinite(s.getFullYear()) && s.setFullYear(e)) : s = new Date(e, t, n, r, i, a, o), s
}).apply(null, s), a = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), null != e._tzm && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[Se] = 24), e._w && void 0 !== e._w.d && e._w.d !== a && (m(e).weekdayMismatch = !0)
}
}
var yt = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
bt = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
wt = /Z|[+-]\d\d(?::?\d\d)?/,
St = [["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/], ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/], ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/], ["GGGG-[W]WW", /\d{4}-W\d\d/, !1], ["YYYY-DDD", /\d{4}-\d{3}/], ["YYYY-MM", /\d{4}-\d\d/, !1], ["YYYYYYMMDD", /[+-]\d{10}/], ["YYYYMMDD", /\d{8}/], ["GGGG[W]WWE", /\d{4}W\d{3}/], ["GGGG[W]WW", /\d{4}W\d{2}/, !1], ["YYYYDDD", /\d{7}/]],
_t = [["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/], ["HH:mm:ss", /\d\d:\d\d:\d\d/], ["HH:mm", /\d\d:\d\d/], ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/], ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/], ["HHmmss", /\d\d\d\d\d\d/], ["HHmm", /\d\d\d\d/], ["HH", /\d\d/]],
kt = /^\/?Date\((\-?\d+)/i;
function xt(e) {
var t, n, r, i, a, o, s = e._i, l = yt.exec(s) || bt.exec(s);
if (l) {
for (m(e).iso = !0, t = 0, n = St.length; t < n; t++) if (St[t][1].exec(l[1])) {
i = St[t][0], r = !1 !== St[t][2];
break
}
if (null == i) return void (e._isValid = !1);
if (l[3]) {
for (t = 0, n = _t.length; t < n; t++) if (_t[t][1].exec(l[3])) {
a = (l[2] || " ") + _t[t][0];
break
}
if (null == a) return void (e._isValid = !1)
}
if (!r && null != a) return void (e._isValid = !1);
if (l[4]) {
if (!wt.exec(l[4])) return void (e._isValid = !1);
o = "Z"
}
e._f = i + (a || "") + (o || ""), Et(e)
} else e._isValid = !1
}
var Pt = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
function Ct(e, t, n, r, i, a) {
var o = [function (e) {
var t = parseInt(e, 10);
if (t <= 49) return 2e3 + t;
if (t <= 999) return 1900 + t;
return t
}(e), We.indexOf(t), parseInt(n, 10), parseInt(r, 10), parseInt(i, 10)];
return a && o.push(parseInt(a, 10)), o
}
var At = {UT: 0, GMT: 0, EDT: -240, EST: -300, CDT: -300, CST: -360, MDT: -360, MST: -420, PDT: -420, PST: -480};
function Tt(e) {
var t = Pt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, ""));
if (t) {
var n = Ct(t[4], t[3], t[2], t[5], t[6], t[7]);
if (!function (e, t, n) {
return !e || Je.indexOf(e) === new Date(t[0], t[1], t[2]).getDay() || (m(n).weekdayMismatch = !0, n._isValid = !1, !1)
}(t[1], n, e)) return;
e._a = n, e._tzm = function (e, t, n) {
if (e) return At[e];
if (t) return 0;
var r = parseInt(n, 10), i = r % 100;
return (r - i) / 100 * 60 + i
}(t[8], t[9], t[10]), e._d = je.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), m(e).rfc2822 = !0
} else e._isValid = !1
}
function Et(e) {
if (e._f !== i.ISO_8601) if (e._f !== i.RFC_2822) {
e._a = [], m(e).empty = !0;
var t, n, r, a, o, s = "" + e._i, l = s.length, c = 0;
for (r = H(e._f, e._locale).match(B) || [], t = 0; t < r.length; t++) a = r[t], (n = (s.match(he(a, e)) || [])[0]) && ((o = s.substr(0, s.indexOf(n))).length > 0 && m(e).unusedInput.push(o), s = s.slice(s.indexOf(n) + n.length), c += n.length), z[a] ? (n ? m(e).empty = !1 : m(e).unusedTokens.push(a), ge(a, n, e)) : e._strict && !n && m(e).unusedTokens.push(a);
m(e).charsLeftOver = l - c, s.length > 0 && m(e).unusedInput.push(s), e._a[Se] <= 12 && !0 === m(e).bigHour && e._a[Se] > 0 && (m(e).bigHour = void 0), m(e).parsedDateParts = e._a.slice(0), m(e).meridiem = e._meridiem, e._a[Se] = function (e, t, n) {
var r;
if (null == n) return t;
return null != e.meridiemHour ? e.meridiemHour(t, n) : null != e.isPM ? ((r = e.isPM(n)) && t < 12 && (t += 12), r || 12 !== t || (t = 0), t) : t
}(e._locale, e._a[Se], e._meridiem), gt(e), mt(e)
} else Tt(e); else xt(e)
}
function Dt(e) {
var t = e._i, n = e._f;
return e._locale = e._locale || ft(e._l), null === t || void 0 === n && "" === t ? g({nullInput: !0}) : ("string" == typeof t && (e._i = t = e._locale.preparse(t)), _(t) ? new S(mt(t)) : (u(t) ? e._d = t : a(n) ? function (e) {
var t, n, r, i, a;
if (0 === e._f.length) return m(e).invalidFormat = !0, void (e._d = new Date(NaN));
for (i = 0; i < e._f.length; i++) a = 0, t = b({}, e), null != e._useUTC && (t._useUTC = e._useUTC), t._f = e._f[i], Et(t), v(t) && (a += m(t).charsLeftOver, a += 10 * m(t).unusedTokens.length, m(t).score = a, (null == r || a < r) && (r = a, n = t));
p(e, n || t)
}(e) : n ? Et(e) : function (e) {
var t = e._i;
l(t) ? e._d = new Date(i.now()) : u(t) ? e._d = new Date(t.valueOf()) : "string" == typeof t ? function (e) {
var t = kt.exec(e._i);
null === t ? (xt(e), !1 === e._isValid && (delete e._isValid, Tt(e), !1 === e._isValid && (delete e._isValid, i.createFromInputFallback(e)))) : e._d = new Date(+t[1])
}(e) : a(t) ? (e._a = d(t.slice(0), function (e) {
return parseInt(e, 10)
}), gt(e)) : s(t) ? function (e) {
if (!e._d) {
var t = W(e._i);
e._a = d([t.year, t.month, t.day || t.date, t.hour, t.minute, t.second, t.millisecond], function (e) {
return e && parseInt(e, 10)
}), gt(e)
}
}(e) : c(t) ? e._d = new Date(t) : i.createFromInputFallback(e)
}(e), v(e) || (e._d = null), e))
}
function It(e, t, n, r, i) {
var o, l = {};
return !0 !== n && !1 !== n || (r = n, n = void 0), (s(e) && function (e) {
if (Object.getOwnPropertyNames) return 0 === Object.getOwnPropertyNames(e).length;
var t;
for (t in e) if (e.hasOwnProperty(t)) return !1;
return !0
}(e) || a(e) && 0 === e.length) && (e = void 0), l._isAMomentObject = !0, l._useUTC = l._isUTC = i, l._l = n, l._i = e, l._f = t, l._strict = r, (o = new S(mt(Dt(l))))._nextDay && (o.add(1, "d"), o._nextDay = void 0), o
}
function Lt(e, t, n, r) {
return It(e, t, n, r, !1)
}
i.createFromInputFallback = A("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function (e) {
e._d = new Date(e._i + (e._useUTC ? " UTC" : ""))
}), i.ISO_8601 = function () {
}, i.RFC_2822 = function () {
};
var Ot = A("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function () {
var e = Lt.apply(null, arguments);
return this.isValid() && e.isValid() ? e < this ? this : e : g()
}),
Mt = A("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function () {
var e = Lt.apply(null, arguments);
return this.isValid() && e.isValid() ? e > this ? this : e : g()
});
function Nt(e, t) {
var n, r;
if (1 === t.length && a(t[0]) && (t = t[0]), !t.length) return Lt();
for (n = t[0], r = 1; r < t.length; ++r) t[r].isValid() && !t[r][e](n) || (n = t[r]);
return n
}
var Rt = ["year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond"];
function Wt(e) {
var t = W(e), n = t.year || 0, r = t.quarter || 0, i = t.month || 0, a = t.week || t.isoWeek || 0,
o = t.day || 0, s = t.hour || 0, l = t.minute || 0, c = t.second || 0, u = t.millisecond || 0;
this._isValid = function (e) {
for (var t in e) if (-1 === Ee.call(Rt, t) || null != e[t] && isNaN(e[t])) return !1;
for (var n = !1, r = 0; r < Rt.length; ++r) if (e[Rt[r]]) {
if (n) return !1;
parseFloat(e[Rt[r]]) !== x(e[Rt[r]]) && (n = !0)
}
return !0
}(t), this._milliseconds = +u + 1e3 * c + 6e4 * l + 1e3 * s * 60 * 60, this._days = +o + 7 * a, this._months = +i + 3 * r + 12 * n, this._data = {}, this._locale = ft(), this._bubble()
}
function Vt(e) {
return e instanceof Wt
}
function Ft(e) {
return e < 0 ? -1 * Math.round(-1 * e) : Math.round(e)
}
function Gt(e, t) {
U(e, 0, 0, function () {
var e = this.utcOffset(), n = "+";
return e < 0 && (e = -e, n = "-"), n + G(~~(e / 60), 2) + t + G(~~e % 60, 2)
})
}
Gt("Z", ":"), Gt("ZZ", ""), de("Z", le), de("ZZ", le), me(["Z", "ZZ"], function (e, t, n) {
n._useUTC = !0, n._tzm = Kt(le, e)
});
var Bt = /([\+\-]|\d\d)/gi;
function Kt(e, t) {
var n = (t || "").match(e);
if (null === n) return null;
var r = ((n[n.length - 1] || []) + "").match(Bt) || ["-", 0, 0], i = 60 * r[1] + x(r[2]);
return 0 === i ? 0 : "+" === r[0] ? i : -i
}
function jt(e, t) {
var n, r;
return t._isUTC ? (n = t.clone(), r = (_(e) || u(e) ? e.valueOf() : Lt(e).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + r), i.updateOffset(n, !1), n) : Lt(e).local()
}
function zt(e) {
return 15 * -Math.round(e._d.getTimezoneOffset() / 15)
}
function Ut() {
return !!this.isValid() && (this._isUTC && 0 === this._offset)
}
i.updateOffset = function () {
};
var qt = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,
Ht = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
function Yt(e, t) {
var n, r, i, a = e, s = null;
return Vt(e) ? a = {
ms: e._milliseconds,
d: e._days,
M: e._months
} : c(e) ? (a = {}, t ? a[t] = e : a.milliseconds = e) : (s = qt.exec(e)) ? (n = "-" === s[1] ? -1 : 1, a = {
y: 0,
d: x(s[we]) * n,
h: x(s[Se]) * n,
m: x(s[_e]) * n,
s: x(s[ke]) * n,
ms: x(Ft(1e3 * s[xe])) * n
}) : (s = Ht.exec(e)) ? (n = "-" === s[1] ? -1 : 1, a = {
y: Xt(s[2], n),
M: Xt(s[3], n),
w: Xt(s[4], n),
d: Xt(s[5], n),
h: Xt(s[6], n),
m: Xt(s[7], n),
s: Xt(s[8], n)
}) : null == a ? a = {} : "object" === (void 0 === a ? "undefined" : o(a)) && ("from" in a || "to" in a) && (i = function (e, t) {
var n;
if (!e.isValid() || !t.isValid()) return {milliseconds: 0, months: 0};
t = jt(t, e), e.isBefore(t) ? n = Jt(e, t) : ((n = Jt(t, e)).milliseconds = -n.milliseconds, n.months = -n.months);
return n
}(Lt(a.from), Lt(a.to)), (a = {}).ms = i.milliseconds, a.M = i.months), r = new Wt(a), Vt(e) && h(e, "_locale") && (r._locale = e._locale), r
}
function Xt(e, t) {
var n = e && parseFloat(e.replace(",", "."));
return (isNaN(n) ? 0 : n) * t
}
function Jt(e, t) {
var n = {};
return n.months = t.month() - e.month() + 12 * (t.year() - e.year()), e.clone().add(n.months, "M").isAfter(t) && --n.months, n.milliseconds = +t - +e.clone().add(n.months, "M"), n
}
function Qt(e, t) {
return function (n, r) {
var i;
return null === r || isNaN(+r) || (D(t, "moment()." + t + "(period, number) is deprecated. Please use moment()." + t + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."), i = n, n = r, r = i), $t(this, Yt(n = "string" == typeof n ? +n : n, r), e), this
}
}
function $t(e, t, n, r) {
var a = t._milliseconds, o = Ft(t._days), s = Ft(t._months);
e.isValid() && (r = null == r || r, s && Ve(e, Le(e, "Month") + s * n), o && Oe(e, "Date", Le(e, "Date") + o * n), a && e._d.setTime(e._d.valueOf() + a * n), r && i.updateOffset(e, o || s))
}
Yt.fn = Wt.prototype, Yt.invalid = function () {
return Yt(NaN)
};
var Zt = Qt(1, "add"), en = Qt(-1, "subtract");
function tn(e, t) {
var n = 12 * (t.year() - e.year()) + (t.month() - e.month()), r = e.clone().add(n, "months");
return -(n + (t - r < 0 ? (t - r) / (r - e.clone().add(n - 1, "months")) : (t - r) / (e.clone().add(n + 1, "months") - r))) || 0
}
function nn(e) {
var t;
return void 0 === e ? this._locale._abbr : (null != (t = ft(e)) && (this._locale = t), this)
}
i.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ", i.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
var rn = A("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function (e) {
return void 0 === e ? this.localeData() : this.locale(e)
});
function an() {
return this._locale
}
var on = 1e3, sn = 60 * on, ln = 60 * sn, cn = 3506328 * ln;
function un(e, t) {
return (e % t + t) % t
}
function dn(e, t, n) {
return e < 100 && e >= 0 ? new Date(e + 400, t, n) - cn : new Date(e, t, n).valueOf()
}
function hn(e, t, n) {
return e < 100 && e >= 0 ? Date.UTC(e + 400, t, n) - cn : Date.UTC(e, t, n)
}
function pn(e, t) {
U(0, [e, e.length], 0, t)
}
function fn(e, t, n, r, i) {
var a;
return null == e ? qe(this, r, i).year : (t > (a = He(e, r, i)) && (t = a), function (e, t, n, r, i) {
var a = Ue(e, t, n, r, i), o = je(a.year, 0, a.dayOfYear);
return this.year(o.getUTCFullYear()), this.month(o.getUTCMonth()), this.date(o.getUTCDate()), this
}.call(this, e, t, n, r, i))
}
U(0, ["gg", 2], 0, function () {
return this.weekYear() % 100
}), U(0, ["GG", 2], 0, function () {
return this.isoWeekYear() % 100
}), pn("gggg", "weekYear"), pn("ggggg", "weekYear"), pn("GGGG", "isoWeekYear"), pn("GGGGG", "isoWeekYear"), N("weekYear", "gg"), N("isoWeekYear", "GG"), F("weekYear", 1), F("isoWeekYear", 1), de("G", oe), de("g", oe), de("GG", Z, X), de("gg", Z, X), de("GGGG", re, Q), de("gggg", re, Q), de("GGGGG", ie, $), de("ggggg", ie, $), ve(["gggg", "ggggg", "GGGG", "GGGGG"], function (e, t, n, r) {
t[r.substr(0, 2)] = x(e)
}), ve(["gg", "GG"], function (e, t, n, r) {
t[r] = i.parseTwoDigitYear(e)
}), U("Q", 0, "Qo", "quarter"), N("quarter", "Q"), F("quarter", 7), de("Q", Y), me("Q", function (e, t) {
t[be] = 3 * (x(e) - 1)
}), U("D", ["DD", 2], "Do", "date"), N("date", "D"), F("date", 9), de("D", Z), de("DD", Z, X), de("Do", function (e, t) {
return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient
}), me(["D", "DD"], we), me("Do", function (e, t) {
t[we] = x(e.match(Z)[0])
});
var mn = Ie("Date", !0);
U("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), N("dayOfYear", "DDD"), F("dayOfYear", 4), de("DDD", ne), de("DDDD", J), me(["DDD", "DDDD"], function (e, t, n) {
n._dayOfYear = x(e)
}), U("m", ["mm", 2], 0, "minute"), N("minute", "m"), F("minute", 14), de("m", Z), de("mm", Z, X), me(["m", "mm"], _e);
var vn = Ie("Minutes", !1);
U("s", ["ss", 2], 0, "second"), N("second", "s"), F("second", 15), de("s", Z), de("ss", Z, X), me(["s", "ss"], ke);
var gn, yn = Ie("Seconds", !1);
for (U("S", 0, 0, function () {
return ~~(this.millisecond() / 100)
}), U(0, ["SS", 2], 0, function () {
return ~~(this.millisecond() / 10)
}), U(0, ["SSS", 3], 0, "millisecond"), U(0, ["SSSS", 4], 0, function () {
return 10 * this.millisecond()
}), U(0, ["SSSSS", 5], 0, function () {
return 100 * this.millisecond()
}), U(0, ["SSSSSS", 6], 0, function () {
return 1e3 * this.millisecond()
}), U(0, ["SSSSSSS", 7], 0, function () {
return 1e4 * this.millisecond()
}), U(0, ["SSSSSSSS", 8], 0, function () {
return 1e5 * this.millisecond()
}), U(0, ["SSSSSSSSS", 9], 0, function () {
return 1e6 * this.millisecond()
}), N("millisecond", "ms"), F("millisecond", 16), de("S", ne, Y), de("SS", ne, X), de("SSS", ne, J), gn = "SSSS"; gn.length <= 9; gn += "S") de(gn, ae);
function bn(e, t) {
t[xe] = x(1e3 * ("0." + e))
}
for (gn = "S"; gn.length <= 9; gn += "S") me(gn, bn);
var wn = Ie("Milliseconds", !1);
U("z", 0, 0, "zoneAbbr"), U("zz", 0, 0, "zoneName");
var Sn = S.prototype;
function _n(e) {
return e
}
Sn.add = Zt, Sn.calendar = function (e, t) {
var n = e || Lt(), r = jt(n, this).startOf("day"), a = i.calendarFormat(this, r) || "sameElse",
o = t && (I(t[a]) ? t[a].call(this, n) : t[a]);
return this.format(o || this.localeData().calendar(a, this, Lt(n)))
}, Sn.clone = function () {
return new S(this)
}, Sn.diff = function (e, t, n) {
var r, i, a;
if (!this.isValid()) return NaN;
if (!(r = jt(e, this)).isValid()) return NaN;
switch (i = 6e4 * (r.utcOffset() - this.utcOffset()), t = R(t)) {
case"year":
a = tn(this, r) / 12;
break;
case"month":
a = tn(this, r);
break;
case"quarter":
a = tn(this, r) / 3;
break;
case"second":
a = (this - r) / 1e3;
break;
case"minute":
a = (this - r) / 6e4;
break;
case"hour":
a = (this - r) / 36e5;
break;
case"day":
a = (this - r - i) / 864e5;
break;
case"week":
a = (this - r - i) / 6048e5;
break;
default:
a = this - r
}
return n ? a : k(a)
}, Sn.endOf = function (e) {
var t;
if (void 0 === (e = R(e)) || "millisecond" === e || !this.isValid()) return this;
var n = this._isUTC ? hn : dn;
switch (e) {
case"year":
t = n(this.year() + 1, 0, 1) - 1;
break;
case"quarter":
t = n(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
break;
case"month":
t = n(this.year(), this.month() + 1, 1) - 1;
break;
case"week":
t = n(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
break;
case"isoWeek":
t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
break;
case"day":
case"date":
t = n(this.year(), this.month(), this.date() + 1) - 1;
break;
case"hour":
t = this._d.valueOf(), t += ln - un(t + (this._isUTC ? 0 : this.utcOffset() * sn), ln) - 1;
break;
case"minute":
t = this._d.valueOf(), t += sn - un(t, sn) - 1;
break;
case"second":
t = this._d.valueOf(), t += on - un(t, on) - 1
}
return this._d.setTime(t), i.updateOffset(this, !0), this
}, Sn.format = function (e) {
e || (e = this.isUtc() ? i.defaultFormatUtc : i.defaultFormat);
var t = q(this, e);
return this.localeData().postformat(t)
}, Sn.from = function (e, t) {
return this.isValid() && (_(e) && e.isValid() || Lt(e).isValid()) ? Yt({
to: this,
from: e
}).locale(this.locale()).humanize(!t) : this.localeData().invalidDate()
}, Sn.fromNow = function (e) {
return this.from(Lt(), e)
}, Sn.to = function (e, t) {
return this.isValid() && (_(e) && e.isValid() || Lt(e).isValid()) ? Yt({
from: this,
to: e
}).locale(this.locale()).humanize(!t) : this.localeData().invalidDate()
}, Sn.toNow = function (e) {
return this.to(Lt(), e)
}, Sn.get = function (e) {
return I(this[e = R(e)]) ? this[e]() : this
}, Sn.invalidAt = function () {
return m(this).overflow
}, Sn.isAfter = function (e, t) {
var n = _(e) ? e : Lt(e);
return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() > n.valueOf() : n.valueOf() < this.clone().startOf(t).valueOf())
}, Sn.isBefore = function (e, t) {
var n = _(e) ? e : Lt(e);
return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() < n.valueOf() : this.clone().endOf(t).valueOf() < n.valueOf())
}, Sn.isBetween = function (e, t, n, r) {
var i = _(e) ? e : Lt(e), a = _(t) ? t : Lt(t);
return !!(this.isValid() && i.isValid() && a.isValid()) && ("(" === (r = r || "()")[0] ? this.isAfter(i, n) : !this.isBefore(i, n)) && (")" === r[1] ? this.isBefore(a, n) : !this.isAfter(a, n))
}, Sn.isSame = function (e, t) {
var n, r = _(e) ? e : Lt(e);
return !(!this.isValid() || !r.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() === r.valueOf() : (n = r.valueOf(), this.clone().startOf(t).valueOf() <= n && n <= this.clone().endOf(t).valueOf()))
}, Sn.isSameOrAfter = function (e, t) {
return this.isSame(e, t) || this.isAfter(e, t)
}, Sn.isSameOrBefore = function (e, t) {
return this.isSame(e, t) || this.isBefore(e, t)
}, Sn.isValid = function () {
return v(this)
}, Sn.lang = rn, Sn.locale = nn, Sn.localeData = an, Sn.max = Mt, Sn.min = Ot, Sn.parsingFlags = function () {
return p({}, m(this))
}, Sn.set = function (e, t) {
if ("object" === (void 0 === e ? "undefined" : o(e))) for (var n = function (e) {
var t = [];
for (var n in e) t.push({unit: n, priority: V[n]});
return t.sort(function (e, t) {
return e.priority - t.priority
}), t
}(e = W(e)), r = 0; r < n.length; r++) this[n[r].unit](e[n[r].unit]); else if (I(this[e = R(e)])) return this[e](t);
return this
}, Sn.startOf = function (e) {
var t;
if (void 0 === (e = R(e)) || "millisecond" === e || !this.isValid()) return this;
var n = this._isUTC ? hn : dn;
switch (e) {
case"year":
t = n(this.year(), 0, 1);
break;
case"quarter":
t = n(this.year(), this.month() - this.month() % 3, 1);
break;
case"month":
t = n(this.year(), this.month(), 1);
break;
case"week":
t = n(this.year(), this.month(), this.date() - this.weekday());
break;
case"isoWeek":
t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
break;
case"day":
case"date":
t = n(this.year(), this.month(), this.date());
break;
case"hour":
t = this._d.valueOf(), t -= un(t + (this._isUTC ? 0 : this.utcOffset() * sn), ln);
break;
case"minute":
t = this._d.valueOf(), t -= un(t, sn);
break;
case"second":
t = this._d.valueOf(), t -= un(t, on)
}
return this._d.setTime(t), i.updateOffset(this, !0), this
}, Sn.subtract = en, Sn.toArray = function () {
var e = this;
return [e.year(), e.month(), e.date(), e.hour(), e.minute(), e.second(), e.millisecond()]
}, Sn.toObject = function () {
var e = this;
return {
years: e.year(),
months: e.month(),
date: e.date(),
hours: e.hours(),
minutes: e.minutes(),
seconds: e.seconds(),
milliseconds: e.milliseconds()
}
}, Sn.toDate = function () {
return new Date(this.valueOf())
}, Sn.toISOString = function (e) {
if (!this.isValid()) return null;
var t = !0 !== e, n = t ? this.clone().utc() : this;
return n.year() < 0 || n.year() > 9999 ? q(n, t ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ") : I(Date.prototype.toISOString) ? t ? this.toDate().toISOString() : new Date(this.valueOf() + 60 * this.utcOffset() * 1e3).toISOString().replace("Z", q(n, "Z")) : q(n, t ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ")
}, Sn.inspect = function () {
if (!this.isValid()) return "moment.invalid(/* " + this._i + " */)";
var e = "moment", t = "";
this.isLocal() || (e = 0 === this.utcOffset() ? "moment.utc" : "moment.parseZone", t = "Z");
var n = "[" + e + '("]', r = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY", i = t + '[")]';
return this.format(n + r + "-MM-DD[T]HH:mm:ss.SSS" + i)
}, Sn.toJSON = function () {
return this.isValid() ? this.toISOString() : null
}, Sn.toString = function () {
return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
}, Sn.unix = function () {
return Math.floor(this.valueOf() / 1e3)
}, Sn.valueOf = function () {
return this._d.valueOf() - 6e4 * (this._offset || 0)
}, Sn.creationData = function () {
return {input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict}
}, Sn.year = De, Sn.isLeapYear = function () {
return Te(this.year())
}, Sn.weekYear = function (e) {
return fn.call(this, e, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy)
}, Sn.isoWeekYear = function (e) {
return fn.call(this, e, this.isoWeek(), this.isoWeekday(), 1, 4)
}, Sn.quarter = Sn.quarters = function (e) {
return null == e ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (e - 1) + this.month() % 3)
}, Sn.month = Fe, Sn.daysInMonth = function () {
return Me(this.year(), this.month())
}, Sn.week = Sn.weeks = function (e) {
var t = this.localeData().week(this);
return null == e ? t : this.add(7 * (e - t), "d")
}, Sn.isoWeek = Sn.isoWeeks = function (e) {
var t = qe(this, 1, 4).week;
return null == e ? t : this.add(7 * (e - t), "d")
}, Sn.weeksInYear = function () {
var e = this.localeData()._week;
return He(this.year(), e.dow, e.doy)
}, Sn.isoWeeksInYear = function () {
return He(this.year(), 1, 4)
}, Sn.date = mn, Sn.day = Sn.days = function (e) {
if (!this.isValid()) return null != e ? this : NaN;
var t = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
return null != e ? (e = function (e, t) {
return "string" != typeof e ? e : isNaN(e) ? "number" == typeof (e = t.weekdaysParse(e)) ? e : null : parseInt(e, 10)
}(e, this.localeData()), this.add(e - t, "d")) : t
}, Sn.weekday = function (e) {
if (!this.isValid()) return null != e ? this : NaN;
var t = (this.day() + 7 - this.localeData()._week.dow) % 7;
return null == e ? t : this.add(e - t, "d")
}, Sn.isoWeekday = function (e) {
if (!this.isValid()) return null != e ? this : NaN;
if (null != e) {
var t = function (e, t) {
return "string" == typeof e ? t.weekdaysParse(e) % 7 || 7 : isNaN(e) ? null : e
}(e, this.localeData());
return this.day(this.day() % 7 ? t : t - 7)
}
return this.day() || 7
}, Sn.dayOfYear = function (e) {
var t = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1;
return null == e ? t : this.add(e - t, "d")
}, Sn.hour = Sn.hours = ot, Sn.minute = Sn.minutes = vn, Sn.second = Sn.seconds = yn, Sn.millisecond = Sn.milliseconds = wn, Sn.utcOffset = function (e, t, n) {
var r, a = this._offset || 0;
if (!this.isValid()) return null != e ? this : NaN;
if (null != e) {
if ("string" == typeof e) {
if (null === (e = Kt(le, e))) return this
} else Math.abs(e) < 16 && !n && (e *= 60);
return !this._isUTC && t && (r = zt(this)), this._offset = e, this._isUTC = !0, null != r && this.add(r, "m"), a !== e && (!t || this._changeInProgress ? $t(this, Yt(e - a, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, i.updateOffset(this, !0), this._changeInProgress = null)), this
}
return this._isUTC ? a : zt(this)
}, Sn.utc = function (e) {
return this.utcOffset(0, e)
}, Sn.local = function (e) {
return this._isUTC && (this.utcOffset(0, e), this._isUTC = !1, e && this.subtract(zt(this), "m")), this
}, Sn.parseZone = function () {
if (null != this._tzm) this.utcOffset(this._tzm, !1, !0); else if ("string" == typeof this._i) {
var e = Kt(se, this._i);
null != e ? this.utcOffset(e) : this.utcOffset(0, !0)
}
return this
}, Sn.hasAlignedHourOffset = function (e) {
return !!this.isValid() && (e = e ? Lt(e).utcOffset() : 0, (this.utcOffset() - e) % 60 == 0)
}, Sn.isDST = function () {
return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset()
}, Sn.isLocal = function () {
return !!this.isValid() && !this._isUTC
}, Sn.isUtcOffset = function () {
return !!this.isValid() && this._isUTC
}, Sn.isUtc = Ut, Sn.isUTC = Ut, Sn.zoneAbbr = function () {
return this._isUTC ? "UTC" : ""
}, Sn.zoneName = function () {
return this._isUTC ? "Coordinated Universal Time" : ""
}, Sn.dates = A("dates accessor is deprecated. Use date instead.", mn), Sn.months = A("months accessor is deprecated. Use month instead", Fe), Sn.years = A("years accessor is deprecated. Use year instead", De), Sn.zone = A("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", function (e, t) {
return null != e ? ("string" != typeof e && (e = -e), this.utcOffset(e, t), this) : -this.utcOffset()
}), Sn.isDSTShifted = A("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", function () {
if (!l(this._isDSTShifted)) return this._isDSTShifted;
var e = {};
if (b(e, this), (e = Dt(e))._a) {
var t = e._isUTC ? f(e._a) : Lt(e._a);
this._isDSTShifted = this.isValid() && P(e._a, t.toArray()) > 0
} else this._isDSTShifted = !1;
return this._isDSTShifted
});
var kn = O.prototype;
function xn(e, t, n, r) {
var i = ft(), a = f().set(r, t);
return i[n](a, e)
}
function Pn(e, t, n) {
if (c(e) && (t = e, e = void 0), e = e || "", null != t) return xn(e, t, n, "month");
var r, i = [];
for (r = 0; r < 12; r++) i[r] = xn(e, r, n, "month");
return i
}
function Cn(e, t, n, r) {
"boolean" == typeof e ? (c(t) && (n = t, t = void 0), t = t || "") : (n = t = e, e = !1, c(t) && (n = t, t = void 0), t = t || "");
var i, a = ft(), o = e ? a._week.dow : 0;
if (null != n) return xn(t, (n + o) % 7, r, "day");
var s = [];
for (i = 0; i < 7; i++) s[i] = xn(t, (i + o) % 7, r, "day");
return s
}
kn.calendar = function (e, t, n) {
var r = this._calendar[e] || this._calendar.sameElse;
return I(r) ? r.call(t, n) : r
}, kn.longDateFormat = function (e) {
var t = this._longDateFormat[e], n = this._longDateFormat[e.toUpperCase()];
return t || !n ? t : (this._longDateFormat[e] = n.replace(/MMMM|MM|DD|dddd/g, function (e) {
return e.slice(1)
}), this._longDateFormat[e])
}, kn.invalidDate = function () {
return this._invalidDate
}, kn.ordinal = function (e) {
return this._ordinal.replace("%d", e)
}, kn.preparse = _n, kn.postformat = _n, kn.relativeTime = function (e, t, n, r) {
var i = this._relativeTime[n];
return I(i) ? i(e, t, n, r) : i.replace(/%d/i, e)
}, kn.pastFuture = function (e, t) {
var n = this._relativeTime[e > 0 ? "future" : "past"];
return I(n) ? n(t) : n.replace(/%s/i, t)
}, kn.set = function (e) {
var t, n;
for (n in e) I(t = e[n]) ? this[n] = t : this["_" + n] = t;
this._config = e, this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source)
}, kn.months = function (e, t) {
return e ? a(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || Ne).test(t) ? "format" : "standalone"][e.month()] : a(this._months) ? this._months : this._months.standalone
}, kn.monthsShort = function (e, t) {
return e ? a(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[Ne.test(t) ? "format" : "standalone"][e.month()] : a(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone
}, kn.monthsParse = function (e, t, n) {
var r, i, a;
if (this._monthsParseExact) return function (e, t, n) {
var r, i, a, o = e.toLocaleLowerCase();
if (!this._monthsParse) for (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = [], r = 0; r < 12; ++r) a = f([2e3, r]), this._shortMonthsParse[r] = this.monthsShort(a, "").toLocaleLowerCase(), this._longMonthsParse[r] = this.months(a, "").toLocaleLowerCase();
return n ? "MMM" === t ? -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : null : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : null : "MMM" === t ? -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : null : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : null
}.call(this, e, t, n);
for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), r = 0; r < 12; r++) {
if (i = f([2e3, r]), n && !this._longMonthsParse[r] && (this._longMonthsParse[r] = new RegExp("^" + this.months(i, "").replace(".", "") + "$", "i"), this._shortMonthsParse[r] = new RegExp("^" + this.monthsShort(i, "").replace(".", "") + "$", "i")), n || this._monthsParse[r] || (a = "^" + this.months(i, "") + "|^" + this.monthsShort(i, ""), this._monthsParse[r] = new RegExp(a.replace(".", ""), "i")), n && "MMMM" === t && this._longMonthsParse[r].test(e)) return r;
if (n && "MMM" === t && this._shortMonthsParse[r].test(e)) return r;
if (!n && this._monthsParse[r].test(e)) return r
}
}, kn.monthsRegex = function (e) {
return this._monthsParseExact ? (h(this, "_monthsRegex") || Ke.call(this), e ? this._monthsStrictRegex : this._monthsRegex) : (h(this, "_monthsRegex") || (this._monthsRegex = Be), this._monthsStrictRegex && e ? this._monthsStrictRegex : this._monthsRegex)
}, kn.monthsShortRegex = function (e) {
return this._monthsParseExact ? (h(this, "_monthsRegex") || Ke.call(this), e ? this._monthsShortStrictRegex : this._monthsShortRegex) : (h(this, "_monthsShortRegex") || (this._monthsShortRegex = Ge), this._monthsShortStrictRegex && e ? this._monthsShortStrictRegex : this._monthsShortRegex)
}, kn.week = function (e) {
return qe(e, this._week.dow, this._week.doy).week
}, kn.firstDayOfYear = function () {
return this._week.doy
}, kn.firstDayOfWeek = function () {
return this._week.dow
}, kn.weekdays = function (e, t) {
var n = a(this._weekdays) ? this._weekdays : this._weekdays[e && !0 !== e && this._weekdays.isFormat.test(t) ? "format" : "standalone"];
return !0 === e ? Ye(n, this._week.dow) : e ? n[e.day()] : n
}, kn.weekdaysMin = function (e) {
return !0 === e ? Ye(this._weekdaysMin, this._week.dow) : e ? this._weekdaysMin[e.day()] : this._weekdaysMin
}, kn.weekdaysShort = function (e) {
return !0 === e ? Ye(this._weekdaysShort, this._week.dow) : e ? this._weekdaysShort[e.day()] : this._weekdaysShort
}, kn.weekdaysParse = function (e, t, n) {
var r, i, a;
if (this._weekdaysParseExact) return function (e, t, n) {
var r, i, a, o = e.toLocaleLowerCase();
if (!this._weekdaysParse) for (this._weekdaysParse = [], this._shortWeekdaysParse = [], this._minWeekdaysParse = [], r = 0; r < 7; ++r) a = f([2e3, 1]).day(r), this._minWeekdaysParse[r] = this.weekdaysMin(a, "").toLocaleLowerCase(), this._shortWeekdaysParse[r] = this.weekdaysShort(a, "").toLocaleLowerCase(), this._weekdaysParse[r] = this.weekdays(a, "").toLocaleLowerCase();
return n ? "dddd" === t ? -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : null : "ddd" === t ? -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : null : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : "dddd" === t ? -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : "ddd" === t ? -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : null
}.call(this, e, t, n);
for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), r = 0; r < 7; r++) {
if (i = f([2e3, 1]).day(r), n && !this._fullWeekdaysParse[r] && (this._fullWeekdaysParse[r] = new RegExp("^" + this.weekdays(i, "").replace(".", "\\.?") + "$", "i"), this._shortWeekdaysParse[r] = new RegExp("^" + this.weekdaysShort(i, "").replace(".", "\\.?") + "$", "i"), this._minWeekdaysParse[r] = new RegExp("^" + this.weekdaysMin(i, "").replace(".", "\\.?") + "$", "i")), this._weekdaysParse[r] || (a = "^" + this.weekdays(i, "") + "|^" + this.weekdaysShort(i, "") + "|^" + this.weekdaysMin(i, ""), this._weekdaysParse[r] = new RegExp(a.replace(".", ""), "i")), n && "dddd" === t && this._fullWeekdaysParse[r].test(e)) return r;
if (n && "ddd" === t && this._shortWeekdaysParse[r].test(e)) return r;
if (n && "dd" === t && this._minWeekdaysParse[r].test(e)) return r;
if (!n && this._weekdaysParse[r].test(e)) return r
}
}, kn.weekdaysRegex = function (e) {
return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysStrictRegex : this._weekdaysRegex) : (h(this, "_weekdaysRegex") || (this._weekdaysRegex = $e), this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex)
}, kn.weekdaysShortRegex = function (e) {
return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (h(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = Ze), this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex)
}, kn.weekdaysMinRegex = function (e) {
return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (h(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = et), this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex)
}, kn.isPM = function (e) {
return "p" === (e + "").toLowerCase().charAt(0)
}, kn.meridiem = function (e, t, n) {
return e > 11 ? n ? "pm" : "PM" : n ? "am" : "AM"
}, ht("en", {
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (e) {
var t = e % 10;
return e + (1 === x(e % 100 / 10) ? "th" : 1 === t ? "st" : 2 === t ? "nd" : 3 === t ? "rd" : "th")
}
}), i.lang = A("moment.lang is deprecated. Use moment.locale instead.", ht), i.langData = A("moment.langData is deprecated. Use moment.localeData instead.", ft);
var An = Math.abs;
function Tn(e, t, n, r) {
var i = Yt(t, n);
return e._milliseconds += r * i._milliseconds, e._days += r * i._days, e._months += r * i._months, e._bubble()
}
function En(e) {
return e < 0 ? Math.floor(e) : Math.ceil(e)
}
function Dn(e) {
return 4800 * e / 146097
}
function In(e) {
return 146097 * e / 4800
}
function Ln(e) {
return function () {
return this.as(e)
}
}
var On = Ln("ms"), Mn = Ln("s"), Nn = Ln("m"), Rn = Ln("h"), Wn = Ln("d"), Vn = Ln("w"), Fn = Ln("M"),
Gn = Ln("Q"), Bn = Ln("y");
function Kn(e) {
return function () {
return this.isValid() ? this._data[e] : NaN
}
}
var jn = Kn("milliseconds"), zn = Kn("seconds"), Un = Kn("minutes"), qn = Kn("hours"), Hn = Kn("days"),
Yn = Kn("months"), Xn = Kn("years");
var Jn = Math.round, Qn = {ss: 44, s: 45, m: 45, h: 22, d: 26, M: 11};
var $n = Math.abs;
function Zn(e) {
return (e > 0) - (e < 0) || +e
}
function er() {
if (!this.isValid()) return this.localeData().invalidDate();
var e, t, n = $n(this._milliseconds) / 1e3, r = $n(this._days), i = $n(this._months);
t = k((e = k(n / 60)) / 60), n %= 60, e %= 60;
var a = k(i / 12), o = i %= 12, s = r, l = t, c = e, u = n ? n.toFixed(3).replace(/\.?0+$/, "") : "",
d = this.asSeconds();
if (!d) return "P0D";
var h = d < 0 ? "-" : "", p = Zn(this._months) !== Zn(d) ? "-" : "", f = Zn(this._days) !== Zn(d) ? "-" : "",
m = Zn(this._milliseconds) !== Zn(d) ? "-" : "";
return h + "P" + (a ? p + a + "Y" : "") + (o ? p + o + "M" : "") + (s ? f + s + "D" : "") + (l || c || u ? "T" : "") + (l ? m + l + "H" : "") + (c ? m + c + "M" : "") + (u ? m + u + "S" : "")
}
var tr = Wt.prototype;
return tr.isValid = function () {
return this._isValid
}, tr.abs = function () {
var e = this._data;
return this._milliseconds = An(this._milliseconds), this._days = An(this._days), this._months = An(this._months), e.milliseconds = An(e.milliseconds), e.seconds = An(e.seconds), e.minutes = An(e.minutes), e.hours = An(e.hours), e.months = An(e.months), e.years = An(e.years), this
}, tr.add = function (e, t) {
return Tn(this, e, t, 1)
}, tr.subtract = function (e, t) {
return Tn(this, e, t, -1)
}, tr.as = function (e) {
if (!this.isValid()) return NaN;
var t, n, r = this._milliseconds;
if ("month" === (e = R(e)) || "quarter" === e || "year" === e) switch (t = this._days + r / 864e5, n = this._months + Dn(t), e) {
case"month":
return n;
case"quarter":
return n / 3;
case"year":
return n / 12
} else switch (t = this._days + Math.round(In(this._months)), e) {
case"week":
return t / 7 + r / 6048e5;
case"day":
return t + r / 864e5;
case"hour":
return 24 * t + r / 36e5;
case"minute":
return 1440 * t + r / 6e4;
case"second":
return 86400 * t + r / 1e3;
case"millisecond":
return Math.floor(864e5 * t) + r;
default:
throw new Error("Unknown unit " + e)
}
}, tr.asMilliseconds = On, tr.asSeconds = Mn, tr.asMinutes = Nn, tr.asHours = Rn, tr.asDays = Wn, tr.asWeeks = Vn, tr.asMonths = Fn, tr.asQuarters = Gn, tr.asYears = Bn, tr.valueOf = function () {
return this.isValid() ? this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * x(this._months / 12) : NaN
}, tr._bubble = function () {
var e, t, n, r, i, a = this._milliseconds, o = this._days, s = this._months, l = this._data;
return a >= 0 && o >= 0 && s >= 0 || a <= 0 && o <= 0 && s <= 0 || (a += 864e5 * En(In(s) + o), o = 0, s = 0), l.milliseconds = a % 1e3, e = k(a / 1e3), l.seconds = e % 60, t = k(e / 60), l.minutes = t % 60, n = k(t / 60), l.hours = n % 24, s += i = k(Dn(o += k(n / 24))), o -= En(In(i)), r = k(s / 12), s %= 12, l.days = o, l.months = s, l.years = r, this
}, tr.clone = function () {
return Yt(this)
}, tr.get = function (e) {
return e = R(e), this.isValid() ? this[e + "s"]() : NaN
}, tr.milliseconds = jn, tr.seconds = zn, tr.minutes = Un, tr.hours = qn, tr.days = Hn, tr.weeks = function () {
return k(this.days() / 7)
}, tr.months = Yn, tr.years = Xn, tr.humanize = function (e) {
if (!this.isValid()) return this.localeData().invalidDate();
var t = this.localeData(), n = function (e, t, n) {
var r = Yt(e).abs(), i = Jn(r.as("s")), a = Jn(r.as("m")), o = Jn(r.as("h")), s = Jn(r.as("d")),
l = Jn(r.as("M")), c = Jn(r.as("y")),
u = i <= Qn.ss && ["s", i] || i < Qn.s && ["ss", i] || a <= 1 && ["m"] || a < Qn.m && ["mm", a] || o <= 1 && ["h"] || o < Qn.h && ["hh", o] || s <= 1 && ["d"] || s < Qn.d && ["dd", s] || l <= 1 && ["M"] || l < Qn.M && ["MM", l] || c <= 1 && ["y"] || ["yy", c];
return u[2] = t, u[3] = +e > 0, u[4] = n, function (e, t, n, r, i) {
return i.relativeTime(t || 1, !!n, e, r)
}.apply(null, u)
}(this, !e, t);
return e && (n = t.pastFuture(+this, n)), t.postformat(n)
}, tr.toISOString = er, tr.toString = er, tr.toJSON = er, tr.locale = nn, tr.localeData = an, tr.toIsoString = A("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", er), tr.lang = rn, U("X", 0, 0, "unix"), U("x", 0, 0, "valueOf"), de("x", oe), de("X", /[+-]?\d+(\.\d{1,3})?/), me("X", function (e, t, n) {
n._d = new Date(1e3 * parseFloat(e, 10))
}), me("x", function (e, t, n) {
n._d = new Date(x(e))
}), i.version = "2.24.0", t = Lt, i.fn = Sn, i.min = function () {
return Nt("isBefore", [].slice.call(arguments, 0))
}, i.max = function () {
return Nt("isAfter", [].slice.call(arguments, 0))
}, i.now = function () {
return Date.now ? Date.now() : +new Date
}, i.utc = f, i.unix = function (e) {
return Lt(1e3 * e)
}, i.months = function (e, t) {
return Pn(e, t, "months")
}, i.isDate = u, i.locale = ht, i.invalid = g, i.duration = Yt, i.isMoment = _, i.weekdays = function (e, t, n) {
return Cn(e, t, n, "weekdays")
}, i.parseZone = function () {
return Lt.apply(null, arguments).parseZone()
}, i.localeData = ft, i.isDuration = Vt, i.monthsShort = function (e, t) {
return Pn(e, t, "monthsShort")
}, i.weekdaysMin = function (e, t, n) {
return Cn(e, t, n, "weekdaysMin")
}, i.defineLocale = pt, i.updateLocale = function (e, t) {
if (null != t) {
var n, r, i = st;
null != (r = dt(e)) && (i = r._config), (n = new O(t = L(i, t))).parentLocale = lt[e], lt[e] = n, ht(e)
} else null != lt[e] && (null != lt[e].parentLocale ? lt[e] = lt[e].parentLocale : null != lt[e] && delete lt[e]);
return lt[e]
}, i.locales = function () {
return T(lt)
}, i.weekdaysShort = function (e, t, n) {
return Cn(e, t, n, "weekdaysShort")
}, i.normalizeUnits = R, i.relativeTimeRounding = function (e) {
return void 0 === e ? Jn : "function" == typeof e && (Jn = e, !0)
}, i.relativeTimeThreshold = function (e, t) {
return void 0 !== Qn[e] && (void 0 === t ? Qn[e] : (Qn[e] = t, "s" === e && (Qn.ss = t - 1), !0))
}, i.calendarFormat = function (e, t) {
var n = e.diff(t, "days", !0);
return n < -6 ? "sameElse" : n < -1 ? "lastWeek" : n < 0 ? "lastDay" : n < 1 ? "sameDay" : n < 2 ? "nextDay" : n < 7 ? "nextWeek" : "sameElse"
}, i.prototype = Sn, i.HTML5_FMT = {
DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
DATE: "YYYY-MM-DD",
TIME: "HH:mm",
TIME_SECONDS: "HH:mm:ss",
TIME_MS: "HH:mm:ss.SSS",
WEEK: "GGGG-[W]WW",
MONTH: "YYYY-MM"
}, i
}, "object" === o(t) && void 0 !== e ? e.exports = a() : void 0 === (i = "function" == typeof (r = a) ? r.call(t, n, t, e) : r) || (e.exports = i)
}).call(t, n(61)(e))
}, function (e, t, n) {
"use strict";
var r = n(10).f, i = n(22), a = n(6)("toStringTag");
e.exports = function (e, t, n) {
e && !i(e = n ? e : e.prototype, a) && r(e, a, {configurable: !0, value: t})
}
}, function (e, t, n) {
"use strict";
var r = n(27), i = n(6)("toStringTag"), a = "Arguments" == r(function () {
return arguments
}());
e.exports = function (e) {
var t, n, o;
return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (n = function (e, t) {
try {
return e[t]
} catch (e) {
}
}(t = Object(e), i)) ? n : a ? r(t) : "Object" == (o = r(t)) && "function" == typeof t.callee ? "Arguments" : o
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(31), a = n(4), o = n(97), s = "[" + o + "]", l = RegExp("^" + s + s + "*"),
c = RegExp(s + s + "*$"), u = function (e, t, n) {
var i = {}, s = a(function () {
return !!o[e]() || "…" != "…"[e]()
}), l = i[e] = s ? t(d) : o[e];
n && (i[n] = l), r(r.P + r.F * s, "String", i)
}, d = u.trim = function (e, t) {
return e = String(i(e)), 1 & t && (e = e.replace(l, "")), 2 & t && (e = e.replace(c, "")), e
};
e.exports = u
}, function (e, t, n) {
"use strict";
e.exports = {}
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
return e.webpackPolyfill || (e.deprecate = function () {
}, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", {
enumerable: !0,
get: function () {
return e.l
}
}), Object.defineProperty(e, "id", {
enumerable: !0, get: function () {
return e.i
}
}), e.webpackPolyfill = 1), e
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.deleteOneSeal = t.removeStampMenu = t.createSealNode = void 0;
var r = n(16), i = n(122), a = n(42), o = n(37), s = n(55), l = n(86), c = n(2);
var u = null;
function d(e, t, n, r, d, m) {
var v = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6],
g = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, y = (0, o.getNumbOfPx)(n.style.left),
b = (0, o.getNumbOfPx)(n.style.top), w = (0, o.getNumbOfPx)(n.style.width),
S = (0, o.getNumbOfPx)(n.style.height);
function _(r) {
r.preventDefault(), r.stopPropagation();
var s = t.pdfViewer.app, d = (e.pageIndex, t.viewport.scale),
p = (0, o.convertScreenToViewportPoint)(r, s.pdfSidebar), m = p.pageX / d, v = p.pageY / d,
y = window.KGPdfViewerWebApp.PDFViewerApplication, b = y.KG_FJRS, w = y.KG_ScanStamp, S = y.KG_UkeyStamp,
_ = y.KG_ScanStamp_V2;
if (_) _.delete(function () {
return f(t, s, e, n, m, v, "")
}); else if (!0 === window.KGPdfViewerWebApp.useCaptcha) (0, l.getPhone)().then(function (r) {
s.KGCaptcha.okCallback = function (r) {
f(t, s, e, n, m, v, r)
}, s.KGCaptcha.open(r)
}); else if (b && b.delKeySN && "1" === b.bSignByCalibrary) b.deleteScanStamp(function () {
f(t, s, e, n, m, v, "")
}); else if (!(w || S && "1" == window.KGPdfViewerWebApp.stampModel) || window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isScanStamp) {
var k = window.KGPdfViewerWebApp.getPasswordPrompt();
k.setUpdateCallback(function (r) {
var o = window.KGPdfViewerWebApp, l = o.certOrigin, d = o.sealOrigin, p = o.fileType, y = o.isSM,
b = o.stampModel, w = function () {
f(t, s, e, n, m, v, r)
};
if (1 == l && "OFD" === p) {
var S = function (i, a) {
return f(t, s, e, n, m, v, r, i, a)
}, _ = function (e) {
return (0, c.closeOverlay)().then(function () {
return g.open(e)
})
};
if (!0 === window.KGPdfViewerWebApp.useNFSSystem) (0, i.deleteNFSSeal)(r, S, _); else new Promise(function (e) {
if (y) {
var t = void 0;
(0, a.WebKGVerify)(u, "", r, function (e) {
t = e
}, _).then(function () {
return e(t)
})
} else e(!0)
}).then(function (e) {
return e && (0, a.deleteOfdSeal)(r, S, _)
})
} else window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? "0" === window.KGPdfViewerWebApp._stampOrigin ? f(t, s, e, n, m, v, r) : h({
password: r,
deleteSealCallback: w
}) : 1 == l || 1 == d || "2" == b ? h({password: r, deleteSealCallback: w}) : f(t, s, e, n, m, v, r)
}), k.open(!1, "delete")
} else "1" == window.KGPdfViewerWebApp.stampModel ? S.delete(function () {
f(t, s, e, n, m, v, "")
}) : w.getQrCodeImage("delete", function () {
f(t, s, e, n, m, v, "")
})
}
var k = m.querySelector(".delSealNode");
function x(r) {
if (r.preventDefault(), r.stopPropagation(), !window.KGPdfViewerWebApp.isUrlDoc) {
var i = window.KGPdfViewerWebApp.PDFViewerApplication, l = i.KG_SealPreLocation;
if (!(i.KG_IWebAuth || l && n.dataset.annotationId == l.annotId)) {
var u = t.pdfViewer.app, d = t.viewport.scale, h = (0, o.convertScreenToViewportPoint)(r, u.pdfSidebar),
p = h.pageX, f = h.pageY, m = p / d, _ = f / d;
if (v) {
if (!(m >= y && m <= y + w && _ >= b && _ <= b + S)) return
} else {
var k = t.getPagePoint(p, f), x = k[0], P = k[1], C = t.viewport.viewBox;
if (P = Math.abs(C[3] - C[1]) - P, !(x >= y && x <= y + w && P >= b && P <= b + S)) return
}
var A = window.KGPdfViewerWebApp.getTipPrompt();
switch (t.pdfViewer.app.l10n._lang) {
case"zh-TW":
A.open("正在驗證印章...");
break;
case"en-US":
A.open("Verifying seal...");
break;
default:
A.open("正在验证印章...")
}
new Promise(function (t) {
null != window.KGPdfViewerWebApp.externalVerifySeal ? window.KGPdfViewerWebApp.externalVerifySeal(t, window.KGPdfViewerWebApp.documentId, e.pageIndex + 1, m, _) : window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? window.KGPdfViewerWebApp.hasClientServer ? window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "1") : window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "2") : window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t)
}).then(function (t) {
if (t.status) {
var n = window.KGPdfViewerWebApp.PDFViewerApplication.KG_VerifySealPrompt, i = t.seal.cert;
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs) {
if (window.KGPdfViewerWebApp.hasClientServer) {
var o = new s.iWebAssist({cilentType: "0"});
return Promise.all([o.promise]).then(function () {
return window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS ? i.bSignByCalibrary ? o.setParamByName("FJRSISPHONE", "1") : o.setParamByName("FJRSISPHONE", "0") : Promise.resolve()
}).then(function () {
return o.verifySignMessage(i.newHash, i.sigData)
}).then(function (r) {
r.result ? (i.sigEffectiveness = !0, A.close().then(function () {
return n.open(t)
})) : new Promise(function (t) {
window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "2")
}).then(function (e) {
i.sigEffectiveness = e.seal && e.seal.cert && e.seal.cert.sigEffectiveness, A.close().then(function () {
return n.open(e)
})
})
})
}
return i.sigEffectiveness = t.seal && t.seal.cert && t.seal.cert.sigEffectiveness, void A.close().then(function () {
return n.open(t)
})
}
if (!("OFD" !== window.KGPdfViewerWebApp.fileType || t.seal.effectiveness && t.seal.cert.sigEffectiveness || null != window.KGPdfViewerWebApp.externalVerifySeal)) {
var l = void 0;
switch (r.target.nodeName.toUpperCase()) {
case"DIV":
l = r.target;
break;
case"SVG":
l = r.target.parentNode;
break;
case"SECTION":
l = r.target.firstChild
}
if (l && !window.KGPdfViewerWebApp.stampMask) {
var u = "width:" + (w - 2) + "px;height:" + (S - 2) + "px";
l.innerHTML = '<svg viewBox="0 0 10 10" style="opacity:0.9;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1" stroke="#FF0000"><line x1="2" y1="2" x2="8" y2="8"/><line x1="2" y1="8" x2="8" y2="2"/></svg>'
}
}
if (i && i.newHash && null == window.KGPdfViewerWebApp.externalVerifySeal) {
var d = new s.iWebAssist({cilentType: "0"});
return Promise.all([d.promise]).then(function () {
return window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS ? i.bSignByCalibrary ? d.setParamByName("FJRSISPHONE", "1") : d.setParamByName("FJRSISPHONE", "0") : Promise.resolve()
}).then(function () {
return d.verifySignMessage(i.newHash, i.sigData)
}).then(function (e) {
if (e.result) i.sigEffectiveness = !0; else {
if ("-8" != e.errcode) return "-1" == e.errcode ? void g.open("未安装签名组件") : void g.open(e.errmsg || "签名验证失败errcode=" + e.errcode);
i.sigEffectiveness = !1
}
A.close().then(function () {
return n.open(t)
})
})
}
var h = !0;
new Promise(function (e) {
var n = window.KGPdfViewerWebApp, r = n.isSM, i = n.fileType;
if (r && "OFD" == i) {
var o = function (e) {
return (0, c.closeOverlay)().then(function () {
h = !1, g.open(e)
})
}, s = function (e) {
t.seal.effectiveness = e, t.seal.cert.sigEffectiveness = e, l.remember()
}, l = window.KGPdfViewerWebApp.getPasswordPrompt();
l.open(), l.setUpdateCallback(function (n) {
var r = t.seal.sm, i = r.dataHashBase64, l = r.sesSignatureBase64;
(0, a.WebKGVerify)(l, i, n, s, o).then(function () {
e(t)
})
})
} else e(t)
}).then(function (e) {
h && A.close().then(function () {
return n.open(e)
})
})
} else A.close().then(function () {
return g.open(t.message)
})
})
}
}
}
function P(r) {
if (r.preventDefault(), r.stopPropagation(), !window.KGPdfViewerWebApp.isUrlDoc) {
var i = window.KGPdfViewerWebApp.PDFViewerApplication, a = i.KG_SealPreLocation;
if (!(i.KG_IWebAuth || a && n.dataset.annotationId == a.annotId)) {
var s = document.getElementById("rightMenu");
s && s.parentNode.removeChild(s);
var l = t.pdfViewer.app, c = t.viewport.scale, d = (0, o.convertScreenToViewportPoint)(r, l.pdfSidebar),
h = d.pageX, f = d.pageY, m = h / c, g = f / c;
if (v) {
if (!(m >= y && m <= y + w && g >= b && g <= b + S)) return
} else {
var k = t.getPagePoint(h, f), P = k[0], C = k[1], A = t.viewport.viewBox;
if (C = Math.abs(A[3] - A[1]) - C, !(P >= y && P <= y + w && C >= b && C <= b + S)) return
}
var T = l.KG_FJRS;
T && (T.delKeySN = null), window.KGPdfViewerWebApp.checkLastone(e.pageIndex + 1, m, g).then(function (e) {
if (e) {
var n = document.createElement("div");
n.id = "rightMenu", n.style.position = "absolute", n.style["background-color"] = "white", n.style.border = "1px solid #999", n.style.zIndex = "200", t.viewport.width < parseFloat(h) + 94 && (h -= 94), t.viewport.height < parseFloat(f) + 70 && (f -= 70), n.style.top = f + "px", n.style.left = h + "px";
var i = '<span class="menuVerifySeal" data-l10n-id="menuVerifySeal">签章验证</span>';
e.status && 2 != window.KGPdfViewerWebApp.stampSystemOrigin ? (n.innerHTML = i + '<span class="menuDeleteSeal" data-l10n-id="menuDeleteSeal">删除签章</span>', window.KGPdfViewerWebApp._stampOrigin = e.stampOrigin, T && e.keySN && (T.delKeySN = e.keySN, T.bSignByCalibrary = e.bSignByCalibrary), window.KGPdfViewerWebApp.scanStamp && (l.KG_ScanStamp.esid = e.esid, l.KG_ScanStamp.sealType = e.sealType), window.KGPdfViewerWebApp.isUkey && (l.KG_UkeyStamp.esid = e.esid), e.stampModel ? window.KGPdfViewerWebApp.stampModel = e.stampModel : window.KGPdfViewerWebApp.stampModel = null, u = window.KGPdfViewerWebApp.isSM ? e.sesSignatureBase64 : null) : n.innerHTML = i, t.div.appendChild(n), t.pdfViewer.app.l10n.translate(n);
var a = n.querySelector(".menuVerifySeal"), o = n.querySelector(".menuDeleteSeal");
a.addEventListener("click", function (e) {
e.preventDefault(), e.stopPropagation(), x(r), p()
}), a.oncontextmenu = null, o && o.addEventListener("click", function (e) {
e.preventDefault(), e.stopPropagation(), _(r), p()
})
}
})
}
}
}
if (n.onmouseout = function (e) {
k && (k.style.display = "none"), m.style.border = "1px dashed transparent"
}, n.onmouseover = function (e) {
m.style.border = "1px dashed black", k && (k.style.display = "block")
}, "0" === window.KGPdfViewerWebApp.mobile.toString()) {
if (n.addEventListener("click", x), k && k.addEventListener("click", _), window.KGPdfViewerWebApp.readOnly) return;
n.oncontextmenu = P
} else n.addEventListener("touchstart", function (e) {
e.preventDefault(), e.stopPropagation(), window.touchstartEvent = e, window.KGPdfViewerWebApp.readOnly || (window.kgTimer = setTimeout(function () {
window.kgTimer = 0, P(e)
}, 500))
}), n.addEventListener("touchend", function (e) {
if (e.preventDefault(), e.stopPropagation(), 0 != window.kgTimer) return clearTimeout(window.kgTimer), x(window.touchstartEvent), !1
})
}
function h(e) {
var t = e.password, n = e.deleteSealCallback, r = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
i = new s.iWebAssist({cilentType: "0"});
Promise.all([i.promise]).then(function () {
return i.getKeyOtherInfo()
}).then(function (e) {
if (!e.result) {
var a = s.iWebAssistError.getKeyOtherInfo, o = e.errmsg || a[e.errcode] || "未知异常";
return window.KGPdfViewerWebApp.getTipPrompt().close(), void r.open(o)
}
var l = e.Res, c = l.substring(1, l.length - 1);
i.verifyPin(t, c).then(function (e) {
if (e.result) window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN = c : window.KGPdfViewerWebApp.userId = c, n && n(); else {
var t = {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败"
}[e.errcode] || e.errmsg || "未知异常";
r.open(t)
}
})
})
}
function p() {
var e = document.getElementById("rightMenu");
e && e.parentNode.removeChild(e)
}
function f(e, t, n, i, a, o, s, l, u) {
var d = n.pageIndex;
window.KGPdfViewerWebApp.deleteSeal(d + 1, a, o, s, l, u).then(function (a) {
return (0, c.closeOverlay)().then(function () {
if (a.data.status) {
if (window.KGPdfViewerWebApp.deleteSealSuccess && window.KGPdfViewerWebApp.deleteSealSuccess(), !1 === window.KGPdfViewerWebApp.useCaptcha) window.KGPdfViewerWebApp.getPasswordPrompt().remember("delete");
if ("OFD" === window.KGPdfViewerWebApp.fileType) !function (e, t) {
function n(t) {
t.renderingState !== r.RenderingStates.RUNNING && t.renderingState !== r.RenderingStates.PAUSED ? (t.deleteStampCallback = function () {
var n = t.div.querySelector(".canvasWrapper");
n && t.div.removeChild(n);
var i = e.pdfThumbnailViewer.getThumbnail(t.pdfPage.pageIndex);
i.renderingState = r.RenderingStates.INITIAL, i.setImage(t)
}, t.renderingState = r.RenderingStates.INITIAL, t.renderingQueue.renderView(t)) : t.reRenderWait = !0
}
var i = e.pdfViewer, a = e.pagesCount, o = t.getAttribute("data-annotation-id"),
s = t.getAttribute("data-goldGridSeal-id");
if (s) for (var l = 0; l < a; l++) {
var c = i.getPageView(l), u = c.pdfPage, d = c.annotationLayer;
if (null == u.delOFDSeal && (u.delOFDSeal = {}), u.reloadOperatorList = !0, null != d && d.div) {
var h = d.div.querySelectorAll("section[data-goldGridSeal-id]");
if (h.length) for (var p = 0; p < h.length; p++) {
var f = h[p];
f.getAttribute("data-goldGridSeal-id") === s && (u.delOFDSeal[s] = !0, d.div.removeChild(f), n(c))
}
} else u.delOFDSeal[s] = !0
} else for (var m = 0; m < a; m++) {
var v = i.getPageView(m), g = v.pdfPage, y = g.newStamps, b = v.annotationLayer;
for (var w in y) if (y.hasOwnProperty(w)) {
var S = y[w], _ = S.getAttribute("data-annotation-id");
_ === o && (delete y[w], null != b && b.div && (b.div.removeChild(S), n(v)))
}
}
}(t, i); else {
var o = a.data.delSeals;
if (o) {
var s = e.pdfViewer, l = i.getAttribute("data-annotation-id");
i.id ? v(o, s, l) : v(o, s)
} else m(e, t, n, i)
}
} else {
var c = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt;
"密码错误" === a.data.message && window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), c.open(a.data.message)
}
})
})
}
function m(e, t, n, r, i) {
var a = !0;
if (void 0 != i && (a = i), n.newStamps[r.id]) delete n.newStamps[r.id]; else {
n.delAnnotions || (n.delAnnotions = {});
var o = r.getAttribute("data-annotation-id");
n.delAnnotions[o] = !0, n.reloadOperatorList = !0
}
var s = e.div;
s.querySelector(".annotationLayer").removeChild(r), a && (2 != e.renderingState ? 1 != e.renderingState ? (e.deleteStampCallback = function () {
var r = s.querySelector(".canvasWrapper"), i = s.querySelector(".textLayer");
r && s.removeChild(r), i && s.removeChild(i);
var a = t.pdfThumbnailViewer.getThumbnail(n.pageIndex);
a.renderingState = 0, a.setImage(e)
}, e.renderingState = 0, e.renderingQueue.renderView(e)) : e.reRenderWait = !0 : n.reloadOperatorList && (e.reRenderWait = !0))
}
function v(e, t, n) {
var r = t.app;
if (n) for (var i in e) {
var a = i, o = t.getPageView(a), s = o.pdfPage, l = o.div.querySelector(".annotationLayer");
if (l && 0 != l.children.length) {
for (var c = [], u = l.children, d = 0; d < u.length; d++) {
var h = u[d];
h.getAttribute("data-annotation-id") == n && c.push(h)
}
for (var p = 0; p < c.length; p++) {
var f = c[p];
p + 1 == c.length ? m(o, r, o.pdfPage, f) : m(o, r, o.pdfPage, f, !1)
}
} else {
var v = s.newStamps;
for (var g in v) {
v[g].getAttribute("data-annotation-id") == n && delete v[g]
}
}
} else for (var i in e) {
var y = i, b = e[i], w = t.getPageView(y), S = w.pdfPage, _ = w.div.querySelector(".annotationLayer");
if (_) for (var k = 0; k < b.length; k++) for (var x = _.children, P = 0; P < x.length; P++) {
var C = x[P], A = C.getAttribute("data-annotation-id");
b[k] == A && (k + 1 == b.length ? m(w, r, w.pdfPage, C) : m(w, r, w.pdfPage, C, !1))
} else {
S.delAnnotions || (S.delAnnotions = {});
for (var T = 0; T < b.length; T++) {
var E = b[T];
S.delAnnotions[E] = !0
}
S.reloadOperatorList = !0;
var D = r.pdfThumbnailViewer.getThumbnail(S.pageIndex);
D.renderingState = 0, D.setImage(w)
}
}
}
t.createSealNode = function (e, t, n, r, i, a) {
n.style["border-width"] = "0";
var s = document.createElement("div"), l = (0, o.getNumbOfPx)(r) - 2, c = (0, o.getNumbOfPx)(i) - 2;
s.style.width = l + "px", s.style.height = c + "px", s.style.border = "1px dashed transparent", s.style.cursor = "pointer";
var u = "width:" + l + "px;height:" + c + "px";
if (a) {
var h = a.data.id, p = null, f = new Promise(function (e) {
p = e
}), m = window.KGPdfViewerWebApp.PDFViewerApplication.KG_IWebAuth;
"PDF" !== window.KGPdfViewerWebApp.fileType || m ? p({
status: !0,
effectiveness: !0
}) : null != window.KGPdfViewerWebApp.externalVerifyOnLoad ? window.KGPdfViewerWebApp.externalVerifyOnLoad(p, window.KGPdfViewerWebApp.documentId, e.pageIndex + 1, h) : window.KGPdfViewerWebApp.verifySealOnLoad(e.pageIndex + 1, h, p), f.then(function (a) {
if (a.status) {
var o = null;
o = a.effectiveness || window.KGPdfViewerWebApp.stampMask ? '<svg viewBox="0 0 1 1" style="opacity:0.0;background-color:white;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1"></svg>' : '<svg viewBox="0 0 10 10" style="opacity:0.9;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1" stroke="#FF0000"><line x1="2" y1="2" x2="8" y2="8"/><line x1="2" y1="8" x2="8" y2="2"/></svg>', "1" === window.KGPdfViewerWebApp.mobile.toString() ? s.innerHTML = o : s.innerHTML = o + "", d(e, t, n, r, i, s, !1)
} else console.log("seal is not exist id = " + h)
})
} else {
var v = '<svg viewBox="0 0 1 1" style="opacity:0.0;background-color:white;' + u + '" wmode="transparent" xmlns="http://www.w3.org/2000/svg" version="1.1"></svg>';
"1" === window.KGPdfViewerWebApp.mobile.toString() ? s.innerHTML = v : s.innerHTML = v + "", d(e, t, n, r, i, s)
}
return s
}, t.removeStampMenu = p, t.deleteOneSeal = m
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.getGlobalEventBus = t.attachDOMEventsToEventBus = void 0;
var r = n(9);
function i(e) {
e.on("documentload", function () {
var e = document.createEvent("CustomEvent");
e.initCustomEvent("documentload", !0, !0, {}), window.dispatchEvent(e)
}), e.on("pagerendered", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("pagerendered", !0, !0, {
pageNumber: e.pageNumber,
cssTransform: e.cssTransform
}), e.source.div.dispatchEvent(t)
}), e.on("textlayerrendered", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("textlayerrendered", !0, !0, {pageNumber: e.pageNumber}), e.source.textLayerDiv.dispatchEvent(t)
}), e.on("pagechange", function (e) {
var t = document.createEvent("UIEvents");
t.initUIEvent("pagechange", !0, !0, window, 0), t.pageNumber = e.pageNumber, e.source.container.dispatchEvent(t)
}), e.on("pagesinit", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("pagesinit", !0, !0, null), e.source.container.dispatchEvent(t)
}), e.on("pagesloaded", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("pagesloaded", !0, !0, {pagesCount: e.pagesCount}), e.source.container.dispatchEvent(t)
}), e.on("scalechange", function (e) {
var t = document.createEvent("UIEvents");
t.initUIEvent("scalechange", !0, !0, window, 0), t.scale = e.scale, t.presetValue = e.presetValue, e.source.container.dispatchEvent(t)
}), e.on("updateviewarea", function (e) {
var t = document.createEvent("UIEvents");
t.initUIEvent("updateviewarea", !0, !0, window, 0), t.location = e.location, e.source.container.dispatchEvent(t)
}), e.on("find", function (e) {
if (e.source !== window) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("find" + e.type, !0, !0, {
query: e.query,
phraseSearch: e.phraseSearch,
caseSensitive: e.caseSensitive,
highlightAll: e.highlightAll,
findPrevious: e.findPrevious
}), window.dispatchEvent(t)
}
}), e.on("attachmentsloaded", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("attachmentsloaded", !0, !0, {attachmentsCount: e.attachmentsCount}), e.source.container.dispatchEvent(t)
}), e.on("sidebarviewchanged", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("sidebarviewchanged", !0, !0, {view: e.view}), e.source.outerContainer.dispatchEvent(t)
}), e.on("pagemode", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("pagemode", !0, !0, {mode: e.mode}), e.source.pdfViewer.container.dispatchEvent(t)
}), e.on("namedaction", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("namedaction", !0, !0, {action: e.action}), e.source.pdfViewer.container.dispatchEvent(t)
}), e.on("presentationmodechanged", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("presentationmodechanged", !0, !0, {
active: e.active,
switchInProgress: e.switchInProgress
}), window.dispatchEvent(t)
}), e.on("outlineloaded", function (e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent("outlineloaded", !0, !0, {outlineCount: e.outlineCount}), e.source.container.dispatchEvent(t)
})
}
var a = null;
t.attachDOMEventsToEventBus = i, t.getGlobalEventBus = function () {
return a || (i(a = new r.EventBus), a)
}
}, function (e, t, n) {
"use strict";
var r = n(13), i = n(3), a = i["__core-js_shared__"] || (i["__core-js_shared__"] = {});
(e.exports = function (e, t) {
return a[e] || (a[e] = void 0 !== t ? t : {})
})("versions", []).push({
version: r.version,
mode: n(39) ? "pure" : "global",
copyright: "© 2019 Denis Pushkarev (zloirock.ru)"
})
}, function (e, t, n) {
"use strict";
var r = n(27);
e.exports = Object("z").propertyIsEnumerable(0) ? Object : function (e) {
return "String" == r(e) ? e.split("") : Object(e)
}
}, function (e, t, n) {
"use strict";
t.f = {}.propertyIsEnumerable
}, function (e, t, n) {
"use strict";
var r = n(1);
e.exports = function () {
var e = r(this), t = "";
return e.global && (t += "g"), e.ignoreCase && (t += "i"), e.multiline && (t += "m"), e.unicode && (t += "u"), e.sticky && (t += "y"), t
}
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(15), a = n(6)("species");
e.exports = function (e, t) {
var n, o = r(e).constructor;
return void 0 === o || void 0 == (n = r(o)[a]) ? t : i(n)
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.rotateBase64Img = function (e, t, n) {
var r = document.createElement("canvas"), i = r.getContext("2d"), a = void 0, o = void 0, s = void 0;
if (t % 90 != 0) throw console.error("旋转角度必须是90的倍数!"), "旋转角度必须是90的倍数!";
var l = t / 90 % 4, c = {sx: 0, sy: 0, ex: 0, ey: 0}, u = new Image;
u.crossOrigin = "anonymous", u.src = e, u.onload = function () {
switch (a = u.width, o = u.height, s = a > o ? a : o, r.width = 2 * s, r.height = 2 * s, l) {
case 0:
c.sx = s, c.sy = s, c.ex = s + a, c.ey = s + o;
break;
case 1:
c.sx = s - o, c.sy = s, c.ex = s, c.ey = s + a;
break;
case 2:
c.sx = s - a, c.sy = s - o, c.ex = s, c.ey = s;
break;
case 3:
c.sx = s, c.sy = s - a, c.ex = s + o, c.ey = s + a
}
i.translate(s, s), i.rotate(t * Math.PI / 180), i.drawImage(u, 0, 0);
var e = i.getImageData(c.sx, c.sy, c.ex, c.ey);
l % 2 == 0 ? (r.width = a, r.height = o) : (r.width = o, r.height = a), i.putImageData(e, 0, 0), n && n(r.toDataURL())
}
}, t.setSectionStyle = s;
var i = n(179), a = n(37), o = n(2);
function s(e, t, n, r, o, s) {
o && (e.style.width = o + "px"), s && (e.style.height = s + "px"), e.style.transform = "matrix(" + t + ", 0, 0, " + t + ", 0, 0)", n && (e.style.left = n + "px"), r && (e.style.top = r + "px"), i.CustomStyle.setProp("transform", e, "matrix(" + t + ", 0, 0, " + t + ", 0, 0)"), i.CustomStyle.setProp("transformOrigin", e, -1 * (n || (0, a.getNumbOfPx)(e.style.left)) + "px " + -1 * r + "px")
}
var l = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = window.KGPdfViewerWebApp.PDFViewerApplication, this.isMobile = "1" === window.KGPdfViewerWebApp.mobile.toString(), this.deleteNodeSize = this.isMobile ? 27 : 18, this.createScaleNode = this.createScaleNode.bind(this);
var r = t.id + "-" + (new Date).getTime().toString();
for (var i in this.section = t.cloneNode(!0), this.section.setAttribute("id", r), this.section.setAttribute("class", "tempStampSection"), this.sealData = {}, n) n.hasOwnProperty(i) && (this.sealData[i] = n[i]);
if (this.sealData.lastSelected = Object.create(null), this.sealData.extraPosition = Object.create(null), this.banNodeList = [], this.sealData._tempStampkey = r, this.sealData.isContinuityStampCheck) for (var a = this.sealData.page.split("-"), l = parseInt(a[0]), c = parseInt(a[1]), u = this.sealData.actionPageInfo, d = l; d <= c; d++) {
var h = this.section.cloneNode(!0);
h.setAttribute("id", this.section.id + "-" + d);
var p = this.app.pdfViewer.getPageView(d - 1), f = p.div, m = parseInt(getComputedStyle(f).width),
v = parseInt(getComputedStyle(f).height),
g = {width: m, height: v, direction: v > m ? "vertical" : "horizontal"}, y = u.direction != g.direction,
b = y ? u.height != g.width : u.width != g.width, w = p.viewport, S = p.annotationLayer,
_ = p.pdfPage.tempStamps, k = w.scale;
if (this.createDeleteNode(h), h.querySelector("img").onmousedown = function (e) {
e.preventDefault()
}, h.oncontextmenu = function (e) {
e.preventDefault()
}, y) {
var x = (0, o.getXYPoint)(this.sealData, {width: v / k, height: m / k});
s(h, k, x.r_left, x.r_top)
}
if (b) {
var P = g.width / u.width, C = g.height / u.height,
A = (0, o.getXYPoint_diffentSize)({wRatio: P, hRatio: C, tempSeal: this.sealData}), T = A.d_top;
s(h, k, A.d_left, T)
}
_[h.id] = h, S && (S.div || (S.div = document.createElement("div"), S.div.className = "annotationLayer", p.div.appendChild(S.div)), S.div.appendChild(h))
} else if (this.sealData.isStampOfQfz) for (var E = 0; E < this.sealData.qfzSeal.length; E++) {
var D = this.sealData.qfzSeal[E];
D.sealdata = [], D.sealdata[0] = {
left: D.left,
width: D.width,
imgdata: D.imgdata
}, delete D.left, delete D.width, delete D.imgdata;
var I = this.section.cloneNode(!0);
I.setAttribute("id", this.section.id + "-" + D.page);
var L = this.app.pdfViewer.getPageView(D.page - 1), O = L.viewport, M = L.annotationLayer,
N = L.pdfPage.tempStamps, R = O.scale, W = L.width / R;
I.style.width = D.sealdata[0].width + "px", I.style.height = D.height + "px", D.sealdata[0].left = W - D.sealdata[0].width, s(I, R, D.sealdata[0].left, D.top), I.querySelector("img").src = D.sealdata[0].imgdata, this.createDeleteNode(I), I.querySelector("img").onmousedown = function (e) {
e.preventDefault()
}, I.oncontextmenu = function (e) {
e.preventDefault()
}, N[I.id] = I, M && (M.div || (M.div = document.createElement("div"), M.div.className = "annotationLayer", L.div.appendChild(M.div)), M.div.appendChild(I))
} else {
var V = this.app.pdfViewer.getPageView(Number(this.sealData.currentPage) - 1), F = V.annotationLayer, G = V.div,
B = V.pdfPage.tempStamps;
if (this.createDeleteNode(this.section), "signature" !== this.sealData.sealType || window.KGPdfViewerWebApp.fingerPrint || this.createScaleNode(this.section), this.section.querySelector("img").onmousedown = function (e) {
e.preventDefault()
}, this.section.oncontextmenu = function (e) {
e.preventDefault()
}, B[this.section.id] = this.section, !F) return;
F.div || (F.div = document.createElement("div"), F.div.className = "annotationLayer", G.appendChild(F.div)), F.div.appendChild(this.section)
}
}
return r(e, [{
key: "createScaleNode", value: function (e) {
if (!window.KGPdfViewerWebApp.hideDeleteNode) {
var t = document.createElement("a"), n = document.createElement("img");
t.classList.add("scaleTempStampSection"), t.style.cursor = "se-resize", t.style.position = "absolute", t.style.padding = "10px", n.setAttribute("src", "images/move.png"), n.style.width = "100%", n.style.height = "100%", this.isMobile ? (t.style.width = "24px", t.style.height = "24px", t.style.right = "-22px", t.style.bottom = "-22px") : (t.style.width = "16px", t.style.height = "16px", t.style.right = "-18px", t.style.bottom = "-18px", n.addEventListener("mousedown", function (e) {
e.preventDefault()
})), e.appendChild(t), t.appendChild(n)
}
}
}, {
key: "createDeleteNode", value: function (e) {
if (!window.KGPdfViewerWebApp.hideDeleteNode) {
var t = document.createElement("a"), n = document.createElement("img");
t.setAttribute("class", "deleteTempStampSection"), t.style.padding = "10px", n.setAttribute("src", "images/close.png"), this.isMobile ? (t.style.width = "24px", t.style.height = "24px", t.style.right = "-22px", t.style.top = "-22px") : this.sealData.isStampOfQfz ? (t.style.width = "16px", t.style.height = "16px", t.style.left = "-18px", t.style.top = "-18px") : (t.style.width = "16px", t.style.height = "16px", t.style.right = "-18px", t.style.top = "-18px"), e.appendChild(t), t.appendChild(n)
}
}
}, {
key: "delete", value: function (e) {
var t = void 0;
if ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("deleteTempStampSection")) t = e.target.parentNode.parentNode; else {
if (!e.target.classList.contains("deleteTempStampSection")) return;
t = e.target.parentNode
}
var n = this.sealData.isContinuityStampCheck ? t.id.slice(0, -2) : t.id;
if (this.sealData.isContinuityStampCheck) {
var r = this.sealData.page.split("-"), i = parseInt(r[0]), a = parseInt(r[1]);
n = [n.split("-")[0], n.split("-")[1]].join("-");
for (var o = i; o <= a; o++) {
var s = this.app.pdfViewer.getPageView(o - 1), l = s.annotationLayer, c = s.pdfPage.tempStamps,
u = n + "-" + o, d = document.getElementById(u);
c.hasOwnProperty(u) && delete c[u], d && l && l.div && l.div.removeChild(d)
}
window.KGPdfViewerWebApp.chainStamp || this.banNodeList.map(function (e) {
e.style["pointer-events"] = "auto"
})
} else if (this.sealData.isStampOfQfz) for (var h = 0; h < this.sealData.qfzSeal.length; h++) {
var p = this.sealData.qfzSeal[h], f = this.app.pdfViewer.getPageView(p.page - 1), m = f.annotationLayer,
v = f.pdfPage.tempStamps, g = (n = [n.split("-")[0], n.split("-")[1]].join("-")) + "-" + p.page,
y = document.getElementById(g);
v.hasOwnProperty(g) && delete v[g], y && m && m.div && m.div.removeChild(y)
} else {
var b = this.app.pdfViewer.getPageView(Number(this.sealData.page) - 1), w = b.annotationLayer,
S = b.pdfPage.tempStamps, _ = document.getElementById(n);
S.hasOwnProperty(n) && delete S.id, _ && w && w.div && w.div.removeChild(_)
}
this.app.pdfStamp.tempSeals = this.app.pdfStamp.tempSeals.filter(function (e) {
return e.section.id !== n
}), this.app.KGStampConfirm.sealDatas = this.app.pdfStamp.tempSeals.map(function (e) {
return e.sealData
}), this.app.pdfStamp.tempSeals.length || (this.app.pdfStamp.cancelStamp(), this.app.KGStampConfirm.hide(), this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData())
}
}, {
key: "eventRegister", value: function () {
var e = this.app, t = e.pdfViewer, n = e.pdfSidebar, r = this.sealData, i = this.section, l = this;
function c(c) {
var u = !1, d = !1, h = !1, p = 0, f = 0, m = 0, v = 0;
function g(e) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : r.currentPage,
i = t.getPageView(Number(n) - 1).pdfPage.tempStamps;
i.hasOwnProperty(e.id) && delete i[e.id]
}
function y(e, n) {
if (!r.isStampOfQfz) {
r.page = r.currentPage = parseInt(e);
var i = t.getPageView(parseInt(e) - 1), a = i.annotationLayer;
i.pdfPage.tempStamps[n.id] = n, a.div || (a.div = document.createElement("div"), a.div.className = "annotationLayer", i.div.appendChild(a.div)), n.parentNode.removeChild(n), a.div.appendChild(n)
}
}
function b(e) {
e.preventDefault(), e.stopPropagation(), c.style.zIndex = 200, !window.KGPdfViewerWebApp.chainStamp && r.isContinuityStampCheck && (l.banNodeList = [].concat(function (e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
return Array.from(e)
}(c.parentNode.children)), l.banNodeList.map(function (e) {
e.style["pointer-events"] = "none"
}), c.style["pointer-events"] = "auto"), ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("deleteTempStampSection") || e.target.classList.contains("deleteTempStampSection")) && l.delete(e), ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("scaleTempStampSection") || e.target.classList.contains("scaleTempStampSection")) && (v = l.isMobile ? e.touches[0].clientX : e.clientX, m = (0, a.getNumbOfPx)(c.style.width), h = !0), ("IMG" === e.target.nodeName && e.target.parentNode.classList.contains("tempStampSection") || e.target.classList.contains("tempStampSection")) && (p = e.offsetX || e.target.offsetWidth / 2, f = e.offsetY || e.target.offsetHeight / 2, u = !0), l.isMobile && (document.ontouchmove = w, document.ontouchend = S)
}
function w(b) {
if (!window.KGPdfViewerWebApp.chainStamp && r.isContinuityStampCheck) {
if ("IMG" !== b.target.nodeName) return;
if ("move" !== window.getComputedStyle(b.target.parentNode).cursor) return
}
if (u) {
var w = (0, a.convertScreenToViewportPoint)(b, n);
if (w) {
var S = (0, a.getNumbOfPx)(c.style.height), _ = w.pageNumber, k = w.pageX, x = w.pageY,
P = t.getPageView(parseInt(_) - 1), C = P.viewport.scale, A = P.width / C, T = P.height / C,
E = k / C - p, D = x / C - f, I = r.left, L = r.top, O = r.xsacle, M = r.ysacle;
if (r.isStampOfQfz ? (D < 0 && (D = 0), D > T - S && (D = T - S)) : r.left = E, r.top = D, r.isContinuityStampCheck) {
d = !0;
var N = P.div, R = parseInt(getComputedStyle(N).width), W = parseInt(getComputedStyle(N).height),
V = {width: R, height: W, direction: W > R ? "vertical" : "horizontal"},
F = (0, o.getXYPoint)(r, {width: R / C, height: W / C}), G = F.XYType, B = F.xsacle, K = F.ysacle,
j = F.r_left, z = F.r_top;
r.xsacle = B, r.ysacle = K, s(i, C, E, D);
for (var U = r.page.split("-"), q = parseInt(U[0]), H = parseInt(U[1]), Y = [], X = q; X <= H; X++) {
var J = e.pdfViewer.getPageView(X - 1), Q = J.div, $ = J.pdfPage.tempStamps,
Z = parseInt(getComputedStyle(Q).width), ee = parseInt(getComputedStyle(Q).height),
te = {width: Z, height: ee, direction: ee > Z ? "vertical" : "horizontal"},
ne = V.direction != te.direction, re = ne ? V.height != te.width : V.width != te.width,
ie = {wRatio: te.width / V.width, hRatio: te.height / V.height};
for (var ae in $) -1 != ae.indexOf(i.id) && ($[ae].isRotate = ne, $[ae].isDiffentSize = re, $[ae].ratio = ie, $[ae].page = {
width: Z,
height: ee
}, Y.push((be = {}, we = ae, Se = $[ae], we in be ? Object.defineProperty(be, we, {
value: Se,
enumerable: !0,
configurable: !0,
writable: !0
}) : be[we] = Se, be)))
}
if (window.KGPdfViewerWebApp.chainStamp) {
r.XYType = G;
var oe = void 0, se = void 0;
Y.map(function (e, t) {
var n = i.id + "-" + (t + q);
if (e.hasOwnProperty(n)) {
var a = e[n], l = a.isRotate, c = a.isDiffentSize, u = a.ratio;
if (l ? (oe = z, se = j) : (oe = D, se = E), c) {
var d = (0, o.getXYPoint_diffentSize)({wRatio: u.wRatio, hRatio: u.hRatio, tempSeal: r}),
h = d.d_top, p = d.d_left;
oe = h, se = p
}
s(e[n], C, se, oe)
}
})
} else {
var le = (0, o.closest)(b.target, "section");
if (!le) return;
var ce = (0, o.getXYPoint)(r, {width: R / C, height: W / C}), ue = ce.xsacle, de = ce.ysacle;
s(le, C, E, D), r.extraPosition[_] = (0, o.removePrototype)({
left: E,
top: D,
xsacle: ue,
ysacle: de,
XYType: G
}), r.lastSelected = (0, o.removePrototype)({
index: _,
tempStampSections: Y,
scale: C
}), r.top = L, r.left = I, r.xsacle = O, r.ysacle = M, l.app.pdfStamp.selectSealData = l.sealData
}
} else if (r.isStampOfQfz) {
r.xsacle = E / A, r.ysacle = D / T, s(i, C, null, D);
var he = (0, a.getNumbOfPx)(c.style.height), pe = (0, a.getNumbOfPx)(c.style.top), fe = T - pe - he;
r.pageAttr.bottom = fe, r.pageAttr.top = pe + he;
for (var me = 0; me < r.qfzSeal.length; me++) {
var ve = r.qfzSeal[me];
ve.top = D;
var ge = i.id + "-" + ve.page, ye = e.pdfViewer.getPageView(ve.page - 1).pdfPage.tempStamps;
ye.hasOwnProperty(ge) && s(ye[ge], C, null, D)
}
} else s(c, C, E, D), l.isMobile ? (r.currentPage < e.pagesCount && D + S / 2 > T && (g(c), y(parseInt(_) + 1, c)), r.currentPage > 1 && D < 0 && -D > S / 2 && (g(c), y(parseInt(_) - 1, c))) : (r.currentPage > 1 && Number(_) < Number(r.currentPage) || r.currentPage < e.pagesCount && Number(_) > Number(r.currentPage)) && (g(c), y(_, c))
}
}
var be, we, Se;
if (h) {
var _e = (0, a.convertScreenToViewportPoint)(b, n);
if (_e) {
var ke = _e.pageNumber, xe = t.getPageView(parseInt(ke) - 1).viewport.scale,
Pe = (0, a.getNumbOfPx)(c.style.width) * xe, Ce = (0, a.getNumbOfPx)(c.style.height) * xe,
Ae = Ce / Pe;
l.isMobile ? r.width = Pe = (m * xe - v + b.touches[0].clientX) / xe : r.width = Pe = (m * xe - v + b.clientX) / xe, r.height = Ce = Pe * Ae, s(c, xe, void 0, void 0, Pe, Ce)
}
}
}
function S() {
d && function () {
if (window.KGPdfViewerWebApp.chainStamp) return;
r.isContinuityStampCheck && l.banNodeList.map(function (e) {
e.style["pointer-events"] = "auto"
});
l.app.pdfStamp.continuityStampModal.open()
}(), c.style.zIndex = 100, d = !1, u = !1, h = !1, p = 0, f = 0, m = 0, v = 0
}
l.isMobile ? c.ontouchstart = b : c.onmouseenter = function () {
c.onmousedown = b, document.onmousemove = w, document.onmouseup = S
}
}
if (r.isContinuityStampCheck) for (var u = r.page.split("-"), d = parseInt(u[0]), h = parseInt(u[1]), p = d; p <= h; p++) {
var f = i.id + "-" + p, m = e.pdfViewer.getPageView(p - 1).pdfPage.tempStamps;
m.hasOwnProperty(f) && c(m[f])
} else if (r.isStampOfQfz) for (var v = 0; v < r.qfzSeal.length; v++) {
var g = r.qfzSeal[v], y = i.id + "-" + g.page, b = e.pdfViewer.getPageView(g.page - 1).pdfPage.tempStamps;
b.hasOwnProperty(y) && c(b[y])
} else {
var w = i.id, S = e.pdfViewer.getPageView(Number(r.page) - 1).pdfPage.tempStamps;
S.hasOwnProperty(w) && c(S[w])
}
}
}, {
key: "eventUnregister", value: function () {
var e = this.app, t = this.sealData, n = this.section;
if (t.isContinuityStampCheck) for (var r = t.page.split("-"), i = parseInt(r[0]), a = parseInt(r[1]), o = i; o <= a; o++) {
var s = n.id + "-" + o, l = e.pdfViewer.getPageView(o - 1).pdfPage.tempStamps;
l.hasOwnProperty(s) && (l[s].onmouseenter = null)
} else if (t.isStampOfQfz) for (var c = 0; c < t.qfzSeal.length; c++) {
var u = t.qfzSeal[c], d = n.id + "-" + u.page, h = e.pdfViewer.getPageView(u.page - 1).pdfPage.tempStamps;
h.hasOwnProperty(d) && (h[d].onmouseenter = null)
} else {
var p = n.id, f = e.pdfViewer.getPageView(Number(t.page) - 1).pdfPage.tempStamps;
f.hasOwnProperty(p) && (f[p].onmouseenter = null)
}
}
}]), e
}();
t.default = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.activeSealClassName = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.arrayDeepCopy = f, t.eventPreventDefault = m, t.sealSectionId = v, t.createSealSection = g, t.removeSealSection = y;
var i = n(16), a = h(n(17)), o = n(2), s = h(n(56)), l = h(n(182)), c = n(37), u = n(62), d = n(69);
function h(e) {
return e && e.__esModule ? e : {default: e}
}
var p = t.activeSealClassName = "stamp";
function f(e) {
var t = [];
return e.forEach(function (e, n) {
for (var r in t.push({}), e) e.hasOwnProperty(r) && (t[n][r] = e[r])
}), t
}
function m(e) {
e.preventDefault()
}
function v(e) {
return e + "-" + (new Date).getTime()
}
function g(e, t, n, r, i, a, o) {
var s = document.createElement("section");
s.setAttribute("data-annotation-id", n), s.id = t, s.className = r, s.style.width = e.width + "px", s.style.height = e.height + "px";
var l = document.createElement("img");
return l.src = e.imgData || e.imgdata, l.style.width = "100%", l.style.height = "100%", l.style.opacity = "0.9", s.appendChild(l), (0, d.setSectionStyle)(s, o, i, a), s
}
function y(e) {
var t = document.getElementsByClassName(e);
0 !== t.length && t[0].parentNode.removeChild(t[0])
}
function b(e, t, n, r, i, a) {
var o = arguments.length > 6 && void 0 !== arguments[6] && arguments[6], s = arguments[7], l = e.getContext("2d"),
c = e.width, u = e.height;
l.fillStyle = "#FFFFFF", l.fillRect(0, 0, c, u), l.fillStyle = n, l.fillRect(0, 0, c, u);
var d = (u - t * (r + 1)) / r;
if (l.font = "normal normal normal " + a + "px SimSun serif", l.textAlign = "center", l.textBaseline = "middle", o) {
l.fillStyle = "#FFFFFF";
var h = .16 * (c - 2 * t), p = u - 2 * t;
l.fillRect(t, t, h, p);
for (var f = 0; f < r; f++) l.fillStyle = "#FFFFFF", l.fillRect(h + 2 * t, t * (f + 1) + d * f, c - h - 3 * t, d), i && i[f] && (l.fillStyle = n, l.fillText(i[f], h + 2 * t + (c - h - 3 * t) / 2, t * (f + 1.5) + d * (f + .5), c - h - 4 * t));
l.fillStyle = n;
var m = 0;
switch (s.length) {
case 1:
m = 1.8;
break;
case 2:
m = 1.4;
break;
case 3:
m = 1.2;
break;
default:
m = 0
}
for (var v = 0; v < s.length; v++) l.fillText(s[v], h / 2 + t, (v + 1) * (p / s.length) - a * m / s.length)
} else for (var g = 0; g < r; g++) l.fillStyle = "#FFFFFF", l.fillRect(t, t * (g + 1) + d * g, c - 2 * t, d), i && i[g] && (l.fillStyle = n, l.fillText(i[g], c / 2, t * (g + 1.5) + d * (g + .5), c - 3 * t))
}
var w = function () {
function e(t, n) {
var r = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.overlayName, this.container = t.container;
var i = window.KGPdfViewerWebApp.btnPositionConfig, a = i.toolbar, s = i.sidebar;
this.docSave = t.docSave, a.indexOf("docSave") > -1 && (this.docSave.removeAttribute("hidden"), this.docSave.onclick = this.save.bind(this)), this.secondaryDocSave = t.secondaryDocSave, s.indexOf("docSave") > -1 && (this.secondaryDocSave.removeAttribute("hidden"), this.secondaryDocSave.onclick = this.save.bind(this)), this.docSaveAs = t.docSaveAs, a.indexOf("docSaveAs") > -1 && (this.docSaveAs.removeAttribute("hidden"), this.docSaveAs.onclick = this.saveAs.bind(this)), this.secondaryDocSaveAs = t.secondaryDocSaveAs, s.indexOf("docSaveAs") > -1 && (this.secondaryDocSaveAs.removeAttribute("hidden"), this.secondaryDocSaveAs.onclick = this.saveAs.bind(this)), this.textToSealCanvasContainer = t.textToSealCanvasContainer, this.indicateSealCanvasContainer = t.indicateSealCanvasContainer, this.invariantSealCanvasContainer = t.invariantSealCanvasContainer, this.textToSealCanvas = t.textToSealCanvas, this.indicateSealCanvas = t.indicateSealCanvas, this.invariantSealCanvas = t.invariantSealCanvas, this.textToSealContainer = t.textToSealContainer, this.textToSealText = t.textToSealText, this.textToSealNum = t.textToSealNum, this.textToSealDate = t.textToSealDate, this.textToSealColor = t.textToSealColor, this.indicateSealContainer = t.indicateSealContainer, this.indicateSealText = t.indicateSealText, this.indicateSealNum = t.indicateSealNum, this.indicateSealDate = t.indicateSealDate, this.indicateSealColor = t.indicateSealColor, this.invariantSealContainer = t.invariantSealContainer, this.button = t.button, a.indexOf("textToSeal") > -1 && (this.button.removeAttribute("hidden"), this.button.onclick = this.open.bind(this)), this.secondaryButton = t.secondaryButton, s.indexOf("textToSeal") > -1 && (this.secondaryButton.removeAttribute("hidden"), this.secondaryButton.onclick = this.open.bind(this)), this.exportBtn = t.exportBtn, a.indexOf("exportAnnotations") > -1 && (this.exportBtn.removeAttribute("hidden"), this.exportBtn.onclick = function () {
r.export(function (e) {
window.KGPdfViewerWebApp.exportKGAnnotations(e)
})
}), this.secondaryExportBtn = t.secondaryExportBtn, s.indexOf("exportAnnotations") > -1 && (this.secondaryExportBtn.removeAttribute("hidden"), this.secondaryExportBtn.onclick = function () {
r.export(function (e) {
window.KGPdfViewerWebApp.exportKGAnnotations(e)
})
}), this.showTextToSealBtn = t.showTextToSealBtn, this.showIndicateSealBtn = t.showIndicateSealBtn, this.showInvariantSealBtn = t.showInvariantSealBtn, this.okButton = t.okButton, this.cancelButton = t.cancelButton, this.seals = [], this.activeSeal = null, this.movingData = {
offsetX: 0,
offsetY: 0,
isMoving: !1,
movingSealSection: null
}, this.app = n, this.overlayManager = this.app.overlayManager, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0), this.showTextToSealBtn.onclick = this.showTextToSeal.bind(this), this.showIndicateSealBtn.onclick = this.showIndicateSeal.bind(this), this.showInvariantSealBtn.onclick = this.showInvariantSeal.bind(this), this.okButton.onclick = this.ok.bind(this), this.cancelButton.onclick = this.close.bind(this), this.export = this.export.bind(this), window.exportKGAnnotations = this.export, document.body.addEventListener("click", u.removeStampMenu), l.default.path = "./stamp/laydate/", this.onDocumentContextmenu = this.onDocumentContextmenu.bind(this), this.onDocumentClick = this.onDocumentClick.bind(this), this.onMouseMove = this.onMouseMove.bind(this), this.createRightMenu = this.createRightMenu.bind(this), this.handleTextToSealDateChange = this.handleTextToSealDateChange.bind(this), this.handleIndicateSealDateChange = this.handleIndicateSealDateChange.bind(this), this.drawTextToSeal = this.drawTextToSeal.bind(this), this.drawIndicateSeal = this.drawIndicateSeal.bind(this), this.handleSealOnMoveStart = this.handleSealOnMoveStart.bind(this), this.handleSealOnMoving = this.handleSealOnMoving.bind(this), this.handleSealOnMoveEnd = this.handleSealOnMoveEnd.bind(this), this.textToSealText.oninput = this.textToSealNum.oninput = this.textToSealDate.onchange = this.textToSealColor.onchange = this.drawTextToSeal, this.indicateSealText.oninput = this.indicateSealNum.oninput = this.indicateSealDate.onchange = this.indicateSealColor.onchange = this.drawIndicateSeal, this.textToSealText.onblur = this.textToSealNum.onblur = this.textToSealDate.onblur = this.textToSealColor.onblur = this.indicateSealText.onblur = this.indicateSealNum.onblur = this.indicateSealDate.onblur = this.indicateSealColor.onblur = o.scrollToResizeScreen
}
return r(e, [{
key: "init", value: function () {
this.textToSealText.value = window.KGPdfViewerWebApp.textToSealDefault.textToSealText, this.indicateSealText.value = window.KGPdfViewerWebApp.textToSealDefault.indicateSealText, this.textToSealNum.value = window.KGPdfViewerWebApp.textToSealDefault.textToSealNum, this.indicateSealNum.value = window.KGPdfViewerWebApp.textToSealDefault.indicateSealNum, l.default.render({
elem: this.textToSealDate,
value: new Date,
format: "yyyy年M月d日",
showBottom: !1,
done: this.handleTextToSealDateChange,
ready: this.handleTextToSealDateChange
}), l.default.render({
elem: this.indicateSealDate,
value: new Date,
format: "yyyy年M月d日",
showBottom: !1,
done: this.handleIndicateSealDateChange,
ready: this.handleIndicateSealDateChange
}), this.textToSealDate.value = (0, s.default)().format("YYYY年M月D日"), this.indicateSealDate.value = (0, s.default)().format("YYYY年M月D日"), this.textToSealColor.jscolor.fromString(window.KGPdfViewerWebApp.textToSealDefault.color.slice(1)), this.indicateSealColor.jscolor.fromString(window.KGPdfViewerWebApp.textToSealDefault.color.slice(1)), this.showTextToSeal()
}
}, {
key: "handleTextToSealDateChange", value: function (e) {
this.textToSealDate.value = "string" == typeof e ? e : e.year + "年" + e.month + "月" + e.date + "日", this.drawTextToSeal()
}
}, {
key: "handleIndicateSealDateChange", value: function (e) {
this.indicateSealDate.value = "string" == typeof e ? e : e.year + "年" + e.month + "月" + e.date + "日", this.drawIndicateSeal()
}
}, {
key: "open", value: function () {
var e = this;
null == this.activeSeal && this.overlayManager.open(this.overlayName).then(function () {
e.init()
})
}
}, {
key: "close", value: function () {
var e = this;
return this.overlayManager.close(this.overlayName).then(function () {
e.textToSealColor.jscolor.hide(), e.indicateSealColor.jscolor.hide()
})
}
}, {
key: "ok", value: function () {
var e = this, t = void 0, n = void 0;
"block" === this.textToSealContainer.style.display ? (t = this.textToSealCanvas, n = window.KGPdfViewerWebApp.textToSealDefault.textToSealType) : "block" === this.indicateSealContainer.style.display ? (t = this.indicateSealCanvas, n = window.KGPdfViewerWebApp.textToSealDefault.indicateSealType) : (t = this.invariantSealCanvas, n = window.KGPdfViewerWebApp.textToSealDefault.invariantSealType);
var r = t.toDataURL("image/png", 1);
return window.KGPdfViewerWebApp.transparentImg(r).then(function (i) {
if (!i || "string" != typeof i) return Promise.reject("生成印章失败");
e.activeSeal = {
originImgData: r,
imgData: "data:image/png;base64," + i,
width: .25 * t.width,
height: .25 * t.height,
customType: n
}, document.body.style.cursor = "move"
}).then(function () {
return e.close()
}).then(function () {
e.documentEventRegister(!0)
}).catch(function (t) {
e.close().then(function () {
e.app.KGAlertPrompt.open(t)
})
})
}
}, {
key: "documentEventRegister", value: function (e) {
e ? (document.body.addEventListener("contextmenu", this.onDocumentContextmenu), document.body.addEventListener("mousedown", this.onDocumentClick), document.body.addEventListener("mousemove", this.onMouseMove), this.sealSectionEventRegister(!1)) : (document.body.removeEventListener("contextmenu", this.onDocumentContextmenu), document.body.removeEventListener("mousedown", this.onDocumentClick), document.body.removeEventListener("mousemove", this.onMouseMove), this.sealSectionEventRegister(!0))
}
}, {
key: "handleSealOnMoveStart", value: function (e) {
e && "IMG" === e.target.nodeName && 0 === e.button && (this.movingData.movingSealSection = e.target.parentNode, this.movingData.offsetX = e.offsetX, this.movingData.offsetY = e.offsetY, this.movingData.isMoving = !0, this.movingData.movingSealSection.querySelector("img").style.opacity = .9)
}
}, {
key: "handleSealOnMoving", value: function (e) {
var t = this;
if (this.movingData.isMoving) {
var n = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (n) {
var r = n.pageX, a = n.pageY, o = n.pageNumber, s = this.app.pdfViewer.getPageView(Number(o) - 1),
l = s.annotationLayer, u = s.viewport.scale, h = this.seals.filter(function (e) {
return e.section.id === t.movingData.movingSealSection.id
})[0];
if (h && !h.hasSaved && (h.left = r / u - this.movingData.offsetX, h.top = a / u - this.movingData.offsetY, (0, d.setSectionStyle)(this.movingData.movingSealSection, u, h.left, h.top), Number(h.page) > 1 && Number(o) < Number(h.page) || Number(h.page) < this.app.pagesCount && Number(o) > Number(h.page))) {
this.movingData.movingSealSection.parentNode.removeChild(this.movingData.movingSealSection), l.div || (l.div = document.createElement("div"), l.div.className = "annotationLayer", s.div.appendChild(l.div)), l.div.appendChild(this.movingData.movingSealSection);
var p = this.app.pdfViewer.getPageView(Number(h.page) - 1);
p.deleteStampCallback = function () {
var e = p.div.querySelector(".canvasWrapper"), n = p.div.querySelector(".textLayer");
e && p.div.removeChild(e), n && p.div.removeChild(n);
var r = t.app.pdfThumbnailViewer.getThumbnail(p.pdfPage.pageIndex);
r.renderingState = i.RenderingStates.INITIAL, r.setImage(p)
}, p.renderingState = i.RenderingStates.INITIAL, p.renderingQueue.renderView(p);
for (var f = 0; f < p.pdfPage.textToSeals.length; f++) if (p.pdfPage.textToSeals[f].section.id === h.section.id) {
p.pdfPage.textToSeals.splice(f, 1);
break
}
h.page = o, s.pdfPage.textToSeals.push(h)
}
}
}
}
}, {
key: "handleSealOnMoveEnd", value: function (e) {
var t = this;
if (this.movingData.isMoving) {
this.movingData.isMoving = !1;
var n = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (n) {
var r = n.pageNumber, a = this.app.pdfViewer.getPageView(Number(r) - 1);
a.deleteStampCallback = function () {
var e = a.div.querySelector(".canvasWrapper"), n = a.div.querySelector(".textLayer");
e && a.div.removeChild(e), n && a.div.removeChild(n), t.movingData.movingSealSection.querySelector("img").style.opacity = 0;
var r = t.app.pdfThumbnailViewer.getThumbnail(a.pdfPage.pageIndex);
r.renderingState = i.RenderingStates.INITIAL, r.setImage(a)
}, a.renderingState = i.RenderingStates.INITIAL, a.renderingQueue.renderView(a)
}
}
}
}, {
key: "sealSectionEventRegister", value: function (e) {
var t = this;
e ? (this.seals.forEach(function (e) {
e.section && e.section.addEventListener("mousedown", t.handleSealOnMoveStart)
}), document.body.addEventListener("mousemove", this.handleSealOnMoving), document.body.addEventListener("mouseup", this.handleSealOnMoveEnd)) : (this.seals.forEach(function (e) {
e.section && e.section.removeEventListener("mouseout", t.handleSealOnMoveStart)
}), document.body.removeEventListener("mousemove", this.handleSealOnMoving), document.body.removeEventListener("mouseup", this.handleSealOnMoveEnd))
}
}, {
key: "onMouseMove", value: function (e) {
var t = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (t) {
var n = t.node, r = t.pageNumber, i = t.pageX, a = t.pageY, o = v(r);
n.style.overflow = "hidden";
var s = this.app.pdfViewer.getPageView(r - 1), l = s.annotationLayer, u = s.viewport.scale;
if (l.div || (l.div = document.createElement("div"), l.div.className = "annotationLayer", n.appendChild(l.div)), i > 0 && a > 0) {
this.activeSeal.section = document.getElementById(o);
var h = i / u - this.activeSeal.width / 2, f = a / u - this.activeSeal.height / 2;
if (this.activeSeal.section) (0, d.setSectionStyle)(this.activeSeal.section, u, h, f); else {
y(p);
var m = (new Date).getTime();
this.activeSeal.section = g(this.activeSeal, o, m, p, h, f, u), l.div.appendChild(this.activeSeal.section)
}
} else y(p)
} else y(p)
}
}, {
key: "onDocumentContextmenu", value: function (e) {
e.preventDefault(), y(p), this.activeSeal = null, document.body.style.cursor = "default", this.documentEventRegister(!1)
}
}, {
key: "onDocumentClick", value: function (e) {
if (e && 0 === e.button) {
var t = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (t) {
var n = t.pageNumber, r = t.pageX, i = t.pageY, a = this.app.pdfViewer.getPageView(n - 1),
o = a.pdfPage.textToSeals;
if (r < 0 || r > a.width || i < 0 || i > a.height) return;
this.activeSeal.section.setAttribute("class", "stampAnnotation"), this.activeSeal.left = (0, c.getNumbOfPx)(this.activeSeal.section.style.left), this.activeSeal.top = (0, c.getNumbOfPx)(this.activeSeal.section.style.top), this.activeSeal.width = (0, c.getNumbOfPx)(this.activeSeal.section.style.width), this.activeSeal.height = (0, c.getNumbOfPx)(this.activeSeal.section.style.height), this.activeSeal.page = n, this.activeSeal.createTime = (0, s.default)().format("YYYY-MM-DD HH:mm:ss"), this.activeSeal.section.style.zIndex = "2", this.seals.push(this.activeSeal), o.push(this.activeSeal), this.activeSeal.section.querySelector("img").addEventListener("mousedown", m), this.activeSeal.section.querySelector("img").addEventListener("contextmenu", this.createRightMenu), this.updateUI(a, this.activeSeal.section), window.KGPdfViewerWebApp.textToSealCb(), this.onDocumentContextmenu(e)
}
}
}
}, {
key: "updateUI", value: function (e, t) {
var n = e.pdfPage, r = e.canvas, a = e.viewport, o = t.querySelector("img");
o.style.opacity = 0;
var s = r.getContext("2d");
s.globalCompositeOperation = "multiply", "multiply" !== s.globalCompositeOperation && (s.globalAlpha = .85);
var l = a.scale * (e.canvas.width / e.canvas.offsetWidth), u = ((0, c.getNumbOfPx)(t.style.left) + 1) * l,
d = ((0, c.getNumbOfPx)(t.style.top) + 1) * l, h = (0, c.getNumbOfPx)(t.style.width) * l,
p = (0, c.getNumbOfPx)(t.style.height) * l;
s.drawImage(o, u, d, h, p);
var f = this.app.pdfThumbnailViewer.getThumbnail(n.pageIndex);
f.renderingState = i.RenderingStates.INITIAL, f.setImage(e)
}
}, {
key: "createRightMenu", value: function (e) {
if (e && "IMG" === e.target.nodeName) {
e.preventDefault();
var t = e.target.parentNode, n = this.seals.filter(function (e) {
return e.section.id === t.id
})[0];
if (n) {
if (n.hasSaved) return;
(0, u.removeStampMenu)();
var r = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar), a = r.pageNumber, o = r.pageX,
s = r.pageY, l = this.app.pdfViewer.getPageView(a - 1), d = document.createElement("div");
d.id = "rightMenu", d.style.position = "absolute", d.style["background-color"] = "white", d.style.border = "1px solid #999", d.style.zIndex = "200", l.viewport.width < parseFloat(o) + 94 && (o -= 94), l.viewport.height < parseFloat(s) + 70 && (s -= 70), d.style.top = s + "px", d.style.left = o + "px";
var h = document.createElement("span");
h.classList.add("menuDeleteSeal"), h.setAttribute("data-l10n-id", "menuDeleteSeal"), d.appendChild(h), h.addEventListener("contextmenu", m), h.addEventListener("click", function () {
var t = this;
(0, u.removeStampMenu)();
var n = e.target.parentNode;
n.parentNode.removeChild(n);
for (var r = this.seals.filter(function (e) {
return e.section.id === n.id
})[0], a = this.app.pdfViewer.getPageView(r.page - 1), o = a.pdfPage.textToSeals, s = 0; s < o.length; s++) if (o[s].section.id === r.section.id) {
o.splice(s, 1);
break
}
for (var l = 0; l < this.seals.length; l++) if (this.seals[l].section.id === n.id) {
this.seals.splice(l, 1);
break
}
a.deleteStampCallback = function () {
var e = a.div.querySelector(".canvasWrapper"), n = a.div.querySelector(".textLayer");
e && a.div.removeChild(e), n && a.div.removeChild(n);
var r = t.app.pdfThumbnailViewer.getThumbnail(a.pdfPage.pageIndex);
r.renderingState = i.RenderingStates.INITIAL, r.setImage(a)
}, a.renderingState = i.RenderingStates.INITIAL, a.renderingQueue.renderView(a)
}.bind(this)), l.div.appendChild(d), this.app.l10n.translate(d)
}
}
}
}, {
key: "showTextToSeal", value: function () {
switch (this.app.l10n._lang) {
case"zh-TW":
this.container.querySelector(".kgtitle").innerHTML = "轉文章";
break;
case"en-US":
this.container.querySelector(".kgtitle").innerHTML = "TextToSeal";
break;
default:
this.container.querySelector(".kgtitle").innerHTML = "转文章"
}
this.showTextToSealBtn.setAttribute("class", "selected"), this.showTextToSealBtn.parentNode.style.borderBottomColor = "#fff", this.textToSealContainer.style.display = "block", this.showInvariantSealBtn.removeAttribute("class"), this.showInvariantSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.invariantSealContainer.style.display = "none", this.showIndicateSealBtn.removeAttribute("class"), this.showIndicateSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.indicateSealContainer.style.display = "none", this.drawTextToSeal()
}
}, {
key: "showIndicateSeal", value: function () {
switch (this.app.l10n._lang) {
case"zh-TW":
this.container.querySelector(".kgtitle").innerHTML = "批示章";
break;
case"en-US":
this.container.querySelector(".kgtitle").innerHTML = "IndicateSeal";
break;
default:
this.container.querySelector(".kgtitle").innerHTML = "批示章"
}
this.showIndicateSealBtn.setAttribute("class", "selected"), this.indicateSealContainer.style.display = "block", this.showIndicateSealBtn.parentNode.style.borderBottomColor = "#fff", this.showTextToSealBtn.removeAttribute("class"), this.textToSealContainer.style.display = "none", this.showTextToSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.showInvariantSealBtn.removeAttribute("class"), this.showInvariantSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.invariantSealContainer.style.display = "none", this.drawIndicateSeal()
}
}, {
key: "showInvariantSeal", value: function () {
switch (this.app.l10n._lang) {
case"zh-TW":
this.container.querySelector(".kgtitle").innerHTML = "固定章";
break;
case"en-US":
this.container.querySelector(".kgtitle").innerHTML = "InvariantSeal";
break;
default:
this.container.querySelector(".kgtitle").innerHTML = "固定章"
}
this.showInvariantSealBtn.setAttribute("class", "selected"), this.invariantSealContainer.style.display = "block", this.showInvariantSealBtn.parentNode.style.borderBottomColor = "#fff", this.showTextToSealBtn.removeAttribute("class"), this.textToSealContainer.style.display = "none", this.showTextToSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.showIndicateSealBtn.removeAttribute("class"), this.showIndicateSealBtn.parentNode.style.borderBottomColor = "rgb(153, 153, 153)", this.indicateSealContainer.style.display = "none", this.drawInvariantSeal()
}
}, {
key: "drawTextToSeal", value: function () {
var e = this.textToSealCanvas;
b(e, 7, "#" + this.textToSealColor.value, 3, [this.textToSealText.value, "第 " + this.textToSealNum.value + " 号", this.textToSealDate.value], Math.ceil(e.width / 9))
}
}, {
key: "drawIndicateSeal", value: function () {
var e = this.indicateSealCanvas, t = "#" + this.indicateSealColor.value, n = this.indicateSealText.value;
b(e, 7, t, 2, ["网第 " + this.indicateSealNum.value + " 号", this.indicateSealDate.value], Math.ceil(e.width / 9), !0, n)
}
}, {
key: "drawInvariantSeal", value: function () {
var e = this.invariantSealCanvas, t = window.KGPdfViewerWebApp.textToSealDefault.invariantSealImgPath,
n = new Image;
n.onload = function () {
var t = e.getContext("2d");
function r(r) {
t.drawImage(n, 0, 0, n.width, n.height, (e.width - n.width * r * 4) / 2, (e.height - n.height * r * 4) / 2, n.width * r * 4, n.height * r * 4)
}
var i = e.height / e.width, a = n.height / n.width;
t.fillStyle = "#FFFFFF", t.fillRect(0, 0, e.width, e.height), a <= i && n.width > n.height ? r(e.width / (4 * n.width)) : r(e.height / (4 * n.height))
}, n.src = t
}
}, {
key: "export", value: function (e) {
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], i = f(this.seals),
o = f(this.app.kgAnnotationViewer.annotationList),
l = "D:" + (0, s.default)().format("YYYYMMDDHHmmss") + "+08'00'";
r || (i = i.filter(function (e) {
return !e.hasSaved
})), i.forEach(function (e) {
var t;
t = window.KGPdfViewerWebApp.PDFViewerApplication.pdfViewer.getPageView(Number(e.page) - 1).viewport.viewBox[3] - e.height - e.top, e.x = e.left, e.y = t, e.styleId = "12", e.styleName = "Stamp", e.pageNo = e.page, e.curDateTime = l, e.authorName = window.KGPdfViewerWebApp.userId, e.annotInfo = JSON.stringify({
customType: e.customType,
type: e.styleName,
author: e.authorName
});
var n = e.originImgData.split(",")[1];
e.annotSignature = a.default.parse(n).toString(), delete e.customType, delete e.top, delete e.left, delete e.section, delete e.page, delete e.imgData, delete e.originImgData, delete e.hasSaved
}), o.forEach(function (e) {
var t;
t = window.KGPdfViewerWebApp.PDFViewerApplication.pdfViewer.getPageView(Number(e.page) - 1).viewport.viewBox[3] - e.height - e.y, e.y = t, e.styleId = "12", e.styleName = "Stamp", e.pageNo = e.page, e.curDateTime = l, delete e.page
});
var c = void 0;
if (c = t ? JSON.stringify({d: i.concat(o)}).slice(5, -1) : JSON.stringify({d: i}).slice(5, -1), n && this.seals.forEach(function (e) {
e.hasSaved = !0
}), !e) return c;
e(c)
}
}, {
key: "save", value: function () {
var e = window.KGPdfViewerWebApp.getTipPrompt(),
t = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt;
e.open("正在合并文档..."), this.export(function (n) {
window.KGPdfViewerWebApp.saveAnnotations(n).then(function (n) {
e.close(), "status" in n && !1 === n.status && t.open(n.message)
})
}, !1, !0, !1)
}
}, {
key: "saveAs", value: function () {
this.export(function (e) {
window.KGPdfViewerWebApp.saveAnnotations(e, !0)
}, !1, !1, !1)
}
}]), e
}();
t.default = w
}, function (e, t, n) {
"use strict";
var r = n(23), i = n(7), a = n(47);
e.exports = function (e) {
return function (t, n, o) {
var s, l = r(t), c = i(l.length), u = a(o, c);
if (e && n != n) {
for (; c > u;) if ((s = l[u++]) != s) return !0
} else for (; c > u; u++) if ((e || u in l) && l[u] === n) return e || u || 0;
return !e && -1
}
}
}, function (e, t, n) {
"use strict";
t.f = Object.getOwnPropertySymbols
}, function (e, t, n) {
"use strict";
var r = n(27);
e.exports = Array.isArray || function (e) {
return "Array" == r(e)
}
}, function (e, t, n) {
"use strict";
var r = n(28), i = n(31);
e.exports = function (e) {
return function (t, n) {
var a, o, s = String(i(t)), l = r(n), c = s.length;
return l < 0 || l >= c ? e ? "" : void 0 : (a = s.charCodeAt(l)) < 55296 || a > 56319 || l + 1 === c || (o = s.charCodeAt(l + 1)) < 56320 || o > 57343 ? e ? s.charAt(l) : a : e ? s.slice(l, l + 2) : o - 56320 + (a - 55296 << 10) + 65536
}
}
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(27), a = n(6)("match");
e.exports = function (e) {
var t;
return r(e) && (void 0 !== (t = e[a]) ? !!t : "RegExp" == i(e))
}
}, function (e, t, n) {
"use strict";
var r = n(6)("iterator"), i = !1;
try {
var a = [7][r]();
a.return = function () {
i = !0
}, Array.from(a, function () {
throw 2
})
} catch (e) {
}
e.exports = function (e, t) {
if (!t && !i) return !1;
var n = !1;
try {
var a = [7], o = a[r]();
o.next = function () {
return {done: n = !0}
}, a[r] = function () {
return o
}, e(a)
} catch (e) {
}
return n
}
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(58), a = RegExp.prototype.exec;
e.exports = function (e, t) {
var n = e.exec;
if ("function" == typeof n) {
var o = n.call(e, t);
if ("object" !== (void 0 === o ? "undefined" : r(o))) throw new TypeError("RegExp exec method returned something other than an Object or null");
return o
}
if ("RegExp" !== i(e)) throw new TypeError("RegExp#exec called on incompatible receiver");
return a.call(e, t)
}
}, function (e, t, n) {
"use strict";
n(148);
var r = n(19), i = n(18), a = n(4), o = n(31), s = n(6), l = n(112), c = s("species"), u = !a(function () {
var e = /./;
return e.exec = function () {
var e = [];
return e.groups = {a: "7"}, e
}, "7" !== "".replace(e, "$<a>")
}), d = function () {
var e = /(?:)/, t = e.exec;
e.exec = function () {
return t.apply(this, arguments)
};
var n = "ab".split(e);
return 2 === n.length && "a" === n[0] && "b" === n[1]
}();
e.exports = function (e, t, n) {
var h = s(e), p = !a(function () {
var t = {};
return t[h] = function () {
return 7
}, 7 != ""[e](t)
}), f = p ? !a(function () {
var t = !1, n = /a/;
return n.exec = function () {
return t = !0, null
}, "split" === e && (n.constructor = {}, n.constructor[c] = function () {
return n
}), n[h](""), !t
}) : void 0;
if (!p || !f || "replace" === e && !u || "split" === e && !d) {
var m = /./[h], v = n(o, h, ""[e], function (e, t, n, r, i) {
return t.exec === l ? p && !i ? {done: !0, value: m.call(t, n, r)} : {
done: !0,
value: e.call(n, t, r)
} : {done: !1}
}), g = v[0], y = v[1];
r(String.prototype, e, g), i(RegExp.prototype, h, 2 == t ? function (e, t) {
return y.call(e, this, t)
} : function (e) {
return y.call(e, this)
})
}
}
}, function (e, t, n) {
"use strict";
var r = n(3).navigator;
e.exports = r && r.userAgent || ""
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(0), a = n(19), o = n(53), s = n(40), l = n(52), c = n(51), u = n(5), d = n(4), h = n(76),
p = n(57), f = n(98);
e.exports = function (e, t, n, m, v, g) {
var y = r[e], b = y, w = v ? "set" : "add", S = b && b.prototype, _ = {}, k = function (e) {
var t = S[e];
a(S, e, "delete" == e ? function (e) {
return !(g && !u(e)) && t.call(this, 0 === e ? 0 : e)
} : "has" == e ? function (e) {
return !(g && !u(e)) && t.call(this, 0 === e ? 0 : e)
} : "get" == e ? function (e) {
return g && !u(e) ? void 0 : t.call(this, 0 === e ? 0 : e)
} : "add" == e ? function (e) {
return t.call(this, 0 === e ? 0 : e), this
} : function (e, n) {
return t.call(this, 0 === e ? 0 : e, n), this
})
};
if ("function" == typeof b && (g || S.forEach && !d(function () {
(new b).entries().next()
}))) {
var x = new b, P = x[w](g ? {} : -0, 1) != x, C = d(function () {
x.has(1)
}), A = h(function (e) {
new b(e)
}), T = !g && d(function () {
for (var e = new b, t = 5; t--;) e[w](t, t);
return !e.has(-0)
});
A || ((b = t(function (t, n) {
c(t, b, e);
var r = f(new y, t, b);
return void 0 != n && l(n, v, r[w], r), r
})).prototype = S, S.constructor = b), (C || T) && (k("delete"), k("has"), v && k("get")), (T || P) && k(w), g && S.clear && delete S.clear
} else b = m.getConstructor(t, e, v, w), o(b.prototype, n), s.NEED = !0;
return p(b, e), _[e] = b, i(i.G + i.W + i.F * (b != y), _), g || m.setStrong(b, e, v), b
}
}, function (e, t, n) {
"use strict";
for (var r, i = n(3), a = n(18), o = n(45), s = o("typed_array"), l = o("view"), c = !(!i.ArrayBuffer || !i.DataView), u = c, d = 0, h = "Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(","); d < 9;) (r = i[h[d++]]) ? (a(r.prototype, s, !0), a(r.prototype, l, !0)) : u = !1;
e.exports = {ABV: c, CONSTR: u, TYPED: s, VIEW: l}
}, function (e, t, n) {
"use strict";
e.exports = n(39) || !n(4)(function () {
var e = Math.random();
__defineSetter__.call(null, e, function () {
}), delete n(3)[e]
})
}, function (e, t, n) {
"use strict";
var r = n(0);
e.exports = function (e) {
r(r.S, e, {
of: function () {
for (var e = arguments.length, t = new Array(e); e--;) t[e] = arguments[e];
return new this(t)
}
})
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(15), a = n(26), o = n(52);
e.exports = function (e) {
r(r.S, e, {
from: function (e) {
var t, n, r, s, l = arguments[1];
return i(this), (t = void 0 !== l) && i(l), void 0 == e ? new this : (n = [], t ? (r = 0, s = a(l, arguments[2], 2), o(e, !1, function (e) {
n.push(s(e, r++))
})) : o(e, !1, n.push, n), new this(n))
}
})
}
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
var t, n, r, i, a, o, s;
return n = (t = e).lib, r = n.Base, i = n.WordArray, a = t.algo, o = a.MD5, s = a.EvpKDF = r.extend({
cfg: r.extend({
keySize: 4,
hasher: o,
iterations: 1
}), init: function (e) {
this.cfg = this.cfg.extend(e)
}, compute: function (e, t) {
for (var n, r = this.cfg, a = r.hasher.create(), o = i.create(), s = o.words, l = r.keySize, c = r.iterations; s.length < l;) {
n && a.update(n), n = a.update(e).finalize(t), a.reset();
for (var u = 1; u < c; u++) n = a.finalize(n), a.reset();
o.concat(n)
}
return o.sigBytes = 4 * l, o
}
}), t.EvpKDF = function (e, t, n) {
return s.create(n).compute(e, t)
}, e.EvpKDF
}, "object" === s(t) ? e.exports = t = o(n(12), n(173), n(174)) : (i = [n(12), n(173), n(174)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.getPhone = t.verifyKeySn = t.sendCaptcha = t.getFontList = void 0;
var r = n(21), i = n(2), a = [{en: "Network Error", zh: "网络错误"}];
function o(e) {
window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e)
}
var s = r.axios.create({headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}});
s.interceptors.response.use(function (e) {
return e.data && !1 === e.data.status ? ((0, i.closeOverlay)().then(function () {
o(e.data.message || "程序异常,请联系管理员!")
}), Promise.reject()) : e.data
}, function (e) {
if (e.message) {
var t = a.filter(function (t) {
return e.message.indexOf(t.en) > -1
})[0];
o(t ? t.zh : e.message)
} else o("程序异常,请联系管理员!");
return Promise.reject(e)
}), t.getFontList = function () {
return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "getFonts",
documentId: window.KGPdfViewerWebApp.documentId,
docType: window.KGPdfViewerWebApp.docType
}))
}, t.sendCaptcha = function () {
return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "sendCaptcha",
keySN: window.KGPdfViewerWebApp.userId
}))
}, t.verifyKeySn = function (e) {
var t = window.KGPdfViewerWebApp, n = t.userCode, r = t.isCa3, a = t.mobile, o = t.fileType;
return n && r && "OFD" === o.toUpperCase() && 0 == a ? s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "verifyKeySn",
keySN: e,
userCode: n
})) : Promise.resolve()
}, t.getPhone = function () {
return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({
action: "getPhone",
keySN: window.KGPdfViewerWebApp.userId
})).then(function (e) {
return e.phone
})
}
}, function (e, t, n) {
"use strict";
var r = n(38), i = n(38).buildOptions, a = n(455);
"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, r.nameRegexp);
!Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt), !Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
var o = {
attributeNamePrefix: "@_",
attrNodeName: !1,
textNodeName: "#text",
ignoreAttributes: !0,
ignoreNameSpace: !1,
allowBooleanAttributes: !1,
parseNodeValue: !0,
parseAttributeValue: !1,
arrayMode: !1,
trimValues: !0,
cdataTagName: !1,
cdataPositionChar: "\\c",
tagValueProcessor: function (e, t) {
return e
},
attrValueProcessor: function (e, t) {
return e
},
stopNodes: []
};
t.defaultOptions = o;
var s = ["attributeNamePrefix", "attrNodeName", "textNodeName", "ignoreAttributes", "ignoreNameSpace", "allowBooleanAttributes", "parseNodeValue", "parseAttributeValue", "arrayMode", "trimValues", "cdataTagName", "cdataPositionChar", "tagValueProcessor", "attrValueProcessor", "parseTrueNumberOnly", "stopNodes"];
function l(e, t, n) {
return t && (n.trimValues && (t = t.trim()), t = u(t = n.tagValueProcessor(t, e), n.parseNodeValue, n.parseTrueNumberOnly)), t
}
function c(e, t) {
if (t.ignoreNameSpace) {
var n = e.split(":"), r = "/" === e.charAt(0) ? "/" : "";
if ("xmlns" === n[0]) return "";
2 === n.length && (e = r + n[1])
}
return e
}
function u(e, t, n) {
if (t && "string" == typeof e) {
var i = void 0;
return "" === e.trim() || isNaN(e) ? i = "true" === e || "false" !== e && e : (-1 !== e.indexOf("0x") ? i = Number.parseInt(e, 16) : -1 !== e.indexOf(".") ? (i = Number.parseFloat(e), e = e.replace(/\.?0+$/, "")) : i = Number.parseInt(e, 10), n && (i = String(i) === e ? i : e)), i
}
return r.isExist(e) ? e : ""
}
t.props = s;
var d = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?", "g");
function h(e, t) {
if (!t.ignoreAttributes && "string" == typeof e) {
e = e.replace(/\r?\n/g, " ");
for (var n = r.getAllMatches(e, d), i = n.length, a = {}, o = 0; o < i; o++) {
var s = c(n[o][1], t);
s.length && (void 0 !== n[o][4] ? (t.trimValues && (n[o][4] = n[o][4].trim()), n[o][4] = t.attrValueProcessor(n[o][4], s), a[t.attributeNamePrefix + s] = u(n[o][4], t.parseAttributeValue, t.parseTrueNumberOnly)) : t.allowBooleanAttributes && (a[t.attributeNamePrefix + s] = !0))
}
if (!Object.keys(a).length) return;
if (t.attrNodeName) {
var l = {};
return l[t.attrNodeName] = a, l
}
return a
}
}
function p(e, t) {
for (var n = void 0, r = "", i = t; i < e.length; i++) {
var a = e[i];
if (n) a === n && (n = ""); else if ('"' === a || "'" === a) n = a; else {
if (">" === a) return {data: r, index: i};
"\t" === a && (a = " ")
}
r += a
}
}
function f(e, t, n, r) {
var i = e.indexOf(t, n);
if (-1 === i) throw new Error(r);
return i + t.length - 1
}
t.getTraversalObj = function (e, t) {
e = e.replace(/\r\n?/g, "\n"), t = i(t, o, s);
for (var n = new a("!xml"), c = n, u = "", d = 0; d < e.length; d++) if ("<" === e[d]) if ("/" === e[d + 1]) {
var m = f(e, ">", d, "Closing Tag is not closed."), v = e.substring(d + 2, m).trim();
if (t.ignoreNameSpace) {
var g = v.indexOf(":");
-1 !== g && (v = v.substr(g + 1))
}
c && (c.val ? c.val = r.getValue(c.val) + "" + l(v, u, t) : c.val = l(v, u, t)), t.stopNodes.length && t.stopNodes.includes(c.tagname) && (c.child = [], void 0 == c.attrsMap && (c.attrsMap = {}), c.val = e.substr(c.startIndex + 1, d - c.startIndex - 1)), c = c.parent, u = "", d = m
} else if ("?" === e[d + 1]) d = f(e, "?>", d, "Pi Tag is not closed."); else if ("!--" === e.substr(d + 1, 3)) d = f(e, "--\x3e", d, "Comment is not closed."); else if ("!D" === e.substr(d + 1, 2)) {
var y = f(e, ">", d, "DOCTYPE is not closed.");
d = e.substring(d, y).indexOf("[") >= 0 ? e.indexOf("]>", d) + 1 : y
} else if ("![" === e.substr(d + 1, 2)) {
var b = f(e, "]]>", d, "CDATA is not closed.") - 2, w = e.substring(d + 9, b);
if (u && (c.val = r.getValue(c.val) + "" + l(c.tagname, u, t), u = ""), t.cdataTagName) {
var S = new a(t.cdataTagName, c, w);
c.addChild(S), c.val = r.getValue(c.val) + t.cdataPositionChar, w && (S.val = w)
} else c.val = (c.val || "") + (w || "");
d = b + 2
} else {
var _ = p(e, d + 1), k = _.data, x = _.index, P = k.indexOf(" "), C = k;
if (-1 !== P && (C = k.substr(0, P).replace(/\s\s*$/, ""), k = k.substr(P + 1)), t.ignoreNameSpace) {
var A = C.indexOf(":");
-1 !== A && (C = C.substr(A + 1))
}
if (c && u && "!xml" !== c.tagname && (c.val = r.getValue(c.val) + "" + l(c.tagname, u, t)), k.length > 0 && k.lastIndexOf("/") === k.length - 1) {
k = "/" === C[C.length - 1] ? C = C.substr(0, C.length - 1) : k.substr(0, k.length - 1);
var T = new a(C, c, "");
C !== k && (T.attrsMap = h(k, t)), c.addChild(T)
} else {
var E = new a(C, c);
t.stopNodes.length && t.stopNodes.includes(E.tagname) && (E.startIndex = x), C !== k && (E.attrsMap = h(k, t)), c.addChild(E), c = E
}
u = "", d = x
} else u += e[d];
return n
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
t.ZINDEX = 200, t.CREATE_MODE = "create", t.EDIT_MODE = "edit", t.DEL_MODE = "delete", t.DEFAULT_AUTHOR = "kg-author", t.PARAMS_TOOLBAR_ID = "params-toolbar", t.TOOLBAR_SHAPE_LIST_ID = "params-toolbar-shape-list", t.SHAPE_ID_MAP = {rect: "toolbar-shape-rect"}, t.SHAPE_ICON_ID_MAP = {rect: "toolbar-shape-rect-icon"}, t.COLOR_ID = "params-toolbar-color", t.SHAPE_BORDER_ACTIVE_COLOR = "#1890ff", t.SHAPE_BORDER_COLOR = "#cccccc", t.PARAMS_TOOLBAR_HEIGHT = 48, t.DEFAULT_OPTIONS = {
viewerDomId: "viewer",
pageClassName: "page",
viewerContainerId: "viewerContainer",
pageNoAttrName: "data-page-number"
}, t.MASK_VIEWER_ID = "mask-viewer", t.MASK_PAGE_CLASSNAME = "mask-page"
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.getEventPath = function (e) {
var t = e.composedPath && e.composedPath() || e.path, n = e.target;
return null != t ? t.indexOf(window) < 0 ? t.concat(window) : t : n === window ? [window] : [n].concat(function e(t, n) {
n = n || [];
var r = t.parentNode;
return r ? e(r, n.concat(r)) : n
}(n, []), window)
}
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(3).document, a = r(i) && r(i.createElement);
e.exports = function (e) {
return a ? i.createElement(e) : {}
}
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(13), a = n(39), o = n(127), s = n(10).f;
e.exports = function (e) {
var t = i.Symbol || (i.Symbol = a ? {} : r.Symbol || {});
"_" == e.charAt(0) || e in t || s(t, e, {value: o.f(e)})
}
}, function (e, t, n) {
"use strict";
var r = n(64)("keys"), i = n(45);
e.exports = function (e) {
return r[e] || (r[e] = i(e))
}
}, function (e, t, n) {
"use strict";
e.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")
}, function (e, t, n) {
"use strict";
var r = n(3).document;
e.exports = r && r.documentElement
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(1), a = function (e, t) {
if (i(e), !r(t) && null !== t) throw TypeError(t + ": can't set as prototype!")
};
e.exports = {
set: Object.setPrototypeOf || ("__proto__" in {} ? function (e, t, r) {
try {
(r = n(26)(Function.call, n(24).f(Object.prototype, "__proto__").set, 2))(e, []), t = !(e instanceof Array)
} catch (e) {
t = !0
}
return function (e, n) {
return a(e, n), t ? e.__proto__ = n : r(e, n), e
}
}({}, !1) : void 0), check: a
}
}, function (e, t, n) {
"use strict";
var r = n(58), i = {};
i[n(6)("toStringTag")] = "z", i + "" != "[object z]" && n(19)(Object.prototype, "toString", function () {
return "[object " + r(this) + "]"
}, !0)
}, function (e, t, n) {
"use strict";
e.exports = "\t\n\v\f\r    \u2028\u2029\ufeff"
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(95).set;
e.exports = function (e, t, n) {
var a, o = t.constructor;
return o !== n && "function" == typeof o && (a = o.prototype) !== n.prototype && r(a) && i && i(e, a), e
}
}, function (e, t, n) {
"use strict";
var r = n(28), i = n(31);
e.exports = function (e) {
var t = String(i(this)), n = "", a = r(e);
if (a < 0 || a == 1 / 0) throw RangeError("Count can't be negative");
for (; a > 0; (a >>>= 1) && (t += t)) 1 & a && (n += t);
return n
}
}, function (e, t, n) {
"use strict";
e.exports = Math.sign || function (e) {
return 0 == (e = +e) || e != e ? e : e < 0 ? -1 : 1
}
}, function (e, t, n) {
"use strict";
var r = Math.expm1;
e.exports = !r || r(10) > 22025.465794806718 || r(10) < 22025.465794806718 || -2e-17 != r(-2e-17) ? function (e) {
return 0 == (e = +e) ? e : e > -1e-6 && e < 1e-6 ? e + e * e / 2 : Math.exp(e) - 1
} : r
}, function (e, t, n) {
"use strict";
var r = n(39), i = n(0), a = n(19), o = n(18), s = n(60), l = n(103), c = n(57), u = n(25), d = n(6)("iterator"),
h = !([].keys && "next" in [].keys()), p = function () {
return this
};
e.exports = function (e, t, n, f, m, v, g) {
l(n, t, f);
var y, b, w, S = function (e) {
if (!h && e in P) return P[e];
switch (e) {
case"keys":
case"values":
return function () {
return new n(this, e)
}
}
return function () {
return new n(this, e)
}
}, _ = t + " Iterator", k = "values" == m, x = !1, P = e.prototype, C = P[d] || P["@@iterator"] || m && P[m],
A = C || S(m), T = m ? k ? S("entries") : A : void 0, E = "Array" == t && P.entries || C;
if (E && (w = u(E.call(new e))) !== Object.prototype && w.next && (c(w, _, !0), r || "function" == typeof w[d] || o(w, d, p)), k && C && "values" !== C.name && (x = !0, A = function () {
return C.call(this)
}), r && !g || !h && !x && P[d] || o(P, d, A), s[t] = A, s[_] = p, m) if (y = {
values: k ? A : S("values"),
keys: v ? A : S("keys"),
entries: T
}, g) for (b in y) b in P || a(P, b, y[b]); else i(i.P + i.F * (h || x), t, y);
return y
}
}, function (e, t, n) {
"use strict";
var r = n(48), i = n(44), a = n(57), o = {};
n(18)(o, n(6)("iterator"), function () {
return this
}), e.exports = function (e, t, n) {
e.prototype = r(o, {next: i(1, n)}), a(e, t + " Iterator")
}
}, function (e, t, n) {
"use strict";
var r = n(75), i = n(31);
e.exports = function (e, t, n) {
if (r(t)) throw TypeError("String#" + n + " doesn't accept regex!");
return String(i(e))
}
}, function (e, t, n) {
"use strict";
var r = n(6)("match");
e.exports = function (e) {
var t = /./;
try {
"/./"[e](t)
} catch (n) {
try {
return t[r] = !1, !"/./"[e](t)
} catch (e) {
}
}
return !0
}
}, function (e, t, n) {
"use strict";
var r = n(60), i = n(6)("iterator"), a = Array.prototype;
e.exports = function (e) {
return void 0 !== e && (r.Array === e || a[i] === e)
}
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(44);
e.exports = function (e, t, n) {
t in e ? r.f(e, t, i(0, n)) : e[t] = n
}
}, function (e, t, n) {
"use strict";
var r = n(58), i = n(6)("iterator"), a = n(60);
e.exports = n(13).getIteratorMethod = function (e) {
if (void 0 != e) return e[i] || e["@@iterator"] || a[r(e)]
}
}, function (e, t, n) {
"use strict";
var r = n(278);
e.exports = function (e, t) {
return new (r(e))(t)
}
}, function (e, t, n) {
"use strict";
var r = n(11), i = n(47), a = n(7);
e.exports = function (e) {
for (var t = r(this), n = a(t.length), o = arguments.length, s = i(o > 1 ? arguments[1] : void 0, n), l = o > 2 ? arguments[2] : void 0, c = void 0 === l ? n : i(l, n); c > s;) t[s++] = e;
return t
}
}, function (e, t, n) {
"use strict";
var r = n(41), i = n(147), a = n(60), o = n(23);
e.exports = n(102)(Array, "Array", function (e, t) {
this._t = o(e), this._i = 0, this._k = t
}, function () {
var e = this._t, t = this._k, n = this._i++;
return !e || n >= e.length ? (this._t = void 0, i(1)) : i(0, "keys" == t ? n : "values" == t ? e[n] : [n, e[n]])
}, "values"), a.Arguments = a.Array, r("keys"), r("values"), r("entries")
}, function (e, t, n) {
"use strict";
var r, i, a = n(67), o = RegExp.prototype.exec, s = String.prototype.replace, l = o,
c = (r = /a/, i = /b*/g, o.call(r, "a"), o.call(i, "a"), 0 !== r.lastIndex || 0 !== i.lastIndex),
u = void 0 !== /()??/.exec("")[1];
(c || u) && (l = function (e) {
var t, n, r, i, l = this;
return u && (n = new RegExp("^" + l.source + "$(?!\\s)", a.call(l))), c && (t = l.lastIndex), r = o.call(l, e), c && r && (l.lastIndex = l.global ? r.index + r[0].length : t), u && r && r.length > 1 && s.call(r[0], n, function () {
for (i = 1; i < arguments.length - 2; i++) void 0 === arguments[i] && (r[i] = void 0)
}), r
}), e.exports = l
}, function (e, t, n) {
"use strict";
var r = n(74)(!0);
e.exports = function (e, t, n) {
return t + (n ? r(e, t).length : 1)
}
}, function (e, t, n) {
"use strict";
var r, i, a, o = n(26), s = n(134), l = n(94), c = n(90), u = n(3), d = u.process, h = u.setImmediate,
p = u.clearImmediate, f = u.MessageChannel, m = u.Dispatch, v = 0, g = {}, y = function () {
var e = +this;
if (g.hasOwnProperty(e)) {
var t = g[e];
delete g[e], t()
}
}, b = function (e) {
y.call(e.data)
};
h && p || (h = function (e) {
for (var t = [], n = 1; arguments.length > n;) t.push(arguments[n++]);
return g[++v] = function () {
s("function" == typeof e ? e : Function(e), t)
}, r(v), v
}, p = function (e) {
delete g[e]
}, "process" == n(27)(d) ? r = function (e) {
d.nextTick(o(y, e, 1))
} : m && m.now ? r = function (e) {
m.now(o(y, e, 1))
} : f ? (a = (i = new f).port2, i.port1.onmessage = b, r = o(a.postMessage, a, 1)) : u.addEventListener && "function" == typeof postMessage && !u.importScripts ? (r = function (e) {
u.postMessage(e + "", "*")
}, u.addEventListener("message", b, !1)) : r = "onreadystatechange" in c("script") ? function (e) {
l.appendChild(c("script")).onreadystatechange = function () {
l.removeChild(this), y.call(e)
}
} : function (e) {
setTimeout(o(y, e, 1), 0)
}), e.exports = {set: h, clear: p}
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(114).set, a = r.MutationObserver || r.WebKitMutationObserver, o = r.process, s = r.Promise,
l = "process" == n(27)(o);
e.exports = function () {
var e, t, n, c = function () {
var r, i;
for (l && (r = o.domain) && r.exit(); e;) {
i = e.fn, e = e.next;
try {
i()
} catch (r) {
throw e ? n() : t = void 0, r
}
}
t = void 0, r && r.enter()
};
if (l) n = function () {
o.nextTick(c)
}; else if (!a || r.navigator && r.navigator.standalone) if (s && s.resolve) {
var u = s.resolve(void 0);
n = function () {
u.then(c)
}
} else n = function () {
i.call(r, c)
}; else {
var d = !0, h = document.createTextNode("");
new a(c).observe(h, {characterData: !0}), n = function () {
h.data = d = !d
}
}
return function (r) {
var i = {fn: r, next: void 0};
t && (t.next = i), e || (e = i, n()), t = i
}
}
}, function (e, t, n) {
"use strict";
var r = n(15);
e.exports.f = function (e) {
return new function (e) {
var t, n;
this.promise = new e(function (e, r) {
if (void 0 !== t || void 0 !== n) throw TypeError("Bad Promise constructor");
t = e, n = r
}), this.resolve = r(t), this.reject = r(n)
}(e)
}
}, function (e, t, n) {
"use strict";
var r, i = n(3), a = n(33)(0), o = n(19), s = n(40), l = n(131), c = n(156), u = n(5), d = n(54), h = n(54),
p = !i.ActiveXObject && "ActiveXObject" in i, f = s.getWeak, m = Object.isExtensible, v = c.ufstore,
g = function (e) {
return function () {
return e(this, arguments.length > 0 ? arguments[0] : void 0)
}
}, y = {
get: function (e) {
if (u(e)) {
var t = f(e);
return !0 === t ? v(d(this, "WeakMap")).get(e) : t ? t[this._i] : void 0
}
}, set: function (e, t) {
return c.def(d(this, "WeakMap"), e, t)
}
}, b = e.exports = n(80)("WeakMap", g, y, c, !0, !0);
h && p && (l((r = c.getConstructor(g, "WeakMap")).prototype, y), s.NEED = !0, a(["delete", "has", "get", "set"], function (e) {
var t = b.prototype, n = t[e];
o(t, e, function (t, i) {
if (u(t) && !m(t)) {
this._f || (this._f = new r);
var a = this._f[e](t, i);
return "set" == e ? this : a
}
return n.call(this, t, i)
})
}))
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(8), a = n(39), o = n(81), s = n(18), l = n(53), c = n(4), u = n(51), d = n(28), h = n(7),
p = n(157), f = n(49).f, m = n(10).f, v = n(110), g = n(57), y = "prototype", b = "Wrong index!", w = r.ArrayBuffer,
S = r.DataView, _ = r.Math, k = r.RangeError, x = r.Infinity, P = w, C = _.abs, A = _.pow, T = _.floor, E = _.log,
D = _.LN2, I = i ? "_b" : "buffer", L = i ? "_l" : "byteLength", O = i ? "_o" : "byteOffset";
function M(e, t, n) {
var r, i, a, o = new Array(n), s = 8 * n - t - 1, l = (1 << s) - 1, c = l >> 1,
u = 23 === t ? A(2, -24) - A(2, -77) : 0, d = 0, h = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
for ((e = C(e)) != e || e === x ? (i = e != e ? 1 : 0, r = l) : (r = T(E(e) / D), e * (a = A(2, -r)) < 1 && (r--, a *= 2), (e += r + c >= 1 ? u / a : u * A(2, 1 - c)) * a >= 2 && (r++, a /= 2), r + c >= l ? (i = 0, r = l) : r + c >= 1 ? (i = (e * a - 1) * A(2, t), r += c) : (i = e * A(2, c - 1) * A(2, t), r = 0)); t >= 8; o[d++] = 255 & i, i /= 256, t -= 8) ;
for (r = r << t | i, s += t; s > 0; o[d++] = 255 & r, r /= 256, s -= 8) ;
return o[--d] |= 128 * h, o
}
function N(e, t, n) {
var r, i = 8 * n - t - 1, a = (1 << i) - 1, o = a >> 1, s = i - 7, l = n - 1, c = e[l--], u = 127 & c;
for (c >>= 7; s > 0; u = 256 * u + e[l], l--, s -= 8) ;
for (r = u & (1 << -s) - 1, u >>= -s, s += t; s > 0; r = 256 * r + e[l], l--, s -= 8) ;
if (0 === u) u = 1 - o; else {
if (u === a) return r ? NaN : c ? -x : x;
r += A(2, t), u -= o
}
return (c ? -1 : 1) * r * A(2, u - t)
}
function R(e) {
return e[3] << 24 | e[2] << 16 | e[1] << 8 | e[0]
}
function W(e) {
return [255 & e]
}
function V(e) {
return [255 & e, e >> 8 & 255]
}
function F(e) {
return [255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255]
}
function G(e) {
return M(e, 52, 8)
}
function B(e) {
return M(e, 23, 4)
}
function K(e, t, n) {
m(e[y], t, {
get: function () {
return this[n]
}
})
}
function j(e, t, n, r) {
var i = p(+n);
if (i + t > e[L]) throw k(b);
var a = e[I]._b, o = i + e[O], s = a.slice(o, o + t);
return r ? s : s.reverse()
}
function z(e, t, n, r, i, a) {
var o = p(+n);
if (o + t > e[L]) throw k(b);
for (var s = e[I]._b, l = o + e[O], c = r(+i), u = 0; u < t; u++) s[l + u] = c[a ? u : t - u - 1]
}
if (o.ABV) {
if (!c(function () {
w(1)
}) || !c(function () {
new w(-1)
}) || c(function () {
return new w, new w(1.5), new w(NaN), "ArrayBuffer" != w.name
})) {
for (var U, q = (w = function (e) {
return u(this, w), new P(p(e))
})[y] = P[y], H = f(P), Y = 0; H.length > Y;) (U = H[Y++]) in w || s(w, U, P[U]);
a || (q.constructor = w)
}
var X = new S(new w(2)), J = S[y].setInt8;
X.setInt8(0, 2147483648), X.setInt8(1, 2147483649), !X.getInt8(0) && X.getInt8(1) || l(S[y], {
setInt8: function (e, t) {
J.call(this, e, t << 24 >> 24)
}, setUint8: function (e, t) {
J.call(this, e, t << 24 >> 24)
}
}, !0)
} else w = function (e) {
u(this, w, "ArrayBuffer");
var t = p(e);
this._b = v.call(new Array(t), 0), this[L] = t
}, S = function (e, t, n) {
u(this, S, "DataView"), u(e, w, "DataView");
var r = e[L], i = d(t);
if (i < 0 || i > r) throw k("Wrong offset!");
if (i + (n = void 0 === n ? r - i : h(n)) > r) throw k("Wrong length!");
this[I] = e, this[O] = i, this[L] = n
}, i && (K(w, "byteLength", "_l"), K(S, "buffer", "_b"), K(S, "byteLength", "_l"), K(S, "byteOffset", "_o")), l(S[y], {
getInt8: function (e) {
return j(this, 1, e)[0] << 24 >> 24
}, getUint8: function (e) {
return j(this, 1, e)[0]
}, getInt16: function (e) {
var t = j(this, 2, e, arguments[1]);
return (t[1] << 8 | t[0]) << 16 >> 16
}, getUint16: function (e) {
var t = j(this, 2, e, arguments[1]);
return t[1] << 8 | t[0]
}, getInt32: function (e) {
return R(j(this, 4, e, arguments[1]))
}, getUint32: function (e) {
return R(j(this, 4, e, arguments[1])) >>> 0
}, getFloat32: function (e) {
return N(j(this, 4, e, arguments[1]), 23, 4)
}, getFloat64: function (e) {
return N(j(this, 8, e, arguments[1]), 52, 8)
}, setInt8: function (e, t) {
z(this, 1, e, W, t)
}, setUint8: function (e, t) {
z(this, 1, e, W, t)
}, setInt16: function (e, t) {
z(this, 2, e, V, t, arguments[2])
}, setUint16: function (e, t) {
z(this, 2, e, V, t, arguments[2])
}, setInt32: function (e, t) {
z(this, 4, e, F, t, arguments[2])
}, setUint32: function (e, t) {
z(this, 4, e, F, t, arguments[2])
}, setFloat32: function (e, t) {
z(this, 4, e, B, t, arguments[2])
}, setFloat64: function (e, t) {
z(this, 8, e, G, t, arguments[2])
}
});
g(w, "ArrayBuffer"), g(S, "DataView"), s(S[y], o.VIEW, !0), t.ArrayBuffer = w, t.DataView = S
}, function (e, t, n) {
"use strict";
for (var r = n(111), i = n(46), a = n(19), o = n(3), s = n(18), l = n(60), c = n(6), u = c("iterator"), d = c("toStringTag"), h = l.Array, p = {
CSSRuleList: !0,
CSSStyleDeclaration: !1,
CSSValueList: !1,
ClientRectList: !1,
DOMRectList: !1,
DOMStringList: !1,
DOMTokenList: !0,
DataTransferItemList: !1,
FileList: !1,
HTMLAllCollection: !1,
HTMLCollection: !1,
HTMLFormElement: !1,
HTMLSelectElement: !1,
MediaList: !0,
MimeTypeArray: !1,
NamedNodeMap: !1,
NodeList: !0,
PaintRequestList: !1,
Plugin: !1,
PluginArray: !1,
SVGLengthList: !1,
SVGNumberList: !1,
SVGPathSegList: !1,
SVGPointList: !1,
SVGStringList: !1,
SVGTransformList: !1,
SourceBufferList: !1,
StyleSheetList: !0,
TextTrackCueList: !1,
TextTrackList: !1,
TouchList: !1
}, f = i(p), m = 0; m < f.length; m++) {
var v, g = f[m], y = p[g], b = o[g], w = b && b.prototype;
if (w && (w[u] || s(w, u, h), w[d] || s(w, d, g), l[g] = h, y)) for (v in r) w[v] || a(w, v, r[v], !0)
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFPrintServiceFactory = t.DefaultExternalServices = t.PDFViewerApplication = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = n(170), a = n(398), o = n(399), s = n(184), l = n(400), c = n(401), u = n(402), d = n(403), h = n(178),
p = n(404), f = n(405), m = n(406), v = n(407), g = n(408), y = n(409), b = n(410), w = n(411), S = n(412),
_ = n(413), k = fe(n(70)), x = n(414), P = n(415), C = n(417), A = n(418), T = n(9), E = n(14), D = n(187),
I = n(16), L = n(420), O = n(63), M = n(421), N = n(422), R = n(423), W = n(424), V = n(425), F = n(188),
G = n(426), B = n(125), K = n(427), j = n(428), z = n(429), U = n(431), q = n(436), H = n(437), Y = n(438),
X = n(37), J = n(439), Q = n(441), $ = n(443), Z = n(444), ee = n(445), te = n(2), ne = n(446), re = n(447),
ie = n(448), ae = n(449), oe = n(451), se = n(452), le = fe(n(17)), ce = fe(n(34)), ue = fe(n(453)),
de = fe(n(460)), he = n(55), pe = n(463);
function fe(e) {
return e && e.__esModule ? e : {default: e}
}
var me = {
updateFindControlState: function (e) {
},
initPassiveLoading: function (e) {
},
fallback: function (e, t) {
},
reportTelemetry: function (e) {
},
createDownloadManager: function () {
throw new Error("Not implemented: createDownloadManager")
},
createPreferences: function () {
throw new Error("Not implemented: createPreferences")
},
createL10n: function () {
throw new Error("Not implemented: createL10n")
},
supportsIntegratedFind: !1,
supportsDocumentFonts: !0,
supportsDocumentColors: !0,
supportedMouseWheelZoomModifierKeys: {ctrlKey: !0, metaKey: !0}
}, ve = {
initialBookmark: document.location.hash.substring(1),
initialized: !1,
fellback: !1,
appConfig: null,
pdfDocument: null,
pdfLoadingTask: null,
printService: null,
pdfViewer: null,
pdfThumbnailViewer: null,
pdfRenderingQueue: null,
pdfPresentationMode: null,
pdfDocumentProperties: null,
pdfLinkService: null,
pdfHistory: null,
pdfSidebar: null,
pdfStamp: null,
pdfOutlineViewer: null,
pdfAttachmentViewer: null,
pdfCursorTools: null,
store: null,
downloadManager: null,
overlayManager: null,
preferences: null,
toolbar: null,
secondaryToolbar: null,
eventBus: null,
l10n: null,
isInitialViewSet: !1,
downloadComplete: !1,
viewerPrefs: {
sidebarViewOnLoad: L.SidebarView.NONE,
pdfBugEnabled: !1,
showPreviousViewOnLoad: !0,
defaultZoomValue: "",
disablePageMode: !1,
disablePageLabels: !1,
renderer: "canvas",
enhanceTextSelection: !1,
renderInteractiveForms: !1,
enablePrintAutoRotate: !1
},
isViewerEmbedded: window.parent !== window,
url: "",
baseUrl: "",
externalServices: me,
_boundEvents: {},
initialize: function (e) {
var t, n = this;
return this.preferences = this.externalServices.createPreferences(), (t = E.PDFJS).imageResourcesPath = "./images/", t.workerSrc = "./core/pdf.worker.js", t.cMapUrl = "./cmaps/", t.cMapPacked = !0, this.appConfig = e, this._readPreferences().then(function () {
return n._initializeL10n()
}).then(function () {
return n._initializeViewerComponents()
}).then(function () {
n.bindEvents(), n.bindWindowEvents();
var t = e.appContainer || document.documentElement;
n.l10n.translate(t).then(function () {
n.eventBus.dispatch("localized")
}), n.isViewerEmbedded && !E.PDFJS.isExternalLinkTargetSet() && (E.PDFJS.externalLinkTarget = E.PDFJS.LinkTarget.TOP), n.initialized = !0
})
},
checkHasClientServer: function () {
window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs && new he.iWebAssist({cilentType: "0"}, !0)
},
_readPreferences: function () {
var e = this.preferences, t = this.viewerPrefs;
return Promise.all([e.get("enableWebGL").then(function (e) {
E.PDFJS.disableWebGL = !e
}), e.get("sidebarViewOnLoad").then(function (e) {
t.sidebarViewOnLoad = e
}), e.get("pdfBugEnabled").then(function (e) {
t.pdfBugEnabled = e
}), e.get("showPreviousViewOnLoad").then(function (e) {
t.showPreviousViewOnLoad = e
}), e.get("defaultZoomValue").then(function (e) {
t.defaultZoomValue = e
}), e.get("enhanceTextSelection").then(function (e) {
t.enhanceTextSelection = e
}), e.get("disableTextLayer").then(function (e) {
!0 !== E.PDFJS.disableTextLayer && (E.PDFJS.disableTextLayer = e)
}), e.get("disableRange").then(function (e) {
!0 !== E.PDFJS.disableRange && (E.PDFJS.disableRange = e)
}), e.get("disableStream").then(function (e) {
!0 !== E.PDFJS.disableStream && (E.PDFJS.disableStream = e)
}), e.get("disableAutoFetch").then(function (e) {
E.PDFJS.disableAutoFetch = e
}), e.get("disableFontFace").then(function (e) {
!0 !== E.PDFJS.disableFontFace && (E.PDFJS.disableFontFace = e)
}), e.get("useOnlyCssZoom").then(function (e) {
E.PDFJS.useOnlyCssZoom = e
}), e.get("externalLinkTarget").then(function (e) {
E.PDFJS.isExternalLinkTargetSet() || (E.PDFJS.externalLinkTarget = e)
}), e.get("renderer").then(function (e) {
t.renderer = e
}), e.get("renderInteractiveForms").then(function (e) {
t.renderInteractiveForms = e
}), e.get("disablePageMode").then(function (e) {
t.disablePageMode = e
}), e.get("disablePageLabels").then(function (e) {
t.disablePageLabels = e
}), e.get("enablePrintAutoRotate").then(function (e) {
t.enablePrintAutoRotate = e
})]).catch(function (e) {
})
},
_initializeL10n: function () {
if (this.viewerPrefs.pdfBugEnabled) {
var e = document.location.hash.substring(1), t = (0, T.parseQueryString)(e);
"locale" in t && (E.PDFJS.locale = t.locale)
}
var n = this.KGPdfViewerWebApp.language;
-1 === ["zh-CN", "zh-TW", "en-US"].indexOf(n) && (n = "zh-CN"), E.PDFJS.locale = n;
var r = document.createElement("style");
return r.type = "text/css", document.getElementsByTagName("head").item(0).appendChild(r), r.innerHTML = "\n #kgSignatureCanvas {\n background-image: url(images/signaturePad-pc-" + n.toLowerCase() + ".png);\n }\n\n @media screen and (max-width: 768px) {\n #kgSignatureCanvas {\n background-image: url(images/signaturePad-mobile-" + n.toLowerCase() + ".png);\n }\n }\n ", "en-US" === n && (r.innerHTML += '\n .btn {\n width: 80px;\n }\n .kg_copyright_label {\n width: 97px;\n }\n .kg_copyright_company {\n width: 129px;\n }\n .kg_productInfo_unit span,\n .kg_productInfo_time span,\n .kg_productInfo_copyright span,\n .kg_productInfo_warning span {\n width: 97px;\n min-width: 97px;\n }\n #KG_ProductInfoOverlay > .dialog > .row > span {\n text-align-last: initial;\n text-align: right;\n }\n #KG_ProductInfoOverlay > .dialog > .row > p {\n width: calc(100% - 97px - 14px);\n max-width: calc(100% - 97px - 14px) !important;\n }\n #documentPropertiesOverlay .row > span {\n width: 93px;\n min-width: 93px;\n }\n #documentPropertiesOverlay .row > p {\n width: calc(100% - 98px);\n max-width: calc(100vw - 98px) !important;\n }\n #kgpasswordOverlay > .dialog, #kgpasswordOverlay > .kg_dialog_header {\n width: 328px;\n }\n #kgpasswordOverlay .kg_checkbox_wrapper {\n margin-left: 80px;\n }\n #kgpasswordOverlay .kg_error_msg {\n margin-left: 80px;\n }\n #kgTipOverlay > .dialog {\n width: 213px;\n }\n #KG_WatermarkOverlay .KG_Form_Label {\n width: 72px;\n }\n #KG_WatermarkOverlay .kg_radio_wrapper:before {\n width: 79px;\n }\n #KG_AdditionTextOverlay .KG_Form_Label {\n width: 99px;\n }\n #KG_AdditionTextOverlay .KG_AdditionText_ConfigContainer {\n width: 319px;\n }\n #KG_AdditionTextOverlay > .dialog, #KG_AdditionTextOverlay > .kg_dialog_header {\n width: 737px;\n }\n .menuVerifySeal, .menuDeleteSeal {\n width: 73px;\n }\n #KG_PagingSealOverlay .KG_Form_Label[data-l10n-id="pagingSeal_average"],\n #KG_PagingSealOverlay .KG_Form_Label[data-l10n-id="pagingSeal_firstPage"] {\n width: 115px;\n }\n #sign-msg-thick-tip {\n width: 364px;\n }\n #sign-msg-thick-slide {\n left: 58px;\n }\n @media screen and (max-width: 768px) {\n #sign-msg-thick-tip {\n top: 150px;\n }\n }\n #KG_CaptchaOverlay form .btn {\n width: 100px;\n }\n #KG_CaptchaOverlay > .dialog, #KG_CaptchaOverlay > .kg_dialog_header {\n width: 303px;\n }\n .KG_VerifySealPrompt_Item label {\n width: 99px;\n }\n @media all and (max-width: 720px) {\n .KG_VerifySealPrompt_Item span {\n max-width: calc(100vw - 139px);\n }\n }\n #kgTextToSealOverlay .kgdialog .tab {\n width: 100px;\n }\n '), this.l10n = this.externalServices.createL10n(), this.l10n.getDirection().then(function (e) {
document.getElementsByTagName("html")[0].dir = e
})
},
_initializeViewerComponents: function () {
var e = this, t = this.appConfig;
return new Promise(function (n, r) {
e.overlayManager = new M.OverlayManager;
var m = t.eventBus || (0, O.getGlobalEventBus)();
e.eventBus = m;
var v = new I.PDFRenderingQueue;
v.onIdle = e.cleanup.bind(e), e.pdfRenderingQueue = v;
var T = new B.PDFLinkService({eventBus: m});
e.pdfLinkService = T;
var E = e.externalServices.createDownloadManager();
e.downloadManager = E;
var Y = t.mainContainer, se = t.viewerContainer;
e.pdfViewer = new U.PDFViewer({
container: Y,
viewer: se,
eventBus: m,
renderingQueue: v,
linkService: T,
downloadManager: E,
renderer: e.viewerPrefs.renderer,
l10n: e.l10n,
enhanceTextSelection: e.viewerPrefs.enhanceTextSelection,
renderInteractiveForms: e.viewerPrefs.renderInteractiveForms,
enablePrintAutoRotate: e.viewerPrefs.enablePrintAutoRotate
}), e.pdfViewer.app = e, v.setViewer(e.pdfViewer), T.setViewer(e.pdfViewer);
var le = t.sidebar.thumbnailView;
e.pdfThumbnailViewer = new z.PDFThumbnailViewer({
container: le,
renderingQueue: v,
linkService: T,
l10n: e.l10n
}), v.setThumbnailViewer(e.pdfThumbnailViewer), e.pdfHistory = new G.PDFHistory({
linkService: T,
eventBus: m
}), T.setHistory(e.pdfHistory), e.findController = new F.PDFFindController({pdfViewer: e.pdfViewer}), e.findController.onUpdateResultsCount = function (t) {
e.supportsIntegratedFind || e.findBar.updateResultsCount(t)
}, e.findController.onUpdateState = function (t, n, r) {
e.supportsIntegratedFind ? e.externalServices.updateFindControlState({
result: t,
findPrevious: n
}) : e.findBar.updateUIState(t, n, r)
}, e.pdfViewer.setFindController(e.findController);
var ce = Object.create(t.findBar);
ce.findController = e.findController, ce.eventBus = m, e.findBar = new V.PDFFindBar(ce, e.l10n), e.pdfDocumentProperties = new W.PDFDocumentProperties(t.documentProperties, e.overlayManager, e.l10n), e.pdfCursorTools = new D.PDFCursorTools({
container: Y,
eventBus: m,
preferences: e.preferences
}), e.toolbar = new H.Toolbar(t.toolbar, Y, m, e.l10n), e.secondaryToolbar = new q.SecondaryToolbar(t.secondaryToolbar, Y, m), e.supportsFullscreen && (e.pdfPresentationMode = new j.PDFPresentationMode({
container: Y,
viewer: se,
pdfViewer: e.pdfViewer,
eventBus: m,
contextMenuItems: t.fullscreen
})), e.passwordPrompt = new N.PasswordPrompt(t.passwordOverlay, e.overlayManager, e.l10n), e.pdfOutlineViewer = new K.PDFOutlineViewer({
container: t.sidebar.outlineView,
eventBus: m,
linkService: T
}), e.pdfAttachmentViewer = new R.PDFAttachmentViewer({
container: t.sidebar.attachmentsView,
eventBus: m,
downloadManager: E
}), e.kgAnnotationViewer = new i.KGAnnotationViewer({
app: e,
container: t.sidebar.kgAnnotationsView,
button: t.sidebar.kgAnnotationsButton
});
var ue = Object.create(t.sidebar);
if (ue.pdfViewer = e.pdfViewer, ue.pdfThumbnailViewer = e.pdfThumbnailViewer, ue.pdfOutlineViewer = e.pdfOutlineViewer, ue.kgAnnotationViewer = e.kgAnnotationViewer, ue.eventBus = m, e.pdfSidebar = new L.PDFSidebar(ue, e.l10n), e.pdfSidebar.onToggled = e.forceRendering.bind(e), e.KGPdfViewerWebApp.disableRotate && (document.getElementById("pageRotatePeparator").setAttribute("hidden", !0), document.getElementById("pageRotateCw").setAttribute("hidden", !0), document.getElementById("pageRotateCcw").setAttribute("hidden", !0)), function () {
var e = [], t = this.KGPdfViewerWebApp.btnPositionConfig, n = t.toolbar, r = void 0 === n ? [] : n,
i = t.sidebar, a = void 0 === i ? [] : i, o = document.body.clientWidth <= 768 ? 1 : 2;
(r = (0, te.unique)(r)).length > o && e.concat(r.splice(o)), a.concat(e), a = (0, te.unique)(a)
}.bind(e)(), e.KGProductInfo = new ee.KG_ProductInfo(e, t.KG_ProductInfo, e.overlayManager), (0, te.functionalJudgment)("stamp") && (e.pdfStamp = new X.PDFStamp(t.toolbar.stamp, t.secondaryToolbar.secondaryStamp, e), e.pdfViewer.pdfStamp = e.pdfStamp), (0, te.functionalJudgment)("prepareStamp") && (e.KGPrepareStamp = new ne.KG_PrepareStamp(t.KG_PrepareStamp, e), e.KGPrepareStampConfirm = new c.KG_WatermarkConfirm(e, t.KG_WatermarkConfirm, e.overlayManager)), (0, te.functionalJudgment)("additionText") && (document.getElementById("addition-text-wrapper").style.display = "block", e.KGAdditionTextConfig = new a.KG_AdditionText(e, t.KG_AdditionText, e.overlayManager)), (0, te.functionalJudgment)("captcha") && (e.KGCaptcha = new o.KG_Captcha(e, t.KG_Captcha, e.overlayManager)), (0, te.functionalJudgment)("watermark") && (e.KGWatermark = new s.KG_Watermark(e, t.KG_Watermark, e.overlayManager), e.KGWatermarkConfirm = new c.KG_WatermarkConfirm(e, t.KG_WatermarkConfirm, e.overlayManager)), (0, te.functionalJudgment)("pagingSeal") && (document.getElementById("paging-seal-wrapper").style.display = "block", e.KGPagingSeal = new p.KG_PagingSeal(e, t.KG_PagingSeal, e.overlayManager)), (0, te.functionalJudgment)("stampConfirm") && (e.KGStampConfirm = new l.KG_StampConfirm(e, t.KG_StampConfirm, e.overlayManager)), (0, te.functionalJudgment)("textConfirm") && (e.KG_TextConfirm = new u.KG_TextConfirm(e, t.KG_TextConfirm, e.overlayManager)), (0, te.functionalJudgment)("signature") && (e.KG_SignaturePad = new x.KG_SignaturePad(e, t.KG_SignaturePad, e.overlayManager)), e.KGAlertPrompt = new h.KG_AlertPrompt(e, t.KG_AlertPrompt, e.overlayManager), (0, te.functionalJudgment)("textToSeal") && (e.KGTextToSeal = new k.default(t.kgTextToSeal, e)), (0, te.functionalJudgment)("download") && (e.KG_Download = new f.KG_Download(e, t.KG_Download)), !0 === e.KGPdfViewerWebApp.useNFSSystem) {
var he = document.createElement("object");
he.id = "SMObj", he.setAttribute("type", "application/signature_manager"), he.style.height = "0px", he.style.width = "0px", document.body.appendChild(he)
}
(0, te.functionalJudgment)("fjrs") && (e.KG_FJRS = new J.KG_FJRS(e, t.KG_FJRS, e.KGPdfViewerWebApp.fjrs, e.overlayManager)), !0 === e.KGPdfViewerWebApp.useTextWidget && (e.KG_TextWidget = new Z.KG_TextWidget), e.KG_DocSign = new Q.KG_DocSign(e, t.KG_DocSign, e.overlayManager), e.KG_DocSignConfirm = new d.KG_DocSignConfirm(e, t.KG_DocSignConfirm, e.overlayManager), (0, te.functionalJudgment)("blockChain") && (e.KG_BlockChain = new g.KG_BlockChain(e, t.KG_BlockChain, e.overlayManager)), (0, te.functionalJudgment)("annotation") && (e.KG_Annotation = new S.KG_Annotation(e, t.KG_Annotation, e.overlayManager)), (0, te.functionalJudgment)("scanStamp") && (e.KG_ScanStamp = new b.KG_ScanStamp(e, t.KG_ScanStamp, e.overlayManager)), (0, te.functionalJudgment)("iWebAuth") && (e.KG_IWebAuth = new P.KG_IWebAuth(e, t.KG_iWebAuthScan, e.overlayManager)), (0, te.functionalJudgment)("certValidity") && (e.KG_CertValidity = new re.KG_CertValidity(e, t.KG_CertValidity, e.overlayManager)), (0, te.functionalJudgment)("openLocalFile") && (e.KG_OpenLocalFile = new ie.KG_OpenLocalFile(e, t, e.overlayManager)), (0, te.functionalJudgment)("indicateSeal") && (e.KG_IndicateSeal = new ae.KG_IndicateSeal(e, t, e.overlayManager)), (0, te.functionalJudgment)("sealPreLocation") && (e.KG_SealPreLocation = new oe.KG_SealPreLocation(e)), e.KGPdfViewerWebApp.surreadPrint && (e.KG_SurreadPrint = new de.default(e)), (0, te.functionalJudgment)("isUkey") && (e.KG_UkeyStamp = new C.KG_UkeyStamp(e, t, e.overlayManager)), (0, te.functionalJudgment)("unifySealPlatformV2") && (e.KG_ScanStamp_V2 = new w.KG_ScanStamp_V2(e, t.KG_ScanStamp_V2, e.overlayManager), e.KG_BlockChain_V2 = new y.KG_BlockChain_V2(e, t.KG_BlockChain_V2, e.overlayManager)), (0, te.functionalJudgment)("fingerPrint") && (e.KG_Finger_Print = new A.KG_Finger_Print(e, t.KG_Finger_Print, e.overlayManager)), e.KG_VerifySealPrompt = new $.KG_VerifySealPrompt(e, t.KG_VerifySealPrompt, e.overlayManager), e.KG_NoServer = new _.KG_NoServer(e), n(void 0)
})
},
run: function (e) {
this.initialize(e).then(be)
},
zoomIn: function (e) {
var t = this.pdfViewer.currentScale;
do {
t = (1.1 * t).toFixed(2), t = Math.ceil(10 * t) / 10, t = Math.min(T.MAX_SCALE, t)
} while (--e > 0 && t < T.MAX_SCALE);
this.pdfViewer.currentScaleValue = t
},
zoomOut: function (e) {
var t = this.pdfViewer.currentScale;
do {
t = (t / 1.1).toFixed(2), t = Math.floor(10 * t) / 10, t = Math.max(T.MIN_SCALE, t)
} while (--e > 0 && t > T.MIN_SCALE);
this.pdfViewer.currentScaleValue = t
},
get pagesCount() {
return this.pdfDocument ? this.pdfDocument.numPages : 0
},
get pageRotation() {
return this.pdfViewer.pagesRotation
},
set page(e) {
this.pdfViewer.currentPageNumber = e
},
get page() {
return this.pdfViewer.currentPageNumber
},
get printing() {
return !!this.printService
},
get supportsPrinting() {
return rt.instance.supportsPrinting
},
get supportsFullscreen() {
var e = void 0, t = document.documentElement;
return e = !!(t.requestFullscreen || t.mozRequestFullScreen || t.webkitRequestFullScreen || t.msRequestFullscreen), !1 !== document.fullscreenEnabled && !1 !== document.mozFullScreenEnabled && !1 !== document.webkitFullscreenEnabled && !1 !== document.msFullscreenEnabled || (e = !1), e && !0 === E.PDFJS.disableFullscreen && (e = !1), (0, E.shadow)(this, "supportsFullscreen", e)
},
get supportsIntegratedFind() {
return this.externalServices.supportsIntegratedFind
},
get supportsDocumentFonts() {
return this.externalServices.supportsDocumentFonts
},
get supportsDocumentColors() {
return this.externalServices.supportsDocumentColors
},
get loadingBar() {
var e = new T.ProgressBar("#loadingBar");
return (0, E.shadow)(this, "loadingBar", e)
},
get supportedMouseWheelZoomModifierKeys() {
return this.externalServices.supportedMouseWheelZoomModifierKeys
},
initPassiveLoading: function () {
throw new Error("Not implemented: initPassiveLoading")
},
setTitleUsingUrl: function (e) {
this.url = e, this.baseUrl = e.split("#")[0];
var t = (0, T.getPDFFileNameFromURL)(e, "");
if (!t) try {
t = decodeURIComponent((0, E.getFilenameFromUrl)(e)) || e
} catch (n) {
t = e
}
this.setTitle(t)
},
setTitle: function (e) {
this.isViewerEmbedded || (document.title = "金格云阅读")
},
close: function () {
if (this.appConfig.errorWrapper.container.setAttribute("hidden", "true"), !this.pdfLoadingTask) return Promise.resolve();
var e = this.pdfLoadingTask.destroy();
return this.pdfLoadingTask = null, this.pdfDocument && (this.pdfDocument = null, this.pdfThumbnailViewer.setDocument(null), this.pdfViewer.setDocument(null), this.pdfLinkService.setDocument(null, null), this.pdfDocumentProperties.setDocument(null, null)), this.store = null, this.isInitialViewSet = !1, this.downloadComplete = !1, this.pdfSidebar.reset(), this.pdfOutlineViewer.reset(), this.pdfAttachmentViewer.reset(), this.findController.reset(), this.findBar.reset(), this.toolbar.reset(), this.secondaryToolbar.reset(), "undefined" != typeof PDFBug && PDFBug.cleanup(), e
},
open: function (e, t) {
var n = this;
if ("" !== e) {
if (arguments.length > 2 || "number" == typeof t) return Promise.reject(new Error("Call of open() with obsolete signature."));
if (this.pdfLoadingTask) return this.close().then(function () {
return n.preferences.reload(), n.open(e, t)
});
var r = Object.create(null);
if ("string" == typeof e ? (this.setTitleUsingUrl(e), r.url = e) : e && "byteLength" in e ? r.data = e : e.url && e.originalUrl && (this.setTitleUsingUrl(e.originalUrl), r.url = e.url), t) for (var i in t) E.PDFJS.pdfjsNext || "scale" !== i ? ("length" === i && this.pdfDocumentProperties.setFileSize(t[i]), r[i] = t[i]) : console.error('Call of open() with obsolete "scale" argument, please use the "defaultZoomValue" preference instead.');
r.rangeChunkSize = window.KGPdfViewerWebApp.rangeChunkSize;
var a = (0, E.getDocument)(r);
return this.pdfLoadingTask = a, a.onPassword = function (e, t) {
n.passwordPrompt.setUpdateCallback(e, t), n.passwordPrompt.open()
}, a.onProgress = function (e) {
var t = e.loaded, r = e.total;
n.progress(t / r)
}, a.onUnsupportedFeature = this.fallback.bind(this), a.promise.then(function (e) {
n.load(e)
}, function (e) {
var t = e && e.message, r = void 0;
if (r = e instanceof E.InvalidPDFException ? n.l10n.get("invalid_file_error", null, "Invalid or corrupted PDF file.") : e instanceof E.MissingPDFException ? n.l10n.get("missing_file_error", null, "Missing PDF file.") : e instanceof E.UnexpectedResponseException ? n.l10n.get("unexpected_response_error", null, "Unexpected server response.") : n.l10n.get("loading_error", null, "An error occurred while loading the PDF."), window.KGPdfViewerWebApp.hasRepairedFile) return r.then(function (e) {
throw n.error(e, {message: t}), new Error(e)
});
window.KGPdfViewerWebApp.hasRepairedFile = !0, window.KGPdfViewerWebApp.repairFileAndOpen()
})
}
},
download: function () {
var e = this;
function t() {
i.downloadUrl(n, r)
}
var n = this.baseUrl, r = (0, T.getPDFFileNameFromURL)(this.url), i = this.downloadManager;
i.onerror = function (t) {
e.error("PDF failed to download: " + t)
}, this.pdfDocument && this.downloadComplete ? this.pdfDocument.getData().then(function (e) {
var t = (0, E.createBlob)(e, "application/pdf");
i.download(t, n, r)
}).catch(t) : t()
},
fallback: function (e) {
},
error: function (e, t) {
var n = [this.l10n.get("error_version_info", {
version: E.version || "?",
build: E.build || "?"
}, "PDF.js v{{version}} (build: {{build}})")];
t && (n.push(this.l10n.get("error_message", {message: t.message}, "Message: {{message}}")), t.stack ? n.push(this.l10n.get("error_stack", {stack: t.stack}, "Stack: {{stack}}")) : (t.filename && n.push(this.l10n.get("error_file", {file: t.filename}, "File: {{file}}")), t.lineNumber && n.push(this.l10n.get("error_line", {line: t.lineNumber}, "Line: {{line}}"))));
var r = this.appConfig.errorWrapper, i = r.container;
i.removeAttribute("hidden"), r.errorMessage.textContent = e;
var a = r.closeButton;
a.onclick = function () {
i.setAttribute("hidden", "true")
};
var o = r.errorMoreInfo, s = r.moreInfoButton, l = r.lessInfoButton;
s.onclick = function () {
o.removeAttribute("hidden"), s.setAttribute("hidden", "true"), l.removeAttribute("hidden"), o.style.height = o.scrollHeight + "px"
}, l.onclick = function () {
o.setAttribute("hidden", "true"), s.removeAttribute("hidden"), l.setAttribute("hidden", "true")
}, s.oncontextmenu = T.noContextMenuHandler, l.oncontextmenu = T.noContextMenuHandler, a.oncontextmenu = T.noContextMenuHandler, s.removeAttribute("hidden"), l.setAttribute("hidden", "true"), Promise.all(n).then(function (e) {
o.value = e.join("\n")
})
},
progress: function (e) {
var t = this;
if (!this.downloadComplete) {
var n = Math.round(100 * e);
(n > this.loadingBar.percent || isNaN(n)) && (this.loadingBar.percent = n, E.PDFJS.disableAutoFetch && n && (this.disableAutoFetchLoadingBarTimeout && (clearTimeout(this.disableAutoFetchLoadingBarTimeout), this.disableAutoFetchLoadingBarTimeout = null), this.loadingBar.show(), this.disableAutoFetchLoadingBarTimeout = setTimeout(function () {
t.loadingBar.hide(), t.disableAutoFetchLoadingBarTimeout = null
}, 5e3)))
}
},
load: function (e) {
var t = this;
this.pdfDocument = e, e.getDownloadInfo().then(function () {
t.downloadComplete = !0, t.loadingBar.hide(), s.then(function () {
t.eventBus.dispatch("documentload", {source: t})
})
});
var n = e.getPageMode().catch(function () {
});
this.toolbar.setPagesCount(e.numPages, !1), this.secondaryToolbar.setPagesCount(e.numPages);
var i = this.documentFingerprint = e.fingerprint, a = this.store = new Y.ViewHistory(i);
this.pdfLinkService.setDocument(e, null), this.pdfDocumentProperties.setDocument(e, this.url);
var o = this.pdfViewer;
o.setDocument(e);
var s = o.firstPagePromise, l = o.pagesPromise, c = o.onePageRendered, u = this.pdfThumbnailViewer;
u.setDocument(e), s.then(function (e) {
if (window.KGPdfViewerWebApp.getTipPrompt().close(), t.loadingBar.setWidth(t.appConfig.viewerContainer), !E.PDFJS.disableHistory && !t.isViewerEmbedded) {
var s = !t.viewerPrefs.showPreviousViewOnLoad;
t.pdfHistory.initialize(i, s), t.pdfHistory.initialBookmark && (t.initialBookmark = t.pdfHistory.initialBookmark, t.initialRotation = t.pdfHistory.initialRotation)
}
var c = {bookmark: null, hash: null}, u = a.getMultiple({
exists: !1,
page: "1",
zoom: T.DEFAULT_SCALE_VALUE,
scrollLeft: "0",
scrollTop: "0",
rotation: null,
sidebarView: L.SidebarView.NONE
}).catch(function () {
});
Promise.all([u, n]).then(function (e) {
var n = r(e, 2), i = n[0], a = void 0 === i ? {} : i, o = n[1],
s = t.viewerPrefs.defaultZoomValue ? "zoom=" + t.viewerPrefs.defaultZoomValue : null, l = null,
c = t.viewerPrefs.sidebarViewOnLoad;
return a.exists && t.viewerPrefs.showPreviousViewOnLoad && (s = "page=" + a.page + "&zoom=" + (t.viewerPrefs.defaultZoomValue || a.zoom) + "," + a.scrollLeft + "," + a.scrollTop, l = parseInt(a.rotation, 10), c = c || 0 | a.sidebarView), o && !t.viewerPrefs.disablePageMode && (c = c || function (e) {
switch (e) {
case"UseNone":
return L.SidebarView.NONE;
case"UseThumbs":
return L.SidebarView.THUMBS;
case"UseOutlines":
return L.SidebarView.OUTLINE;
case"UseAttachments":
return L.SidebarView.ATTACHMENTS
}
return L.SidebarView.NONE
}(o)), {hash: s, rotation: l, sidebarView: c}
}).then(function (e) {
var n = e.hash, r = e.rotation, i = e.sidebarView;
return c.bookmark = t.initialBookmark, c.hash = n, t.setInitialView(n, {
rotation: r,
sidebarView: i
}), t.isViewerEmbedded || o.focus(), l
}).then(function () {
(c.bookmark || c.hash) && (o.hasEqualPageSizes || (t.initialBookmark = c.bookmark, o.currentScaleValue = o.currentScaleValue, t.setInitialView(c.hash)))
}).then(function () {
o.update(), t.KG_InsetPageNum = new v.KG_InsetPageNum(t, t.appConfig)
}).finally(function () {
if (t.KGPdfViewerWebApp.previewWatermark && t.KGWatermark.renderWatermarkOnlyWeb(), 2 == window.KGPdfViewerWebApp.stampSystemOrigin && document.getElementById("KG_ProductInfo").setAttribute("hidden", !0), window.KGPdfViewerWebApp.externalSeals && Array.isArray(window.KGPdfViewerWebApp.externalSeals)) {
var n = window.KGPdfViewerWebApp.externalSeals.concat();
t.KG_NoServer.renderExternalSeals(n, o, e)
}
null != window.KGPdfViewerWebApp.sealPreLocation && t.KG_SealPreLocation.renderPreSeal(window.KGPdfViewerWebApp.sealPreLocation), window.KGPdfViewerWebApp.disableRotate || (t.KG_RotateDocument = new se.KG_RotateDocument(t)), t.KGPdfViewerWebApp.stampMask && t.KGPdfViewerWebApp.mobile + "" == "0" && (t.KG_StampMask = pe.KG_StampMask.getInstance(t, t.appConfig)), t.checkHasClientServer()
})
}), e.getPageLabels().then(function (n) {
if (n && !t.viewerPrefs.disablePageLabels) {
var r = 0, i = n.length;
if (i === t.pagesCount) {
for (; r < i && n[r] === (r + 1).toString();) r++;
r !== i && (o.setPageLabels(n), u.setPageLabels(n), t.toolbar.setPagesCount(e.numPages, !0), t.toolbar.setPageNumber(o.currentPageNumber, o.currentPageLabel))
} else console.error("The number of Page Labels does not match the number of pages in the document.")
}
}), l.then(function () {
t.supportsPrinting && e.getJavaScript().then(function (e) {
if (0 !== e.length) {
e.some(function (e) {
return !!e && (console.warn("Warning: JavaScript is not supported"), t.fallback(E.UNSUPPORTED_FEATURES.javaScript), !0)
});
for (var n = /\bprint\s*\(/, r = 0, i = e.length; r < i; r++) {
var a = e[r];
if (a && n.test(a)) return void setTimeout(function () {
window.print()
})
}
}
})
}), Promise.all([c, T.animationStarted]).then(function () {
e.getOutline().then(function (e) {
t.pdfOutlineViewer.render({outline: e})
}), e.getAttachments().then(function (e) {
t.pdfAttachmentViewer.render({attachments: e})
})
}), e.getMetadata().then(function (e) {
var n = e.info, r = e.metadata;
t.documentInfo = n, t.metadata = r;
var i = void 0;
if (r && r.has("dc:title")) {
var a = r.get("dc:title");
"Untitled" !== a && (i = a)
}
!i && n && n.Title && (i = n.Title), i && t.setTitle(i + " - " + document.title), n.IsAcroFormPresent && (console.warn("Warning: AcroForm/XFA is not supported"), t.fallback(E.UNSUPPORTED_FEATURES.forms)), new m.KG_GuideTip(t, t.appConfig.KG_GuideTip);
var o = t.KGPdfViewerWebApp, s = o.btnPositionConfig, l = s.toolbar, c = s.sidebar, u = o.showPrintBtn,
d = o.textToSeal, h = o.setThemeColorStyle, p = o.surreadPrint;
if ((!0 === u || !0 === d || p) && (l.indexOf("print") > -1 && t.appConfig.toolbar.print.removeAttribute("hidden"), c.indexOf("print") > -1 && t.appConfig.secondaryToolbar.printButton.removeAttribute("hidden")), h.bind(t.KGPdfViewerWebApp)(), null != t.KGPdfViewerWebApp.license && null != t.KGPdfViewerWebApp.version) {
var f = t.appConfig, v = f.secondaryToolbar.toolbar, g = f.KG_ProductInfo.container;
g.querySelector(".kg_productInfo_version").innerHTML = "V" + t.KGPdfViewerWebApp.version;
var y = ce.default.stringify(le.default.parse(t.KGPdfViewerWebApp.license, "=ABCDEFGHIJKLabcdefghijklmnopqrstuvwxyzMNOPQRSTUVWXYZ0123456789+/")),
b = ue.default.parse(y, {attributeNamePrefix: "@_", ignoreAttributes: !1}).kinggrid.iSignature_PDF_API.item,
w = b.filter(function (e) {
return "company" == e["@_name"]
})[0], S = b.filter(function (e) {
return "expiredDateTime" == e["@_name"]
})[0];
v.querySelector(".kg_copyright_company").innerHTML = w["#text"], g.querySelector(".kg_productInfo_unit p").innerHTML = w["#text"], S ? (v.querySelector(".kg_copyright_time").innerHTML = S["#text"], g.querySelector(".kg_productInfo_time p").innerHTML = S["#text"]) : (v.querySelector(".kg_copyright_time").parentNode.setAttribute("hidden", !0), g.querySelector(".kg_productInfo_time p").setAttribute("hidden", !0))
} else t.KGPdfViewerWebApp.isUrlDoc || t.KGPdfViewerWebApp.getLicenseInfo().then(function (e) {
var n = e.companyName, r = e.expirationTime, i = e.version, a = t.appConfig, o = a.secondaryToolbar.toolbar,
s = a.KG_ProductInfo.container;
o.querySelector(".kg_copyright_company").innerHTML = n, s.querySelector(".kg_productInfo_unit p").innerHTML = n, s.querySelector(".kg_productInfo_version").innerHTML = "V" + i, r ? (o.querySelector(".kg_copyright_time").innerHTML = r, s.querySelector(".kg_productInfo_time p").innerHTML = r) : (o.querySelector(".kg_copyright_time").parentNode.setAttribute("hidden", !0), s.querySelector(".kg_productInfo_time p").setAttribute("hidden", !0))
})
})
},
setInitialView: function (e) {
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.rotation,
i = (n.sidebarView, function (e) {
(0, T.isValidRotation)(e) && (t.pdfViewer.pagesRotation = e)
});
this.isInitialViewSet = !0, this.initialBookmark ? (i(this.initialRotation), delete this.initialRotation, this.pdfLinkService.setHash(this.initialBookmark), this.initialBookmark = null) : e && (i(r), this.pdfLinkService.setHash(e)), this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel), this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber), this.pdfViewer.currentScaleValue || (this.pdfViewer.currentScaleValue = T.DEFAULT_SCALE_VALUE)
},
cleanup: function () {
this.pdfDocument && (this.pdfViewer.cleanup(), this.pdfThumbnailViewer.cleanup(), this.pdfViewer.renderer !== T.RendererType.SVG && this.pdfDocument.cleanup())
},
forceRendering: function () {
this.pdfRenderingQueue.printing = this.printing, this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar.isThumbnailViewVisible, this.pdfRenderingQueue.renderHighestPriority()
},
beforePrint: function () {
var e = this;
if (!this.printService) if (this.supportsPrinting) if (this.pdfViewer.pageViewsReady) {
var t = this.pdfViewer.getPagesOverview(), n = this.appConfig.printContainer,
r = rt.instance.createPrintService(this.pdfDocument, t, n, this.l10n);
this.printService = r, this.forceRendering(), r.layout()
} else this.l10n.get("printing_not_ready", null, "Warning: The PDF is not fully loaded for printing.").then(function (e) {
window.alert(e)
}); else this.l10n.get("printing_not_supported", null, "Warning: Printing is not fully supported by this browser.").then(function (t) {
e.error(t)
})
},
afterPrint: function () {
this.printService && (this.printService.destroy(), this.printService = null), this.forceRendering()
},
rotatePages: function (e) {
if (this.pdfDocument) {
var t = (this.pdfViewer.pagesRotation + 360 + e) % 360;
this.pdfViewer.pagesRotation = t
}
},
requestPresentationMode: function () {
this.pdfPresentationMode && this.pdfPresentationMode.request()
},
bindEvents: function () {
var e = this.eventBus, t = this._boundEvents;
t.beforePrint = this.beforePrint.bind(this), t.afterPrint = this.afterPrint.bind(this), e.on("resize", Ee), e.on("hashchange", De), e.on("beforeprint", t.beforePrint), e.on("afterprint", t.afterPrint), e.on("pagerendered", Se), e.on("textlayerrendered", ke), e.on("updateviewarea", Te), e.on("pagechanging", Qe), e.on("scalechanging", Xe), e.on("rotationchanging", Je), e.on("sidebarviewchanged", Ae), e.on("pagemode", xe), e.on("namedaction", Pe), e.on("presentationmodechanged", Ce), e.on("presentationmode", Le), e.on("openfile", Oe), e.on("print", Me), e.on("download", Ne), e.on("firstpage", Re), e.on("lastpage", We), e.on("nextpage", Ve), e.on("previouspage", Fe), e.on("zoomin", Ge), e.on("zoomout", Be), e.on("pagenumberchanged", Ke), e.on("scalechanged", je), e.on("rotatecw", ze), e.on("rotateccw", Ue), e.on("documentproperties", qe), e.on("find", He), e.on("findfromurlhash", Ye), e.on("fileinputchange", Ie), e.on("secondaryToolbarOpen", it), e.on("findbarOpen", at)
},
bindWindowEvents: function () {
var e = this.eventBus, t = this._boundEvents;
t.windowResize = function () {
e.dispatch("resize")
}, t.windowHashChange = function () {
e.dispatch("hashchange", {hash: document.location.hash.substring(1)})
}, t.windowBeforePrint = function () {
e.dispatch("beforeprint")
}, t.windowAfterPrint = function () {
e.dispatch("afterprint")
}, window.addEventListener("wheel", et), window.addEventListener("click", tt), window.addEventListener("keydown", nt), window.addEventListener("resize", t.windowResize), window.addEventListener("hashchange", t.windowHashChange), window.addEventListener("beforeprint", t.windowBeforePrint), window.addEventListener("afterprint", t.windowAfterPrint)
},
unbindEvents: function () {
var e = this.eventBus, t = this._boundEvents;
e.off("resize", Ee), e.off("hashchange", De), e.off("beforeprint", t.beforePrint), e.off("afterprint", t.afterPrint), e.off("pagerendered", Se), e.off("textlayerrendered", ke), e.off("updateviewarea", Te), e.off("pagechanging", Qe), e.off("scalechanging", Xe), e.off("rotationchanging", Je), e.off("sidebarviewchanged", Ae), e.off("pagemode", xe), e.off("namedaction", Pe), e.off("presentationmodechanged", Ce), e.off("presentationmode", Le), e.off("openfile", Oe), e.off("print", Me), e.off("download", Ne), e.off("firstpage", Re), e.off("lastpage", We), e.off("nextpage", Ve), e.off("previouspage", Fe), e.off("zoomin", Ge), e.off("zoomout", Be), e.off("pagenumberchanged", Ke), e.off("scalechanged", je), e.off("rotatecw", ze), e.off("rotateccw", Ue), e.off("documentproperties", qe), e.off("find", He), e.off("findfromurlhash", Ye), e.off("fileinputchange", Ie), e.off("secondaryToolbarOpen", it), t.beforePrint = null, t.afterPrint = null
},
unbindWindowEvents: function () {
var e = this._boundEvents;
window.removeEventListener("wheel", et), window.removeEventListener("click", tt), window.removeEventListener("keydown", nt), window.removeEventListener("resize", e.windowResize), window.removeEventListener("hashchange", e.windowHashChange), window.removeEventListener("beforeprint", e.windowBeforePrint), window.removeEventListener("afterprint", e.windowAfterPrint), e.windowResize = null, e.windowHashChange = null, e.windowBeforePrint = null, e.windowAfterPrint = null
}
}, ge = void 0, ye = ["null", "http://mozilla.github.io", "https://mozilla.github.io"];
function be() {
var e, t = ve.appConfig, n = document.location.search.substring(1), r = (0, T.parseQueryString)(n);
e = "file" in r ? r.file : t.defaultUrl, ge(e);
var i, a = [];
if (ve.viewerPrefs.pdfBugEnabled) {
var o = document.location.hash.substring(1), s = (0, T.parseQueryString)(o);
if ("disableworker" in s && (E.PDFJS.disableWorker = "true" === s.disableworker), "disablerange" in s && (E.PDFJS.disableRange = "true" === s.disablerange), "disablestream" in s && (E.PDFJS.disableStream = "true" === s.disablestream), "disableautofetch" in s && (E.PDFJS.disableAutoFetch = "true" === s.disableautofetch), "disablefontface" in s && (E.PDFJS.disableFontFace = "true" === s.disablefontface), "disablehistory" in s && (E.PDFJS.disableHistory = "true" === s.disablehistory), "webgl" in s && (E.PDFJS.disableWebGL = "true" !== s.webgl), "useonlycsszoom" in s && (E.PDFJS.useOnlyCssZoom = "true" === s.useonlycsszoom), "verbosity" in s && (E.PDFJS.verbosity = 0 | s.verbosity), "ignorecurrentpositiononzoom" in s && (E.PDFJS.ignoreCurrentPositionOnZoom = "true" === s.ignorecurrentpositiononzoom), "textlayer" in s) switch (s.textlayer) {
case"off":
E.PDFJS.disableTextLayer = !0;
break;
case"visible":
case"shadow":
case"hover":
t.viewerContainer.classList.add("textLayer-" + s.textlayer)
}
if ("pdfbug" in s) {
E.PDFJS.pdfBug = !0;
var l = s.pdfbug.split(",");
a.push((i = l, new Promise(function (e, t) {
var n = ve.appConfig, r = document.createElement("script");
r.src = n.debuggerScriptPath, r.onload = function () {
PDFBug.enable(i), PDFBug.init({PDFJS: E.PDFJS, OPS: E.OPS}, n.mainContainer), e()
}, r.onerror = function () {
t(new Error("Cannot load debugger at " + r.src))
}, (document.getElementsByTagName("head")[0] || document.body).appendChild(r)
})))
}
}
ve.supportsPrinting || (t.toolbar.print.classList.add("hidden"), t.secondaryToolbar.printButton.classList.add("hidden")), ve.supportsFullscreen, ve.supportsIntegratedFind && t.toolbar.viewFind.classList.add("hidden"), t.sidebar.mainContainer.addEventListener("transitionend", function (e) {
e.target === this && ve.eventBus.dispatch("resize")
}, !0), t.sidebar.toggleButton.addEventListener("click", function (e) {
ve.pdfSidebar.toggle()
}), Promise.all(a).then(function () {
we(e)
}).catch(function (e) {
ve.l10n.get("loading_error", null, "An error occurred while opening.").then(function (t) {
ve.error(t, e)
})
})
}
ge = function (e) {
if (void 0 !== e) try {
var t = new URL(window.location.href).origin || "null";
if (ye.indexOf(t) >= 0) return;
new URL(e, window.location.href).origin
} catch (e) {
var n = e && e.message;
throw ve.l10n.get("loading_error", null, "An error occurred while loading the PDF.").then(function (e) {
ve.error(e, {message: n})
}), e
}
};
var we = void 0;
function Se(e) {
var t = e.pageNumber, n = t - 1, r = ve.pdfViewer.getPageView(n);
if (t === ve.page && ve.toolbar.updateLoadingIndicatorState(!1), r) {
if (ve.pdfSidebar.isThumbnailViewVisible) ve.pdfThumbnailViewer.getThumbnail(n).setImage(r);
E.PDFJS.pdfBug && Stats.enabled && r.stats && Stats.add(t, r.stats), r.error && ve.l10n.get("rendering_error", null, "An error occurred while rendering the page.").then(function (e) {
ve.error(e, r.error)
})
}
}
we = function (e) {
if (e && 0 === e.lastIndexOf("file:", 0)) {
ve.setTitleUsingUrl(e);
var t = new XMLHttpRequest;
t.onload = function () {
ve.open(new Uint8Array(t.response))
};
try {
t.open("GET", e), t.responseType = "arraybuffer", t.send()
} catch (e) {
ve.l10n.get("loading_error", null, "An error occurred while loading the PDF.").then(function (t) {
ve.error(t, e)
})
}
} else e && ve.open(e)
};
var _e = !1;
function ke(e) {
e.numTextDivs > 0 ? (_e = !0, ve.appConfig.findBar.bar.removeAttribute("hidden"), ve.appConfig.findBar.toggleButton.removeAttribute("hidden")) : _e || (ve.appConfig.findBar.bar.setAttribute("hidden", !0), ve.appConfig.findBar.toggleButton.setAttribute("hidden", !0))
}
function xe(e) {
var t = e.mode, n = void 0;
switch (t) {
case"thumbs":
n = L.SidebarView.THUMBS;
break;
case"bookmarks":
case"outline":
n = L.SidebarView.OUTLINE;
break;
case"attachments":
n = L.SidebarView.ATTACHMENTS;
break;
case"none":
n = L.SidebarView.NONE;
break;
default:
return void console.error('Invalid "pagemode" hash parameter: ' + t)
}
ve.pdfSidebar.switchView(n, !0)
}
function Pe(e) {
switch (e.action) {
case"GoToPage":
ve.appConfig.toolbar.pageNumber.select();
break;
case"Find":
ve.supportsIntegratedFind || ve.findBar.toggle()
}
}
function Ce(e) {
var t = e.active, n = e.switchInProgress;
ve.pdfViewer.presentationModeState = n ? T.PresentationModeState.CHANGING : t ? T.PresentationModeState.FULLSCREEN : T.PresentationModeState.NORMAL
}
function Ae(e) {
ve.pdfRenderingQueue.isThumbnailViewEnabled = ve.pdfSidebar.isThumbnailViewVisible;
var t = ve.store;
t && ve.isInitialViewSet && t.set("sidebarView", e.view).catch(function () {
})
}
function Te(e) {
var t = e.location, n = ve.store;
n && ve.isInitialViewSet && n.setMultiple({
exists: !0,
page: t.pageNumber,
zoom: t.scale,
scrollLeft: t.left,
scrollTop: t.top,
rotation: t.rotation
}).catch(function () {
});
var r = ve.pdfLinkService.getAnchorUrl(t.pdfOpenParams);
window.KGPdfViewerWebApp.currentView = r;
var i = ve.pdfViewer.getPageView(ve.page - 1).renderingState !== I.RenderingStates.FINISHED;
ve.toolbar.updateLoadingIndicatorState(i)
}
function Ee() {
var e = ve.pdfDocument, t = ve.pdfViewer, n = ve.KG_InsetPageNum;
if (e) {
var r = t.currentScaleValue;
"auto" !== r && "page-fit" !== r && "page-width" !== r || (t.currentScaleValue = r), t.update(), n.update()
}
}
function De(e) {
var t = e.hash;
t && (ve.isInitialViewSet ? ve.pdfHistory.popStateInProgress || ve.pdfLinkService.setHash(t) : ve.initialBookmark = t)
}
var Ie = void 0;
function Le() {
ve.requestPresentationMode()
}
function Oe() {
var e = ve.appConfig.openFileInputName;
document.getElementById(e).click()
}
function Me() {
window.KGPdfViewerWebApp.surreadPrint ? ve.KG_SurreadPrint.print() : window.print()
}
function Ne() {
ve.download()
}
function Re() {
ve.pdfDocument && (ve.page = 1)
}
function We() {
ve.pdfDocument && (ve.page = ve.pagesCount)
}
function Ve() {
ve.page++
}
function Fe() {
ve.page--
}
function Ge() {
ve.zoomIn();
var e = ve.KG_InsetPageNum, t = ve.KG_StampMask;
e.update(), t && t.scaleChange()
}
function Be() {
ve.zoomOut();
var e = ve.KG_InsetPageNum, t = ve.KG_StampMask;
e.update(), t && t.scaleChange()
}
function Ke(e) {
var t = ve.pdfViewer;
t.currentPageLabel = e.value, e.value !== t.currentPageNumber.toString() && e.value !== t.currentPageLabel && ve.toolbar.setPageNumber(t.currentPageNumber, t.currentPageLabel)
}
function je(e) {
ve.pdfViewer.currentScaleValue = e.value, ve.KG_InsetPageNum.update();
var t = ve.KG_StampMask;
t && t.scaleChange()
}
function ze() {
ve.rotatePages(90)
}
function Ue() {
ve.rotatePages(-90)
}
function qe() {
ve.pdfDocumentProperties.open()
}
function He(e) {
ve.findController.executeCommand("find" + e.type, {
query: e.query,
phraseSearch: e.phraseSearch,
caseSensitive: e.caseSensitive,
highlightAll: e.highlightAll,
findPrevious: e.findPrevious
})
}
function Ye(e) {
ve.findController.executeCommand("find", {
query: e.query,
phraseSearch: e.phraseSearch,
caseSensitive: !1,
highlightAll: !0,
findPrevious: !1
})
}
function Xe(e) {
ve.toolbar.setPageScale(e.presetValue, e.scale), ve.pdfViewer.update()
}
function Je(e) {
ve.pdfThumbnailViewer.pagesRotation = e.pagesRotation, ve.forceRendering(), ve.pdfViewer.currentPageNumber = e.pageNumber
}
function Qe(e) {
var t = e.pageNumber;
if (ve.toolbar.setPageNumber(t, e.pageLabel || null), ve.secondaryToolbar.setPageNumber(t), ve.pdfSidebar.isThumbnailViewVisible && ve.pdfThumbnailViewer.scrollThumbnailIntoView(t), E.PDFJS.pdfBug && Stats.enabled) {
var n = ve.pdfViewer.getPageView(t - 1);
n.stats && Stats.add(t, n.stats)
}
}
Ie = function (e) {
var t = e.fileInput.files[0];
if (!E.PDFJS.disableCreateObjectURL && URL.createObjectURL) ve.open(URL.createObjectURL(t)); else {
var n = new FileReader;
n.onload = function (e) {
var t = e.target.result;
ve.open(new Uint8Array(t))
}, n.readAsArrayBuffer(t)
}
ve.setTitleUsingUrl(t.name)
};
var $e = !1, Ze = void 0;
function et(e) {
var t = ve.pdfViewer;
if (!t.isInPresentationMode) if (e.ctrlKey || e.metaKey) {
var n = ve.supportedMouseWheelZoomModifierKeys;
if (e.ctrlKey && !n.ctrlKey || e.metaKey && !n.metaKey) return;
if (e.preventDefault(), $e) return;
var r = t.currentScale, i = 3 * (0, T.normalizeWheelEventDelta)(e);
i < 0 ? ve.zoomOut(-i) : ve.zoomIn(i);
var a = t.currentScale;
if (r !== a) {
var o = a / r - 1, s = t.container.getBoundingClientRect(), l = e.clientX - s.left, c = e.clientY - s.top;
t.container.scrollLeft += l * o, t.container.scrollTop += c * o
}
} else $e = !0, clearTimeout(Ze), Ze = setTimeout(function () {
$e = !1
}, 1e3)
}
function tt(e) {
if (ve.secondaryToolbar.isOpen) {
var t = ve.appConfig;
(ve.pdfViewer.containsElement(e.target) || t.toolbar.container.contains(e.target) && e.target !== t.secondaryToolbar.toggleButton) && ve.secondaryToolbar.close()
}
}
function nt(e) {
if (!ve.overlayManager.active) {
var t = !1, n = !1, r = (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0),
i = ve.pdfViewer, a = i && i.isInPresentationMode;
if (1 === r || 8 === r || 5 === r || 12 === r) switch (e.keyCode) {
case 70:
ve.supportsIntegratedFind || (ve.findBar.open(), t = !0);
break;
case 71:
if (!ve.supportsIntegratedFind) {
var o = ve.findController.state;
o && ve.findController.executeCommand("findagain", {
query: o.query,
phraseSearch: o.phraseSearch,
caseSensitive: o.caseSensitive,
highlightAll: o.highlightAll,
findPrevious: 5 === r || 12 === r
}), t = !0
}
break;
case 61:
case 107:
case 187:
case 171:
a || ve.zoomIn(), t = !0;
break;
case 173:
case 109:
case 189:
a || ve.zoomOut(), t = !0;
break;
case 48:
case 96:
a || (setTimeout(function () {
i.currentScaleValue = T.DEFAULT_SCALE_VALUE
}), t = !1);
break;
case 38:
(a || ve.page > 1) && (ve.page = 1, t = !0, n = !0);
break;
case 40:
(a || ve.page < ve.pagesCount) && (ve.page = ve.pagesCount, t = !0, n = !0)
}
if (1 === r || 8 === r) switch (e.keyCode) {
case 83:
t = !0
}
if (3 === r || 10 === r) switch (e.keyCode) {
case 80:
ve.requestPresentationMode(), t = !0;
break;
case 71:
ve.appConfig.toolbar.pageNumber.select(), t = !0
}
if (t) return n && !a && i.focus(), void e.preventDefault();
var s = document.activeElement || document.querySelector(":focus"), l = s && s.tagName.toUpperCase();
if ("INPUT" !== l && "TEXTAREA" !== l && "SELECT" !== l || 27 === e.keyCode) {
if (0 === r) switch (e.keyCode) {
case 38:
case 33:
case 8:
if (!a && "page-fit" !== i.currentScaleValue) break;
case 37:
if (i.isHorizontalScrollbarEnabled) break;
case 75:
case 80:
ve.page > 1 && ve.page--, t = !0;
break;
case 27:
ve.secondaryToolbar.isOpen && (ve.secondaryToolbar.close(), t = !0), !ve.supportsIntegratedFind && ve.findBar.opened && (ve.findBar.close(), t = !0);
break;
case 40:
case 34:
case 32:
if (!a && "page-fit" !== i.currentScaleValue) break;
case 39:
if (i.isHorizontalScrollbarEnabled) break;
case 74:
case 78:
ve.page < ve.pagesCount && ve.page++, t = !0;
break;
case 36:
(a || ve.page > 1) && (ve.page = 1, t = !0, n = !0);
break;
case 35:
(a || ve.page < ve.pagesCount) && (ve.page = ve.pagesCount, t = !0, n = !0);
break;
case 83:
ve.pdfCursorTools.switchTool(D.CursorTool.SELECT);
break;
case 72:
ve.pdfCursorTools.switchTool(D.CursorTool.HAND);
break;
case 82:
ve.rotatePages(90)
}
if (4 === r) switch (e.keyCode) {
case 32:
if (!a && "page-fit" !== i.currentScaleValue) break;
ve.page > 1 && ve.page--, t = !0;
break;
case 82:
ve.rotatePages(-90)
}
t || a || (e.keyCode >= 33 && e.keyCode <= 40 || 32 === e.keyCode && "BUTTON" !== l) && (n = !0), n && !i.containsElement(s) && i.focus(), t && e.preventDefault()
}
}
}
var rt = {
instance: {
supportsPrinting: !1, createPrintService: function () {
throw new Error("Not implemented: createPrintService")
}
}
};
function it() {
ve.pdfSidebar.close(), ve.findBar.close()
}
function at() {
ve.pdfSidebar.close(), ve.secondaryToolbar.close()
}
t.PDFViewerApplication = ve, t.DefaultExternalServices = me, t.PDFPrintServiceFactory = rt
}, function (e, t) {
(function (t) {
e.exports = t
}).call(t, {})
}, function (e, t, n) {
"use strict";
function r(e) {
return new Promise(function (t, n) {
var r = document.getElementById("SMObj"), i = r.WebGetKeyCount();
if (isNaN(Number(i)) || 1 !== Number(i)) Number(i) > 1 ? n({message: "插入了太多的密钥盘"}) : -1 === Number(i) ? n({message: o(r, "授权已过期")}) : n({message: o(r, "没有插入密钥盘")}); else {
var a = r.WebOpenKey(0);
if (a && "none" !== a && "0" !== a.toString()) {
var s = r.WebKeyIsAdmin(a);
if ("false" === s || !1 === s) {
var l = r.WebVerifyPin(a, e);
if (l && "-1" !== l.toString()) t({
SMObj: r,
keyHandle: a
}); else window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), n({
message: o(r, "密钥盘密码错误,请输入正确的密码"),
defaultMsg: "密钥盘密码错误"
})
} else n({message: "没有检测到用户密钥盘"})
} else n({message: o(r, "开启密钥盘失败")})
}
})
}
function i(e, t) {
e.WebCloseKey(t)
}
function a(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
return new Promise(function (r, i) {
var a = e.WebGetSealData(t, n);
a && "none" !== a ? r(a) : i({message: o(e, "获取印章失败(印章索引:" + n + "")})
})
}
function o(e, t) {
var n = e.WebGetLastErrorMsg();
return n && "none" !== n ? n : t
}
function s(e, t, n) {
return new Promise(function (r, i) {
var a = e.WebSign(t, n);
a && "-1" !== a.toString() ? r(a) : i({message: o(e, "数据签名失败")})
})
}
Object.defineProperty(t, "__esModule", {value: !0}), t.closeNFSKey = i, t.getNFSSeals = function (e, t, n, s) {
var l = void 0, c = void 0, u = void 0, d = void 0, h = void 0;
return r(e).then(function (e) {
var t = e.SMObj, n = e.keyHandle;
return d = t, h = n, new Promise(function (e, t) {
var n = d.WebGetSealCount(h);
!isNaN(Number(n)) && Number(n) >= 1 ? e(n) : t({message: o(d, "密钥盘中不存在印章")})
})
}).then(function (e) {
for (var t = [], n = 0; n < e; n++) t.push(a(d, h, n));
return Promise.all(t)
}).then(function (e) {
if (!e || 0 === e.length) return Promise.reject({message: o(d, "获取印章失败")});
l = d.WebGetKeySerialNumber(h), c = d.WebGetCertData(h), u = d.WebGetKeyUnit(h);
var n = {action: "handleCilentSeal", keySN: l, unitName: u, seals: e};
return t && t(n)
}).then(function (e) {
var t = e.data;
n && n(t, c, l)
}).catch(function (e) {
var t = e.message, n = e.defaultMsg;
return s && s({message: t, defaultMsg: n}), Promise.resolve()
}).then(function () {
return null != h && i(d, h), Promise.resolve()
})
}, t.NFSSign = function (e, t, n, a, o, l) {
var c = void 0, u = void 0, d = void 0;
return r(e).then(function (e) {
var r = e.SMObj, i = e.keyHandle;
u = i;
var a = (c = r).WebGetKeySerialNumber(u);
if (t !== a) return Promise.reject({message: "密钥盘已更换"});
d = c.WebGetCertData(u);
for (var o = [], l = 0; l < n.length; l++) o.push(s(c, u, n[l].toSignData));
return Promise.all(o)
}).then(function (e) {
for (var t = [], r = 0; r < e.length; r++) {
var i = {
signedData: e[r],
cert: d,
sealType: n[r].sealType,
toSignData: n[r].toSignData,
signDirPath: n[r].signDirPath
};
t.push(a(i))
}
return Promise.all(t)
}).then(function () {
o && o()
}).catch(function (e) {
var t = e.message;
return l && l(t), Promise.resolve()
}).then(function () {
null != u && i(c, u)
})
}, t.deleteNFSSeal = function (e, t, n) {
var a = void 0, o = void 0;
return r(e).then(function (e) {
var t = e.SMObj, n = e.keyHandle;
a = t, o = n
}).then(function () {
return t && t()
}).catch(function (e) {
var t = e.message;
return n && n(t), Promise.resolve()
}).then(function () {
null != o && i(a, o)
})
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.iWebAssistError = t.iWebAssist = void 0;
var r = n(2), i = n(43);
var a = function (e, t) {
this.kg = new i.KG("IWEBASSIST.iWebAssistCtrl.1", "4240FB41-A213-42B6-8CB5E6705C99B319");
var n = (0, i.createCapability)();
this.promise = n.promise;
var r = this, a = window.KGPdfViewerWebApp.softType, o = window.KGPdfViewerWebApp.appCode;
this.kg.init(t).then(function () {
"0" === (e || {}).clientType ? r.kg.invoke("SetParamByName", "SOFTTYPE", a).then(r.kg.invoke("SetParamByName", "APPCODE", o)).then(n.resolve) : n.resolve()
})
};
a.prototype = {
getCspName: function () {
var e = this.kg, t = (0, i.createCapability)();
return e.invoke("KGGetPublicParm", "Public", "CSPName", "").then(function (e) {
0 == e.indexOf("M") && function e(t, n, r) {
var i = r;
return t.indexOf(n) >= 0 && i < 4 && (i++, i = e(t.substr(t.indexOf(n) + 1, t.length), n, i)), i
}(e, "W", 0) > 0 && (e = e.replace(e.substring(e.indexOf("M") + 1, e.indexOf("W")), "&")), t.resolve(e)
}), t.promise
}, setParamByName: function (e, t) {
return this.kg.invoke("SetParamByName", e, t)
}, getKeyInfo: function () {
return this.kg.invoke("KGGetKeyInfo")
}, getKeyOtherInfo: function () {
return this.kg.invoke("KGGetKeyOtherInfo", "0")
}, getParamByName: function (e) {
return this.kg.invoke("GetParamByName", e)
}, makeGMV4Data: function (e) {
return this.kg.invoke("makeGMV4Data", window.KGPdfViewerWebApp.getPasswordPrompt().pwd, e.imgdata.split(",")[1], e.imgExt, (0, r.pxCovertToMM)(e.width) / 10, (0, r.pxCovertToMM)(e.height) / 10, e.signName, 5)
}, getCert: function () {
this.kg.invoke("KGGetCerInfo", "")
}, verifyPin: function (e, t) {
return this.kg.invoke("KGVerifyPin", e, t)
}, sig_pkcs7: function (e, t, n) {
return "Base64" === n ? this.kg.invoke("KGCrySignMessageEX", e, t, t.length, "Base64") : this.kg.invoke("KGCrySignMessage", e, t, t.length)
}, verifySignMessage: function (e, t) {
return this.kg.invoke("KGVerifySignMessage", "", e, t)
}, getPublicParam: function (e, t, n) {
return t || (t = ""), n || (n = ""), this.kg.invoke("KGGetPublicParm", e, t, n)
}
};
t.iWebAssist = a, t.iWebAssistError = {
getKeyInfo: {
"-1": "未安装组件",
1: "请插入电子密钥盘",
2: "没有进行正确初始化的电子密钥盘",
3: "没有找到key驱动文件",
4: "插入太多的key",
8: "非法授权的电子密钥盘",
11: "密钥盘中不存在印章",
12: "获取印章信息失败",
"-101": "获取钥匙盘有效期异常,请重新尝试签章",
"-103": "钥匙盘未生效,不能签章",
"-104": "钥匙盘已过期,不能签章",
35: "钥匙盘未生效,不能签章",
36: "钥匙盘已过期,不能签章",
37: "授权信息结构非法",
38: "验证失败,签章证书已经过期或还未生效",
39: "验证失败,签章证书不受颁发机构信任",
40: "验证失败,签章证书已被吊销",
41: "验证失败,签章证书根证书未安装或无效的根证书",
42: "验证失败,吊销列表文件不存在",
43: "验证失败,未检测到证书",
44: "验证失败,根证书文件不存在",
45: "验证失败,根证书和该证书的根证书不配套",
46: "验证失败,吊销列表和该证书的吊销列表不配套"
},
getKeyOtherInfo: {
"-100": "不支持此类型的信息获取",
"-4": "插入太多的密钥盘",
"-3": "连接签章服务器失败",
"-2": "获取失败",
"-1": "未安装管理组件",
1: "请插入电子密钥盘",
2: "没有进行正确初始化的电子密钥盘",
3: "没有找到key驱动文件",
4: "插入太多的key",
8: "非法授权的电子密钥盘",
11: "密钥盘中不存在印章",
12: "获取印章信息失败",
"-101": "获取钥匙盘有效期异常,请重新尝试签章",
"-103": "钥匙盘未生效,不能签章",
"-104": "钥匙盘已过期,不能签章"
},
verifyPin: {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
"-3": "未安装手机盾组件",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败",
10: "签章助手登录失败"
}
}
}, function (e, t, n) {
"use strict";
(function (e) {
var n, r, i, a, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
a = function () {
return function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {i: r, l: !1, exports: {}};
return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports
}
return n.m = e, n.c = t, n.d = function (e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {enumerable: !0, get: r})
}, n.r = function (e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
}, n.t = function (e, t) {
if (1 & t && (e = n(e)), 8 & t) return e;
if (4 & t && "object" === (void 0 === e ? "undefined" : o(e)) && e && e.__esModule) return e;
var r = Object.create(null);
if (n.r(r), Object.defineProperty(r, "default", {
enumerable: !0,
value: e
}), 2 & t && "string" != typeof e) for (var i in e) n.d(r, i, function (t) {
return e[t]
}.bind(null, i));
return r
}, n.n = function (e) {
var t = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return n.d(t, "a", t), t
}, n.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 6)
}([function (e, t) {
e.exports = function (e) {
var t;
if ("SELECT" === e.nodeName) e.focus(), t = e.value; else if ("INPUT" === e.nodeName || "TEXTAREA" === e.nodeName) {
var n = e.hasAttribute("readonly");
n || e.setAttribute("readonly", ""), e.select(), e.setSelectionRange(0, e.value.length), n || e.removeAttribute("readonly"), t = e.value
} else {
e.hasAttribute("contenteditable") && e.focus();
var r = window.getSelection(), i = document.createRange();
i.selectNodeContents(e), r.removeAllRanges(), r.addRange(i), t = r.toString()
}
return t
}
}, function (e, t) {
function n() {
}
n.prototype = {
on: function (e, t, n) {
var r = this.e || (this.e = {});
return (r[e] || (r[e] = [])).push({fn: t, ctx: n}), this
}, once: function (e, t, n) {
var r = this;
function i() {
r.off(e, i), t.apply(n, arguments)
}
return i._ = t, this.on(e, i, n)
}, emit: function (e) {
for (var t = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[e] || []).slice(), r = 0, i = n.length; r < i; r++) n[r].fn.apply(n[r].ctx, t);
return this
}, off: function (e, t) {
var n = this.e || (this.e = {}), r = n[e], i = [];
if (r && t) for (var a = 0, o = r.length; a < o; a++) r[a].fn !== t && r[a].fn._ !== t && i.push(r[a]);
return i.length ? n[e] = i : delete n[e], this
}
}, e.exports = n, e.exports.TinyEmitter = n
}, function (e, t, n) {
var r = n(3), i = n(4);
e.exports = function (e, t, n) {
if (!e && !t && !n) throw new Error("Missing required arguments");
if (!r.string(t)) throw new TypeError("Second argument must be a String");
if (!r.fn(n)) throw new TypeError("Third argument must be a Function");
if (r.node(e)) return function (e, t, n) {
return e.addEventListener(t, n), {
destroy: function () {
e.removeEventListener(t, n)
}
}
}(e, t, n);
if (r.nodeList(e)) return function (e, t, n) {
return Array.prototype.forEach.call(e, function (e) {
e.addEventListener(t, n)
}), {
destroy: function () {
Array.prototype.forEach.call(e, function (e) {
e.removeEventListener(t, n)
})
}
}
}(e, t, n);
if (r.string(e)) return function (e, t, n) {
return i(document.body, e, t, n)
}(e, t, n);
throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")
}
}, function (e, t) {
t.node = function (e) {
return void 0 !== e && e instanceof HTMLElement && 1 === e.nodeType
}, t.nodeList = function (e) {
var n = Object.prototype.toString.call(e);
return void 0 !== e && ("[object NodeList]" === n || "[object HTMLCollection]" === n) && "length" in e && (0 === e.length || t.node(e[0]))
}, t.string = function (e) {
return "string" == typeof e || e instanceof String
}, t.fn = function (e) {
return "[object Function]" === Object.prototype.toString.call(e)
}
}, function (e, t, n) {
var r = n(5);
function i(e, t, n, i, a) {
var o = function (e, t, n, i) {
return function (n) {
n.delegateTarget = r(n.target, t), n.delegateTarget && i.call(e, n)
}
}.apply(this, arguments);
return e.addEventListener(n, o, a), {
destroy: function () {
e.removeEventListener(n, o, a)
}
}
}
e.exports = function (e, t, n, r, a) {
return "function" == typeof e.addEventListener ? i.apply(null, arguments) : "function" == typeof n ? i.bind(null, document).apply(null, arguments) : ("string" == typeof e && (e = document.querySelectorAll(e)), Array.prototype.map.call(e, function (e) {
return i(e, t, n, r, a)
}))
}
}, function (e, t) {
var n = 9;
if ("undefined" != typeof Element && !Element.prototype.matches) {
var r = Element.prototype;
r.matches = r.matchesSelector || r.mozMatchesSelector || r.msMatchesSelector || r.oMatchesSelector || r.webkitMatchesSelector
}
e.exports = function (e, t) {
for (; e && e.nodeType !== n;) {
if ("function" == typeof e.matches && e.matches(t)) return e;
e = e.parentNode
}
}
}, function (e, t, n) {
n.r(t);
var r = n(0), i = n.n(r), a = "function" == typeof Symbol && "symbol" === o(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : o(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : o(e)
}, s = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var l = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.resolveOptions(t), this.initSelection()
}
return s(e, [{
key: "resolveOptions", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
this.action = e.action, this.container = e.container, this.emitter = e.emitter, this.target = e.target, this.text = e.text, this.trigger = e.trigger, this.selectedText = ""
}
}, {
key: "initSelection", value: function () {
this.text ? this.selectFake() : this.target && this.selectTarget()
}
}, {
key: "selectFake", value: function () {
var e = this, t = "rtl" == document.documentElement.getAttribute("dir");
this.removeFake(), this.fakeHandlerCallback = function () {
return e.removeFake()
}, this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0, this.fakeElem = document.createElement("textarea"), this.fakeElem.style.fontSize = "12pt", this.fakeElem.style.border = "0", this.fakeElem.style.padding = "0", this.fakeElem.style.margin = "0", this.fakeElem.style.position = "absolute", this.fakeElem.style[t ? "right" : "left"] = "-9999px";
var n = window.pageYOffset || document.documentElement.scrollTop;
this.fakeElem.style.top = n + "px", this.fakeElem.setAttribute("readonly", ""), this.fakeElem.value = this.text, this.container.appendChild(this.fakeElem), this.selectedText = i()(this.fakeElem), this.copyText()
}
}, {
key: "removeFake", value: function () {
this.fakeHandler && (this.container.removeEventListener("click", this.fakeHandlerCallback), this.fakeHandler = null, this.fakeHandlerCallback = null), this.fakeElem && (this.container.removeChild(this.fakeElem), this.fakeElem = null)
}
}, {
key: "selectTarget", value: function () {
this.selectedText = i()(this.target), this.copyText()
}
}, {
key: "copyText", value: function () {
var e = void 0;
try {
e = document.execCommand(this.action)
} catch (t) {
e = !1
}
this.handleResult(e)
}
}, {
key: "handleResult", value: function (e) {
this.emitter.emit(e ? "success" : "error", {
action: this.action,
text: this.selectedText,
trigger: this.trigger,
clearSelection: this.clearSelection.bind(this)
})
}
}, {
key: "clearSelection", value: function () {
this.trigger && this.trigger.focus(), document.activeElement.blur(), window.getSelection().removeAllRanges()
}
}, {
key: "destroy", value: function () {
this.removeFake()
}
}, {
key: "action", set: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "copy";
if (this._action = e, "copy" !== this._action && "cut" !== this._action) throw new Error('Invalid "action" value, use either "copy" or "cut"')
}, get: function () {
return this._action
}
}, {
key: "target", set: function (e) {
if (void 0 !== e) {
if (!e || "object" !== (void 0 === e ? "undefined" : a(e)) || 1 !== e.nodeType) throw new Error('Invalid "target" value, use a valid Element');
if ("copy" === this.action && e.hasAttribute("disabled")) throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
if ("cut" === this.action && (e.hasAttribute("readonly") || e.hasAttribute("disabled"))) throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
this._target = e
}
}, get: function () {
return this._target
}
}]), e
}(), c = n(1), u = n.n(c), d = n(2), h = n.n(d),
p = "function" == typeof Symbol && "symbol" === o(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : o(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : o(e)
}, f = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var m = function (e) {
function t(e, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t);
var r = function (e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" !== (void 0 === t ? "undefined" : o(t)) && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
return r.resolveOptions(n), r.listenClick(e), r
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === t ? "undefined" : o(t)));
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, u.a), f(t, [{
key: "resolveOptions", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
this.action = "function" == typeof e.action ? e.action : this.defaultAction, this.target = "function" == typeof e.target ? e.target : this.defaultTarget, this.text = "function" == typeof e.text ? e.text : this.defaultText, this.container = "object" === p(e.container) ? e.container : document.body
}
}, {
key: "listenClick", value: function (e) {
var t = this;
this.listener = h()(e, "click", function (e) {
return t.onClick(e)
})
}
}, {
key: "onClick", value: function (e) {
var t = e.delegateTarget || e.currentTarget;
this.clipboardAction && (this.clipboardAction = null), this.clipboardAction = new l({
action: this.action(t),
target: this.target(t),
text: this.text(t),
container: this.container,
trigger: t,
emitter: this
})
}
}, {
key: "defaultAction", value: function (e) {
return v("action", e)
}
}, {
key: "defaultTarget", value: function (e) {
var t = v("target", e);
if (t) return document.querySelector(t)
}
}, {
key: "defaultText", value: function (e) {
return v("text", e)
}
}, {
key: "destroy", value: function () {
this.listener.destroy(), this.clipboardAction && (this.clipboardAction.destroy(), this.clipboardAction = null)
}
}], [{
key: "isSupported", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"],
t = "string" == typeof e ? [e] : e, n = !!document.queryCommandSupported;
return t.forEach(function (e) {
n = n && !!document.queryCommandSupported(e)
}), n
}
}]), t
}();
function v(e, t) {
var n = "data-clipboard-" + e;
if (t.hasAttribute(n)) return t.getAttribute(n)
}
t.default = m
}]).default
}, "object" === o(t) && "object" === o(e) ? e.exports = a() : (r = [], void 0 === (i = "function" == typeof (n = a) ? n.apply(t, r) : n) || (e.exports = i))
}).call(t, n(61)(e))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.SimpleLinkService = t.PDFLinkService = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(63), o = n(9);
function s(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var l = function () {
function e() {
var t = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).eventBus;
s(this, e), this.eventBus = t || (0, a.getGlobalEventBus)(), this.baseUrl = null, this.pdfDocument = null, this.pdfViewer = null, this.pdfHistory = null, this._pagesRefCache = null
}
return i(e, [{
key: "setDocument", value: function (e, t) {
this.baseUrl = t, this.pdfDocument = e, this._pagesRefCache = Object.create(null)
}
}, {
key: "setViewer", value: function (e) {
this.pdfViewer = e
}
}, {
key: "setHistory", value: function (e) {
this.pdfHistory = e
}
}, {
key: "navigateTo", value: function (e) {
var t = this;
new Promise(function (n, r) {
"string" != typeof e ? n({
namedDest: "",
explicitDest: e
}) : t.pdfDocument.getDestination(e).then(function (t) {
n({namedDest: e, explicitDest: t})
})
}).then(function (n) {
n.explicitDest instanceof Array ? function n(r) {
var i = r.namedDest, a = r.explicitDest, o = a[0], s = void 0;
if (o instanceof Object) {
if (null === (s = t._cachedPageNumber(o))) return void t.pdfDocument.getPageIndex(o).then(function (e) {
t.cachePageRef(e + 1, o), n({namedDest: i, explicitDest: a})
}).catch(function () {
console.error('PDFLinkService.navigateTo: "' + o + '" is not a valid page reference, for dest="' + e + '".')
})
} else {
if (!Number.isInteger(o)) return void console.error('PDFLinkService.navigateTo: "' + o + '" is not a valid destination reference, for dest="' + e + '".');
s = o + 1
}
!s || s < 1 || s > t.pagesCount ? console.error('PDFLinkService.navigateTo: "' + s + '" is not a valid page number, for dest="' + e + '".') : (t.pdfHistory && (t.pdfHistory.pushCurrentPosition(), t.pdfHistory.push({
namedDest: i,
explicitDest: a,
pageNumber: s
})), t.pdfViewer.scrollPageIntoView({pageNumber: s, destArray: a}))
}(n) : console.error('PDFLinkService.navigateTo: "' + n.explicitDest + '" is not a valid destination array, for dest="' + e + '".')
})
}
}, {
key: "getDestinationHash", value: function (e) {
if ("string" == typeof e) return this.getAnchorUrl("#" + escape(e));
if (e instanceof Array) {
var t = JSON.stringify(e);
return this.getAnchorUrl("#" + escape(t))
}
return this.getAnchorUrl("")
}
}, {
key: "getAnchorUrl", value: function (e) {
return (this.baseUrl || "") + e
}
}, {
key: "setHash", value: function (e) {
var t = void 0, n = void 0;
if (e.indexOf("=") >= 0) {
var i = (0, o.parseQueryString)(e);
if ("search" in i && this.eventBus.dispatch("findfromurlhash", {
source: this,
query: i.search.replace(/"/g, ""),
phraseSearch: "true" === i.phrase
}), "nameddest" in i) return void this.navigateTo(i.nameddest);
if ("page" in i && (t = 0 | i.page || 1), "zoom" in i) {
var a = i.zoom.split(","), s = a[0], l = parseFloat(s);
-1 === s.indexOf("Fit") ? n = [null, {name: "XYZ"}, a.length > 1 ? 0 | a[1] : null, a.length > 2 ? 0 | a[2] : null, l ? l / 100 : s] : "Fit" === s || "FitB" === s ? n = [null, {name: s}] : "FitH" === s || "FitBH" === s || "FitV" === s || "FitBV" === s ? n = [null, {name: s}, a.length > 1 ? 0 | a[1] : null] : "FitR" === s ? 5 !== a.length ? console.error('PDFLinkService.setHash: Not enough parameters for "FitR".') : n = [null, {name: s}, 0 | a[1], 0 | a[2], 0 | a[3], 0 | a[4]] : console.error('PDFLinkService.setHash: "' + s + '" is not a valid zoom value.')
}
n ? this.pdfViewer.scrollPageIntoView({
pageNumber: t || this.page,
destArray: n,
allowNegativeOffset: !0
}) : t && (this.page = t), "pagemode" in i && this.eventBus.dispatch("pagemode", {
source: this,
mode: i.pagemode
})
} else {
/^\d+$/.test(e) && e <= this.pagesCount && (console.warn('PDFLinkService_setHash: specifying a page number directly after the hash symbol (#) is deprecated, please use the "#page=' + e + '" form instead.'), this.page = 0 | e), n = unescape(e);
try {
(n = JSON.parse(n)) instanceof Array || (n = n.toString())
} catch (e) {
}
if ("string" == typeof n || function (e) {
if (!(e instanceof Array)) return !1;
var t = e.length, n = !0;
if (t < 2) return !1;
var i = e[0];
if (!("object" === (void 0 === i ? "undefined" : r(i)) && Number.isInteger(i.num) && Number.isInteger(i.gen) || Number.isInteger(i) && i >= 0)) return !1;
var a = e[1];
if ("object" !== (void 0 === a ? "undefined" : r(a)) || "string" != typeof a.name) return !1;
switch (a.name) {
case"XYZ":
if (5 !== t) return !1;
break;
case"Fit":
case"FitB":
return 2 === t;
case"FitH":
case"FitBH":
case"FitV":
case"FitBV":
if (3 !== t) return !1;
break;
case"FitR":
if (6 !== t) return !1;
n = !1;
break;
default:
return !1
}
for (var o = 2; o < t; o++) {
var s = e[o];
if (!("number" == typeof s || n && null === s)) return !1
}
return !0
}(n)) return void this.navigateTo(n);
console.error('PDFLinkService.setHash: "' + unescape(e) + '" is not a valid destination.')
}
}
}, {
key: "executeNamedAction", value: function (e) {
switch (e) {
case"GoBack":
this.pdfHistory && this.pdfHistory.back();
break;
case"GoForward":
this.pdfHistory && this.pdfHistory.forward();
break;
case"NextPage":
this.page < this.pagesCount && this.page++;
break;
case"PrevPage":
this.page > 1 && this.page--;
break;
case"LastPage":
this.page = this.pagesCount;
break;
case"FirstPage":
this.page = 1
}
this.eventBus.dispatch("namedaction", {source: this, action: e})
}
}, {
key: "onFileAttachmentAnnotation", value: function (e) {
var t = e.id, n = e.filename, r = e.content;
this.eventBus.dispatch("fileattachmentannotation", {source: this, id: t, filename: n, content: r})
}
}, {
key: "cachePageRef", value: function (e, t) {
var n = t.num + " " + t.gen + " R";
this._pagesRefCache[n] = e
}
}, {
key: "_cachedPageNumber", value: function (e) {
var t = e.num + " " + e.gen + " R";
return this._pagesRefCache && this._pagesRefCache[t] || null
}
}, {
key: "pagesCount", get: function () {
return this.pdfDocument ? this.pdfDocument.numPages : 0
}
}, {
key: "page", get: function () {
return this.pdfViewer.currentPageNumber
}, set: function (e) {
this.pdfViewer.currentPageNumber = e
}
}, {
key: "rotation", get: function () {
return this.pdfViewer.pagesRotation
}, set: function (e) {
this.pdfViewer.pagesRotation = e
}
}]), e
}();
var c = function () {
function e() {
s(this, e)
}
return i(e, [{
key: "navigateTo", value: function (e) {
}
}, {
key: "getDestinationHash", value: function (e) {
return "#"
}
}, {
key: "getAnchorUrl", value: function (e) {
return "#"
}
}, {
key: "setHash", value: function (e) {
}
}, {
key: "executeNamedAction", value: function (e) {
}
}, {
key: "onFileAttachmentAnnotation", value: function (e) {
e.id, e.filename, e.content
}
}, {
key: "cachePageRef", value: function (e, t) {
}
}, {
key: "page", get: function () {
return 0
}, set: function (e) {
}
}, {
key: "rotation", get: function () {
return 0
}, set: function (e) {
}
}]), e
}();
t.PDFLinkService = l, t.SimpleLinkService = c
}, function (e, t, n) {
"use strict";
e.exports = !n(8) && !n(4)(function () {
return 7 != Object.defineProperty(n(90)("div"), "a", {
get: function () {
return 7
}
}).a
})
}, function (e, t, n) {
"use strict";
t.f = n(6)
}, function (e, t, n) {
"use strict";
var r = n(22), i = n(23), a = n(71)(!1), o = n(92)("IE_PROTO");
e.exports = function (e, t) {
var n, s = i(e), l = 0, c = [];
for (n in s) n != o && r(s, n) && c.push(n);
for (; t.length > l;) r(s, n = t[l++]) && (~a(c, n) || c.push(n));
return c
}
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(1), a = n(46);
e.exports = n(8) ? Object.defineProperties : function (e, t) {
i(e);
for (var n, o = a(t), s = o.length, l = 0; s > l;) r.f(e, n = o[l++], t[n]);
return e
}
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(23), a = n(49).f, o = {}.toString,
s = "object" == ("undefined" == typeof window ? "undefined" : r(window)) && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
e.exports.f = function (e) {
return s && "[object Window]" == o.call(e) ? function (e) {
try {
return a(e)
} catch (e) {
return s.slice()
}
}(e) : a(i(e))
}
}, function (e, t, n) {
"use strict";
var r = n(8), i = n(46), a = n(72), o = n(66), s = n(11), l = n(65), c = Object.assign;
e.exports = !c || n(4)(function () {
var e = {}, t = {}, n = Symbol(), r = "abcdefghijklmnopqrst";
return e[n] = 7, r.split("").forEach(function (e) {
t[e] = e
}), 7 != c({}, e)[n] || Object.keys(c({}, t)).join("") != r
}) ? function (e, t) {
for (var n = s(e), c = arguments.length, u = 1, d = a.f, h = o.f; c > u;) for (var p, f = l(arguments[u++]), m = d ? i(f).concat(d(f)) : i(f), v = m.length, g = 0; v > g;) p = m[g++], r && !h.call(f, p) || (n[p] = f[p]);
return n
} : c
}, function (e, t, n) {
"use strict";
e.exports = Object.is || function (e, t) {
return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t
}
}, function (e, t, n) {
"use strict";
var r = n(15), i = n(5), a = n(134), o = [].slice, s = {};
e.exports = Function.bind || function (e) {
var t = r(this), n = o.call(arguments, 1), l = function r() {
var i = n.concat(o.call(arguments));
return this instanceof r ? function (e, t, n) {
if (!(t in s)) {
for (var r = [], i = 0; i < t; i++) r[i] = "a[" + i + "]";
s[t] = Function("F,a", "return new F(" + r.join(",") + ")")
}
return s[t](e, n)
}(t, i.length, i) : a(t, i, e)
};
return i(t.prototype) && (l.prototype = t.prototype), l
}
}, function (e, t, n) {
"use strict";
e.exports = function (e, t, n) {
var r = void 0 === n;
switch (t.length) {
case 0:
return r ? e() : e.call(n);
case 1:
return r ? e(t[0]) : e.call(n, t[0]);
case 2:
return r ? e(t[0], t[1]) : e.call(n, t[0], t[1]);
case 3:
return r ? e(t[0], t[1], t[2]) : e.call(n, t[0], t[1], t[2]);
case 4:
return r ? e(t[0], t[1], t[2], t[3]) : e.call(n, t[0], t[1], t[2], t[3])
}
return e.apply(n, t)
}
}, function (e, t, n) {
"use strict";
var r = n(3).parseInt, i = n(59).trim, a = n(97), o = /^[-+]?0[xX]/;
e.exports = 8 !== r(a + "08") || 22 !== r(a + "0x16") ? function (e, t) {
var n = i(String(e), 3);
return r(n, t >>> 0 || (o.test(n) ? 16 : 10))
} : r
}, function (e, t, n) {
"use strict";
var r = n(3).parseFloat, i = n(59).trim;
e.exports = 1 / r(n(97) + "-0") != -1 / 0 ? function (e) {
var t = i(String(e), 3), n = r(t);
return 0 === n && "-" == t.charAt(0) ? -0 : n
} : r
}, function (e, t, n) {
"use strict";
var r = n(27);
e.exports = function (e, t) {
if ("number" != typeof e && "Number" != r(e)) throw TypeError(t);
return +e
}
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Number", {isInteger: n(139)})
}, function (e, t, n) {
"use strict";
var r = n(5), i = Math.floor;
e.exports = function (e) {
return !r(e) && isFinite(e) && i(e) === e
}
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Number", {
isNaN: function (e) {
return e != e
}
})
}, function (e, t, n) {
"use strict";
e.exports = Math.log1p || function (e) {
return (e = +e) > -1e-8 && e < 1e-8 ? e - e * e / 2 : Math.log(1 + e)
}
}, function (e, t, n) {
"use strict";
var r = n(100), i = Math.pow, a = i(2, -52), o = i(2, -23), s = i(2, 127) * (2 - o), l = i(2, -126);
e.exports = Math.fround || function (e) {
var t, n, i = Math.abs(e), c = r(e);
return i < l ? c * (i / l / o + 1 / a - 1 / a) * l * o : (n = (t = (1 + o / a) * i) - (t - i)) > s || n != n ? c * (1 / 0) : c * n
}
}, function (e, t, n) {
"use strict";
var r = n(74)(!0);
n(102)(String, "String", function (e) {
this._t = String(e), this._i = 0
}, function () {
var e, t = this._t, n = this._i;
return n >= t.length ? {value: void 0, done: !0} : (e = r(t, n), this._i += e.length, {value: e, done: !1})
})
}, function (e, t, n) {
"use strict";
var r = n(1);
e.exports = function (e, t, n, i) {
try {
return i ? t(r(n)[0], n[1]) : t(n)
} catch (t) {
var a = e.return;
throw void 0 !== a && r(a.call(e)), t
}
}
}, function (e, t, n) {
"use strict";
var r = n(15), i = n(11), a = n(65), o = n(7);
e.exports = function (e, t, n, s, l) {
r(t);
var c = i(e), u = a(c), d = o(c.length), h = l ? d - 1 : 0, p = l ? -1 : 1;
if (n < 2) for (; ;) {
if (h in u) {
s = u[h], h += p;
break
}
if (h += p, l ? h < 0 : d <= h) throw TypeError("Reduce of empty array with no initial value")
}
for (; l ? h >= 0 : d > h; h += p) h in u && (s = t(s, u[h], h, c));
return s
}
}, function (e, t, n) {
"use strict";
var r = n(11), i = n(47), a = n(7);
e.exports = [].copyWithin || function (e, t) {
var n = r(this), o = a(n.length), s = i(e, o), l = i(t, o), c = arguments.length > 2 ? arguments[2] : void 0,
u = Math.min((void 0 === c ? o : i(c, o)) - l, o - s), d = 1;
for (l < s && s < l + u && (d = -1, l += u - 1, s += u - 1); u-- > 0;) l in n ? n[s] = n[l] : delete n[s], s += d, l += d;
return n
}
}, function (e, t, n) {
"use strict";
e.exports = function (e, t) {
return {value: t, done: !!e}
}
}, function (e, t, n) {
"use strict";
var r = n(112);
n(0)({target: "RegExp", proto: !0, forced: r !== /./.exec}, {exec: r})
}, function (e, t, n) {
"use strict";
n(8) && "g" != /./g.flags && n(10).f(RegExp.prototype, "flags", {configurable: !0, get: n(67)})
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = n(39), l = n(3), c = n(26), u = n(58), d = n(0), h = n(5), p = n(15), f = n(51), m = n(52),
v = n(68), g = n(114).set, y = n(115)(), b = n(116), w = n(151), S = n(79), _ = n(152), k = l.TypeError,
x = l.process, P = x && x.versions, C = P && P.v8 || "", A = l.Promise, T = "process" == u(x), E = function () {
}, D = i = b.f, I = !!function () {
try {
var e = A.resolve(1), t = (e.constructor = {})[n(6)("species")] = function (e) {
e(E, E)
};
return (T || "function" == typeof PromiseRejectionEvent) && e.then(E) instanceof t && 0 !== C.indexOf("6.6") && -1 === S.indexOf("Chrome/66")
} catch (e) {
}
}(), L = function (e) {
var t;
return !(!h(e) || "function" != typeof (t = e.then)) && t
}, O = function (e, t) {
if (!e._n) {
e._n = !0;
var n = e._c;
y(function () {
for (var r = e._v, i = 1 == e._s, a = 0, o = function (t) {
var n, a, o, s = i ? t.ok : t.fail, l = t.resolve, c = t.reject, u = t.domain;
try {
s ? (i || (2 == e._h && R(e), e._h = 1), !0 === s ? n = r : (u && u.enter(), n = s(r), u && (u.exit(), o = !0)), n === t.promise ? c(k("Promise-chain cycle")) : (a = L(n)) ? a.call(n, l, c) : l(n)) : c(r)
} catch (e) {
u && !o && u.exit(), c(e)
}
}; n.length > a;) o(n[a++]);
e._c = [], e._n = !1, t && !e._h && M(e)
})
}
}, M = function (e) {
g.call(l, function () {
var t, n, r, i = e._v, a = N(e);
if (a && (t = w(function () {
T ? x.emit("unhandledRejection", i, e) : (n = l.onunhandledrejection) ? n({
promise: e,
reason: i
}) : (r = l.console) && r.error && r.error("Unhandled promise rejection", i)
}), e._h = T || N(e) ? 2 : 1), e._a = void 0, a && t.e) throw t.v
})
}, N = function (e) {
return 1 !== e._h && 0 === (e._a || e._c).length
}, R = function (e) {
g.call(l, function () {
var t;
T ? x.emit("rejectionHandled", e) : (t = l.onrejectionhandled) && t({promise: e, reason: e._v})
})
}, W = function (e) {
var t = this;
t._d || (t._d = !0, (t = t._w || t)._v = e, t._s = 2, t._a || (t._a = t._c.slice()), O(t, !0))
}, V = function e(t) {
var n, r = this;
if (!r._d) {
r._d = !0, r = r._w || r;
try {
if (r === t) throw k("Promise can't be resolved itself");
(n = L(t)) ? y(function () {
var i = {_w: r, _d: !1};
try {
n.call(t, c(e, i, 1), c(W, i, 1))
} catch (e) {
W.call(i, e)
}
}) : (r._v = t, r._s = 1, O(r, !1))
} catch (e) {
W.call({_w: r, _d: !1}, e)
}
}
};
I || (A = function (e) {
f(this, A, "Promise", "_h"), p(e), r.call(this);
try {
e(c(V, this, 1), c(W, this, 1))
} catch (e) {
W.call(this, e)
}
}, (r = function (e) {
this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, this._n = !1
}).prototype = n(53)(A.prototype, {
then: function (e, t) {
var n = D(v(this, A));
return n.ok = "function" != typeof e || e, n.fail = "function" == typeof t && t, n.domain = T ? x.domain : void 0, this._c.push(n), this._a && this._a.push(n), this._s && O(this, !1), n.promise
}, catch: function (e) {
return this.then(void 0, e)
}
}), a = function () {
var e = new r;
this.promise = e, this.resolve = c(V, e, 1), this.reject = c(W, e, 1)
}, b.f = D = function (e) {
return e === A || e === o ? new a(e) : i(e)
}), d(d.G + d.W + d.F * !I, {Promise: A}), n(57)(A, "Promise"), n(50)("Promise"), o = n(13).Promise, d(d.S + d.F * !I, "Promise", {
reject: function (e) {
var t = D(this);
return (0, t.reject)(e), t.promise
}
}), d(d.S + d.F * (s || !I), "Promise", {
resolve: function (e) {
return _(s && this === o ? A : this, e)
}
}), d(d.S + d.F * !(I && n(76)(function (e) {
A.all(e).catch(E)
})), "Promise", {
all: function (e) {
var t = this, n = D(t), r = n.resolve, i = n.reject, a = w(function () {
var n = [], a = 0, o = 1;
m(e, !1, function (e) {
var s = a++, l = !1;
n.push(void 0), o++, t.resolve(e).then(function (e) {
l || (l = !0, n[s] = e, --o || r(n))
}, i)
}), --o || r(n)
});
return a.e && i(a.v), n.promise
}, race: function (e) {
var t = this, n = D(t), r = n.reject, i = w(function () {
m(e, !1, function (e) {
t.resolve(e).then(n.resolve, r)
})
});
return i.e && r(i.v), n.promise
}
})
}, function (e, t, n) {
"use strict";
e.exports = function (e) {
try {
return {e: !1, v: e()}
} catch (e) {
return {e: !0, v: e}
}
}
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(5), a = n(116);
e.exports = function (e, t) {
if (r(e), i(t) && t.constructor === e) return t;
var n = a.f(e);
return (0, n.resolve)(t), n.promise
}
}, function (e, t, n) {
"use strict";
var r = n(154), i = n(54);
e.exports = n(80)("Map", function (e) {
return function () {
return e(this, arguments.length > 0 ? arguments[0] : void 0)
}
}, {
get: function (e) {
var t = r.getEntry(i(this, "Map"), e);
return t && t.v
}, set: function (e, t) {
return r.def(i(this, "Map"), 0 === e ? 0 : e, t)
}
}, r, !0)
}, function (e, t, n) {
"use strict";
var r = n(10).f, i = n(48), a = n(53), o = n(26), s = n(51), l = n(52), c = n(102), u = n(147), d = n(50), h = n(8),
p = n(40).fastKey, f = n(54), m = h ? "_s" : "size", v = function (e, t) {
var n, r = p(t);
if ("F" !== r) return e._i[r];
for (n = e._f; n; n = n.n) if (n.k == t) return n
};
e.exports = {
getConstructor: function (e, t, n, c) {
var u = e(function (e, r) {
s(e, u, t, "_i"), e._t = t, e._i = i(null), e._f = void 0, e._l = void 0, e[m] = 0, void 0 != r && l(r, n, e[c], e)
});
return a(u.prototype, {
clear: function () {
for (var e = f(this, t), n = e._i, r = e._f; r; r = r.n) r.r = !0, r.p && (r.p = r.p.n = void 0), delete n[r.i];
e._f = e._l = void 0, e[m] = 0
}, delete: function (e) {
var n = f(this, t), r = v(n, e);
if (r) {
var i = r.n, a = r.p;
delete n._i[r.i], r.r = !0, a && (a.n = i), i && (i.p = a), n._f == r && (n._f = i), n._l == r && (n._l = a), n[m]--
}
return !!r
}, forEach: function (e) {
f(this, t);
for (var n, r = o(e, arguments.length > 1 ? arguments[1] : void 0, 3); n = n ? n.n : this._f;) for (r(n.v, n.k, this); n && n.r;) n = n.p
}, has: function (e) {
return !!v(f(this, t), e)
}
}), h && r(u.prototype, "size", {
get: function () {
return f(this, t)[m]
}
}), u
}, def: function (e, t, n) {
var r, i, a = v(e, t);
return a ? a.v = n : (e._l = a = {
i: i = p(t, !0),
k: t,
v: n,
p: r = e._l,
n: void 0,
r: !1
}, e._f || (e._f = a), r && (r.n = a), e[m]++, "F" !== i && (e._i[i] = a)), e
}, getEntry: v, setStrong: function (e, t, n) {
c(e, t, function (e, n) {
this._t = f(e, t), this._k = n, this._l = void 0
}, function () {
for (var e = this._k, t = this._l; t && t.r;) t = t.p;
return this._t && (this._l = t = t ? t.n : this._t._f) ? u(0, "keys" == e ? t.k : "values" == e ? t.v : [t.k, t.v]) : (this._t = void 0, u(1))
}, n ? "entries" : "values", !n, !0), d(t)
}
}
}, function (e, t, n) {
"use strict";
var r = n(154), i = n(54);
e.exports = n(80)("Set", function (e) {
return function () {
return e(this, arguments.length > 0 ? arguments[0] : void 0)
}
}, {
add: function (e) {
return r.def(i(this, "Set"), e = 0 === e ? 0 : e, e)
}
}, r)
}, function (e, t, n) {
"use strict";
var r = n(53), i = n(40).getWeak, a = n(1), o = n(5), s = n(51), l = n(52), c = n(33), u = n(22), d = n(54), h = c(5),
p = c(6), f = 0, m = function (e) {
return e._l || (e._l = new v)
}, v = function () {
this.a = []
}, g = function (e, t) {
return h(e.a, function (e) {
return e[0] === t
})
};
v.prototype = {
get: function (e) {
var t = g(this, e);
if (t) return t[1]
}, has: function (e) {
return !!g(this, e)
}, set: function (e, t) {
var n = g(this, e);
n ? n[1] = t : this.a.push([e, t])
}, delete: function (e) {
var t = p(this.a, function (t) {
return t[0] === e
});
return ~t && this.a.splice(t, 1), !!~t
}
}, e.exports = {
getConstructor: function (e, t, n, a) {
var c = e(function (e, r) {
s(e, c, t, "_i"), e._t = t, e._i = f++, e._l = void 0, void 0 != r && l(r, n, e[a], e)
});
return r(c.prototype, {
delete: function (e) {
if (!o(e)) return !1;
var n = i(e);
return !0 === n ? m(d(this, t)).delete(e) : n && u(n, this._i) && delete n[this._i]
}, has: function (e) {
if (!o(e)) return !1;
var n = i(e);
return !0 === n ? m(d(this, t)).has(e) : n && u(n, this._i)
}
}), c
}, def: function (e, t, n) {
var r = i(a(t), !0);
return !0 === r ? m(e).set(t, n) : r[e._i] = n, e
}, ufstore: m
}
}, function (e, t, n) {
"use strict";
var r = n(28), i = n(7);
e.exports = function (e) {
if (void 0 === e) return 0;
var t = r(e), n = i(t);
if (t !== n) throw RangeError("Wrong length!");
return n
}
}, function (e, t, n) {
"use strict";
n(35)("Uint8", 1, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
}, !0)
}, function (e, t, n) {
"use strict";
var r = n(49), i = n(72), a = n(1), o = n(3).Reflect;
e.exports = o && o.ownKeys || function (e) {
var t = r.f(a(e)), n = i.f;
return n ? t.concat(n(e)) : t
}
}, function (e, t, n) {
"use strict";
var r = n(73), i = n(5), a = n(7), o = n(26), s = n(6)("isConcatSpreadable");
e.exports = function e(t, n, l, c, u, d, h, p) {
for (var f, m, v = u, g = 0, y = !!h && o(h, p, 3); g < c;) {
if (g in l) {
if (f = y ? y(l[g], g, n) : l[g], m = !1, i(f) && (m = void 0 !== (m = f[s]) ? !!m : r(f)), m && d > 0) v = e(t, n, f, a(f.length), v, d - 1) - 1; else {
if (v >= 9007199254740991) throw TypeError();
t[v] = f
}
v++
}
g++
}
return v
}
}, function (e, t, n) {
"use strict";
var r = n(7), i = n(99), a = n(31);
e.exports = function (e, t, n, o) {
var s = String(a(e)), l = s.length, c = void 0 === n ? " " : String(n), u = r(t);
if (u <= l || "" == c) return s;
var d = u - l, h = i.call(c, Math.ceil(d / c.length));
return h.length > d && (h = h.slice(0, d)), o ? h + s : s + h
}
}, function (e, t, n) {
"use strict";
var r = n(8), i = n(46), a = n(23), o = n(66).f;
e.exports = function (e) {
return function (t) {
for (var n, s = a(t), l = i(s), c = l.length, u = 0, d = []; c > u;) n = l[u++], r && !o.call(s, n) || d.push(e ? [n, s[n]] : s[n]);
return d
}
}
}, function (e, t, n) {
"use strict";
var r = n(58), i = n(164);
e.exports = function (e) {
return function () {
if (r(this) != e) throw TypeError(e + "#toJSON isn't generic");
return i(this)
}
}
}, function (e, t, n) {
"use strict";
var r = n(52);
e.exports = function (e, t) {
var n = [];
return r(e, !1, n.push, n, t), n
}
}, function (e, t, n) {
"use strict";
n(83)("WeakMap")
}, function (e, t, n) {
"use strict";
n(84)("WeakMap")
}, function (e, t, n) {
"use strict";
e.exports = Math.scale || function (e, t, n, r, i) {
return 0 === arguments.length || e != e || t != t || n != n || r != r || i != i ? NaN : e === 1 / 0 || e === -1 / 0 ? e : (e - t) * (i - r) / (n - t) + r
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(13), a = n(3), o = n(68), s = n(152);
r(r.P + r.R, "Promise", {
finally: function (e) {
var t = o(this, i.Promise || a.Promise), n = "function" == typeof e;
return this.then(n ? function (n) {
return s(t, e()).then(function () {
return n
})
} : e, n ? function (n) {
return s(t, e()).then(function () {
throw n
})
} : e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(116), a = n(151);
r(r.S, "Promise", {
try: function (e) {
var t = i.f(this), n = a(e);
return (n.e ? t.reject : t.resolve)(n.v), t.promise
}
})
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KGAnnotationViewer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.setBorder = s;
var i = n(16), a = n(70), o = n(37);
function s(e) {
for (var t = document.getElementsByClassName("stampAnnotation"), n = 0; n < t.length; n++) t[n].style.border && (t[n].style.border = "");
e && "SECTION" === e.nodeName && (e.style.border = "1px dashed #000")
}
var l = function () {
function e(t) {
var n = t.app, r = t.container, i = t.button;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = n, this.container = r, this.button = i, this.annotationList = [], !0 === window.KGPdfViewerWebApp.textToSeal || null != window.KGPdfViewerWebApp.annotationVisibleType ? this.app.pdfViewer.container.addEventListener("click", s) : this.button.style.display = "none"
}
return r(e, [{
key: "init", value: function () {
var e = this;
window.KGPdfViewerWebApp.getAnnotationList().then(function (t) {
t && t instanceof Array == !0 ? e.annotationList = t.map(function (e) {
return e.x = e.X, e.y = e.Y, e.page = e.pageNo, delete e.X, delete e.Y, delete e.pageNo, e
}) : e.annotationList = [], e.renderList()
})
}
}, {
key: "renderList", value: function () {
var e = this;
this.container.innerHTML = "";
var t = this.formatSealsData(), n = void 0;
null != window.KGPdfViewerWebApp.annotationVisibleType ? n = window.KGPdfViewerWebApp.annotationVisibleType : window.KGPdfViewerWebApp.textToSealDefault.visibleType && (n = window.KGPdfViewerWebApp.textToSealDefault.visibleType), (n ? this.annotationList.concat(t).filter(function (e) {
try {
var t = JSON.parse(e.annotInfo);
return !(!t || !t.hasOwnProperty("customType")) && t.customType.toString() === n
} catch (e) {
return !1
}
}).sort(function (e, t) {
return Number(e.page || e.pageNo) - Number(t.page || t.pageNo)
}) : []).forEach(function (t) {
var n = document.createElement("div");
n.setAttribute("class", "annotationItem");
var r = document.createElement("a"), a = Number(t.page || t.pageNo);
r.title = r.innerText = "第" + a + "页 " + t.authorName + "\n" + t.createTime;
var l = e.app.pdfViewer, c = l.getPageView(a - 1), u = c.viewport.viewBox[3] - t.y,
d = [{num: a, gen: 0}, {name: "XYZ"}, t.x, u, 0];
r.onclick = function () {
l.scrollPageIntoView({pageNumber: a, destArray: d}), c.onAfterDraw = function () {
for (var e = c.annotationLayer.div.getElementsByTagName("section"), n = void 0, r = 0; r < e.length; r++) {
var i = Math.round((0, o.getNumbOfPx)(e[r].style.left)), a = Math.round(t.x),
l = Math.round((0, o.getNumbOfPx)(e[r].style.top)), u = Math.round(t.y);
if (i >= a - 3 && i <= a + 3 && l >= u - 3 && l <= u + 3) {
n = e[r];
break
}
}
n && s(n), c.onAfterDraw = null
}, c.destroy(), c.renderingState = i.RenderingStates.INITIAL, c.draw(), l.update()
}, n.appendChild(r), e.container.appendChild(n)
})
}
}, {
key: "formatSealsData", value: function () {
var e = this.app.KGTextToSeal ? (0, a.arrayDeepCopy)(this.app.KGTextToSeal.seals) : [];
return e.forEach(function (e) {
e.x = e.left, e.y = e.top, e.authorName = window.KGPdfViewerWebApp.userId, delete e.createTime, delete e.imgData, delete e.height, delete e.width, delete e.section, delete e.top, delete e.left
}), e
}
}]), e
}();
t.KGAnnotationViewer = l
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return function () {
var t = e, n = t.lib.BlockCipher, r = t.algo, i = [], a = [], o = [], s = [], l = [], c = [], u = [], d = [],
h = [], p = [];
!function () {
for (var e = [], t = 0; t < 256; t++) e[t] = t < 128 ? t << 1 : t << 1 ^ 283;
var n = 0, r = 0;
for (t = 0; t < 256; t++) {
var f = r ^ r << 1 ^ r << 2 ^ r << 3 ^ r << 4;
f = f >>> 8 ^ 255 & f ^ 99, i[n] = f, a[f] = n;
var m = e[n], v = e[m], g = e[v], y = 257 * e[f] ^ 16843008 * f;
o[n] = y << 24 | y >>> 8, s[n] = y << 16 | y >>> 16, l[n] = y << 8 | y >>> 24, c[n] = y;
y = 16843009 * g ^ 65537 * v ^ 257 * m ^ 16843008 * n;
u[f] = y << 24 | y >>> 8, d[f] = y << 16 | y >>> 16, h[f] = y << 8 | y >>> 24, p[f] = y, n ? (n = m ^ e[e[e[g ^ m]]], r ^= e[e[r]]) : n = r = 1
}
}();
var f = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], m = r.AES = n.extend({
_doReset: function () {
if (!this._nRounds || this._keyPriorReset !== this._key) {
for (var e = this._keyPriorReset = this._key, t = e.words, n = e.sigBytes / 4, r = 4 * ((this._nRounds = n + 6) + 1), a = this._keySchedule = [], o = 0; o < r; o++) o < n ? a[o] = t[o] : (c = a[o - 1], o % n ? n > 6 && o % n == 4 && (c = i[c >>> 24] << 24 | i[c >>> 16 & 255] << 16 | i[c >>> 8 & 255] << 8 | i[255 & c]) : (c = i[(c = c << 8 | c >>> 24) >>> 24] << 24 | i[c >>> 16 & 255] << 16 | i[c >>> 8 & 255] << 8 | i[255 & c], c ^= f[o / n | 0] << 24), a[o] = a[o - n] ^ c);
for (var s = this._invKeySchedule = [], l = 0; l < r; l++) {
o = r - l;
if (l % 4) var c = a[o]; else c = a[o - 4];
s[l] = l < 4 || o <= 4 ? c : u[i[c >>> 24]] ^ d[i[c >>> 16 & 255]] ^ h[i[c >>> 8 & 255]] ^ p[i[255 & c]]
}
}
}, encryptBlock: function (e, t) {
this._doCryptBlock(e, t, this._keySchedule, o, s, l, c, i)
}, decryptBlock: function (e, t) {
var n = e[t + 1];
e[t + 1] = e[t + 3], e[t + 3] = n, this._doCryptBlock(e, t, this._invKeySchedule, u, d, h, p, a);
n = e[t + 1];
e[t + 1] = e[t + 3], e[t + 3] = n
}, _doCryptBlock: function (e, t, n, r, i, a, o, s) {
for (var l = this._nRounds, c = e[t] ^ n[0], u = e[t + 1] ^ n[1], d = e[t + 2] ^ n[2], h = e[t + 3] ^ n[3], p = 4, f = 1; f < l; f++) {
var m = r[c >>> 24] ^ i[u >>> 16 & 255] ^ a[d >>> 8 & 255] ^ o[255 & h] ^ n[p++],
v = r[u >>> 24] ^ i[d >>> 16 & 255] ^ a[h >>> 8 & 255] ^ o[255 & c] ^ n[p++],
g = r[d >>> 24] ^ i[h >>> 16 & 255] ^ a[c >>> 8 & 255] ^ o[255 & u] ^ n[p++],
y = r[h >>> 24] ^ i[c >>> 16 & 255] ^ a[u >>> 8 & 255] ^ o[255 & d] ^ n[p++];
c = m, u = v, d = g, h = y
}
m = (s[c >>> 24] << 24 | s[u >>> 16 & 255] << 16 | s[d >>> 8 & 255] << 8 | s[255 & h]) ^ n[p++], v = (s[u >>> 24] << 24 | s[d >>> 16 & 255] << 16 | s[h >>> 8 & 255] << 8 | s[255 & c]) ^ n[p++], g = (s[d >>> 24] << 24 | s[h >>> 16 & 255] << 16 | s[c >>> 8 & 255] << 8 | s[255 & u]) ^ n[p++], y = (s[h >>> 24] << 24 | s[c >>> 16 & 255] << 16 | s[u >>> 8 & 255] << 8 | s[255 & d]) ^ n[p++];
e[t] = m, e[t + 1] = v, e[t + 2] = g, e[t + 3] = y
}, keySize: 8
});
t.AES = n._createHelper(m)
}(), e.AES
}, "object" === s(t) ? e.exports = t = o(n(12), n(17), n(172), n(85), n(175)) : (i = [n(12), n(17), n(172), n(85), n(175)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return function (t) {
var n = e, r = n.lib, i = r.WordArray, a = r.Hasher, o = n.algo, s = [];
!function () {
for (var e = 0; e < 64; e++) s[e] = 4294967296 * t.abs(t.sin(e + 1)) | 0
}();
var l = o.MD5 = a.extend({
_doReset: function () {
this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878])
}, _doProcessBlock: function (e, t) {
for (var n = 0; n < 16; n++) {
var r = t + n, i = e[r];
e[r] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8)
}
var a = this._hash.words, o = e[t + 0], l = e[t + 1], p = e[t + 2], f = e[t + 3], m = e[t + 4], v = e[t + 5],
g = e[t + 6], y = e[t + 7], b = e[t + 8], w = e[t + 9], S = e[t + 10], _ = e[t + 11], k = e[t + 12],
x = e[t + 13], P = e[t + 14], C = e[t + 15], A = a[0], T = a[1], E = a[2], D = a[3];
T = h(T = h(T = h(T = h(T = d(T = d(T = d(T = d(T = u(T = u(T = u(T = u(T = c(T = c(T = c(T = c(T, E = c(E, D = c(D, A = c(A, T, E, D, o, 7, s[0]), T, E, l, 12, s[1]), A, T, p, 17, s[2]), D, A, f, 22, s[3]), E = c(E, D = c(D, A = c(A, T, E, D, m, 7, s[4]), T, E, v, 12, s[5]), A, T, g, 17, s[6]), D, A, y, 22, s[7]), E = c(E, D = c(D, A = c(A, T, E, D, b, 7, s[8]), T, E, w, 12, s[9]), A, T, S, 17, s[10]), D, A, _, 22, s[11]), E = c(E, D = c(D, A = c(A, T, E, D, k, 7, s[12]), T, E, x, 12, s[13]), A, T, P, 17, s[14]), D, A, C, 22, s[15]), E = u(E, D = u(D, A = u(A, T, E, D, l, 5, s[16]), T, E, g, 9, s[17]), A, T, _, 14, s[18]), D, A, o, 20, s[19]), E = u(E, D = u(D, A = u(A, T, E, D, v, 5, s[20]), T, E, S, 9, s[21]), A, T, C, 14, s[22]), D, A, m, 20, s[23]), E = u(E, D = u(D, A = u(A, T, E, D, w, 5, s[24]), T, E, P, 9, s[25]), A, T, f, 14, s[26]), D, A, b, 20, s[27]), E = u(E, D = u(D, A = u(A, T, E, D, x, 5, s[28]), T, E, p, 9, s[29]), A, T, y, 14, s[30]), D, A, k, 20, s[31]), E = d(E, D = d(D, A = d(A, T, E, D, v, 4, s[32]), T, E, b, 11, s[33]), A, T, _, 16, s[34]), D, A, P, 23, s[35]), E = d(E, D = d(D, A = d(A, T, E, D, l, 4, s[36]), T, E, m, 11, s[37]), A, T, y, 16, s[38]), D, A, S, 23, s[39]), E = d(E, D = d(D, A = d(A, T, E, D, x, 4, s[40]), T, E, o, 11, s[41]), A, T, f, 16, s[42]), D, A, g, 23, s[43]), E = d(E, D = d(D, A = d(A, T, E, D, w, 4, s[44]), T, E, k, 11, s[45]), A, T, C, 16, s[46]), D, A, p, 23, s[47]), E = h(E, D = h(D, A = h(A, T, E, D, o, 6, s[48]), T, E, y, 10, s[49]), A, T, P, 15, s[50]), D, A, v, 21, s[51]), E = h(E, D = h(D, A = h(A, T, E, D, k, 6, s[52]), T, E, f, 10, s[53]), A, T, S, 15, s[54]), D, A, l, 21, s[55]), E = h(E, D = h(D, A = h(A, T, E, D, b, 6, s[56]), T, E, C, 10, s[57]), A, T, g, 15, s[58]), D, A, x, 21, s[59]), E = h(E, D = h(D, A = h(A, T, E, D, m, 6, s[60]), T, E, _, 10, s[61]), A, T, p, 15, s[62]), D, A, w, 21, s[63]), a[0] = a[0] + A | 0, a[1] = a[1] + T | 0, a[2] = a[2] + E | 0, a[3] = a[3] + D | 0
}, _doFinalize: function () {
var e = this._data, n = e.words, r = 8 * this._nDataBytes, i = 8 * e.sigBytes;
n[i >>> 5] |= 128 << 24 - i % 32;
var a = t.floor(r / 4294967296), o = r;
n[15 + (i + 64 >>> 9 << 4)] = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8), n[14 + (i + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), e.sigBytes = 4 * (n.length + 1), this._process();
for (var s = this._hash, l = s.words, c = 0; c < 4; c++) {
var u = l[c];
l[c] = 16711935 & (u << 8 | u >>> 24) | 4278255360 & (u << 24 | u >>> 8)
}
return s
}, clone: function () {
var e = a.clone.call(this);
return e._hash = this._hash.clone(), e
}
});
function c(e, t, n, r, i, a, o) {
var s = e + (t & n | ~t & r) + i + o;
return (s << a | s >>> 32 - a) + t
}
function u(e, t, n, r, i, a, o) {
var s = e + (t & r | n & ~r) + i + o;
return (s << a | s >>> 32 - a) + t
}
function d(e, t, n, r, i, a, o) {
var s = e + (t ^ n ^ r) + i + o;
return (s << a | s >>> 32 - a) + t
}
function h(e, t, n, r, i, a, o) {
var s = e + (n ^ (t | ~r)) + i + o;
return (s << a | s >>> 32 - a) + t
}
n.MD5 = a._createHelper(l), n.HmacMD5 = a._createHmacHelper(l)
}(Math), e.MD5
}, "object" === s(t) ? e.exports = t = o(n(12)) : (i = [n(12)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
var t, n, r, i, a, o;
return n = (t = e).lib, r = n.WordArray, i = n.Hasher, a = [], o = t.algo.SHA1 = i.extend({
_doReset: function () {
this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
}, _doProcessBlock: function (e, t) {
for (var n = this._hash.words, r = n[0], i = n[1], o = n[2], s = n[3], l = n[4], c = 0; c < 80; c++) {
if (c < 16) a[c] = 0 | e[t + c]; else {
var u = a[c - 3] ^ a[c - 8] ^ a[c - 14] ^ a[c - 16];
a[c] = u << 1 | u >>> 31
}
var d = (r << 5 | r >>> 27) + l + a[c];
d += c < 20 ? 1518500249 + (i & o | ~i & s) : c < 40 ? 1859775393 + (i ^ o ^ s) : c < 60 ? (i & o | i & s | o & s) - 1894007588 : (i ^ o ^ s) - 899497514, l = s, s = o, o = i << 30 | i >>> 2, i = r, r = d
}
n[0] = n[0] + r | 0, n[1] = n[1] + i | 0, n[2] = n[2] + o | 0, n[3] = n[3] + s | 0, n[4] = n[4] + l | 0
}, _doFinalize: function () {
var e = this._data, t = e.words, n = 8 * this._nDataBytes, r = 8 * e.sigBytes;
return t[r >>> 5] |= 128 << 24 - r % 32, t[14 + (r + 64 >>> 9 << 4)] = Math.floor(n / 4294967296), t[15 + (r + 64 >>> 9 << 4)] = n, e.sigBytes = 4 * t.length, this._process(), this._hash
}, clone: function () {
var e = i.clone.call(this);
return e._hash = this._hash.clone(), e
}
}), t.SHA1 = i._createHelper(o), t.HmacSHA1 = i._createHmacHelper(o), e.SHA1
}, "object" === s(t) ? e.exports = t = o(n(12)) : (i = [n(12)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
var t, n, r;
n = (t = e).lib.Base, r = t.enc.Utf8, t.algo.HMAC = n.extend({
init: function (e, t) {
e = this._hasher = new e.init, "string" == typeof t && (t = r.parse(t));
var n = e.blockSize, i = 4 * n;
t.sigBytes > i && (t = e.finalize(t)), t.clamp();
for (var a = this._oKey = t.clone(), o = this._iKey = t.clone(), s = a.words, l = o.words, c = 0; c < n; c++) s[c] ^= 1549556828, l[c] ^= 909522486;
a.sigBytes = o.sigBytes = i, this.reset()
}, reset: function () {
var e = this._hasher;
e.reset(), e.update(this._iKey)
}, update: function (e) {
return this._hasher.update(e), this
}, finalize: function (e) {
var t = this._hasher, n = t.finalize(e);
return t.reset(), t.finalize(this._oKey.clone().concat(n))
}
})
}, "object" === s(t) ? e.exports = t = o(n(12)) : (i = [n(12)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
e.lib.Cipher || function (t) {
var n = e, r = n.lib, i = r.Base, a = r.WordArray, o = r.BufferedBlockAlgorithm, s = n.enc,
l = (s.Utf8, s.Base64), c = n.algo.EvpKDF, u = r.Cipher = o.extend({
cfg: i.extend(), createEncryptor: function (e, t) {
return this.create(this._ENC_XFORM_MODE, e, t)
}, createDecryptor: function (e, t) {
return this.create(this._DEC_XFORM_MODE, e, t)
}, init: function (e, t, n) {
this.cfg = this.cfg.extend(n), this._xformMode = e, this._key = t, this.reset()
}, reset: function () {
o.reset.call(this), this._doReset()
}, process: function (e) {
return this._append(e), this._process()
}, finalize: function (e) {
return e && this._append(e), this._doFinalize()
}, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function () {
function e(e) {
return "string" == typeof e ? b : g
}
return function (t) {
return {
encrypt: function (n, r, i) {
return e(r).encrypt(t, n, r, i)
}, decrypt: function (n, r, i) {
return e(r).decrypt(t, n, r, i)
}
}
}
}()
}), d = (r.StreamCipher = u.extend({
_doFinalize: function () {
return this._process(!0)
}, blockSize: 1
}), n.mode = {}), h = r.BlockCipherMode = i.extend({
createEncryptor: function (e, t) {
return this.Encryptor.create(e, t)
}, createDecryptor: function (e, t) {
return this.Decryptor.create(e, t)
}, init: function (e, t) {
this._cipher = e, this._iv = t
}
}), p = d.CBC = function () {
var e = h.extend();
function n(e, n, r) {
var i, a = this._iv;
a ? (i = a, this._iv = t) : i = this._prevBlock;
for (var o = 0; o < r; o++) e[n + o] ^= i[o]
}
return e.Encryptor = e.extend({
processBlock: function (e, t) {
var r = this._cipher, i = r.blockSize;
n.call(this, e, t, i), r.encryptBlock(e, t), this._prevBlock = e.slice(t, t + i)
}
}), e.Decryptor = e.extend({
processBlock: function (e, t) {
var r = this._cipher, i = r.blockSize, a = e.slice(t, t + i);
r.decryptBlock(e, t), n.call(this, e, t, i), this._prevBlock = a
}
}), e
}(), f = (n.pad = {}).Pkcs7 = {
pad: function (e, t) {
for (var n = 4 * t, r = n - e.sigBytes % n, i = r << 24 | r << 16 | r << 8 | r, o = [], s = 0; s < r; s += 4) o.push(i);
var l = a.create(o, r);
e.concat(l)
}, unpad: function (e) {
var t = 255 & e.words[e.sigBytes - 1 >>> 2];
e.sigBytes -= t
}
}, m = (r.BlockCipher = u.extend({
cfg: u.cfg.extend({mode: p, padding: f}), reset: function () {
var e;
u.reset.call(this);
var t = this.cfg, n = t.iv, r = t.mode;
this._xformMode == this._ENC_XFORM_MODE ? e = r.createEncryptor : (e = r.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == e ? this._mode.init(this, n && n.words) : (this._mode = e.call(r, this, n && n.words), this._mode.__creator = e)
}, _doProcessBlock: function (e, t) {
this._mode.processBlock(e, t)
}, _doFinalize: function () {
var e, t = this.cfg.padding;
return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize), e = this._process(!0)) : (e = this._process(!0), t.unpad(e)), e
}, blockSize: 4
}), r.CipherParams = i.extend({
init: function (e) {
this.mixIn(e)
}, toString: function (e) {
return (e || this.formatter).stringify(this)
}
})), v = (n.format = {}).OpenSSL = {
stringify: function (e) {
var t = e.ciphertext, n = e.salt;
return (n ? a.create([1398893684, 1701076831]).concat(n).concat(t) : t).toString(l)
}, parse: function (e) {
var t, n = l.parse(e), r = n.words;
return 1398893684 == r[0] && 1701076831 == r[1] && (t = a.create(r.slice(2, 4)), r.splice(0, 4), n.sigBytes -= 16), m.create({
ciphertext: n,
salt: t
})
}
}, g = r.SerializableCipher = i.extend({
cfg: i.extend({format: v}), encrypt: function (e, t, n, r) {
r = this.cfg.extend(r);
var i = e.createEncryptor(n, r), a = i.finalize(t), o = i.cfg;
return m.create({
ciphertext: a,
key: n,
iv: o.iv,
algorithm: e,
mode: o.mode,
padding: o.padding,
blockSize: e.blockSize,
formatter: r.format
})
}, decrypt: function (e, t, n, r) {
return r = this.cfg.extend(r), t = this._parse(t, r.format), e.createDecryptor(n, r).finalize(t.ciphertext)
}, _parse: function (e, t) {
return "string" == typeof e ? t.parse(e, this) : e
}
}), y = (n.kdf = {}).OpenSSL = {
execute: function (e, t, n, r) {
r || (r = a.random(8));
var i = c.create({keySize: t + n}).compute(e, r), o = a.create(i.words.slice(t), 4 * n);
return i.sigBytes = 4 * t, m.create({key: i, iv: o, salt: r})
}
}, b = r.PasswordBasedCipher = g.extend({
cfg: g.cfg.extend({kdf: y}), encrypt: function (e, t, n, r) {
var i = (r = this.cfg.extend(r)).kdf.execute(n, e.keySize, e.ivSize);
r.iv = i.iv;
var a = g.encrypt.call(this, e, t, i.key, r);
return a.mixIn(i), a
}, decrypt: function (e, t, n, r) {
r = this.cfg.extend(r), t = this._parse(t, r.format);
var i = r.kdf.execute(n, e.keySize, e.ivSize, t.salt);
return r.iv = i.iv, g.decrypt.call(this, e, t, i.key, r)
}
})
}()
}, "object" === s(t) ? e.exports = t = o(n(12), n(85)) : (i = [n(12), n(85)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r, i, a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
r = window, i = function () {
return function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {exports: {}, id: r, loaded: !1};
return e[r].call(i.exports, i, i.exports, n), i.loaded = !0, i.exports
}
return n.m = e, n.c = t, n.p = "", n(0)
}([function (e, t, n) {
e.exports = n(1)
}, function (e, t, n) {
var r = n(2), i = n(3), a = n(5), o = n(6);
function s(e) {
var t = new a(e), n = i(a.prototype.request, t);
return r.extend(n, a.prototype, t), r.extend(n, t), n
}
var l = s(o);
l.Axios = a, l.create = function (e) {
return s(r.merge(o, e))
}, l.Cancel = n(23), l.CancelToken = n(24), l.isCancel = n(20), l.all = function (e) {
return Promise.all(e)
}, l.spread = n(25), e.exports = l, e.exports.default = l
}, function (e, t, n) {
var r = n(3), i = n(4), o = Object.prototype.toString;
function s(e) {
return "[object Array]" === o.call(e)
}
function l(e) {
return null !== e && "object" === (void 0 === e ? "undefined" : a(e))
}
function c(e) {
return "[object Function]" === o.call(e)
}
function u(e, t) {
if (null !== e && void 0 !== e) if ("object" === (void 0 === e ? "undefined" : a(e)) || s(e) || (e = [e]), s(e)) for (var n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e); else for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.call(null, e[i], i, e)
}
e.exports = {
isArray: s, isArrayBuffer: function (e) {
return "[object ArrayBuffer]" === o.call(e)
}, isBuffer: i, isFormData: function (e) {
return "undefined" != typeof FormData && e instanceof FormData
}, isArrayBufferView: function (e) {
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer
}, isString: function (e) {
return "string" == typeof e
}, isNumber: function (e) {
return "number" == typeof e
}, isObject: l, isUndefined: function (e) {
return void 0 === e
}, isDate: function (e) {
return "[object Date]" === o.call(e)
}, isFile: function (e) {
return "[object File]" === o.call(e)
}, isBlob: function (e) {
return "[object Blob]" === o.call(e)
}, isFunction: c, isStream: function (e) {
return l(e) && c(e.pipe)
}, isURLSearchParams: function (e) {
return "undefined" != typeof URLSearchParams && e instanceof URLSearchParams
}, isStandardBrowserEnv: function () {
return ("undefined" == typeof navigator || "ReactNative" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document
}, forEach: u, merge: function e() {
var t = {};
function n(n, r) {
"object" === a(t[r]) && "object" === (void 0 === n ? "undefined" : a(n)) ? t[r] = e(t[r], n) : t[r] = n
}
for (var r = 0, i = arguments.length; r < i; r++) u(arguments[r], n);
return t
}, extend: function (e, t, n) {
return u(t, function (t, i) {
e[i] = n && "function" == typeof t ? r(t, n) : t
}), e
}, trim: function (e) {
return e.replace(/^\s*/, "").replace(/\s*$/, "")
}
}
}, function (e, t) {
e.exports = function (e, t) {
return function () {
for (var n = new Array(arguments.length), r = 0; r < n.length; r++) n[r] = arguments[r];
return e.apply(t, n)
}
}
}, function (e, t) {
function n(e) {
return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
}
e.exports = function (e) {
return null != e && (n(e) || function (e) {
return "function" == typeof e.readFloatLE && "function" == typeof e.slice && n(e.slice(0, 0))
}(e) || !!e._isBuffer)
}
}, function (e, t, n) {
var r = n(6), i = n(2), a = n(17), o = n(18);
function s(e) {
this.defaults = e, this.interceptors = {request: new a, response: new a}
}
s.prototype.request = function (e) {
"string" == typeof e && (e = i.merge({url: arguments[0]}, arguments[1])), (e = i.merge(r, this.defaults, {method: "get"}, e)).method = e.method.toLowerCase();
var t = [o, void 0], n = Promise.resolve(e);
for (this.interceptors.request.forEach(function (e) {
t.unshift(e.fulfilled, e.rejected)
}), this.interceptors.response.forEach(function (e) {
t.push(e.fulfilled, e.rejected)
}); t.length;) n = n.then(t.shift(), t.shift());
return n
}, i.forEach(["delete", "get", "head", "options"], function (e) {
s.prototype[e] = function (t, n) {
return this.request(i.merge(n || {}, {method: e, url: t}))
}
}), i.forEach(["post", "put", "patch"], function (e) {
s.prototype[e] = function (t, n, r) {
return this.request(i.merge(r || {}, {method: e, url: t, data: n}))
}
}), e.exports = s
}, function (e, t, n) {
var r = n(2), i = n(7), a = {"Content-Type": "application/x-www-form-urlencoded"};
function o(e, t) {
!r.isUndefined(e) && r.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t)
}
var s, l = {
adapter: ("undefined" != typeof XMLHttpRequest ? s = n(8) : "undefined" != typeof process && (s = n(8)), s),
transformRequest: [function (e, t) {
if (i(t, "Content-Type"), r.isFormData(e) || r.isArrayBuffer(e) || r.isBuffer(e) || r.isStream(e) || r.isFile(e) || r.isBlob(e)) return e;
if (r.isArrayBufferView(e)) return e.buffer;
if (r.isURLSearchParams(e)) return o(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString();
if (r.isObject(e)) {
if ("application/json" === t["Content-Type"]) return o(t, "application/json;charset=utf-8"), JSON.stringify(e);
o(t, "application/x-www-form-urlencoded;charset=utf-8");
var n = new Array;
for (var a in e) n.push(a + "=" + encodeURI(e[a]));
return n.join("&")
}
return e
}],
transformResponse: [function (e) {
if ("string" == typeof e) try {
e = JSON.parse(e)
} catch (e) {
}
return e
}],
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
validateStatus: function (e) {
return e >= 200 && e < 300
}
};
l.headers = {common: {Accept: "application/json, text/plain, */*"}}, r.forEach(["delete", "get", "head"], function (e) {
l.headers[e] = {}
}), r.forEach(["post", "put", "patch"], function (e) {
l.headers[e] = r.merge(a)
}), e.exports = l
}, function (e, t, n) {
var r = n(2);
e.exports = function (e, t) {
r.forEach(e, function (n, r) {
r !== t && r.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[r])
})
}
}, function (e, t, n) {
var r = n(2), i = n(9), a = n(12), o = n(13), s = n(14), l = n(10),
c = "undefined" != typeof window && window.btoa && window.btoa.bind(window) || n(15);
e.exports = function (e) {
return new Promise(function (t, u) {
var d = e.data, h = e.headers;
r.isFormData(d) && delete h["Content-Type"];
var p = new XMLHttpRequest, f = "onreadystatechange", m = !1;
if (window.XMLHttpRequest || "undefined" == typeof window || !window.XDomainRequest || "withCredentials" in p || s(e.url) || (p = new window.XDomainRequest, f = "onload", m = !0, p.onprogress = function () {
}, p.ontimeout = function () {
}), e.auth) {
var v = e.auth.username || "", g = e.auth.password || "";
h.Authorization = "Basic " + c(v + ":" + g)
}
if (p.open(e.method.toUpperCase(), a(e.url, e.params, e.paramsSerializer), !0), p.timeout = e.timeout, p[f] = function () {
if (p && (4 === p.readyState || m) && (0 !== p.status || p.responseURL && 0 === p.responseURL.indexOf("file:"))) {
var n = "getAllResponseHeaders" in p ? o(p.getAllResponseHeaders()) : null, r = {
data: e.responseType && "text" !== e.responseType ? p.response : p.responseText,
status: 1223 === p.status ? 204 : p.status,
statusText: 1223 === p.status ? "No Content" : p.statusText,
headers: n,
config: e,
request: p
};
i(t, u, r), p = null
}
}, p.onerror = function () {
u(l("Network Error", e, null, p)), p = null
}, p.ontimeout = function () {
u(l("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", p)), p = null
}, r.isStandardBrowserEnv()) {
var y = n(16), b = (e.withCredentials || s(e.url)) && e.xsrfCookieName ? y.read(e.xsrfCookieName) : void 0;
b && (h[e.xsrfHeaderName] = b)
}
if ("setRequestHeader" in p && r.forEach(h, function (e, t) {
void 0 === d && "content-type" === t.toLowerCase() ? delete h[t] : p.setRequestHeader(t, e)
}), e.withCredentials && (p.withCredentials = !0), e.responseType) try {
p.responseType = e.responseType
} catch (t) {
if ("json" !== e.responseType) throw t
}
"function" == typeof e.onDownloadProgress && p.addEventListener("progress", e.onDownloadProgress), "function" == typeof e.onUploadProgress && p.upload && p.upload.addEventListener("progress", e.onUploadProgress), e.cancelToken && e.cancelToken.promise.then(function (e) {
p && (p.abort(), u(e), p = null)
}), void 0 === d && (d = null), p.send(d)
})
}
}, function (e, t, n) {
var r = n(10);
e.exports = function (e, t, n) {
var i = n.config.validateStatus;
n.status && i && !i(n.status) ? t(r("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n)
}
}, function (e, t, n) {
var r = n(11);
e.exports = function (e, t, n, i, a) {
var o = new Error(e);
return r(o, t, n, i, a)
}
}, function (e, t) {
e.exports = function (e, t, n, r, i) {
return e.config = t, n && (e.code = n), e.request = r, e.response = i, e
}
}, function (e, t, n) {
var r = n(2);
function i(e) {
return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]")
}
e.exports = function (e, t, n) {
if (!t) return e;
var a;
if (n) a = n(t); else if (r.isURLSearchParams(t)) a = t.toString(); else {
var o = [];
r.forEach(t, function (e, t) {
null !== e && void 0 !== e && (r.isArray(e) && (t += "[]"), r.isArray(e) || (e = [e]), r.forEach(e, function (e) {
r.isDate(e) ? e = e.toISOString() : r.isObject(e) && (e = JSON.stringify(e)), o.push(i(t) + "=" + i(e))
}))
}), a = o.join("&")
}
return a && (e += (-1 === e.indexOf("?") ? "?" : "&") + a), e
}
}, function (e, t, n) {
var r = n(2),
i = ["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"];
e.exports = function (e) {
var t, n, a, o = {};
return e ? (r.forEach(e.split("\n"), function (e) {
if (a = e.indexOf(":"), t = r.trim(e.substr(0, a)).toLowerCase(), n = r.trim(e.substr(a + 1)), t) {
if (o[t] && i.indexOf(t) >= 0) return;
o[t] = "set-cookie" === t ? (o[t] ? o[t] : []).concat([n]) : o[t] ? o[t] + ", " + n : n
}
}), o) : o
}
}, function (e, t, n) {
var r = n(2);
e.exports = r.isStandardBrowserEnv() ? function () {
var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
function i(e) {
var r = e;
return t && (n.setAttribute("href", r), r = n.href), n.setAttribute("href", r), {
href: n.href,
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
host: n.host,
search: n.search ? n.search.replace(/^\?/, "") : "",
hash: n.hash ? n.hash.replace(/^#/, "") : "",
hostname: n.hostname,
port: n.port,
pathname: "/" === n.pathname.charAt(0) ? n.pathname : "/" + n.pathname
}
}
return e = i(window.location.href), function (t) {
var n = r.isString(t) ? i(t) : t;
return n.protocol === e.protocol && n.host === e.host
}
}() : function () {
return !0
}
}, function (e, t) {
var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function r() {
this.message = "String contains an invalid character"
}
r.prototype = new Error, r.prototype.code = 5, r.prototype.name = "InvalidCharacterError", e.exports = function (e) {
for (var t, i, a = String(e), o = "", s = 0, l = n; a.charAt(0 | s) || (l = "=", s % 1); o += l.charAt(63 & t >> 8 - s % 1 * 8)) {
if ((i = a.charCodeAt(s += .75)) > 255) throw new r;
t = t << 8 | i
}
return o
}
}, function (e, t, n) {
var r = n(2);
e.exports = r.isStandardBrowserEnv() ? {
write: function (e, t, n, i, a, o) {
var s = [];
s.push(e + "=" + encodeURIComponent(t)), r.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), r.isString(i) && s.push("path=" + i), r.isString(a) && s.push("domain=" + a), !0 === o && s.push("secure"), document.cookie = s.join("; ")
}, read: function (e) {
var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : null
}, remove: function (e) {
this.write(e, "", Date.now() - 864e5)
}
} : {
write: function () {
}, read: function () {
return null
}, remove: function () {
}
}
}, function (e, t, n) {
var r = n(2);
function i() {
this.handlers = []
}
i.prototype.use = function (e, t) {
return this.handlers.push({fulfilled: e, rejected: t}), this.handlers.length - 1
}, i.prototype.eject = function (e) {
this.handlers[e] && (this.handlers[e] = null)
}, i.prototype.forEach = function (e) {
r.forEach(this.handlers, function (t) {
null !== t && e(t)
})
}, e.exports = i
}, function (e, t, n) {
var r = n(2), i = n(19), a = n(20), o = n(6), s = n(21), l = n(22);
function c(e) {
e.cancelToken && e.cancelToken.throwIfRequested()
}
e.exports = function (e) {
return c(e), e.baseURL && !s(e.url) && (e.url = l(e.baseURL, e.url)), e.headers = e.headers || {}, e.data = i(e.data, e.headers, e.transformRequest), e.headers = r.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers || {}), r.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (t) {
delete e.headers[t]
}), (e.adapter || o.adapter)(e).then(function (t) {
return c(e), t.data = i(t.data, t.headers, e.transformResponse), t
}, function (t) {
return a(t) || (c(e), t && t.response && (t.response.data = i(t.response.data, t.response.headers, e.transformResponse))), Promise.reject(t)
})
}
}, function (e, t, n) {
var r = n(2);
e.exports = function (e, t, n) {
return r.forEach(n, function (n) {
e = n(e, t)
}), e
}
}, function (e, t) {
e.exports = function (e) {
return !(!e || !e.__CANCEL__)
}
}, function (e, t) {
e.exports = function (e) {
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)
}
}, function (e, t) {
e.exports = function (e, t) {
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
}
}, function (e, t) {
function n(e) {
this.message = e
}
n.prototype.toString = function () {
return "Cancel" + (this.message ? ": " + this.message : "")
}, n.prototype.__CANCEL__ = !0, e.exports = n
}, function (e, t, n) {
var r = n(23);
function i(e) {
if ("function" != typeof e) throw new TypeError("executor must be a function.");
var t;
this.promise = new Promise(function (e) {
t = e
});
var n = this;
e(function (e) {
n.reason || (n.reason = new r(e), t(n.reason))
})
}
i.prototype.throwIfRequested = function () {
if (this.reason) throw this.reason
}, i.source = function () {
var e;
return {
token: new i(function (t) {
e = t
}), cancel: e
}
}, e.exports = i
}, function (e, t) {
e.exports = function (e) {
return function (t) {
return e.apply(null, t)
}
}
}])
}, r.axios = i(), t.axios = axios
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KGPdfViewerWebApp = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = n(16), a = n(21), o = n(122), s = n(42), l = n(170), c = S(n(385)), u = n(386), d = n(37), h = n(387),
p = n(178), f = n(388), m = n(2), v = n(123), g = S(n(17)), y = S(n(34)), b = S(n(171)), w = S(n(12));
function S(e) {
return e && e.__esModule ? e : {default: e}
}
var _ = "#$~%kinggrid%~$#", k = {
PDFViewerApplication: null,
adaptContainer: [],
passwordPrompt: null,
selectSealPrompt: null,
alertPrompt: null,
tipPrompt: null,
confirmOverlay: null,
url: null,
documentId: null,
fileType: "PDF",
cert: null,
userId: null,
userCode: null,
imgTag: null,
softType: 0,
sealOrigin: 0,
sealType: "PT",
certOrigin: 0,
stampType: 0,
imageTransparent: !1,
capability: null,
mobile: 0,
pdfPwd: "",
needTipFileSize: 1536,
readOnly: !1,
multipleStamp: !0,
hideDeleteNode: !1,
allowFollow: !1,
additionText: !0,
additionTextConfig: {},
additionTextDefaultConfig: {
presetTexts: [],
color: "000",
fontSize: 18,
timeFontSize: 18,
maxLength: 200,
font: "宋体",
textPosition: "right_bottom",
timePosition: "right_bottom",
timeFormat: "YYYY年MM月DD日",
loaction: "fixed",
percentY: 50,
defaultText: "",
isSelect: !1
},
useCaptcha: !1,
pagingSeal: !0,
textToSeal: !1,
textToSealDefault: {
textToSealText: "中共北京市委转文",
indicateSealText: "领导",
textToSealNum: "123456",
indicateSealNum: "1234",
color: "#2c2cff",
visibleType: "MarkHandwrite",
textToSealType: "textToSeal",
indicateSealType: "indicateSeal",
invariantSealType: "invariantSeal",
invariantSealImgPath: "./images/yfs.png"
},
annotation: !1,
annotationDefaultConfig: {
mode: "text",
height: 360,
width: 720,
minHeight: 200,
minWidth: 640,
font: "宋体",
size: "24",
color: "black",
line: "5",
callback: null,
wrapSize: null,
editable: !0,
extend: null,
annotationSuccess: null,
annotationQueueSuccess: null
},
annotationConfig: {},
openAnnotationPanel: function () {
return window.KGPdfViewerWebApp.PDFViewerApplication.KG_Annotation.show()
},
annotationVisibleType: null,
disableSignaturePad: !1,
clientCode: "",
clientErrorConfig: [],
prepareStamp: null,
indicateSeal: !1,
indicateSealDefaultConfig: {authorName: null, name: "领导", number: "", color: "#088ED7"},
indicateSealConfig: {},
indicateSealSuccess: function (e) {
},
textToSealCb: function () {
},
exportKGAnnotations: function (e) {
console.log(e)
},
exportKGAnnotationList: function () {
var e = this.PDFViewerApplication.kgAnnotationViewer, t = e.annotationList, n = e.formatSealsData(), r = void 0;
return null != this.annotationVisibleType ? r = this.annotationVisibleType : this.textToSealDefault.visibleType && (r = this.textToSealDefault.visibleType), r ? t.concat(n).filter(function (e) {
try {
var t = JSON.parse(e.annotInfo);
return !(!t || !t.hasOwnProperty("customType")) && t.customType.toString() === r
} catch (e) {
return !1
}
}).sort(function (e, t) {
return Number(e.page || e.pageNo) - Number(t.page || t.pageNo)
}) : []
},
navigateToKGAnnotation: function (e, t, n) {
var r = this.PDFViewerApplication.pdfViewer, a = r.getPageView(Number(e) - 1), o = a.viewport.viewBox[3],
s = [{num: e, gen: 0}, {name: "XYZ"}, t, o - n, 0];
r.scrollPageIntoView({pageNumber: e, destArray: s}), a.onAfterDraw = function () {
for (var e = a.annotationLayer.div.getElementsByTagName("section"), r = void 0, i = 0; i < e.length; i++) {
var o = Math.round((0, d.getNumbOfPx)(e[i].style.left)), s = Math.round((0, d.getNumbOfPx)(e[i].style.top));
if (o >= Math.round(t) - 3 && o <= Math.round(t) + 3 && s >= Math.round(n) - 3 && s <= Math.round(n) + 3) {
r = e[i];
break
}
}
r && (0, l.setBorder)(r), a.onAfterDraw = null
}, a.destroy(), a.renderingState = i.RenderingStates.INITIAL, a.draw()
},
exportKGBookmarks: function () {
var e = this.PDFViewerApplication.pdfOutlineViewer.outline, t = [];
return null != e && function e(t) {
for (var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], r = 0; r < t.length; r++) n[r] = {}, n[r].title = t[r].title, n[r].data = JSON.stringify({dest: t[r].dest}), n[r].children = [], t[r].items.length && e(t[r].items, n[r].children)
}(e, t), t
},
navigateToKGBookmark: function (e) {
var t = JSON.parse(e).dest;
this.PDFViewerApplication.pdfLinkService.navigateTo(t)
},
useNFSSystem: !1,
showPrintBtn: !1,
watermark: !1,
addWatermarkSuccess: function () {
console.log("添加水印成功~")
},
secretSeal: !1,
secretSealImg: "./images/secret-seal.png",
disableTextAnnotation: !1,
downlaod: !1,
fjrs: null,
appCode: "",
scanStamp: !1,
getQrCodeBase64Image: function (e) {
console.log(e)
},
filterSealNames: null,
useTextWidget: !1,
disableRotate: !0,
btnPositionConfig: {
toolbar: ["stamp"],
sidebar: ["prepareStamp", "indicateSeal", "signature", "download", "scanStamp", "textToSeal", "exportAnnotations", "docSave", "docSaveAs", "print", "watermark", "annotation", "openLocalFile", "docSign", "iWebAuthScan", "iWebAuthUkey", "Ukey"]
},
themeColor: "#1890ff",
setThemeColorStyle: function () {
var e, t, n, r = void 0, i = void 0, a = void 0, o = void 0;
if (r = this.themeColor.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i)) 6 === r[1].length ? (i = parseInt(r[1].substr(0, 2), 16), a = parseInt(r[1].substr(2, 2), 16), o = parseInt(r[1].substr(4, 2), 16)) : (i = parseInt(r[1].charAt(0) + r[1].charAt(0), 16), a = parseInt(r[1].charAt(1) + r[1].charAt(1), 16), o = parseInt(r[1].charAt(2) + r[1].charAt(2), 16)); else if (r = this.themeColor.match(/^\W*rgba?\(([^)]*)\)\W*$/i)) {
var s = r[1].split(","), l = void 0, c = void 0, u = void 0;
s.length >= 3 && (l = s[0].match(/^\s*(\d*)(\.\d+)?\s*$/)) && (c = s[1].match(/^\s*(\d*)(\.\d+)?\s*$/)) && (u = s[2].match(/^\s*(\d*)(\.\d+)?\s*$/)) && (i = parseFloat((l[1] || "0") + (l[2] || "")), a = parseFloat((c[1] || "0") + (c[2] || "")), o = parseFloat((u[1] || "0") + (u[2] || "")))
}
if (t = "rgba(" + (i = Math.max(0, Math.min(255, i))) + ", " + (a = Math.max(0, Math.min(255, a))) + ", " + (o = Math.max(0, Math.min(255, o))) + ", .2)", n = "rgba(" + i + ", " + a + ", " + o + ", .7)", !(e = "rgb(" + i + ", " + a + ", " + o + ")")) throw Error("颜色格式不正确");
var d = document.createElement("style");
d.type = "text/css", d.innerHTML = "\n #KG_CertValidityOverlay .certDays {\n color: " + e + ";\n }\n\n .layui-laydate .layui-laydate-header i:hover,\n .layui-laydate .layui-laydate-header span:hover {\n color: " + e + ";\n }\n\n .layui-laydate .layui-laydate-content .layui-this {\n background-color: " + e + " !important;\n }\n\n .kg_checkbox_wrapper.kg_checkbox_wrapper-checked:before {\n color: " + e + ";\n }\n\n .kg_radio_wrapper.kg_radio_wrapper-checked:before {\n color: " + e + ";\n }\n\n .thumbnail.selected > .thumbnailSelectionRing > .thumbnailImage {\n box-shadow: 0 0 0 2px " + e + ";\n }\n\n #loadingBar .progress {\n background-color: " + e + ";\n }\n\n #toolbarSidebar .toolbarButton.toggled {\n border-bottom: 2px solid " + e + ";\n background-color: " + t + ";\n }\n\n .toolbarButton:hover,\n .toolbarButton:focus,\n .toolbarButton:hover:active,\n .splitToolbarButton.toggled > .toolbarButton.toggled,\n .toolbarButton.toggled:hover:active {\n color: " + e + ";\n }\n\n .secondaryToolbarButton:hover,\n .secondaryToolbarButton:focus,\n .secondaryToolbarButton.toggled,\n .secondaryToolbarButton:hover:active,\n .secondaryToolbarButton.toggled:hover:active {\n color: " + e + ";\n }\n\n .dropdownToolbarButton:hover,\n .dropdownToolbarButton:focus,\n #pageNumber:hover,\n #pageNumber:focus {\n border: 1px solid " + e + ";\n }\n\n #sidebarContainer .toolbarButton.toggled:hover:active,\n .outlineItemToggler:hover,\n .outlineItemToggler:hover + a,\n .outlineItemToggler:hover ~ .outlineItems,\n .outlineItem > a:hover,\n .annotationItem > a:hover,\n .attachmentsItem > button:hover {\n color: " + e + ";\n }\n\n .KG_VerifySealPrompt_Tab:hover {\n color: " + e + ";\n }\n\n .KG_VerifySealPrompt_Tab.active {\n color: " + e + ";\n border-bottom: 2px solid " + e + ";\n }\n\n .KG_VerifySealPrompt_Tip_Copy {\n color: " + e + ";\n }\n\n .KG_VerifySealPrompt_Tip_Copy:hover {\n color: " + n + ";\n }\n\n .kg_productInfo_copyright > p > a:hover {\n color: " + e + ";\n }\n\n #kgTextToSealOverlay .kgdialog .tab .selected {\n color: " + e + ";\n }\n\n #documentPropertiesOverlay #fileType {\n color: " + e + ";\n border: 2px solid " + e + ";\n }\n\n .KG_GuideTip_NeverShow:hover {\n color: " + e + ";\n }\n\n .toolbarField:hover {\n border-color: " + e + ";\n }\n\n .toolbarField:focus {\n border-color: " + e + ";\n }\n\n .btn:hover,\n .btn:focus {\n color: " + e + ";\n border-color: " + e + ";\n }\n\n .btn-primary {\n background-color: " + e + ";\n border-color: " + e + ";\n }\n\n .btn-primary:hover,\n .btn-primary:focus {\n color: #fff;\n background-color: " + n + ";\n border-color: " + n + ";\n }\n\n .btn-border-primary {\n color: " + e + ";\n border-color: " + e + ";\n }\n\n .btn-text-primary {\n color: " + e + ";\n }\n\n .btn-text-primary:hover,\n .btn-text-primary:focus {\n background-color: " + t + ";\n }\n\n #kg-seal-left:hover, #kg-seal-right:hover {\n color: " + e + ";\n }\n\n .kgInput:hover, .kgInput:focus {\n border: 1px solid " + e + ";\n }\n\n #sign-msg-thick.active, #sign-msg-thick:hover {\n color: " + e + ";\n }\n\n #sign-msg-thick-drop {\n border: 2px solid " + e + ";\n }\n\n .kg_progress_active {\n background-color: " + e + ";\n }\n ", document.getElementsByTagName("head").item(0).appendChild(d)
},
surreadPrint: !1,
setSurreadPrintConfig: function (e) {
if (!this.PDFViewerApplication.KG_SurreadPrint) throw new Error("[打印控制组件异常] 未初始化");
this.PDFViewerApplication.KG_SurreadPrint.combineConfig(e)
},
getSurreadPrintConfig: function () {
if (!this.PDFViewerApplication.KG_SurreadPrint) throw new Error("[打印控制组件异常] 未初始化");
var e = this.surreadPrint;
return {
customParam: e.customParam,
print: e.print,
watermark: e.watermark,
showPannel: e.showPannel,
printerList: e.printerList
}
},
setAppCode: function (e) {
var t = this;
e && (this.appCode = e);
var n = new v.iWebAssist;
return n.promise.then(function () {
return n.setParamByName("APPCODE", t.appCode)
})
},
language: "zh-CN",
checkFile: !1,
algorithmType: {cloud: "RSA", key: null},
verifyChainInfo: !1,
openLocalFile: !1,
uploadLocalFileUrl: null,
uploadLocalFileSuccess: function (e) {
console.log("Upload success: ", e)
},
stampSuccess: function (e) {
},
deleteSealSuccess: function () {
},
externalSign: null,
externalGetSeals: null,
externalStampSeal: null,
externalVerifyOnLoad: null,
externalVerifySeal: null,
externalUnit: "px",
externalSeals: null,
sealPreLocation: null,
renderExternalSealsComplete: function (e) {
console.log(e)
},
externalDeleteSeal: function (e, t) {
this.PDFViewerApplication.KG_NoServer.deleteSeal(e, t)
},
disableDelete: !1,
license: null,
version: null,
selectedSeal: null,
isCa3: !1,
isUrlDoc: !1,
currentView: "",
iWebAuth: {scan: !1, uKey: !1},
getCurrentView: function () {
return this.currentView.split("#")[1]
},
setCurrentView: function (e) {
this.PDFViewerApplication.setInitialView(e)
},
getConfirmPrompt: function () {
if (null == this.confirmPrompt) {
var e = this.PDFViewerApplication;
this.confirmPrompt = new c.default(e, e.overlayManager)
}
return this.confirmPrompt
},
getPasswordPrompt: function () {
if (null == this.passwordPrompt) {
var e = this.PDFViewerApplication;
this.passwordPrompt = new u.KGPasswordPrompt(e.appConfig.kgpasswordOverlay, e.overlayManager, e.l10n)
}
return this.passwordPrompt
},
getSelectSealPrompt: function () {
if (null == this.selectSealPrompt) {
var e = this.PDFViewerApplication;
this.selectSealPrompt = new h.SelectSealPrompt(e.appConfig.selectSealOverlay, e.overlayManager, e.l10n)
}
return this.selectSealPrompt
},
getAlertPrompt: function () {
if (null == this.alertPrompt) {
var e = this.PDFViewerApplication;
this.alertPrompt = new p.AlertPrompt(e.appConfig.alertPromptOverlay, e.overlayManager, e.l10n)
}
return this.alertPrompt
},
getTipPrompt: function () {
if (null == this.tipPrompt) {
var e = this.PDFViewerApplication;
this.tipPrompt = new f.KGTipPrompt(null, e.overlayManager, e.l10n)
}
return this.tipPrompt
},
setUrl: function (e) {
this.url = e
},
getUrl: function () {
return this.url
},
open: function (e, t) {
var n = this;
this.setDocumentId(encodeURIComponent(e)), this.setFileType(t), this.pdfPwd = "";
var r = this.isUrlDoc ? e : this.getDocTypeUrl() + "&action=download&documentId=" + encodeURIComponent(e) + "&t=" + (new Date).getTime();
this.PDFViewerApplication.open(r).then(function () {
n.openDocSuccess(), !0 !== n.textToSeal && null == window.KGPdfViewerWebApp.annotationVisibleType || 0 !== n.docType || n.PDFViewerApplication.kgAnnotationViewer.init()
})
},
repairFileAndOpen: function () {
var e = this,
t = this.isUrlDoc ? this.documentId : this.getDocTypeUrl() + "&action=download&repairPdf=true&documentId=" + encodeURIComponent(this.documentId) + "&t=" + (new Date).getTime();
this.PDFViewerApplication.open(t).then(function () {
e.openDocSuccess(), !0 !== e.textToSeal && null == window.KGPdfViewerWebApp.annotationVisibleType || 0 !== e.docType || e.PDFViewerApplication.kgAnnotationViewer.init()
})
},
openDocSuccess: function () {
console.log("打开文档成功~")
},
getDocTypeUrl: function () {
var e = this.url;
return e.indexOf("?") > -1 ? e += "&" : e += "?", e + "docType=" + this.docType
},
setFileType: function (e) {
this.fileType = e ? e.toUpperCase() : this.fileType.toUpperCase(), "PDF" !== this.fileType && "OFD" !== this.fileType && (this.fileType = "PDF"), this.docType = "OFD" === this.fileType ? 1 : 0, "OFD" === this.fileType && (this.textToSeal = !1)
},
getFileType: function () {
return this.fileType
},
getPdfPwd: function () {
return this.encryptPWd ? this.aesEncrypt(this.pdfPwd) : this.pdfPwd
},
setDocumentId: function (e) {
this.documentId = e
},
setSealOrigin: function (e) {
this.sealOrigin = e
},
getSealOrigin: function () {
return this.sealOrigin
},
getNumPages: function () {
return this.PDFViewerApplication.pdfDocument.numPages
},
stamp: function () {
this.PDFViewerApplication.pdfStamp.stamp()
},
SCSJTT_getFirstSealFromServer: function (e, t) {
this.PDFViewerApplication.pdfStamp.SCSJTT_getFirstSealFromServer(e, t)
},
stampOfXY: function (e, t, n, r, i) {
this.PDFViewerApplication.pdfStamp.stampOfXY(e, t, n, r, i)
},
stampOfText: function (e, t, n, r) {
this.PDFViewerApplication.pdfStamp.stampOfText(e, t, n, r)
},
getUserBeforeSign: function (e) {
var t = {
action: "getUser",
password: this.encryptPWd ? this.aesEncrypt(e) : e,
keySN: this.userId,
userCode: this.userCode,
isEncrypt: this.encryptPWd,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin,
appCode: this.appCode
};
return a.myaxios.post(this.url, t)
},
transformSignatureToGmSeal: function (e) {
var t = this, n = {
action: "getSealData",
keySN: e.keySN,
imgdata: e.imgdata.split(",")[1],
imgExt: e.imgExt,
signName: e.signName,
width: (0, m.pxCovertToMM)(e.width),
height: (0, m.pxCovertToMM)(e.height),
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
return a.myaxios.post(this.url, n).then(function (n) {
if (n.data.status) {
var r = n.data, i = r.sealData, a = r.version;
return e.version = a, e.sealData = i, Promise.resolve(e)
}
return t.getTipPrompt().close(), Promise.reject(n.data.message)
})
},
addSeal: function (e, t) {
var n = this, i = this.certOrigin, o = this.sealType, s = this.fileType, l = this.stampType, c = e.sealdata,
u = e.capability, d = this.getTipPrompt();
switch (this.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
var h = this.iWebAuth.scan || this.iWebAuth.uKey,
p = "string" == typeof this.algorithmType ? this.algorithmType : this.algorithmType.cloud;
h && (p = window.KGPdfViewerWebApp.PDFViewerApplication.KG_IWebAuth.algorithmType);
var f = {
action: "stampSeal",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
stampType: this.stampType,
certOrigin: window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer ? 1 : this.certOrigin,
seals: c,
sealType: o,
clientCode: this.clientCode,
isWebAuth: h,
appCode: this.appCode,
algorithmType: p,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin,
unifySealPlatformV2: window.KGPdfViewerWebApp.unifySealPlatformV2
};
if (window.KGPdfViewerWebApp.unifySealPlatformV2) {
var v = this.PDFViewerApplication.KG_ScanStamp_V2, g = v.code, y = v.token;
f.code = g, f.token = y
}
!0 === this.useCaptcha && (f.captcha = e.captcha), this.scanStamp && "scan" == this.systemStampMode && (f.scanStamp = !0, f.userToken = this.PDFViewerApplication.KG_ScanStamp.userToken, f.qrcodeId = this.PDFViewerApplication.KG_ScanStamp.scanId, f.qrCodeUserUid = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserUid, f.qrCodeUserName = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserName, f.scanSealType = this.PDFViewerApplication.KG_ScanStamp.sealType), f.isUkey = this.isUkey && "ukey" == this.systemStampMode;
var b = this.PDFViewerApplication, w = b.pdfStamp, S = b.pdfDocument,
_ = this.isLoadComplete() ? [S.getDownloadInfo(), u.resolve] : [Promise.resolve({}), w.renderSignatureSeals],
k = r(_, 2), x = k[0], P = k[1];
x.then(function (e) {
if (e.length && (length / 1024 > n.needTipFileSize || 1 == n.certOrigin)) switch (n.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
("OFD" === s || "PDF" === s && 2 === l) && (f.seals = (0, m.sortClass)(f.seals, ["esid"])), a.myaxios.post(n.getDocTypeUrl(), f).then(function (e) {
(0, m.closeOverlay)().then(function () {
var r = e.data;
if (r.status) {
if (n.annotation) {
var a = n.PDFViewerApplication.KG_Annotation, o = a.defaultConfig, s = a.userInput, l = a.extendValue,
c = a.isAnnotation, h = a.annotQueue;
c && o.annotationSuccess && !h && (o.annotationSuccess(s, l), n.PDFViewerApplication.KG_Annotation.resetAnnotationExtendValue())
}
if (1 == i) {
var p = r.sigObj;
switch (n.capability = u, n.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
t(p, {textPositions: r.textPositions})
} else {
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) {
var f = r.sigObj;
switch (n.capability = u, n.PDFViewerApplication.l10n._lang) {
case"zh-TW":
d.open("正在進行簽章加蓋...");
break;
case"en-US":
d.open("Signing and stamping...");
break;
default:
d.open("正在进行签章加盖...")
}
t(f, {textPositions: r.textPositions})
}
P({status: !0, textPositions: r.textPositions, successPassBackParameter: r.successPassBackParameter})
}
} else n.PDFViewerApplication.KGAlertPrompt.open(r.message), P({status: !1})
})
}).catch(function () {
P({status: !1})
})
})
},
addOFDSeal: function (e) {
var t = this, n = (0, m.sortClass)(e.sealdata, ["esid"]), i = e.capability;
this.capability = i;
var l = this.PDFViewerApplication, c = l.pdfStamp, u = l.pdfDocument, d = l.KG_UkeyStamp,
h = c.pdfStampSeal.keyPwd || this.getPasswordPrompt().pwd || d.password, p = this, f = c.tempSeals,
v = this.getTipPrompt(),
g = this.isLoadComplete() ? [u.getDownloadInfo(), i.resolve] : [Promise.resolve({}), c.renderSignatureSeals],
y = r(g, 2), b = y[0], w = y[1];
b.then(function (e) {
if (e.length && (length / 1024 > t.needTipFileSize || "1" === t.certOrigin.toString())) switch (t.PDFViewerApplication.l10n._lang) {
case"zh-TW":
v.open("正在進行簽章加蓋...");
break;
case"en-US":
v.open("Signing and stamping...");
break;
default:
v.open("正在进行签章加盖...")
}
var r = function (e) {
return (0, m.closeOverlay)().then(function () {
return t.PDFViewerApplication.KGAlertPrompt.open(e)
}).then(function () {
w({status: !1}), t.sigError()
})
};
!function e(t) {
var i = n[t][0].esid, l = {certOrigin: p.certOrigin, cert: p.cert, seals: [n[t]], sealType: p.sealType};
p.fjrs && p.fjrs.isServer && (l = {
certOrigin: 1,
cert: p.PDFViewerApplication.KG_FJRS.sealListInfo[0].certBase64,
seals: n[t],
sealType: 1
});
var c = {
action: "stampSeal",
documentId: p.documentId,
pdfPwd: p.getPdfPwd(),
stampType: p.stampType,
certOrigin: l.certOrigin,
cert: l.cert,
seals: l.seals,
sealType: l.sealType,
isEncrypt: p.encryptPWd,
isSM: p.isSM && "OFD" == p.fileType,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin,
appCode: window.KGPdfViewerWebApp.appCode
};
a.myaxios.post(p.getDocTypeUrl(), c).then(function (a) {
var l = a.data, c = l.status, u = l.sigObj, d = l.message, v = l.textPositions;
if (c && u) {
if (p.multipleStamp) {
var g = !0, y = !1, b = void 0;
try {
for (var S, _ = f[Symbol.iterator](); !(g = (S = _.next()).done); g = !0) {
var k = S.value;
k.sealData.esid == i && (k.ofdStampSuccess = !0)
}
} catch (e) {
y = !0, b = e
} finally {
try {
!g && _.return && _.return()
} finally {
if (y) throw b
}
}
}
var x = function (e) {
var r = e.signedData, i = e.cert, a = e.sealType, o = e.toSignData, s = e.signDirPath, l = !1;
return t >= n.length - 1 && (l = !0), p.reWriteSigData(r, i, {textPositions: v}, a, o, s, l)
}, P = function () {
++t < n.length ? e(t) : w({status: !0, textPositions: v})
};
!0 === p.useNFSSystem ? (0, o.NFSSign)(h, p.keySN, u, x, P, r) : null != p.externalSign ? (0, m.externalSign)(u, x, P, r) : 2 == p.stampType && "PDF" == p.fileType ? (0, s.pdfSM2RegionSign)(h, p.keySN, u, x, P, r) : (0, s.ofdSign)(h, p.keySN, u, x, P, r)
} else (0, m.closeOverlay)().then(function () {
return r(d || "加盖印章出现错误,中止操作")
})
})
}(0)
})
},
modifyText: function (e) {
var t = this, n = {action: "FilltextField", documentId: this.documentId, fileType: this.fileType, data: e};
a.myaxios.post(this.getDocTypeUrl(), n).then(function (e) {
(0, m.closeOverlay)().then(function () {
var n = e.data;
n.status || t.PDFViewerApplication.KGAlertPrompt.open(n.message)
})
})
},
reWriteSigData: function (e, t, n, r, i, o) {
var s = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6],
l = this.iWebAuth.scan || this.iWebAuth.uKey, c = {
action: "reWriteSigData",
documentId: this.documentId,
keySN: this.keySN || this.userId,
pdfPwd: this.getPdfPwd(),
clientCode: this.clientCode,
stampType: this.stampType,
isWebAuth: l,
cert: t ? g.default.stringify(y.default.parse(t)) : null,
isEncrypt: this.encryptPWd,
isSM: this.isSM && "OFD" == this.fileType
};
null != this.externalSign && (c.externalSign = !0), "OFD" === this.fileType ? c.data = [{
sealType: r,
toSignData: i,
signDirPath: o,
signData: e
}] : c.data = e;
var u = this, d = this.PDFViewerApplication.pdfStamp,
h = this.isLoadComplete() ? u.capability.resolve : d.renderSignatureSeals;
return a.myaxios.post(this.getDocTypeUrl(), c).then(function (e) {
var t = e.data;
t.status ? s && ((0, m.closeOverlay)(), h({
status: !0,
textPositions: n.textPositions,
successPassBackParameter: t.successPassBackParameter
})) : ((0, m.closeOverlay)(), u.PDFViewerApplication.KGAlertPrompt.open(t.message), h({status: !1}))
}).catch(function () {
h({status: !1})
})
},
sigError: function () {
var e = this, t = {
action: "reWriteSigData",
clientCode: this.clientCode,
documentId: this.documentId,
stampType: this.stampType,
error: !0
};
e.getTipPrompt().close(), a.myaxios.post(this.getDocTypeUrl(), t).then(function (t) {
var n = t.data;
e.capability.resolve(!1), n.status || e.app.KGAlertPrompt.open(n.message)
})
},
deleteSeal: function (e, t, n, r, i, o) {
var s = {
action: "deleteSeal",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
keySN: this.userId,
userCode: this.userCode,
certOrigin: this.certOrigin,
page: e,
x: t,
y: n,
isEncrypt: this.encryptPWd,
isSM: this.isSM && "OFD" == this.fileType,
appCode: this.appCode,
unifySealPlatformV2: this.unifySealPlatformV2
};
if (this.PDFViewerApplication.KG_FJRS && this.PDFViewerApplication.KG_FJRS.delKeySN && (s.keySN = this.PDFViewerApplication.KG_FJRS.delKeySN), !0 === this.useCaptcha ? s.captcha = r : s.password = r, this.unifySealPlatformV2) {
var l = this.PDFViewerApplication.KG_ScanStamp_V2, c = l.code, u = l.token;
s.code = c, s.token = u
}
return i && o && (s.rand = i, s.signedBase64 = o), !window.KGPdfViewerWebApp.stampModel && this.scanStamp && (s.scanStamp = !0, s.userToken = this.PDFViewerApplication.KG_ScanStamp.userToken, s.qrcodeId = this.PDFViewerApplication.KG_ScanStamp.scanId, s.qrCodeUserUid = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserUid, s.qrCodeUserName = this.PDFViewerApplication.KG_ScanStamp.qrCodeUserName), a.myaxios.post(this.getDocTypeUrl(), s)
},
verifySeal: function (e, t, n, r, i) {
var o = this.certOrigin;
i && ("1" === i ? o = 1 : "2" === i && (o = 0));
var s = {
action: "verifySeal",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
certOrigin: o,
isScanStamp: this.scanStamp,
page: e,
x: t,
y: n,
isEncrypt: this.encryptPWd,
isSM: this.isSM && "OFD" == this.fileType,
isUkey: this.isUkey
};
window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs && (s.isfjrs = !0), a.myaxios.post(this.getDocTypeUrl(), s).then(function (e) {
r(e.data)
})
},
verifySealOnLoad: function (e, t, n) {
var r = {
action: "verifySealOnLoad",
documentId: this.documentId,
pdfPwd: this.getPdfPwd(),
page: e,
indRefNumber: t,
isEncrypt: this.encryptPWd
};
a.myaxios.post(this.getDocTypeUrl(), r).then(function (e) {
n(e.data)
})
},
checkLastone: function (e, t, n) {
var r = this;
this.cancelCheckLastOne && this.cancelCheckLastOne();
var i = a.axios.CancelToken, o = {action: "checkLastone", documentId: this.documentId, page: e, x: t, y: n};
return this.disableDelete ? Promise.resolve({status: !1}) : "OFD" === this.fileType || 1 == this.stampType || 2 == this.stampType || 1 == this.scanStamp || this.PDFViewerApplication.KG_FJRS ? a.axios.post(this.getDocTypeUrl(), (0, m.transformData)(o), {
cancelToken: new i(function (e) {
r.cancelCheckLastOne = e
}), withCredentials: !0, headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}
}).then(function (e) {
return e.data
}).catch(function (e) {
e instanceof a.axios.Cancel ? console.log("取消请求") : r.PDFViewerApplication.KGAlertPrompt.open(e.message)
}) : Promise.resolve({status: !0})
},
transparentImg: function (e) {
var t = {action: "imageToTransparence", imagedata: e};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
},
getAnnotationList: function () {
var e = {action: "getAnnotsList", documentId: this.documentId};
return a.myaxios.post(this.getDocTypeUrl(), e).then(function (e) {
return e.data
})
},
addWatermark: function (e) {
var t = this, n = {action: "addWatermark", documentId: this.documentId};
for (var r in e) n[r] = e[r];
return a.myaxios.post(this.getDocTypeUrl(), n).then(function (e) {
return e.data.status && t.addWatermarkSuccess(), e.data
})
},
saveAnnotations: function (e) {
if (!(arguments.length > 1 && void 0 !== arguments[1] && arguments[1])) {
var t = {action: "improtAnnots", documentId: this.documentId, annotsData: e, saveAs: !1};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
}
var n = document.getElementById("saveAnnotations");
n && n.parentNode.removeChild(n);
var r = document.createElement("form");
r.id = "saveAnnotations", r.method = "POST", r.action = this.getDocTypeUrl(), r.style.display = "none", document.body.appendChild(r);
var i = document.createElement("input");
i.name = "action", i.value = "improtAnnots", r.appendChild(i);
var o = document.createElement("input");
o.name = "documentId", o.value = this.documentId, r.appendChild(o);
var s = document.createElement("input");
s.name = "annotsData", s.value = e, r.appendChild(s);
var l = document.createElement("input");
l.name = "saveAs", l.value = "true", r.appendChild(l), r.submit()
},
getLicenseInfo: function () {
return a.myaxios.post(this.getDocTypeUrl(), {action: "getLicenseInfo"}).then(function (e) {
return e.data
})
},
elecSigModeCheckFile: function () {
if (this.checkFile && 0 == this.stampType && 0 == this.docType) {
var e = {action: "elecSigModeCheckFile", documentId: this.documentId};
return a.myaxios.post(this.getDocTypeUrl(), e).then(function (e) {
return e.data
})
}
return Promise.resolve({status: !0})
},
verifyAllSeal: function (e, t, n) {
var r = {
action: "verifyAllSeal",
documentId: this.documentId,
saveType: t,
fileUrl: e,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
}, i = {result: {validCount: 0, invalidCount: 0}, errorCode: "", errorMessage: ""};
a.myaxios.post(this.getDocTypeUrl(), r).then(function (e) {
if (e.data.status) {
for (var t = [], n = e.data.signInfoArray, r = function (e) {
var r = !1, a = !1, o = n[e], s = o.effectiveness, l = o.newHash, c = o.sigData;
t.push(new Promise(function (e) {
if (r = s) {
if (l && c) {
var t = new v.iWebAssist({cilentType: "0"});
return Promise.resolve(t.promise).then(function () {
return t.verifySignMessage(l, c)
}).then(function (t) {
t && (a = !!t.result), e({sealEffectiveness: r, signEffectiveness: a})
})
}
e({sealEffectiveness: r, signEffectiveness: a = !0})
} else e({sealEffectiveness: r})
}).then(function (e) {
var t = e.sealEffectiveness, n = e.signEffectiveness;
t && n ? i.result.validCount++ : i.result.invalidCount++
}))
}, a = 0; a < n.length; a++) r(a);
return Promise.all(t)
}
var o = e.data.message;
return Promise.reject(o || "程序异常,验证失败")
}).then(function () {
n(i)
}).catch(function (e) {
console.log(e)
})
},
getSealArray:async function(e,t){
var r = {
action: "verifyAllSeal",
documentId: this.documentId,
saveType: t,
fileUrl: e,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
let res;
await a.myaxios.post(this.getDocTypeUrl(), r).then(function(e) {
res = e;
})
return res;
},
getQrCodeImage: function (e, t, n) {
var r = {
action: "getQrCodeImage",
scanSealType: t,
esid: n,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
switch (e) {
case"stamp":
r.way = "1";
break;
case"delete":
r.way = "2"
}
return a.myaxios.post(this.getDocTypeUrl(), r).then(function (e) {
return e.data
})
},
getQrCodeToken: function (e) {
var t = {action: "getQrCodeToken", qrcodeId: e, stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
},
exitSession: function (e) {
var t = {action: "exitSession", userToken: e};
return a.myaxios.post(this.getDocTypeUrl(), t).then(function (e) {
return e.data
})
},
certExpiryVerify: function (e, t) {
var n = {action: "certExpiryVerify", cert: e, days: t};
return a.myaxios.post(this.getDocTypeUrl(), n).then(function (e) {
return e.data && 1 == e.data.status ? e.data : Promise.reject({message: e.data.message})
})
},
customVerifyOption: null,
defaultVerifyOptionByOFD: {
seal: {
_map: {
sealID: {value: "sealID", title: "印章序列"},
signDate: {value: "signDate", title: "签章时间"},
signName: {value: "sealName", title: "签名名称"},
unitName: {value: "sealVid", title: "授权单位"},
userName: {value: "userName", title: "用户名称"},
validStart: {value: "validStart", title: "起始时间"},
validEnd: {value: "validEnd", title: "截止时间"}
}, _show: ["unitName", "userName", "signName", "sealID", "signDate", "validStart", "validEnd"]
},
cert: {
_map: {
issuerDN: {value: "issuerDN", title: "证书签发者"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["serialNumber", "subjectDN", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
tsa: {
tsaCert: {
_map: {
issuerDN: {value: "issuerDN", title: "时间戳机构"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["subjectDN", "serialNumber", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
_map: {
tsaTime: {value: "tsaTime", title: "签名时间"},
tsaEffectiveness: {value: "tsaEffectiveness", title: "时间戳验证"}
},
_show: ["tsaTime"]
},
chain: {},
_map: {
seal: {value: "seal", title: "签章信息"},
cert: {value: "cert", title: "证书信息"},
tsa: {value: "tsaInfo", title: "时间戳"},
chain: {value: "chain", title: "区块链"}
}
},
defaultVerifyOptionByPDF: {
seal: {
_map: {
appName: {value: "appName", title: "应用程序"},
signDateTime: {value: "signDateTime", title: "签章时间"},
signName: {value: "signName", title: "签名名称"},
signSN: {value: "signSN", title: "印章标识"},
sealValidStart: {value: "sealValidStart", title: "开始时间"},
sealValidEnd: {value: "sealValidEnd", title: "结束时间"}
}, _show: ["appName", "signSN", "signName", "sealValidStart", "sealValidEnd", "signDateTime"]
},
cert: {
_map: {
issuerDN: {value: "issuerDN", title: "证书签发者"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["serialNumber", "subjectDN", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
tsa: {
tsaCert: {
_map: {
issuerDN: {value: "issuerDN", title: "时间戳机构"},
serialNumber: {value: "serialNumber", title: "证书序列号"},
sigAlg: {value: "sigAlg", title: "签名算法"},
subjectDN: {value: "subjectDN", title: "证书使用者"},
notBefore: {value: "notBefore", title: "起始时间"},
notAfter: {value: "notAfter", title: "截止时间"}
}, _show: ["subjectDN", "serialNumber", "issuerDN", "sigAlg", "notBefore", "notAfter"]
},
_map: {
tsaTime: {value: "tsaTime", title: "时间戳时间"},
tsaEffectiveness: {value: "tsaEffectiveness", title: "时间戳验证"}
},
_show: ["tsaTime"]
},
chain: {},
_map: {
seal: {value: "seal", title: "签章信息"},
cert: {value: "cert", title: "证书信息"},
tsa: {value: "tsaInfo", title: "时间戳"},
chain: {value: "chain", title: "区块链"}
}
},
paginSealDefaultConfig: {
beginPage: 1,
range: "allPage",
setting: 1,
firstPagePercent: 50,
otherPageNum: 3,
averagePageNum: 2
},
paginSealConfig: null,
singlePageSeal: !1,
continuityRange: null,
customScanDialog: {information: ['打开"码上办事APP"', '进入"电子印章服务",点击右上角扫码按钮'], imageName: "kg_extend_img.png"},
password: "",
pwdDefaultConfig: {defaultPwd: null, disable: !1, tips: null, tipsColor: "#868686", type: null, keepRemember: !1},
watermarkConfig: {
text: "金格科技",
file: "",
font: "黑体",
size: 32,
color: "c9c9c9",
rotate: 45,
opacity: 80,
isTiled: !1,
density: 100,
vertical: "middle",
horizontal: "center"
},
previewWatermark: null,
getAuthCode: function (e, t) {
e(null)
},
encryptPWd: !1,
aesEncrypt: function (e) {
return b.default.encrypt(w.default.enc.Utf8.parse(e), w.default.enc.Utf8.parse("AaBbCcDdEeFfGgH1"), {
iv: w.default.enc.Utf8.parse(_),
mode: w.default.mode.CBC,
padding: w.default.pad.Pkcs7
}).ciphertext.toString()
},
aesDecrypt: function (e) {
var t = w.default.enc.Hex.parse(e), n = w.default.enc.Base64.stringify(t);
return w.default.AES.decrypt(n, w.default.enc.Utf8.parse("AaBbCcDdEeFfGgH1"), {
iv: w.default.enc.Utf8.parse(_),
mode: w.default.mode.CBC,
padding: w.default.pad.Pkcs7
}).toString(w.default.enc.Utf8).toString()
},
globalAnnotation: null,
addDocSign: function (e) {
var t = {action: "addAnnot", documentId: this.documentId, annots: e};
return a.myaxios.post(this.getDocTypeUrl(), t)
},
deleteDocSign: function (e, t, n, r, i, o) {
var s = {
action: "deleteAnnot",
documentId: this.documentId,
page: e,
x: t,
y: n,
authorName: o || this.globalAnnotation.author
}, l = this;
return a.myaxios.post(this.getDocTypeUrl(), s).then(function (e) {
var t = e.data;
(0, m.closeOverlay)().then(function () {
t.status ? l.deleteDocSignOnCanvas(r, i) : l.PDFViewerApplication.KGAlertPrompt.open(t.message)
})
})
},
deleteDocSignOnCanvas: function (e, t) {
var n = e.getAttribute("data-annotation-id"), r = t.pdfPage;
if (r.newDocSigns[n] ? delete r.newDocSigns[n] : (r.delAnnotions || (r.delAnnotions = {}), r.delAnnotions[n] = !0, r.reloadOperatorList = !0), 1 != t.renderingState) {
var i = t.div, a = i.querySelector(".annotationLayer");
e.parentNode == a && a.removeChild(e), t.deleteStampCallback = function () {
var e = i.querySelector(".canvasWrapper"), n = i.querySelector(".textLayer");
e && i.removeChild(e), n && i.removeChild(n);
var a = window.KGPdfViewerWebApp.PDFViewerApplication.pdfThumbnailViewer.getThumbnail(r.pageIndex);
a.renderingState = 0, a.setImage(t)
}, t.renderingState = 0, t.renderingQueue.renderView(t)
} else t.reRenderWait = !0
},
certFromKey: !1,
getExternalToken: null,
isLoadComplete: function () {
return !!window.KGPdfViewerWebApp.documentLoaded
},
enableButtons: function () {
[].concat(function (e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
return Array.from(e)
}(document.querySelectorAll(".kg_disabled"))).forEach(function (e) {
e.removeAttribute("disabled"), e.classList.remove("kg_disabled")
})
},
chainStamp: !0,
postEncrypt: !1,
cancelStampCallback: function () {
},
isSM: !1,
isUkey: !1,
systemStampMode: null,
stampModel: null,
rangeChunkSize: 1048576,
repairJpegConfig: {size: 0, opacity: 75},
repairJpegXObjectByIE: function (e) {
var t = e.width, n = e.height, r = e.callback, i = window.KGPdfViewerWebApp.repairJpegConfig, a = i.size,
o = i.opacity;
if ((0, m.isIE)() && a) {
var s = (0, m.pxConversionMm)(t), l = (0, m.pxConversionMm)(n), c = 10 * a;
(s < c || l < c) && r && r(o / 100)
}
},
stampMask: null,
downloadDoc: function () {
var e = window.KGPdfViewerWebApp, t = e.url, n = e.documentId;
(0, m.download)(t, n)
},
stampSystemOrigin: 1,
unifySealPlatformV2: !1,
fingerPrint: null
};
window.KGPdfViewerWebApp = k, window.exportKGBookmarks = k.exportKGBookmarks.bind(window.KGPdfViewerWebApp), window.navigateToKGBookmarks = k.navigateToKGBookmark.bind(window.KGPdfViewerWebApp), window.exportKGAnnotationList = k.exportKGAnnotationList.bind(window.KGPdfViewerWebApp), window.navigateToKGAnnotation = k.navigateToKGAnnotation.bind(window.KGPdfViewerWebApp), window.setAppCode = k.setAppCode.bind(window.KGPdfViewerWebApp), window.getAuthCode = k.getAuthCode.bind(window.KGPdfViewerWebApp), null != k.externalSign && (window.KGPdfViewerWebApp.externalSignCallback = window.KGPdfViewerWebApp.externalSign = k.externalSign.bind(window.KGPdfViewerWebApp)), window.verifyAllSeal = k.verifyAllSeal.bind(window.KGPdfViewerWebApp),window.getSealArray = k.getSealArray.bind(window.KGPdfViewerWebApp), t.KGPdfViewerWebApp = k
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_AlertPrompt = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.overlayName = n.overlayName, this.container = n.container, this.close = this.close.bind(this), this.createDom = this.createDom.bind(this), this.init = this.init.bind(this), this.createDom(), this.init(), this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.close, !1), this.closeCallback = null
}
return r(e, [{
key: "createDom", value: function () {
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.container.appendChild(e);
var t = document.createElement("div");
t.classList.add("kg_dialog_title"), t.setAttribute("data-l10n-id", "alert_title"), e.appendChild(t), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", e.appendChild(this.closeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.container.appendChild(n), this.content = document.createElement("p"), this.content.classList.add("KG_AlertPrompt_Content"), n.appendChild(this.content);
var r = document.createElement("div");
r.classList.add("KG_Form_Footer"), n.appendChild(r), this.okBtn = document.createElement("button"), this.okBtn.setAttribute("data-l10n-id", "password_ok"), this.okBtn.classList.add("btn"), this.okBtn.classList.add("btn-primary"), r.appendChild(this.okBtn), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
this.okBtn.addEventListener("click", this.close), this.closeBtn.addEventListener("click", this.close)
}
}, {
key: "open", value: function (e) {
var t = this;
return window.KGPdfViewerWebApp.getTipPrompt().close(), this.overlayManager.open(this.overlayName).then(function () {
var n = window.KGPdfViewerWebApp.clientErrorConfig.filter(function (t) {
return e.indexOf(t.errCode) > -1
})[0];
n ? (t.content.innerHTML = n.errText || e, t.closeCallback = n.errCallback) : t.content.innerHTML = e
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.closeCallback && (e.closeCallback(), e.closeCallback = null)
})
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.DOMSVGFactory = t.DOMCMapReaderFactory = t.DOMCanvasFactory = t.DEFAULT_LINK_REL = t.getDefaultSetting = t.LinkTarget = t.getFilenameFromUrl = t.isValidUrl = t.isExternalLinkTargetSet = t.addLinkAttributes = t.RenderingCancelledException = t.CustomStyle = void 0;
var r, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(180), o = n(181), s = (r = o) && r.__esModule ? r : {default: r};
function l(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var c = "noopener noreferrer nofollow", u = "http://www.w3.org/2000/svg", d = function () {
function e() {
l(this, e)
}
return i(e, [{
key: "create", value: function (e, t) {
if (e <= 0 || t <= 0) throw new Error("invalid canvas size");
var n = document.createElement("canvas"), r = n.getContext("2d");
return n.width = e, n.height = t, {canvas: n, context: r}
}
}, {
key: "reset", value: function (e, t, n) {
if (!e.canvas) throw new Error("canvas is not specified");
if (t <= 0 || n <= 0) throw new Error("invalid canvas size");
e.canvas.width = t, e.canvas.height = n
}
}, {
key: "destroy", value: function (e) {
if (!e.canvas) throw new Error("canvas is not specified");
e.canvas.width = 0, e.canvas.height = 0, e.canvas = null, e.context = null
}
}]), e
}(), h = function () {
function e(t) {
var n = t.baseUrl, r = void 0 === n ? null : n, i = t.isCompressed, a = void 0 !== i && i;
l(this, e), this.baseUrl = r, this.isCompressed = a
}
return i(e, [{
key: "fetch", value: function (e) {
var t = this, n = e.name;
return this.baseUrl ? n ? new Promise(function (e, r) {
var i = t.baseUrl + n + (t.isCompressed ? ".bcmap" : ""), o = new XMLHttpRequest;
o.open("GET", i, !0), t.isCompressed && (o.responseType = "arraybuffer"), o.onreadystatechange = function () {
if (o.readyState === XMLHttpRequest.DONE) {
if (200 === o.status || 0 === o.status) {
var n = void 0;
if (t.isCompressed && o.response ? n = new Uint8Array(o.response) : !t.isCompressed && o.responseText && (n = (0, a.stringToBytes)(o.responseText)), n) return void e({
cMapData: n,
compressionType: t.isCompressed ? a.CMapCompressionType.BINARY : a.CMapCompressionType.NONE
})
}
r(new Error("Unable to load " + (t.isCompressed ? "binary " : "") + "CMap at: " + i))
}
}, o.send(null)
}) : Promise.reject(new Error("CMap name must be specified.")) : Promise.reject(new Error('CMap baseUrl must be specified, see "PDFJS.cMapUrl" (and also "PDFJS.cMapPacked").'))
}
}]), e
}(), p = function () {
function e() {
l(this, e)
}
return i(e, [{
key: "create", value: function (e, t) {
(0, a.assert)(e > 0 && t > 0, "Invalid SVG dimensions");
var n = document.createElementNS(u, "svg:svg");
return n.setAttribute("version", "1.1"), n.setAttribute("width", e + "px"), n.setAttribute("height", t + "px"), n.setAttribute("preserveAspectRatio", "none"), n.setAttribute("viewBox", "0 0 " + e + " " + t), n
}
}, {
key: "createElement", value: function (e) {
return (0, a.assert)("string" == typeof e, "Invalid SVG element type"), document.createElementNS(u, e)
}
}]), e
}(), f = function () {
var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null);
function n() {
}
return n.getProp = function (n, r) {
if (1 === arguments.length && "string" == typeof t[n]) return t[n];
var i, a, o = (r = r || document.documentElement).style;
if ("string" == typeof o[n]) return t[n] = n;
a = n.charAt(0).toUpperCase() + n.slice(1);
for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof o[i = e[s] + a]) return t[n] = i;
return t[n] = "undefined"
}, n.setProp = function (e, t, n) {
var r = this.getProp(e);
"undefined" !== r && (t.style[r] = n)
}, n
}(), m = function () {
function e(e, t) {
this.message = e, this.type = t
}
return e.prototype = new Error, e.prototype.name = "RenderingCancelledException", e.constructor = e, e
}(), v = {NONE: 0, SELF: 1, BLANK: 2, PARENT: 3, TOP: 4}, g = ["", "_self", "_blank", "_parent", "_top"];
function y(e) {
var t = s.default.PDFJS;
switch (e) {
case"pdfBug":
return !!t && t.pdfBug;
case"disableAutoFetch":
return !!t && t.disableAutoFetch;
case"disableStream":
return !!t && t.disableStream;
case"disableRange":
return !!t && t.disableRange;
case"disableFontFace":
return !!t && t.disableFontFace;
case"disableCreateObjectURL":
return !!t && t.disableCreateObjectURL;
case"disableWebGL":
return !t || t.disableWebGL;
case"cMapUrl":
return t ? t.cMapUrl : null;
case"cMapPacked":
return !!t && t.cMapPacked;
case"postMessageTransfers":
return !t || t.postMessageTransfers;
case"workerPort":
return t ? t.workerPort : null;
case"workerSrc":
return t ? t.workerSrc : null;
case"disableWorker":
return !!t && t.disableWorker;
case"maxImageSize":
return t ? t.maxImageSize : -1;
case"imageResourcesPath":
return t ? t.imageResourcesPath : "";
case"isEvalSupported":
return !t || t.isEvalSupported;
case"externalLinkTarget":
if (!t) return v.NONE;
switch (t.externalLinkTarget) {
case v.NONE:
case v.SELF:
case v.BLANK:
case v.PARENT:
case v.TOP:
return t.externalLinkTarget
}
return (0, a.warn)("PDFJS.externalLinkTarget is invalid: " + t.externalLinkTarget), t.externalLinkTarget = v.NONE, v.NONE;
case"externalLinkRel":
return t ? t.externalLinkRel : c;
case"enableStats":
return !(!t || !t.enableStats);
case"pdfjsNext":
return !(!t || !t.pdfjsNext);
default:
throw new Error("Unknown default setting: " + e)
}
}
t.CustomStyle = f, t.RenderingCancelledException = m, t.addLinkAttributes = function (e, t) {
var n = t && t.url;
if (e.href = e.title = n ? (0, a.removeNullCharacters)(n) : "", n) {
var r = t.target;
void 0 === r && (r = y("externalLinkTarget")), e.target = g[r];
var i = t.rel;
void 0 === i && (i = y("externalLinkRel")), e.rel = i
}
}, t.isExternalLinkTargetSet = function () {
switch (y("externalLinkTarget")) {
case v.NONE:
return !1;
case v.SELF:
case v.BLANK:
case v.PARENT:
case v.TOP:
return !0
}
}, t.isValidUrl = function (e, t) {
(0, a.deprecated)("isValidUrl(), please use createValidAbsoluteUrl() instead.");
var n = t ? "http://example.com" : null;
return null !== (0, a.createValidAbsoluteUrl)(e, n)
}, t.getFilenameFromUrl = function (e) {
var t = e.indexOf("#"), n = e.indexOf("?"), r = Math.min(t > 0 ? t : e.length, n > 0 ? n : e.length);
return e.substring(e.lastIndexOf("/", r) + 1, r)
}, t.LinkTarget = v, t.getDefaultSetting = y, t.DEFAULT_LINK_REL = c, t.DOMCanvasFactory = d, t.DOMCMapReaderFactory = h, t.DOMSVGFactory = p
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.unreachable = t.warn = t.utf8StringToString = t.stringToUTF8String = t.stringToPDFString = t.stringToBytes = t.string32 = t.shadow = t.setVerbosityLevel = t.ReadableStream = t.removeNullCharacters = t.readUint32 = t.readUint16 = t.readInt8 = t.log2 = t.loadJpegStream = t.isEvalSupported = t.isLittleEndian = t.createValidAbsoluteUrl = t.isSameOrigin = t.isNodeJS = t.isSpace = t.isString = t.isNum = t.isEmptyObj = t.isBool = t.isArrayBuffer = t.info = t.getVerbosityLevel = t.getLookupTableFactory = t.deprecated = t.createObjectURL = t.createPromiseCapability = t.createBlob = t.bytesToString = t.assert = t.arraysToBytes = t.arrayByteLength = t.FormatError = t.XRefParseException = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.TextRenderingMode = t.StreamType = t.StatTimer = t.PasswordResponses = t.PasswordException = t.PageViewport = t.NotImplementedException = t.NativeImageDecoding = t.MissingPDFException = t.MissingDataException = t.MessageHandler = t.InvalidPDFException = t.AbortException = t.CMapCompressionType = t.ImageKind = t.FontType = t.AnnotationType = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationBorderStyleType = t.UNSUPPORTED_FEATURES = t.VERBOSITY_LEVELS = t.OPS = t.IDENTITY_MATRIX = t.FONT_IDENTITY_MATRIX = t.BaseException = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
n(389);
var i = n(395), a = {errors: 0, warnings: 1, infos: 5}, o = a.warnings;
function s(e) {
o >= a.warnings && console.log("Warning: " + e)
}
function l(e) {
throw new Error(e)
}
function c(e, t) {
e || l(t)
}
var u = function () {
function e(e, t) {
this.name = "PasswordException", this.message = e, this.code = t
}
return e.prototype = new Error, e.constructor = e, e
}(), d = function () {
function e(e, t) {
this.name = "UnknownErrorException", this.message = e, this.details = t
}
return e.prototype = new Error, e.constructor = e, e
}(), h = function () {
function e(e) {
this.name = "InvalidPDFException", this.message = e
}
return e.prototype = new Error, e.constructor = e, e
}(), p = function () {
function e(e) {
this.name = "MissingPDFException", this.message = e
}
return e.prototype = new Error, e.constructor = e, e
}(), f = function () {
function e(e, t) {
this.name = "UnexpectedResponseException", this.message = e, this.status = t
}
return e.prototype = new Error, e.constructor = e, e
}(), m = function () {
function e(e) {
this.message = e
}
return e.prototype = new Error, e.prototype.name = "NotImplementedException", e.constructor = e, e
}(), v = function () {
function e(e, t) {
this.begin = e, this.end = t, this.message = "Missing data [" + e + ", " + t + ")"
}
return e.prototype = new Error, e.prototype.name = "MissingDataException", e.constructor = e, e
}(), g = function () {
function e(e) {
this.message = e
}
return e.prototype = new Error, e.prototype.name = "XRefParseException", e.constructor = e, e
}(), y = function () {
function e(e) {
this.message = e
}
return e.prototype = new Error, e.prototype.name = "FormatError", e.constructor = e, e
}(), b = function () {
function e(e) {
this.name = "AbortException", this.message = e
}
return e.prototype = new Error, e.constructor = e, e
}(), w = /\x00/g;
function S(e) {
c("string" == typeof e, "Invalid argument for stringToBytes");
for (var t = e.length, n = new Uint8Array(t), r = 0; r < t; ++r) n[r] = 255 & e.charCodeAt(r);
return n
}
function _(e) {
return void 0 !== e.length ? e.length : (c(void 0 !== e.byteLength), e.byteLength)
}
var k = function () {
function e() {
}
var t = ["rgb(", 0, ",", 0, ",", 0, ")"];
e.makeCssRgb = function (e, n, r) {
return t[1] = e, t[3] = n, t[5] = r, t.join("")
}, e.transform = function (e, t) {
return [e[0] * t[0] + e[2] * t[1], e[1] * t[0] + e[3] * t[1], e[0] * t[2] + e[2] * t[3], e[1] * t[2] + e[3] * t[3], e[0] * t[4] + e[2] * t[5] + e[4], e[1] * t[4] + e[3] * t[5] + e[5]]
}, e.applyTransform = function (e, t) {
return [e[0] * t[0] + e[1] * t[2] + t[4], e[0] * t[1] + e[1] * t[3] + t[5]]
}, e.applyInverseTransform = function (e, t) {
var n = t[0] * t[3] - t[1] * t[2];
return [(e[0] * t[3] - e[1] * t[2] + t[2] * t[5] - t[4] * t[3]) / n, (-e[0] * t[1] + e[1] * t[0] + t[4] * t[1] - t[5] * t[0]) / n]
}, e.getAxialAlignedBoundingBox = function (t, n) {
var r = e.applyTransform(t, n), i = e.applyTransform(t.slice(2, 4), n), a = e.applyTransform([t[0], t[3]], n),
o = e.applyTransform([t[2], t[1]], n);
return [Math.min(r[0], i[0], a[0], o[0]), Math.min(r[1], i[1], a[1], o[1]), Math.max(r[0], i[0], a[0], o[0]), Math.max(r[1], i[1], a[1], o[1])]
}, e.inverseTransform = function (e) {
var t = e[0] * e[3] - e[1] * e[2];
return [e[3] / t, -e[1] / t, -e[2] / t, e[0] / t, (e[2] * e[5] - e[4] * e[3]) / t, (e[4] * e[1] - e[5] * e[0]) / t]
}, e.apply3dTransform = function (e, t) {
return [e[0] * t[0] + e[1] * t[1] + e[2] * t[2], e[3] * t[0] + e[4] * t[1] + e[5] * t[2], e[6] * t[0] + e[7] * t[1] + e[8] * t[2]]
}, e.singularValueDecompose2dScale = function (e) {
var t = [e[0], e[2], e[1], e[3]], n = e[0] * t[0] + e[1] * t[2], r = e[0] * t[1] + e[1] * t[3],
i = e[2] * t[0] + e[3] * t[2], a = e[2] * t[1] + e[3] * t[3], o = (n + a) / 2,
s = Math.sqrt((n + a) * (n + a) - 4 * (n * a - i * r)) / 2, l = o + s || 1, c = o - s || 1;
return [Math.sqrt(l), Math.sqrt(c)]
}, e.normalizeRect = function (e) {
var t = e.slice(0);
return e[0] > e[2] && (t[0] = e[2], t[2] = e[0]), e[1] > e[3] && (t[1] = e[3], t[3] = e[1]), t
}, e.intersect = function (t, n) {
function r(e, t) {
return e - t
}
var i = [t[0], t[2], n[0], n[2]].sort(r), a = [t[1], t[3], n[1], n[3]].sort(r), o = [];
return t = e.normalizeRect(t), n = e.normalizeRect(n), (i[0] === t[0] && i[1] === n[0] || i[0] === n[0] && i[1] === t[0]) && (o[0] = i[1], o[2] = i[2], (a[0] === t[1] && a[1] === n[1] || a[0] === n[1] && a[1] === t[1]) && (o[1] = a[1], o[3] = a[2], o))
};
var n = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"];
return e.toRoman = function (e, t) {
c(Number.isInteger(e) && e > 0, "The number should be a positive integer.");
for (var r, i = []; e >= 1e3;) e -= 1e3, i.push("M");
r = e / 100 | 0, e %= 100, i.push(n[r]), r = e / 10 | 0, e %= 10, i.push(n[10 + r]), i.push(n[20 + e]);
var a = i.join("");
return t ? a.toLowerCase() : a
}, e.appendToArray = function (e, t) {
Array.prototype.push.apply(e, t)
}, e.prependToArray = function (e, t) {
Array.prototype.unshift.apply(e, t)
}, e.extendObj = function (e, t) {
for (var n in t) e[n] = t[n]
}, e.getInheritableProperty = function (e, t, n) {
for (; e && !e.has(t);) e = e.get("Parent");
return e ? n ? e.getArray(t) : e.get(t) : null
}, e.inherit = function (e, t, n) {
for (var r in e.prototype = Object.create(t.prototype), e.prototype.constructor = e, n) e.prototype[r] = n[r]
}, e.loadScript = function (e, t) {
var n = document.createElement("script"), r = !1;
n.setAttribute("src", e), t && (n.onload = function () {
r || t(), r = !0
}), document.getElementsByTagName("head")[0].appendChild(n)
}, e
}(), x = function () {
function e(e, t, n, r, i, a) {
this.viewBox = e, this.scale = t, this.rotation = n, this.offsetX = r, this.offsetY = i;
var o, s, l, c, u, d, h, p, f = (e[2] + e[0]) / 2, m = (e[3] + e[1]) / 2;
switch (n = (n %= 360) < 0 ? n + 360 : n) {
case 180:
o = -1, s = 0, l = 0, c = 1;
break;
case 90:
o = 0, s = 1, l = 1, c = 0;
break;
case 270:
o = 0, s = -1, l = -1, c = 0;
break;
default:
o = 1, s = 0, l = 0, c = -1
}
a && (l = -l, c = -c), 0 === o ? (u = Math.abs(m - e[1]) * t + r, d = Math.abs(f - e[0]) * t + i, h = Math.abs(e[3] - e[1]) * t, p = Math.abs(e[2] - e[0]) * t) : (u = Math.abs(f - e[0]) * t + r, d = Math.abs(m - e[1]) * t + i, h = Math.abs(e[2] - e[0]) * t, p = Math.abs(e[3] - e[1]) * t), this.transform = [o * t, s * t, l * t, c * t, u - o * t * f - l * t * m, d - s * t * f - c * t * m], this.width = h, this.height = p, this.fontScale = t
}
return e.prototype = {
clone: function (t) {
var n = "scale" in (t = t || {}) ? t.scale : this.scale, r = "rotation" in t ? t.rotation : this.rotation;
return new e(this.viewBox.slice(), n, r, this.offsetX, this.offsetY, t.dontFlip)
}, convertToViewportPoint: function (e, t) {
return k.applyTransform([e, t], this.transform)
}, convertToViewportRectangle: function (e) {
var t = k.applyTransform([e[0], e[1]], this.transform), n = k.applyTransform([e[2], e[3]], this.transform);
return [t[0], t[1], n[0], n[1]]
}, convertToPdfPoint: function (e, t) {
return k.applyInverseTransform([e, t], this.transform)
}
}, e
}(),
P = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
function C() {
var e = {};
return e.promise = new Promise(function (t, n) {
e.resolve = t, e.reject = n
}), e
}
var A, T = function () {
function e(e, t, n) {
for (; e.length < n;) e += t;
return e
}
function t() {
this.started = Object.create(null), this.times = [], this.enabled = !0
}
return t.prototype = {
time: function (e) {
this.enabled && (e in this.started && s("Timer is already running for " + e), this.started[e] = Date.now())
}, timeEnd: function (e) {
this.enabled && (e in this.started || s("Timer has not been started for " + e), this.times.push({
name: e,
start: this.started[e],
end: Date.now()
}), delete this.started[e])
}, toString: function () {
var t, n, r = this.times, i = "", a = 0;
for (t = 0, n = r.length; t < n; ++t) {
var o = r[t].name;
o.length > a && (a = o.length)
}
for (t = 0, n = r.length; t < n; ++t) {
var s = r[t], l = s.end - s.start;
i += e(s.name, " ", a) + " " + l + "ms\n"
}
return i
}
}, t
}(), E = function (e, t) {
if ("undefined" != typeof Blob) return new Blob([e], {type: t});
throw new Error('The "Blob" constructor is not supported.')
}, D = (A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", function (e, t) {
if (!(arguments.length > 2 && void 0 !== arguments[2] && arguments[2]) && URL.createObjectURL) {
var n = E(e, t);
return URL.createObjectURL(n)
}
for (var r = "data:" + t + ";base64,", i = 0, a = e.length; i < a; i += 3) {
var o = 255 & e[i], s = 255 & e[i + 1], l = 255 & e[i + 2];
r += A[o >> 2] + A[(3 & o) << 4 | s >> 4] + A[i + 1 < a ? (15 & s) << 2 | l >> 6 : 64] + A[i + 2 < a ? 63 & l : 64]
}
return r
});
function I(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null;
return e ? new Promise(function (r, i) {
r(e.apply(n, t))
}) : Promise.resolve(void 0)
}
function L(e) {
if ("object" !== (void 0 === e ? "undefined" : r(e))) return e;
switch (e.name) {
case"AbortException":
return new b(e.message);
case"MissingPDFException":
return new p(e.message);
case"UnexpectedResponseException":
return new f(e.message, e.status);
default:
return new d(e.message, e.details)
}
}
function O(e, t, n) {
t ? e.resolve() : e.reject(n)
}
function M(e, t, n) {
var r = this;
this.sourceName = e, this.targetName = t, this.comObj = n, this.callbackId = 1, this.streamId = 1, this.postMessageTransfers = !0, this.streamSinks = Object.create(null), this.streamControllers = Object.create(null);
var i = this.callbacksCapabilities = Object.create(null), a = this.actionHandler = Object.create(null);
this._onComObjOnMessage = function (e) {
var t = e.data;
if (t.targetName === r.sourceName) if (t.stream) r._processStreamMessage(t); else if (t.isReply) {
var o = t.callbackId;
if (!(t.callbackId in i)) throw new Error("Cannot resolve callback " + o);
var s = i[o];
delete i[o], "error" in t ? s.reject(L(t.error)) : s.resolve(t.data)
} else {
if (!(t.action in a)) throw new Error("Unknown action from worker: " + t.action);
var l = a[t.action];
if (t.callbackId) {
var c = r.sourceName, u = t.sourceName;
Promise.resolve().then(function () {
return l[0].call(l[1], t.data)
}).then(function (e) {
n.postMessage({sourceName: c, targetName: u, isReply: !0, callbackId: t.callbackId, data: e})
}, function (e) {
n.postMessage({
sourceName: c, targetName: u, isReply: !0, callbackId: t.callbackId, error: function (e) {
return !(e instanceof Error) || e instanceof b || e instanceof p || e instanceof f || e instanceof d ? e : new d(e.message, e.toString())
}(e)
})
})
} else t.streamId ? r._createStreamSink(t) : l[0].call(l[1], t.data)
}
}, n.addEventListener("message", this._onComObjOnMessage)
}
M.prototype = {
on: function (e, t, n) {
var r = this.actionHandler;
if (r[e]) throw new Error('There is already an actionName called "' + e + '"');
r[e] = [t, n]
}, send: function (e, t, n) {
var r = {sourceName: this.sourceName, targetName: this.targetName, action: e, data: t};
this.postMessage(r, n)
}, sendWithPromise: function (e, t, n) {
var r = this.callbackId++,
i = {sourceName: this.sourceName, targetName: this.targetName, action: e, data: t, callbackId: r}, a = C();
this.callbacksCapabilities[r] = a;
try {
this.postMessage(i, n)
} catch (e) {
a.reject(e)
}
return a.promise
}, sendWithStream: function (e, t, n, r) {
var a = this, o = this.streamId++, s = this.sourceName, l = this.targetName;
return new i.ReadableStream({
start: function (n) {
var r = C();
return a.streamControllers[o] = {controller: n, startCall: r, isClosed: !1}, a.postMessage({
sourceName: s,
targetName: l,
action: e,
streamId: o,
data: t,
desiredSize: n.desiredSize
}), r.promise
}, pull: function (e) {
var t = C();
return a.streamControllers[o].pullCall = t, a.postMessage({
sourceName: s,
targetName: l,
stream: "pull",
streamId: o,
desiredSize: e.desiredSize
}), t.promise
}, cancel: function (e) {
var t = C();
return a.streamControllers[o].cancelCall = t, a.streamControllers[o].isClosed = !0, a.postMessage({
sourceName: s,
targetName: l,
stream: "cancel",
reason: e,
streamId: o
}), t.promise
}
}, n)
}, _createStreamSink: function (e) {
var t = this, n = this, r = this.actionHandler[e.action], i = e.streamId, a = e.desiredSize, o = this.sourceName,
s = e.sourceName, l = function (e) {
var n = e.stream, r = e.chunk, a = e.transfers, l = e.success, c = e.reason;
t.postMessage({sourceName: o, targetName: s, stream: n, streamId: i, chunk: r, success: l, reason: c}, a)
}, c = {
enqueue: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments[2];
if (!this.isCancelled) {
var r = this.desiredSize;
this.desiredSize -= t, r > 0 && this.desiredSize <= 0 && (this.sinkCapability = C(), this.ready = this.sinkCapability.promise), l({
stream: "enqueue",
chunk: e,
transfers: n
})
}
}, close: function () {
this.isCancelled || (this.isCancelled = !0, l({stream: "close"}), delete n.streamSinks[i])
}, error: function (e) {
this.isCancelled || (this.isCancelled = !0, l({stream: "error", reason: e}))
}, sinkCapability: C(), onPull: null, onCancel: null, isCancelled: !1, desiredSize: a, ready: null
};
c.sinkCapability.resolve(), c.ready = c.sinkCapability.promise, this.streamSinks[i] = c, I(r[0], [e.data, c], r[1]).then(function () {
l({stream: "start_complete", success: !0})
}, function (e) {
l({stream: "start_complete", success: !1, reason: e})
})
}, _processStreamMessage: function (e) {
var t = this, n = this.sourceName, r = e.sourceName, i = e.streamId, a = function (e) {
var a = e.stream, o = e.success, s = e.reason;
t.comObj.postMessage({sourceName: n, targetName: r, stream: a, success: o, streamId: i, reason: s})
}, o = function () {
Promise.all([t.streamControllers[e.streamId].startCall, t.streamControllers[e.streamId].pullCall, t.streamControllers[e.streamId].cancelCall].map(function (e) {
return e && (t = e.promise, Promise.resolve(t).catch(function () {
}));
var t
})).then(function () {
delete t.streamControllers[e.streamId]
})
};
switch (e.stream) {
case"start_complete":
O(this.streamControllers[e.streamId].startCall, e.success, L(e.reason));
break;
case"pull_complete":
O(this.streamControllers[e.streamId].pullCall, e.success, L(e.reason));
break;
case"pull":
if (!this.streamSinks[e.streamId]) {
a({stream: "pull_complete", success: !0});
break
}
this.streamSinks[e.streamId].desiredSize <= 0 && e.desiredSize > 0 && this.streamSinks[e.streamId].sinkCapability.resolve(), this.streamSinks[e.streamId].desiredSize = e.desiredSize, I(this.streamSinks[e.streamId].onPull).then(function () {
a({stream: "pull_complete", success: !0})
}, function (e) {
a({stream: "pull_complete", success: !1, reason: e})
});
break;
case"enqueue":
c(this.streamControllers[e.streamId], "enqueue should have stream controller"), this.streamControllers[e.streamId].isClosed || this.streamControllers[e.streamId].controller.enqueue(e.chunk);
break;
case"close":
if (c(this.streamControllers[e.streamId], "close should have stream controller"), this.streamControllers[e.streamId].isClosed) break;
this.streamControllers[e.streamId].isClosed = !0, this.streamControllers[e.streamId].controller.close(), o();
break;
case"error":
c(this.streamControllers[e.streamId], "error should have stream controller"), this.streamControllers[e.streamId].controller.error(L(e.reason)), o();
break;
case"cancel_complete":
O(this.streamControllers[e.streamId].cancelCall, e.success, L(e.reason)), o();
break;
case"cancel":
if (!this.streamSinks[e.streamId]) break;
I(this.streamSinks[e.streamId].onCancel, [L(e.reason)]).then(function () {
a({stream: "cancel_complete", success: !0})
}, function (e) {
a({stream: "cancel_complete", success: !1, reason: e})
}), this.streamSinks[e.streamId].sinkCapability.reject(L(e.reason)), this.streamSinks[e.streamId].isCancelled = !0, delete this.streamSinks[e.streamId];
break;
default:
throw new Error("Unexpected stream case")
}
}, postMessage: function (e, t) {
t && this.postMessageTransfers ? this.comObj.postMessage(e, t) : this.comObj.postMessage(e)
}, destroy: function () {
this.comObj.removeEventListener("message", this._onComObjOnMessage)
}
};
var N = function () {
function e(t, n) {
this.constructor === e && l("Cannot initialize BaseException."), this.message = t, this.name = n
}
return e.prototype = new Error, e.constructor = e, e
}();
t.BaseException = N, t.FONT_IDENTITY_MATRIX = [.001, 0, 0, .001, 0, 0], t.IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0], t.OPS = {
dependency: 1,
setLineWidth: 2,
setLineCap: 3,
setLineJoin: 4,
setMiterLimit: 5,
setDash: 6,
setRenderingIntent: 7,
setFlatness: 8,
setGState: 9,
save: 10,
restore: 11,
transform: 12,
moveTo: 13,
lineTo: 14,
curveTo: 15,
curveTo2: 16,
curveTo3: 17,
closePath: 18,
rectangle: 19,
stroke: 20,
closeStroke: 21,
fill: 22,
eoFill: 23,
fillStroke: 24,
eoFillStroke: 25,
closeFillStroke: 26,
closeEOFillStroke: 27,
endPath: 28,
clip: 29,
eoClip: 30,
beginText: 31,
endText: 32,
setCharSpacing: 33,
setWordSpacing: 34,
setHScale: 35,
setLeading: 36,
setFont: 37,
setTextRenderingMode: 38,
setTextRise: 39,
moveText: 40,
setLeadingMoveText: 41,
setTextMatrix: 42,
nextLine: 43,
showText: 44,
showSpacedText: 45,
nextLineShowText: 46,
nextLineSetSpacingShowText: 47,
setCharWidth: 48,
setCharWidthAndBounds: 49,
setStrokeColorSpace: 50,
setFillColorSpace: 51,
setStrokeColor: 52,
setStrokeColorN: 53,
setFillColor: 54,
setFillColorN: 55,
setStrokeGray: 56,
setFillGray: 57,
setStrokeRGBColor: 58,
setFillRGBColor: 59,
setStrokeCMYKColor: 60,
setFillCMYKColor: 61,
shadingFill: 62,
beginInlineImage: 63,
beginImageData: 64,
endInlineImage: 65,
paintXObject: 66,
markPoint: 67,
markPointProps: 68,
beginMarkedContent: 69,
beginMarkedContentProps: 70,
endMarkedContent: 71,
beginCompat: 72,
endCompat: 73,
paintFormXObjectBegin: 74,
paintFormXObjectEnd: 75,
beginGroup: 76,
endGroup: 77,
beginAnnotations: 78,
endAnnotations: 79,
beginAnnotation: 80,
endAnnotation: 81,
paintJpegXObject: 82,
paintImageMaskXObject: 83,
paintImageMaskXObjectGroup: 84,
paintImageXObject: 85,
paintInlineImageXObject: 86,
paintInlineImageXObjectGroup: 87,
paintImageXObjectRepeat: 88,
paintImageMaskXObjectRepeat: 89,
paintSolidColorImageMask: 90,
constructPath: 91
}, t.VERBOSITY_LEVELS = a, t.UNSUPPORTED_FEATURES = {
unknown: "unknown",
forms: "forms",
javaScript: "javaScript",
smask: "smask",
shadingPattern: "shadingPattern",
font: "font"
}, t.AnnotationBorderStyleType = {
SOLID: 1,
DASHED: 2,
BEVELED: 3,
INSET: 4,
UNDERLINE: 5
}, t.AnnotationFieldFlag = {
READONLY: 1,
REQUIRED: 2,
NOEXPORT: 4,
MULTILINE: 4096,
PASSWORD: 8192,
NOTOGGLETOOFF: 16384,
RADIO: 32768,
PUSHBUTTON: 65536,
COMBO: 131072,
EDIT: 262144,
SORT: 524288,
FILESELECT: 1048576,
MULTISELECT: 2097152,
DONOTSPELLCHECK: 4194304,
DONOTSCROLL: 8388608,
COMB: 16777216,
RICHTEXT: 33554432,
RADIOSINUNISON: 33554432,
COMMITONSELCHANGE: 67108864
}, t.AnnotationFlag = {
INVISIBLE: 1,
HIDDEN: 2,
PRINT: 4,
NOZOOM: 8,
NOROTATE: 16,
NOVIEW: 32,
READONLY: 64,
LOCKED: 128,
TOGGLENOVIEW: 256,
LOCKEDCONTENTS: 512
}, t.AnnotationType = {
TEXT: 1,
LINK: 2,
FREETEXT: 3,
LINE: 4,
SQUARE: 5,
CIRCLE: 6,
POLYGON: 7,
POLYLINE: 8,
HIGHLIGHT: 9,
UNDERLINE: 10,
SQUIGGLY: 11,
STRIKEOUT: 12,
STAMP: 13,
CARET: 14,
INK: 15,
POPUP: 16,
FILEATTACHMENT: 17,
SOUND: 18,
MOVIE: 19,
WIDGET: 20,
SCREEN: 21,
PRINTERMARK: 22,
TRAPNET: 23,
WATERMARK: 24,
THREED: 25,
REDACT: 26
}, t.FontType = {
UNKNOWN: 0,
TYPE1: 1,
TYPE1C: 2,
CIDFONTTYPE0: 3,
CIDFONTTYPE0C: 4,
TRUETYPE: 5,
CIDFONTTYPE2: 6,
TYPE3: 7,
OPENTYPE: 8,
TYPE0: 9,
MMTYPE1: 10
}, t.ImageKind = {GRAYSCALE_1BPP: 1, RGB_24BPP: 2, RGBA_32BPP: 3}, t.CMapCompressionType = {
NONE: 0,
BINARY: 1,
STREAM: 2
}, t.AbortException = b, t.InvalidPDFException = h, t.MessageHandler = M, t.MissingDataException = v, t.MissingPDFException = p, t.NativeImageDecoding = {
NONE: "none",
DECODE: "decode",
DISPLAY: "display"
}, t.NotImplementedException = m, t.PageViewport = x, t.PasswordException = u, t.PasswordResponses = {
NEED_PASSWORD: 1,
INCORRECT_PASSWORD: 2
}, t.StatTimer = T, t.StreamType = {
UNKNOWN: 0,
FLATE: 1,
LZW: 2,
DCT: 3,
JPX: 4,
JBIG: 5,
A85: 6,
AHX: 7,
CCF: 8,
RL: 9
}, t.TextRenderingMode = {
FILL: 0,
STROKE: 1,
FILL_STROKE: 2,
INVISIBLE: 3,
FILL_ADD_TO_PATH: 4,
STROKE_ADD_TO_PATH: 5,
FILL_STROKE_ADD_TO_PATH: 6,
ADD_TO_PATH: 7,
FILL_STROKE_MASK: 3,
ADD_TO_PATH_FLAG: 4
}, t.UnexpectedResponseException = f, t.UnknownErrorException = d, t.Util = k, t.XRefParseException = g, t.FormatError = y, t.arrayByteLength = _, t.arraysToBytes = function (e) {
if (1 === e.length && e[0] instanceof Uint8Array) return e[0];
var t, n, r, i = 0, a = e.length;
for (t = 0; t < a; t++) i += r = _(n = e[t]);
var o = 0, s = new Uint8Array(i);
for (t = 0; t < a; t++) (n = e[t]) instanceof Uint8Array || (n = "string" == typeof n ? S(n) : new Uint8Array(n)), r = n.byteLength, s.set(n, o), o += r;
return s
}, t.assert = c, t.bytesToString = function (e) {
c(null !== e && "object" === (void 0 === e ? "undefined" : r(e)) && void 0 !== e.length, "Invalid argument for bytesToString");
var t = e.length;
if (t < 8192) return String.fromCharCode.apply(null, e);
for (var n = [], i = 0; i < t; i += 8192) {
var a = Math.min(i + 8192, t), o = e.subarray(i, a);
n.push(String.fromCharCode.apply(null, o))
}
return n.join("")
}, t.createBlob = E, t.createPromiseCapability = C, t.createObjectURL = D, t.deprecated = function (e) {
console.log("Deprecated API usage: " + e)
}, t.getLookupTableFactory = function (e) {
var t;
return function () {
return e && (t = Object.create(null), e(t), e = null), t
}
}, t.getVerbosityLevel = function () {
return o
}, t.info = function (e) {
o >= a.infos && console.log("Info: " + e)
}, t.isArrayBuffer = function (e) {
return "object" === (void 0 === e ? "undefined" : r(e)) && null !== e && void 0 !== e.byteLength
}, t.isBool = function (e) {
return "boolean" == typeof e
}, t.isEmptyObj = function (e) {
for (var t in e) return !1;
return !0
}, t.isNum = function (e) {
return "number" == typeof e
}, t.isString = function (e) {
return "string" == typeof e
}, t.isSpace = function (e) {
return 32 === e || 9 === e || 13 === e || 10 === e
}, t.isNodeJS = function () {
return "object" === ("undefined" == typeof process ? "undefined" : r(process)) && process + "" == "[object process]"
}, t.isSameOrigin = function (e, t) {
try {
var n = new URL(e);
if (!n.origin || "null" === n.origin) return !1
} catch (e) {
return !1
}
var r = new URL(t, n);
return n.origin === r.origin
}, t.createValidAbsoluteUrl = function (e, t) {
if (!e) return null;
try {
var n = t ? new URL(e, t) : new URL(e);
if (function (e) {
if (!e) return !1;
switch (e.protocol) {
case"http:":
case"https:":
case"ftp:":
case"mailto:":
case"tel:":
return !0;
default:
return !1
}
}(n)) return n
} catch (e) {
}
return null
}, t.isLittleEndian = function () {
var e = new Uint8Array(4);
return e[0] = 1, 1 === new Uint32Array(e.buffer, 0, 1)[0]
}, t.isEvalSupported = function () {
try {
return new Function(""), !0
} catch (e) {
return !1
}
}, t.loadJpegStream = function (e, t, n) {
var r = new Image;
r.onload = function () {
n.resolve(e, r)
}, r.onerror = function () {
n.resolve(e, null), s("Error during JPEG image loading")
}, r.src = t
}, t.log2 = function (e) {
return e <= 0 ? 0 : Math.ceil(Math.log2(e))
}, t.readInt8 = function (e, t) {
return e[t] << 24 >> 24
}, t.readUint16 = function (e, t) {
return e[t] << 8 | e[t + 1]
}, t.readUint32 = function (e, t) {
return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0
}, t.removeNullCharacters = function (e) {
return "string" != typeof e ? (s("The argument for removeNullCharacters must be a string."), e) : e.replace(w, "")
}, t.ReadableStream = i.ReadableStream, t.setVerbosityLevel = function (e) {
o = e
}, t.shadow = function (e, t, n) {
return Object.defineProperty(e, t, {value: n, enumerable: !0, configurable: !0, writable: !1}), n
}, t.string32 = function (e) {
return String.fromCharCode(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e)
}, t.stringToBytes = S, t.stringToPDFString = function (e) {
var t, n = e.length, r = [];
if ("þ" === e[0] && "ÿ" === e[1]) for (t = 2; t < n; t += 2) r.push(String.fromCharCode(e.charCodeAt(t) << 8 | e.charCodeAt(t + 1))); else for (t = 0; t < n; ++t) {
var i = P[e.charCodeAt(t)];
r.push(i ? String.fromCharCode(i) : e.charAt(t))
}
return r.join("")
}, t.stringToUTF8String = function (e) {
return decodeURIComponent(escape(e))
}, t.utf8StringToString = function (e) {
return unescape(encodeURIComponent(e))
}, t.warn = s, t.unreachable = l
}, function (e, t, n) {
"use strict";
e.exports = "undefined" != typeof window && window.Math === Math ? window : "undefined" != typeof global && global.Math === Math ? global : "undefined" != typeof self && self.Math === Math ? self : {}
}, function (e, t, n) {
"use strict";
var r, i, a, o, s, l, c, u, d, h, p, f, m, v, g, y,
b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = window.layui && layui.define, s = {
getPath: (i = document.currentScript ? document.currentScript.src : function () {
for (var e, t = document.scripts, n = t.length - 1, r = n; r > 0; r--) if ("interactive" === t[r].readyState) {
e = t[r].src;
break
}
return e || t[n].src
}(), i.substring(0, i.lastIndexOf("/") + 1)), getStyle: function (e, t) {
var n = e.currentStyle ? e.currentStyle : window.getComputedStyle(e, null);
return n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"](t)
}, link: function (e, t, n) {
if (l.path) {
var r = document.getElementsByTagName("head")[0], i = document.createElement("link");
"string" == typeof t && (n = t);
var a = "layuicss-" + (n || e).replace(/\.|\//g, ""), o = 0;
i.rel = "stylesheet", i.href = l.path + e, i.id = a, document.getElementById(a) || r.appendChild(i), "function" == typeof t && function e() {
if (++o > 80) return window.console && console.error("laydate.css: Invalid");
1989 === parseInt(s.getStyle(document.getElementById(a), "width")) ? t() : setTimeout(e, 100)
}()
}
}
}, l = {
v: "5.0.9",
config: {},
index: window.laydate && window.laydate.v ? 1e5 : 0,
path: s.getPath,
set: function (e) {
return this.config = g.extend({}, this.config, e), this
},
ready: function (e) {
var t = (o ? "modules/laydate/" : "theme/") + "default/laydate.css?v=" + l.v;
return o ? layui.addcss(t, e, "laydate") : s.link(t, e, "laydate"), this
}
}, c = "layui-this", u = "laydate-disabled", d = "开始日期超出了结束日期<br>建议重新选择", h = [100, 2e5], p = "layui-laydate-list", f = "layui-laydate-hint", m = ".laydate-btns-confirm", v = function (e) {
var t = this;
t.index = ++l.index, t.config = g.extend({}, t.config, l.config, e), l.ready(function () {
t.init()
})
}, g = function (e) {
return new y(e)
}, (y = function (e) {
for (var t = 0, n = "object" === (void 0 === e ? "undefined" : b(e)) ? [e] : (this.selector = e, document.querySelectorAll(e || null)); t < n.length; t++) this.push(n[t])
}).prototype = [], y.prototype.constructor = y, g.extend = function () {
var e = 1, t = arguments, n = function e(t, n) {
for (var r in t = t || (n.constructor === Array ? [] : {}), n) t[r] = n[r] && n[r].constructor === Object ? e(t[r], n[r]) : n[r];
return t
};
for (t[0] = "object" === b(t[0]) ? t[0] : {}; e < t.length; e++) "object" === b(t[e]) && n(t[0], t[e]);
return t[0]
}, g.ie = (a = navigator.userAgent.toLowerCase(), !!(window.ActiveXObject || "ActiveXObject" in window) && ((a.match(/msie\s(\d+)/) || [])[1] || "11")), g.stope = function (e) {
(e = e || window.event).stopPropagation ? e.stopPropagation() : e.cancelBubble = !0
}, g.each = function (e, t) {
var n;
if ("function" != typeof t) return this;
if ((e = e || []).constructor === Object) {
for (n in e) if (t.call(e[n], n, e[n])) break
} else for (n = 0; n < e.length && !t.call(e[n], n, e[n]); n++) ;
return this
}, g.digit = function (e, t, n) {
var r = "";
e = String(e), t = t || 2;
for (var i = e.length; i < t; i++) r += "0";
return e < Math.pow(10, t) ? r + (0 | e) : e
}, g.elem = function (e, t) {
var n = document.createElement(e);
return g.each(t || {}, function (e, t) {
n.setAttribute(e, t)
}), n
}, y.addStr = function (e, t) {
return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), g.each(t, function (t, n) {
new RegExp("\\b" + n + "\\b").test(e) || (e = e + " " + n)
}), e.replace(/^\s|\s$/, "")
}, y.removeStr = function (e, t) {
return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), g.each(t, function (t, n) {
var r = new RegExp("\\b" + n + "\\b");
r.test(e) && (e = e.replace(r, ""))
}), e.replace(/\s+/, " ").replace(/^\s|\s$/, "")
}, y.prototype.find = function (e) {
var t = this, n = 0, r = [], i = "object" === (void 0 === e ? "undefined" : b(e));
return this.each(function (a, o) {
for (var s = i ? [e] : o.querySelectorAll(e || null); n < s.length; n++) r.push(s[n]);
t.shift()
}), i || (t.selector = (t.selector ? t.selector + " " : "") + e), g.each(r, function (e, n) {
t.push(n)
}), t
}, y.prototype.each = function (e) {
return g.each.call(this, this, e)
}, y.prototype.addClass = function (e, t) {
return this.each(function (n, r) {
r.className = y[t ? "removeStr" : "addStr"](r.className, e)
})
}, y.prototype.removeClass = function (e) {
return this.addClass(e, !0)
}, y.prototype.hasClass = function (e) {
var t = !1;
return this.each(function (n, r) {
new RegExp("\\b" + e + "\\b").test(r.className) && (t = !0)
}), t
}, y.prototype.attr = function (e, t) {
var n = this;
return void 0 === t ? function () {
if (n.length > 0) return n[0].getAttribute(e)
}() : n.each(function (n, r) {
r.setAttribute(e, t)
})
}, y.prototype.removeAttr = function (e) {
return this.each(function (t, n) {
n.removeAttribute(e)
})
}, y.prototype.html = function (e) {
return this.each(function (t, n) {
n.innerHTML = e
})
}, y.prototype.val = function (e) {
return this.each(function (t, n) {
n.value = e
})
}, y.prototype.append = function (e) {
return this.each(function (t, n) {
"object" === (void 0 === e ? "undefined" : b(e)) ? n.appendChild(e) : n.innerHTML = n.innerHTML + e
})
}, y.prototype.remove = function (e) {
return this.each(function (t, n) {
e ? n.removeChild(e) : n.parentNode.removeChild(n)
})
}, y.prototype.on = function (e, t) {
return this.each(function (n, r) {
r.attachEvent ? r.attachEvent("on" + e, function (e) {
e.target = e.srcElement, t.call(r, e)
}) : r.addEventListener(e, t, !1)
})
}, y.prototype.off = function (e, t) {
return this.each(function (n, r) {
r.detachEvent ? r.detachEvent("on" + e, t) : r.removeEventListener(e, t, !1)
})
}, v.isLeapYear = function (e) {
return e % 4 == 0 && e % 100 != 0 || e % 400 == 0
}, v.prototype.config = {
type: "date",
range: !1,
format: "yyyy-MM-dd",
value: null,
min: "1900-1-1",
max: "2099-12-31",
trigger: "focus",
show: !1,
showBottom: !0,
btns: ["clear", "now", "confirm"],
lang: "cn",
theme: "default",
position: null,
calendar: !1,
mark: {},
zIndex: null,
done: null,
change: null
}, v.prototype.lang = function () {
var e = {
cn: {
weeks: ["日", "一", "二", "三", "四", "五", "六"],
time: ["时", "分", "秒"],
timeTips: "选择时间",
startTime: "开始时间",
endTime: "结束时间",
dateTips: "返回日期",
month: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],
tools: {confirm: "确定", clear: "清空", now: "现在"}
},
en: {
weeks: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
time: ["Hours", "Minutes", "Seconds"],
timeTips: "Select Time",
startTime: "Start Time",
endTime: "End Time",
dateTips: "Select Date",
month: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
tools: {confirm: "Confirm", clear: "Clear", now: "Now"}
}
};
return e[this.config.lang] || e.cn
}, v.prototype.init = function () {
var e = this, t = e.config, n = "yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s", r = "static" === t.position,
i = {year: "yyyy", month: "yyyy-MM", date: "yyyy-MM-dd", time: "HH:mm:ss", datetime: "yyyy-MM-dd HH:mm:ss"};
t.elem = g(t.elem), t.eventElem = g(t.eventElem), t.elem[0] && (!0 === t.range && (t.range = "-"), t.format === i.date && (t.format = i[t.type]), e.format = t.format.match(new RegExp(n + "|.", "g")) || [], e.EXP_IF = "", e.EXP_SPLIT = "", g.each(e.format, function (t, r) {
var i = new RegExp(n).test(r) ? "\\d{" + (new RegExp(n).test(e.format[0 === t ? t + 1 : t - 1] || "") ? /^yyyy|y$/.test(r) ? 4 : r.length : /^yyyy$/.test(r) ? "1,4" : /^y$/.test(r) ? "1,308" : "1,2") + "}" : "\\" + r;
e.EXP_IF = e.EXP_IF + i, e.EXP_SPLIT = e.EXP_SPLIT + "(" + i + ")"
}), e.EXP_IF = new RegExp("^" + (t.range ? e.EXP_IF + "\\s\\" + t.range + "\\s" + e.EXP_IF : e.EXP_IF) + "$"), e.EXP_SPLIT = new RegExp("^" + e.EXP_SPLIT + "$", ""), e.isInput(t.elem[0]) || "focus" === t.trigger && (t.trigger = "click"), t.elem.attr("lay-key") || (t.elem.attr("lay-key", e.index), t.eventElem.attr("lay-key", e.index)), t.mark = g.extend({}, t.calendar && "cn" === t.lang ? {
"0-1-1": "元旦",
"0-2-14": "情人",
"0-3-8": "妇女",
"0-3-12": "植树",
"0-4-1": "愚人",
"0-5-1": "劳动",
"0-5-4": "青年",
"0-6-1": "儿童",
"0-9-10": "教师",
"0-9-18": "国耻",
"0-10-1": "国庆",
"0-12-25": "圣诞"
} : {}, t.mark), g.each(["min", "max"], function (e, n) {
var r = [], i = [];
if ("number" == typeof t[n]) {
var a = t[n], o = (new Date).getTime(), s = new Date(a ? a < 864e5 ? o + 864e5 * a : a : o);
r = [s.getFullYear(), s.getMonth() + 1, s.getDate()], a < 864e5 || (i = [s.getHours(), s.getMinutes(), s.getSeconds()])
} else r = (t[n].match(/\d+-\d+-\d+/) || [""])[0].split("-"), i = (t[n].match(/\d+:\d+:\d+/) || [""])[0].split(":");
t[n] = {
year: 0 | r[0] || (new Date).getFullYear(),
month: r[1] ? (0 | r[1]) - 1 : (new Date).getMonth(),
date: 0 | r[2] || (new Date).getDate(),
hours: 0 | i[0],
minutes: 0 | i[1],
seconds: 0 | i[2]
}
}), e.elemID = "layui-laydate" + t.elem.attr("lay-key"), (t.show || r) && e.render(), r || e.events(), t.value && (t.value.constructor === Date ? e.setValue(e.parse(0, e.systemDate(t.value))) : e.setValue(t.value)))
}, v.prototype.render = function () {
var e, t, n = this.config, r = this.lang(), i = "static" === n.position, a = this.elem = g.elem("div", {
id: this.elemID,
class: ["layui-laydate", n.range ? " layui-laydate-range" : "", i ? " layui-laydate-static" : "", n.theme && "default" !== n.theme && !/^#/.test(n.theme) ? " laydate-theme-" + n.theme : ""].join("")
}), o = this.elemMain = [], s = this.elemHeader = [], l = this.elemCont = [], c = this.table = [],
u = this.footer = g.elem("div", {class: "layui-laydate-footer"});
if (n.zIndex && (a.style.zIndex = n.zIndex), g.each(new Array(2), function (e) {
if (!n.range && e > 0) return !0;
var t, i = g.elem("div", {class: "layui-laydate-header"}),
a = [(t = g.elem("i", {class: "layui-icon laydate-icon laydate-prev-y"}), t.innerHTML = "&#xe65a;", t), function () {
var e = g.elem("i", {class: "layui-icon laydate-icon laydate-prev-m"});
return e.innerHTML = "&#xe603;", e
}(), function () {
var e = g.elem("div", {class: "laydate-set-ym"}), t = g.elem("span"), n = g.elem("span");
return e.appendChild(t), e.appendChild(n), e
}(), function () {
var e = g.elem("i", {class: "layui-icon laydate-icon laydate-next-m"});
return e.innerHTML = "&#xe602;", e
}(), function () {
var e = g.elem("i", {class: "layui-icon laydate-icon laydate-next-y"});
return e.innerHTML = "&#xe65b;", e
}()], u = g.elem("div", {class: "layui-laydate-content"}), d = g.elem("table"), h = g.elem("thead"),
p = g.elem("tr");
g.each(a, function (e, t) {
i.appendChild(t)
}), h.appendChild(p), g.each(new Array(6), function (e) {
var t = d.insertRow(0);
g.each(new Array(7), function (n) {
if (0 === e) {
var i = g.elem("th");
i.innerHTML = r.weeks[n], p.appendChild(i)
}
t.insertCell(n)
})
}), d.insertBefore(h, d.children[0]), u.appendChild(d), o[e] = g.elem("div", {class: "layui-laydate-main laydate-main-list-" + e}), o[e].appendChild(i), o[e].appendChild(u), s.push(a), l.push(u), c.push(d)
}), g(u).html((e = [], t = [], "datetime" === n.type && e.push('<span lay-type="datetime" class="laydate-btns-time">' + r.timeTips + "</span>"), g.each(n.btns, function (e, a) {
var o = r.tools[a] || "btn";
n.range && "now" === a || (i && "clear" === a && (o = "cn" === n.lang ? "重置" : "Reset"), t.push('<span lay-type="' + a + '" class="laydate-btns-' + a + '">' + o + "</span>"))
}), e.push('<div class="laydate-footer-btns">' + t.join("") + "</div>"), e.join(""))), g.each(o, function (e, t) {
a.appendChild(t)
}), n.showBottom && a.appendChild(u), /^#/.test(n.theme)) {
var d = g.elem("style"),
h = ["#{{id}} .layui-laydate-header{background-color:{{theme}};}", "#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g, this.elemID).replace(/{{theme}}/g, n.theme);
"styleSheet" in d ? (d.setAttribute("type", "text/css"), d.styleSheet.cssText = h) : d.innerHTML = h, g(a).addClass("laydate-theme-molv"), a.appendChild(d)
}
this.remove(v.thisElemDate), i ? n.elem.append(a) : (document.body.appendChild(a), this.position()), this.checkDate().calendar(), this.changeEvent(), v.thisElemDate = this.elemID, "function" == typeof n.ready && n.ready(g.extend({}, n.dateTime, {month: n.dateTime.month + 1}))
}, v.prototype.remove = function (e) {
this.config;
var t = g("#" + (e || this.elemID));
return t.hasClass("layui-laydate-static") || this.checkDate(function () {
t.remove()
}), this
}, v.prototype.position = function () {
var e = this.config, t = (this.bindElem || e.elem[0]).getBoundingClientRect(), n = this.elem.offsetWidth,
r = this.elem.offsetHeight, i = function (e) {
return e = e ? "scrollLeft" : "scrollTop", document.body[e] | document.documentElement[e]
}, a = function (e) {
return document.documentElement[e ? "clientWidth" : "clientHeight"]
}, o = t.left, s = t.bottom;
o + n + 5 > a("width") && (o = a("width") - n - 5), s + r + 5 > a() && (s = t.top > r ? t.top - r : a() - r, s -= 10), e.position && (this.elem.style.position = e.position), this.elem.style.left = o + ("fixed" === e.position ? 0 : i(1)) + "px", this.elem.style.top = s + ("fixed" === e.position ? 0 : i()) + "px"
}, v.prototype.hint = function (e) {
var t = this, n = (t.config, g.elem("div", {class: f}));
n.innerHTML = e || "", g(t.elem).find("." + f).remove(), t.elem.appendChild(n), clearTimeout(t.hinTimer), t.hinTimer = setTimeout(function () {
g(t.elem).find("." + f).remove()
}, 3e3)
}, v.prototype.getAsYM = function (e, t, n) {
return n ? t-- : t++, t < 0 && (t = 11, e--), t > 11 && (t = 0, e++), [e, t]
}, v.prototype.systemDate = function (e) {
var t = e || new Date;
return {
year: t.getFullYear(),
month: t.getMonth(),
date: t.getDate(),
hours: e ? e.getHours() : 0,
minutes: e ? e.getMinutes() : 0,
seconds: e ? e.getSeconds() : 0
}
}, v.prototype.checkDate = function (e) {
var t, n, r = this, i = (new Date, r.config), a = i.dateTime = i.dateTime || r.systemDate(),
o = r.bindElem || i.elem[0],
s = (r.isInput(o), r.isInput(o) ? o.value : "static" === i.position ? "" : o.innerHTML), c = function (e) {
e.year > h[1] && (e.year = h[1], n = !0), e.month > 11 && (e.month = 11, n = !0), e.hours > 23 && (e.hours = 0, n = !0), e.minutes > 59 && (e.minutes = 0, e.hours++, n = !0), e.seconds > 59 && (e.seconds = 0, e.minutes++, n = !0), t = l.getEndDate(e.month + 1, e.year), e.date > t && (e.date = t, n = !0)
}, u = function (e, t, a) {
var o = ["startTime", "endTime"];
t = (t.match(r.EXP_SPLIT) || []).slice(1), a = a || 0, i.range && (r[o[a]] = r[o[a]] || {}), g.each(r.format, function (s, l) {
var c = parseFloat(t[s]);
t[s].length < l.length && (n = !0), /yyyy|y/.test(l) ? (c < h[0] && (c = h[0], n = !0), e.year = c) : /MM|M/.test(l) ? (c < 1 && (c = 1, n = !0), e.month = c - 1) : /dd|d/.test(l) ? (c < 1 && (c = 1, n = !0), e.date = c) : /HH|H/.test(l) ? (c < 1 && (c = 0, n = !0), e.hours = c, i.range && (r[o[a]].hours = c)) : /mm|m/.test(l) ? (c < 1 && (c = 0, n = !0), e.minutes = c, i.range && (r[o[a]].minutes = c)) : /ss|s/.test(l) && (c < 1 && (c = 0, n = !0), e.seconds = c, i.range && (r[o[a]].seconds = c))
}), c(e)
};
return "limit" === e ? (c(a), r) : ("string" == typeof (s = s || i.value) && (s = s.replace(/\s+/g, " ").replace(/^\s|\s$/g, "")), r.startState && !r.endState && (delete r.startState, r.endState = !0), "string" == typeof s && s ? r.EXP_IF.test(s) ? i.range ? (s = s.split(" " + i.range + " "), r.startDate = r.startDate || r.systemDate(), r.endDate = r.endDate || r.systemDate(), i.dateTime = g.extend({}, r.startDate), g.each([r.startDate, r.endDate], function (e, t) {
u(t, s[e], e)
})) : u(a, s) : (r.hint("日期格式不合法<br>必须遵循下述格式:<br>" + (i.range ? i.format + " " + i.range + " " + i.format : i.format) + "<br>已为你重置"), n = !0) : s && s.constructor === Date ? i.dateTime = r.systemDate(s) : (i.dateTime = r.systemDate(), delete r.startState, delete r.endState, delete r.startDate, delete r.endDate, delete r.startTime, delete r.endTime), c(a), n && s && r.setValue(i.range ? r.endDate ? r.parse() : "" : r.parse()), e && e(), r)
}, v.prototype.mark = function (e, t) {
var n, r = this.config;
return g.each(r.mark, function (e, r) {
var i = e.split("-");
i[0] != t[0] && 0 != i[0] || i[1] != t[1] && 0 != i[1] || i[2] != t[2] || (n = r || t[2])
}), n && e.html('<span class="laydate-day-mark">' + n + "</span>"), this
}, v.prototype.limit = function (e, t, n, r) {
var i, a = this, o = a.config, s = {}, l = o[n > 41 ? "endDate" : "dateTime"], c = g.extend({}, l, t || {});
return g.each({now: c, min: o.min, max: o.max}, function (e, t) {
var n;
s[e] = a.newDate(g.extend({year: t.year, month: t.month, date: t.date}, (n = {}, g.each(r, function (e, r) {
n[r] = t[r]
}), n))).getTime()
}), i = s.now < s.min || s.now > s.max, e && e[i ? "addClass" : "removeClass"](u), i
}, v.prototype.calendar = function (e) {
var t, n, r, i = this, a = i.config, o = e || a.dateTime, s = new Date, u = i.lang(),
d = "date" !== a.type && "datetime" !== a.type, p = e ? 1 : 0, f = g(i.table[p]).find("td"),
v = g(i.elemHeader[p][2]).find("span");
if (o.year < h[0] && (o.year = h[0], i.hint("最低只能支持到公元" + h[0] + "年")), o.year > h[1] && (o.year = h[1], i.hint("最高只能支持到公元" + h[1] + "年")), i.firstDate || (i.firstDate = g.extend({}, o)), s.setFullYear(o.year, o.month, 1), t = s.getDay(), n = l.getEndDate(o.month || 12, o.year), r = l.getEndDate(o.month + 1, o.year), g.each(f, function (e, s) {
var l = [o.year, o.month], u = 0;
(s = g(s)).removeAttr("class"), e < t ? (u = n - t + e, s.addClass("laydate-day-prev"), l = i.getAsYM(o.year, o.month, "sub")) : e >= t && e < r + t ? (u = e - t, a.range || u + 1 === o.date && s.addClass(c)) : (u = e - r - t, s.addClass("laydate-day-next"), l = i.getAsYM(o.year, o.month)), l[1]++, l[2] = u + 1, s.attr("lay-ymd", l.join("-")).html(l[2]), i.mark(s, l).limit(s, {
year: l[0],
month: l[1] - 1,
date: l[2]
}, e)
}), g(v[0]).attr("lay-ym", o.year + "-" + (o.month + 1)), g(v[1]).attr("lay-ym", o.year + "-" + (o.month + 1)), "cn" === a.lang ? (g(v[0]).attr("lay-type", "year").html(o.year + "年"), g(v[1]).attr("lay-type", "month").html(o.month + 1 + "月")) : (g(v[0]).attr("lay-type", "month").html(u.month[o.month]), g(v[1]).attr("lay-type", "year").html(o.year)), d && (a.range && (e ? i.endDate = i.endDate || {
year: o.year + ("year" === a.type ? 1 : 0),
month: o.month + ("month" === a.type ? 0 : -1)
} : i.startDate = i.startDate || {
year: o.year,
month: o.month
}, e && (i.listYM = [[i.startDate.year, i.startDate.month + 1], [i.endDate.year, i.endDate.month + 1]], i.list(a.type, 0).list(a.type, 1), "time" === a.type ? i.setBtnStatus("时间", g.extend({}, i.systemDate(), i.startTime), g.extend({}, i.systemDate(), i.endTime)) : i.setBtnStatus(!0))), a.range || (i.listYM = [[o.year, o.month + 1]], i.list(a.type, 0))), a.range && !e) {
var y = i.getAsYM(o.year, o.month);
i.calendar(g.extend({}, o, {year: y[0], month: y[1]}))
}
return a.range || i.limit(g(i.footer).find(m), null, 0, ["hours", "minutes", "seconds"]), a.range && e && !d && i.stampRange(), i
}, v.prototype.list = function (e, t) {
var n = this, r = n.config, i = r.dateTime, a = n.lang(), o = r.range && "date" !== r.type && "datetime" !== r.type,
s = g.elem("ul", {
class: p + " " + {
year: "laydate-year-list",
month: "laydate-month-list",
time: "laydate-time-list"
}[e]
}), l = n.elemHeader[t], d = g(l[2]).find("span"), h = n.elemCont[t || 0], f = g(h).find("." + p)[0],
v = "cn" === r.lang, y = v ? "年" : "", b = n.listYM[t] || {}, w = ["hours", "minutes", "seconds"],
S = ["startTime", "endTime"][t];
if (b[0] < 1 && (b[0] = 1), "year" === e) {
var _, k = _ = b[0] - 7;
k < 1 && (k = _ = 1), g.each(new Array(15), function (e) {
var i = g.elem("li", {"lay-ym": _}), a = {year: _};
_ == b[0] && g(i).addClass(c), i.innerHTML = _ + y, s.appendChild(i), _ < n.firstDate.year ? (a.month = r.min.month, a.date = r.min.date) : _ >= n.firstDate.year && (a.month = r.max.month, a.date = r.max.date), n.limit(g(i), a, t), _++
}), g(d[v ? 0 : 1]).attr("lay-ym", _ - 8 + "-" + b[1]).html(k + y + " - " + (_ - 1 + y))
} else if ("month" === e) g.each(new Array(12), function (e) {
var i = g.elem("li", {"lay-ym": e}), o = {year: b[0], month: e};
e + 1 == b[1] && g(i).addClass(c), i.innerHTML = a.month[e] + (v ? "月" : ""), s.appendChild(i), b[0] < n.firstDate.year ? o.date = r.min.date : b[0] >= n.firstDate.year && (o.date = r.max.date), n.limit(g(i), o, t)
}), g(d[v ? 0 : 1]).attr("lay-ym", b[0] + "-" + b[1]).html(b[0] + y); else if ("time" === e) {
var x = function () {
g(s).find("ol").each(function (e, r) {
g(r).find("li").each(function (r, i) {
n.limit(g(i), [{hours: r}, {hours: n[S].hours, minutes: r}, {
hours: n[S].hours,
minutes: n[S].minutes,
seconds: r
}][e], t, [["hours"], ["hours", "minutes"], ["hours", "minutes", "seconds"]][e])
})
}), r.range || n.limit(g(n.footer).find(m), n[S], 0, ["hours", "minutes", "seconds"])
};
r.range ? n[S] || (n[S] = {hours: 0, minutes: 0, seconds: 0}) : n[S] = i, g.each([24, 60, 60], function (e, t) {
var r = g.elem("li"), i = ["<p>" + a.time[e] + "</p><ol>"];
g.each(new Array(t), function (t) {
i.push("<li" + (n[S][w[e]] === t ? ' class="' + c + '"' : "") + ">" + g.digit(t, 2) + "</li>")
}), r.innerHTML = i.join("") + "</ol>", s.appendChild(r)
}), x()
}
if (f && h.removeChild(f), h.appendChild(s), "year" === e || "month" === e) g(n.elemMain[t]).addClass("laydate-ym-show"), g(s).find("li").on("click", function () {
var a = 0 | g(this).attr("lay-ym");
if (!g(this).hasClass(u)) {
if (0 === t) i[e] = a, o && (n.startDate[e] = a), n.limit(g(n.footer).find(m), null, 0); else if (o) n.endDate[e] = a; else {
var l = "year" === e ? n.getAsYM(a, b[1] - 1, "sub") : n.getAsYM(b[0], a, "sub");
g.extend(i, {year: l[0], month: l[1]})
}
"year" === r.type || "month" === r.type ? (g(s).find("." + c).removeClass(c), g(this).addClass(c), "month" === r.type && "year" === e && (n.listYM[t][0] = a, o && (n[["startDate", "endDate"][t]].year = a), n.list("month", t))) : (n.checkDate("limit").calendar(), n.closeList()), n.setBtnStatus(), r.range || n.done(null, "change"), g(n.footer).find(".laydate-btns-time").removeClass(u)
}
}); else {
var P = g.elem("span", {class: "laydate-time-text"}), C = function () {
g(s).find("ol").each(function (e) {
var t = this, r = g(t).find("li");
t.scrollTop = 30 * (n[S][w[e]] - 2), t.scrollTop <= 0 && r.each(function (e, n) {
if (!g(this).hasClass(u)) return t.scrollTop = 30 * (e - 2), !0
})
})
}, A = g(l[2]).find(".laydate-time-text");
C(), P.innerHTML = r.range ? [a.startTime, a.endTime][t] : a.timeTips, g(n.elemMain[t]).addClass("laydate-time-show"), A[0] && A.remove(), l[2].appendChild(P), g(s).find("ol").each(function (e) {
var t = this;
g(t).find("li").on("click", function () {
var a = 0 | this.innerHTML;
g(this).hasClass(u) || (r.range ? n[S][w[e]] = a : i[w[e]] = a, g(t).find("." + c).removeClass(c), g(this).addClass(c), x(), C(), (n.endDate || "time" === r.type) && n.done(null, "change"), n.setBtnStatus())
})
})
}
return n
}, v.prototype.listYM = [], v.prototype.closeList = function () {
var e = this;
e.config, g.each(e.elemCont, function (t, n) {
g(this).find("." + p).remove(), g(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")
}), g(e.elem).find(".laydate-time-text").remove()
}, v.prototype.setBtnStatus = function (e, t, n) {
var r, i = this.config, a = g(this.footer).find(m);
i.range && "date" !== i.type && "time" !== i.type && (t = t || this.startDate, n = n || this.endDate, r = this.newDate(t).getTime() > this.newDate(n).getTime(), this.limit(null, t) || this.limit(null, n) ? a.addClass(u) : a[r ? "addClass" : "removeClass"](u), e && r && this.hint("string" == typeof e ? d.replace(/日期/g, e) : d))
}, v.prototype.parse = function (e, t) {
var n = this.config,
r = t || (e ? g.extend({}, this.endDate, this.endTime) : n.range ? g.extend({}, this.startDate, this.startTime) : n.dateTime),
i = this.format.concat();
return g.each(i, function (e, t) {
/yyyy|y/.test(t) ? i[e] = g.digit(r.year, t.length) : /MM|M/.test(t) ? i[e] = g.digit(r.month + 1, t.length) : /dd|d/.test(t) ? i[e] = g.digit(r.date, t.length) : /HH|H/.test(t) ? i[e] = g.digit(r.hours, t.length) : /mm|m/.test(t) ? i[e] = g.digit(r.minutes, t.length) : /ss|s/.test(t) && (i[e] = g.digit(r.seconds, t.length))
}), n.range && !e ? i.join("") + " " + n.range + " " + this.parse(1) : i.join("")
}, v.prototype.newDate = function (e) {
return e = e || {}, new Date(e.year || 1, e.month || 0, e.date || 1, e.hours || 0, e.minutes || 0, e.seconds || 0)
}, v.prototype.setValue = function (e) {
var t = this.config, n = this.bindElem || t.elem[0], r = this.isInput(n) ? "val" : "html";
return "static" === t.position || g(n)[r](e || ""), this
}, v.prototype.stampRange = function () {
var e, t, n = this, r = n.config, i = g(n.elem).find("td");
if (r.range && !n.endDate && g(n.footer).find(m).addClass(u), n.endDate) {
if (e = n.newDate({
year: n.startDate.year,
month: n.startDate.month,
date: n.startDate.date
}).getTime(), t = n.newDate({
year: n.endDate.year,
month: n.endDate.month,
date: n.endDate.date
}).getTime(), e > t) return n.hint(d);
g.each(i, function (r, i) {
var a = g(i).attr("lay-ymd").split("-"), o = n.newDate({year: a[0], month: a[1] - 1, date: a[2]}).getTime();
g(i).removeClass("laydate-selected " + c), o !== e && o !== t || g(i).addClass(g(i).hasClass("laydate-day-prev") || g(i).hasClass("laydate-day-next") ? "laydate-selected" : c), o > e && o < t && g(i).addClass("laydate-selected")
})
}
}, v.prototype.done = function (e, t) {
var n = this.config, r = g.extend({}, this.startDate ? g.extend(this.startDate, this.startTime) : n.dateTime),
i = g.extend({}, g.extend(this.endDate, this.endTime));
return g.each([r, i], function (e, t) {
"month" in t && g.extend(t, {month: t.month + 1})
}), e = e || [this.parse(), r, i], "function" == typeof n[t || "done"] && n[t || "done"].apply(n, e), this
}, v.prototype.choose = function (e) {
var t = this, n = t.config, r = n.dateTime, i = g(t.elem).find("td"), a = e.attr("lay-ymd").split("-"),
o = function (e) {
new Date, e && g.extend(r, a), n.range && (t.startDate ? g.extend(t.startDate, a) : t.startDate = g.extend({}, a, t.startTime), t.startYMD = a)
};
if (a = {year: 0 | a[0], month: (0 | a[1]) - 1, date: 0 | a[2]}, !e.hasClass(u)) if (n.range) {
if (g.each(["startTime", "endTime"], function (e, n) {
t[n] = t[n] || {hours: 0, minutes: 0, seconds: 0}
}), t.endState) o(), delete t.endState, delete t.endDate, t.startState = !0, i.removeClass(c + " laydate-selected"), e.addClass(c); else if (t.startState) {
if (e.addClass(c), t.endDate ? g.extend(t.endDate, a) : t.endDate = g.extend({}, a, t.endTime), t.newDate(a).getTime() < t.newDate(t.startYMD).getTime()) {
var s = g.extend({}, t.endDate, {
hours: t.startDate.hours,
minutes: t.startDate.minutes,
seconds: t.startDate.seconds
});
g.extend(t.endDate, t.startDate, {
hours: t.endDate.hours,
minutes: t.endDate.minutes,
seconds: t.endDate.seconds
}), t.startDate = s
}
n.showBottom || t.done(), t.stampRange(), t.endState = !0, t.done(null, "change")
} else e.addClass(c), o(), t.startState = !0;
g(t.footer).find(m)[t.endDate ? "removeClass" : "addClass"](u)
} else "static" === n.position ? (o(!0), t.calendar().done().done(null, "change")) : "date" === n.type ? (o(!0), t.setValue(t.parse()).remove().done()) : "datetime" === n.type && (o(!0), t.calendar().done(null, "change"))
}, v.prototype.tool = function (e, t) {
var n = this, r = n.config, i = r.dateTime, a = "static" === r.position, o = {
datetime: function () {
g(e).hasClass(u) || (n.list("time", 0), r.range && n.list("time", 1), g(e).attr("lay-type", "date").html(n.lang().dateTips))
}, date: function () {
n.closeList(), g(e).attr("lay-type", "datetime").html(n.lang().timeTips)
}, clear: function () {
n.setValue("").remove(), a && (g.extend(i, n.firstDate), n.calendar()), r.range && (delete n.startState, delete n.endState, delete n.endDate, delete n.startTime, delete n.endTime), n.done(["", {}, {}])
}, now: function () {
var e = new Date;
g.extend(i, n.systemDate(), {
hours: e.getHours(),
minutes: e.getMinutes(),
seconds: e.getSeconds()
}), n.setValue(n.parse()).remove(), a && n.calendar(), n.done()
}, confirm: function () {
if (r.range) {
if (!n.endDate) return n.hint("请先选择日期范围");
if (g(e).hasClass(u)) return n.hint("time" === r.type ? d.replace(/日期/g, "时间") : d)
} else if (g(e).hasClass(u)) return n.hint("不在有效日期或时间范围内");
n.done(), n.setValue(n.parse()).remove()
}
};
o[t] && o[t]()
}, v.prototype.change = function (e) {
var t = this, n = t.config, r = n.dateTime, i = n.range && ("year" === n.type || "month" === n.type),
a = t.elemCont[e || 0], o = t.listYM[e], s = function (s) {
var l = ["startDate", "endDate"][e], c = g(a).find(".laydate-year-list")[0],
u = g(a).find(".laydate-month-list")[0];
return c && (o[0] = s ? o[0] - 15 : o[0] + 15, t.list("year", e)), u && (s ? o[0]-- : o[0]++, t.list("month", e)), (c || u) && (g.extend(r, {year: o[0]}), i && (t[l].year = o[0]), n.range || t.done(null, "change"), t.setBtnStatus(), n.range || t.limit(g(t.footer).find(m), {year: o[0]})), c || u
};
return {
prevYear: function () {
s("sub") || (r.year--, t.checkDate("limit").calendar(), n.range || t.done(null, "change"))
}, prevMonth: function () {
var e = t.getAsYM(r.year, r.month, "sub");
g.extend(r, {year: e[0], month: e[1]}), t.checkDate("limit").calendar(), n.range || t.done(null, "change")
}, nextMonth: function () {
var e = t.getAsYM(r.year, r.month);
g.extend(r, {year: e[0], month: e[1]}), t.checkDate("limit").calendar(), n.range || t.done(null, "change")
}, nextYear: function () {
s() || (r.year++, t.checkDate("limit").calendar(), n.range || t.done(null, "change"))
}
}
}, v.prototype.changeEvent = function () {
var e = this;
e.config, g(e.elem).on("click", function (e) {
g.stope(e)
}), g.each(e.elemHeader, function (t, n) {
g(n[0]).on("click", function (n) {
e.change(t).prevYear()
}), g(n[1]).on("click", function (n) {
e.change(t).prevMonth()
}), g(n[2]).find("span").on("click", function (n) {
var r = g(this), i = r.attr("lay-ym"), a = r.attr("lay-type");
i && (i = i.split("-"), e.listYM[t] = [0 | i[0], 0 | i[1]], e.list(a, t), g(e.footer).find(".laydate-btns-time").addClass(u))
}), g(n[3]).on("click", function (n) {
e.change(t).nextMonth()
}), g(n[4]).on("click", function (n) {
e.change(t).nextYear()
})
}), g.each(e.table, function (t, n) {
g(n).find("td").on("click", function () {
e.choose(g(this))
})
}), g(e.footer).find("span").on("click", function () {
var t = g(this).attr("lay-type");
e.tool(this, t)
})
}, v.prototype.isInput = function (e) {
return /input|textarea/.test(e.tagName.toLocaleLowerCase())
}, v.prototype.events = function () {
var e = this, t = e.config, n = function (n, r) {
n.on(t.trigger, function () {
r && (e.bindElem = this), e.render()
})
};
t.elem[0] && !t.elem[0].eventHandler && (n(t.elem, "bind"), n(t.eventElem), g(document).on("click", function (n) {
n.target !== t.elem[0] && n.target !== t.eventElem[0] && n.target !== g(t.closeStop)[0] && e.remove()
}).on("keydown", function (t) {
13 === t.keyCode && g("#" + e.elemID)[0] && e.elemID === v.thisElem && (t.preventDefault(), g(e.footer).find(m)[0].click())
}), g(window).on("resize", function () {
if (!e.elem || !g(".layui-laydate")[0]) return !1;
e.position()
}), t.elem[0].eventHandler = !0)
}, l.render = function (e) {
var t = new v(e);
return function () {
var e = this;
return {
hint: function (t) {
e.hint.call(e, t)
}, config: e.config
}
}.call(t)
}, l.getEndDate = function (e, t) {
var n = new Date;
return n.setFullYear(t || n.getFullYear(), e || n.getMonth() + 1, 1), new Date(n.getTime() - 864e5).getDate()
}, window.lay = window.lay || g, o ? (l.ready(), layui.define(function (e) {
l.path = layui.cache.dir, e("laydate", l)
})) : void 0 === (r = function () {
return l
}.call(t, n, t, e)) || (e.exports = r)
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_ModalFactory = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.close = this.close.bind(this), this.createDom = this.createDom.bind(this), this.config = r, this.overlayName = this.config.overlayName, this.overlayManager = n, this.register(this.overlayName), this.createDom(), this.overlayManager.register(this.overlayName, this.container, this.close, !1)
}
return r(e, [{
key: "register", value: function (e) {
if (document.getElementById(e)) throw new Error(e + "已存在")
}
}, {
key: "createDom", value: function () {
var e = this;
this.overlayContainer = document.createElement("div"), this.overlayContainer.classList.add("KG_OverlayContainer"), this.overlayContainer.classList.add("hidden"), this.container = document.createElement("div"), this.container.setAttribute("id", this.overlayName), this.container.classList.add("container"), this.container.classList.add("hidden"), this.overlayContainer.appendChild(this.container), document.getElementById("outerContainer").appendChild(this.overlayContainer);
var t = document.createElement("div");
t.classList.add("kg_dialog_header"), this.container.appendChild(t);
var n = document.createElement("div");
n.classList.add("kg_dialog_title"), n.setAttribute("data-l10n-id", "alert_title"), t.appendChild(n), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", this.closeBtn.addEventListener("click", this.close), t.appendChild(this.closeBtn);
var r = document.createElement("div");
r.classList.add("dialog"), this.container.appendChild(r);
var i = (this.config.width || 280) + "px";
t.style.width = i, r.style.width = i, this.content = document.createElement("p"), this.content.classList.add("KG_CustomModal_Content"), r.appendChild(this.content);
var a = document.createElement("div");
a.classList.add("KG_Form_Footer"), r.appendChild(a), this.config.buttons.map(function (t) {
var n = document.createElement("button");
n.innerHTML = t.content, n.classList.add("btn"), n.classList.add("custom_btn"), "primary" == t.type && n.classList.add("btn-primary");
n.addEventListener("click", function () {
t.callback(), e.close()
}), a.appendChild(n)
}), this.app.l10n.translate(this.container)
}
}, {
key: "open", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
t.content.innerHTML = e || t.config.message
})
}
}, {
key: "close", value: function () {
this.overlayManager.close(this.overlayName)
}
}]), e
}()
}, function (module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {value: !0}), exports.KG_Watermark = void 0;
var _createClass = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
exports.renderWaterMark = renderWaterMark;
var _pdf_rendering_queue = __webpack_require__(16), _utils = __webpack_require__(2),
_request = __webpack_require__(86);
function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var rotateOptions = [{label: "旋转45°", value: 45}, {label: "水平", value: 0}, {
label: "旋转-45°",
value: -45
}, {label: "自定义", value: "custom"}],
verticalOptions = [{label: "顶部对齐", value: "top"}, {label: "居中", value: "middle"}, {
label: "底部对齐",
value: "bottom"
}, {label: "自定义", value: "custom"}],
horizontalOptions = [{label: "左对齐", value: "left"}, {label: "居中", value: "center"}, {
label: "右对齐",
value: "right"
}, {label: "自定义", value: "custom"}];
function getDistance(e) {
var t = {x: 0, y: 0}, n = e.rotate, r = n * Math.PI / 180, i = void 0, a = void 0;
"text" === e.source && (i = (0, _utils.computeTextWdith)(e.text, e.fontSize) / e.density, a = e.fontSize / e.density);
"file" === e.source && (i = e.fileWidth / e.density, a = e.fileHeight / e.density);
var o = Math.sqrt(Math.pow(i, 2) + Math.pow(a, 2)), s = Math.atan(a / i), l = 0, c = 0;
return 0 === n || 180 === n ? (c = a, l = i) : 90 === n || 270 === n ? (c = i, l = a) : 0 < n && n < 90 ? (c = o * Math.abs(Math.sin(r + s)), l = o * Math.abs(Math.cos(r + s))) : 90 < n && n < 180 ? (c = o * Math.abs(Math.sin(Math.PI - r + s)), l = o * Math.abs(Math.cos(Math.PI - r + s))) : 180 < n && n < 270 ? (c = o * Math.abs(Math.sin(r - Math.PI + s)), l = o * Math.abs(Math.cos(r - Math.PI + s))) : 270 < n && n < 360 && (c = o * Math.abs(Math.sin(2 * Math.PI - r + s)), l = o * Math.abs(Math.cos(2 * Math.PI - r + s))), t.x = l, t.y = c, t
}
function getXYPositions(e, t, n, r, i, a) {
for (var o = {x: [], y: []}, s = e, l = e; !((s -= n) < 0);) o.x.push(s);
for (o.x.push(e); !((l += n) > i);) o.x.push(l);
for (var c = t, u = t; !((c += r) > a);) o.y.push(c);
for (o.y.push(t); !((u -= r) < 0);) o.y.push(u);
return o
}
function renderWaterMark(e, t, n, r, i, a, o) {
var s = document.createElement("canvas");
s.width = r, s.height = i;
var l = s.getContext("2d"), c = s.width / 2, u = s.height / 2;
return l.translate(s.width / 2, s.height / 2), l.rotate(e.rotate * Math.PI / 180), l.translate(-s.width / 2, -s.height / 2), l.globalAlpha = e.opacity, new Promise(function (o) {
if ("text" === e.source && e.text) l.textAlign = "center", l.fillStyle = e.color, l.font = e.fontSize * n + "px " + e.font, l.fillText(e.text, c, u), o(); else if ("file" === e.source && e.file) {
var s = new Image;
s.onload = function () {
var t = s.width * n, r = s.height * n;
e.fileWidth = s.width, e.fileHeight = s.height, l.drawImage(s, 0, 0, s.width, s.height, c - t / 2, u - r / 2, t, r), o()
}, s.src = e.file
} else if (a) {
t.width = r, t.height = i, t.getContext("2d").drawImage(a.canvas, 0, 0, a.canvas.width, a.canvas.height, 0, 0, r, i)
}
}).then(function () {
var l = s.toDataURL("png", 1);
return new Promise(function (s) {
var c = new Image;
c.onload = function () {
var l = t.getContext("2d");
a && (t.width = r, t.height = i, l.drawImage(a.canvas, 0, 0, a.canvas.width, a.canvas.height, 0, 0, r, i));
var u = r / 2, d = i / 2, h = [];
if ("tile" === e.fullscreen) {
var p, f, m = getDistance(e), v = m.x, g = m.y;
p = f = v > g ? v : g;
for (var y = getXYPositions(r / 2, i / 2, p * n, f * n, r, i), b = 0; b < y.x.length; b++) for (var w = 0; w < y.y.length; w++) l.drawImage(c, 0, 0, c.width, c.height, y.x[b] - c.width / 2, y.y[w] - c.height / 2, c.width, c.height), "text" === e.source && o && h.push((0, _utils.createTextLayerElement)(e.text, y.x[b], y.y[w], e.fontSize, e.font, e.rotate, n))
} else {
var S = e.position.x * n, _ = e.position.y * n;
l.drawImage(c, 0, 0, c.width, c.height, u - c.width / 2 + S, d - c.height / 2 + _, c.width, c.height), "text" === e.source && o && h.push((0, _utils.createTextLayerElement)(e.text, u + S, d + _, e.fontSize, e.font, e.rotate, n))
}
s(h)
}, c.src = l
})
})
}
var KG_Watermark = exports.KG_Watermark = function () {
function KG_Watermark(e, t, n) {
_classCallCheck(this, KG_Watermark), this.app = e, this.overlayName = t.overlayName, this.container = t.container, this.toolbarBtn = t.toolbarBtn, this.secondaryToolbarBtn = t.secondaryToolbarBtn, this.overlayManager = n, this.fontList = [], this.fileBase64 = "", this.watermarkConfig = (0, _utils.mergerConfig)(window.KGPdfViewerWebApp.watermarkConfig, window.KGPdfViewerWebApp.previewWatermark), this.open = this.open.bind(this), this.getFontList = this.getFontList.bind(this), this.getWaterMarkConfig = this.getWaterMarkConfig.bind(this), this.drawPreview = this.drawPreview.bind(this), this.disableText = this.disableText.bind(this), this.disableFile = this.disableFile.bind(this), this.disableDensity = this.disableDensity.bind(this), this.disablePosition = this.disablePosition.bind(this), this.deleteWatermarkFromDocument = this.deleteWatermarkFromDocument.bind(this), this.renderWatermarkOnDocument = this.renderWatermarkOnDocument.bind(this), this.onOk = this.onOk.bind(this), this.close = this.close.bind(this), this.overlayManager.register(this.overlayName, this.container, this.close, !0), this.createDom = this.createDom.bind(this), this.createDom(), this.init = this.init.bind(this), this.init(), this.reset = this.reset.bind(this)
}
return _createClass(KG_Watermark, [{
key: "disableText", value: function (e) {
this.textInput.classList.remove("KG_Input_Error"), this.textInput.disabled = e, this.textInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.fontSelect.disabled = e, this.fontSelect.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.fontSizeInput.disabled = e, this.fontSizeInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.colorInput.disabled = e, this.colorInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.colorInput.jscolor.showOnClick = !e
}
}, {
key: "disableFile", value: function (e) {
this.fileNameInput.classList.remove("KG_Input_Error"), this.fileNameInput.disabled = e, this.fileNameInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.fileUploadBtn.disabled = e, this.fileUploadBtn.classList[e ? "add" : "remove"]("KG_Btn_Disabled")
}
}, {
key: "disableDensity", value: function (e) {
this.densityInput.disabled = e, this.densityInput.classList[e ? "add" : "remove"]("KG_Input_Disabled")
}
}, {
key: "disablePosition", value: function (e) {
this.verticalSelect.disabled = e, this.verticalSelect.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.verticalCustomInput.disabled = e, this.verticalCustomInput.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.horizontalSelect.disabled = e, this.horizontalSelect.classList[e ? "add" : "remove"]("KG_Input_Disabled"), this.horizontalCustomInput.disabled = e, this.horizontalCustomInput.classList[e ? "add" : "remove"]("KG_Input_Disabled")
}
}, {
key: "createDom", value: function () {
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.container.appendChild(e);
var t = document.createElement("div");
t.classList.add("kg_dialog_title"), t.setAttribute("data-l10n-id", "watermark_title"), e.appendChild(t), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", e.appendChild(this.closeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.container.appendChild(n), this.iframe = document.createElement("iframe"), this.iframe.style.display = "none", this.iframe.name = "KG_Watermark_iframe", n.appendChild(this.iframe);
var r = document.createElement("div");
r.classList.add("KG_Clearfix"), n.appendChild(r);
var i = document.createElement("div");
i.classList.add("KG_Watermark_ConfigContainer"), r.appendChild(i);
var a = document.createElement("fieldset");
a.classList.add("KG_Form_Fieldset"), i.appendChild(a);
var o = document.createElement("legend");
o.setAttribute("data-l10n-id", "watermark_source"), o.classList.add("KG_Form_Legend"), a.appendChild(o), this.textContainer = document.createElement("div"), this.textContainer.classList.add("KG_Form_Item"), this.textContainer.classList.add("kg_radio_wrapper"), a.appendChild(this.textContainer);
var s = document.createElement("label");
s.setAttribute("data-l10n-id", "watermark_text"), s.classList.add("KG_Form_Label"), this.textContainer.appendChild(s), this.textRadio = document.createElement("input"), this.textRadio.type = "radio", this.textRadio.name = "source", this.textRadio.value = "text", this.textContainer.appendChild(this.textRadio), this.textInput = document.createElement("input"), this.textInput.classList.add("kgInput"), this.textInput.autocomplete = "off", this.textInput.type = "text", this.textInput.style.marginLeft = "11px", this.textInput.style.width = "calc(100% - 119px)", this.textContainer.appendChild(this.textInput);
var l = document.createElement("div");
l.classList.add("KG_Form_Item"), a.appendChild(l);
var c = document.createElement("label");
c.setAttribute("data-l10n-id", "watermark_font"), c.classList.add("KG_Form_Label"), l.appendChild(c), this.fontSelect = document.createElement("select"), this.fontSelect.classList.add("kgInput"), l.appendChild(this.fontSelect);
var u = document.createElement("div");
u.classList.add("KG_Form_Item"), a.appendChild(u);
var d = document.createElement("label");
d.setAttribute("data-l10n-id", "watermark_fontSize"), d.classList.add("KG_Form_Label"), u.appendChild(d), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = 12, this.fontSizeInput.classList.add("kgInput"), u.appendChild(this.fontSizeInput);
var h = document.createElement("div");
h.classList.add("KG_Form_Item"), a.appendChild(h);
var p = document.createElement("label");
p.setAttribute("data-l10n-id", "watermark_fontColor"), p.classList.add("KG_Form_Label"), h.appendChild(p), this.colorInput = document.createElement("input"), this.colorInput.type = "text", this.colorInput.classList.add("kgInput"), this.colorInput.classList.add("jscolor"), this.colorInput.jscolor = new jscolor(this.colorInput), h.appendChild(this.colorInput), this.fileContainer = document.createElement("div"), this.fileContainer.classList.add("KG_Form_Item"), this.fileContainer.classList.add("kg_radio_wrapper"), a.appendChild(this.fileContainer);
var f = document.createElement("label");
f.setAttribute("data-l10n-id", "watermark_uploadFile"), f.classList.add("KG_Form_Label"), this.fileContainer.appendChild(f), this.fileRadio = document.createElement("input"), this.fileRadio.type = "radio", this.fileRadio.name = "source", this.fileRadio.value = "file", this.fileContainer.appendChild(this.fileRadio), this.fileNameInput = document.createElement("input"), this.fileNameInput.classList.add("kgInput"), this.fileNameInput.readOnly = !0, this.fileNameInput.type = "text", this.fileNameInput.style.marginLeft = "11px", "en-US" === this.app.l10n._lang ? this.fileNameInput.style.width = "calc(100% - 191px)" : this.fileNameInput.style.width = "calc(100% - 195px)", this.fileContainer.appendChild(this.fileNameInput), this.fileUploadBtn = document.createElement("button"), this.fileUploadBtn.setAttribute("data-l10n-id", "watermark_uploadBtn"), this.fileUploadBtn.classList.add("btn"), this.fileUploadBtn.classList.add("btn-primary"), this.fileUploadBtn.type = "button", this.fileUploadBtn.style.marginLeft = "12px", "en-US" === this.app.l10n._lang ? this.fileUploadBtn.style.width = "74px" : this.fileUploadBtn.style.width = "64px", this.fileContainer.appendChild(this.fileUploadBtn), this.fileForm = document.createElement("form"), this.fileForm.setAttribute("enctype", "multipart/form-data");
var m = window.KGPdfViewerWebApp.getDocTypeUrl(), v = window.KGPdfViewerWebApp.documentId,
g = (new Date).getTime();
this.fileForm.setAttribute("action", m + "&action=imageToBase64&documentId=" + v + "&t=" + g), this.fileForm.style.display = "none", this.fileForm.target = this.iframe.name, this.fileForm.method = "POST", this.fileContainer.appendChild(this.fileForm), this.fileInput = document.createElement("input"), this.fileInput.name = "file", this.fileInput.type = "file", this.fileInput.accept = "image/*", this.fileForm.appendChild(this.fileInput);
var y = document.createElement("fieldset");
y.classList.add("KG_Form_Fieldset"), i.appendChild(y);
var b = document.createElement("legend");
b.setAttribute("data-l10n-id", "watermark_exterior"), b.classList.add("KG_Form_Legend"), y.appendChild(b);
var w = document.createElement("div");
w.classList.add("KG_Form_Item"), y.appendChild(w);
var S = document.createElement("label");
S.setAttribute("data-l10n-id", "watermark_rotate"), S.classList.add("KG_Form_Label"), w.appendChild(S), this.rotateSelect = document.createElement("select"), this.rotateSelect.classList.add("kgInput"), w.appendChild(this.rotateSelect);
for (var _ = 0; _ < rotateOptions.length; _++) {
var k = document.createElement("option");
k.setAttribute("data-l10n-id", "watermark_rotate_option_" + rotateOptions[_].value), k.value = rotateOptions[_].value, this.rotateSelect.appendChild(k)
}
this.rotateCustomInput = document.createElement("input"), this.rotateCustomInput.classList.add("kgInput"), this.rotateCustomInput.type = "number", this.rotateCustomInput.style.marginLeft = "6px", this.rotateCustomInput.style.display = "none", w.appendChild(this.rotateCustomInput), this.rotateUnit = document.createElement("span"), this.rotateUnit.innerHTML = "°", this.rotateUnit.style.marginLeft = "6px", this.rotateUnit.style.display = "none", w.appendChild(this.rotateUnit);
var x = document.createElement("div");
x.classList.add("KG_Form_Item"), y.appendChild(x);
var P = document.createElement("label");
P.setAttribute("data-l10n-id", "watermark_opacity"), P.classList.add("KG_Form_Label"), x.appendChild(P), this.opacityInput = document.createElement("input"), this.opacityInput.classList.add("kgInput"), this.opacityInput.type = "number", this.opacityInput.min = 0, this.opacityInput.max = 100, x.appendChild(this.opacityInput);
var C = document.createElement("span");
C.innerHTML = "%", C.style.marginLeft = "6px", x.appendChild(C);
var A = document.createElement("fieldset");
A.classList.add("KG_Form_Fieldset"), i.appendChild(A);
var T = document.createElement("legend");
T.setAttribute("data-l10n-id", "watermark_position"), T.classList.add("KG_Form_Legend"), A.appendChild(T), this.fullScreenContainer = document.createElement("div"), this.fullScreenContainer.classList.add("KG_Form_Item"), this.fullScreenContainer.classList.add("kg_checkbox_wrapper"), A.appendChild(this.fullScreenContainer);
var E = document.createElement("label");
E.setAttribute("data-l10n-id", "watermark_tiled"), E.classList.add("KG_Form_Label"), this.fullScreenContainer.appendChild(E), this.fullScreenCheckBox = document.createElement("input"), this.fullScreenCheckBox.type = "checkbox", this.fullScreenCheckBox.classList.add("KG_CheckBox"), this.fullScreenContainer.appendChild(this.fullScreenCheckBox);
var D = document.createElement("div");
D.classList.add("KG_Form_Item"), A.appendChild(D);
var I = document.createElement("label");
I.setAttribute("data-l10n-id", "watermark_density"), I.classList.add("KG_Form_Label"), D.appendChild(I), this.densityInput = document.createElement("input"), this.densityInput.classList.add("kgInput"), this.densityInput.type = "number", this.densityInput.min = 1, this.densityInput.max = 100, D.appendChild(this.densityInput);
var L = document.createElement("div");
L.classList.add("KG_Form_Item"), A.appendChild(L);
var O = document.createElement("label");
O.setAttribute("data-l10n-id", "watermark_vertical"), O.classList.add("KG_Form_Label"), L.appendChild(O), this.verticalSelect = document.createElement("select"), this.verticalSelect.classList.add("kgInput"), L.appendChild(this.verticalSelect);
for (var M = 0; M < verticalOptions.length; M++) {
var N = document.createElement("option");
N.setAttribute("data-l10n-id", "watermark_vertical_option_" + verticalOptions[M].value), N.value = verticalOptions[M].value, this.verticalSelect.appendChild(N)
}
this.verticalCustomInput = document.createElement("input"), this.verticalCustomInput.classList.add("kgInput"), this.verticalCustomInput.type = "number", this.verticalCustomInput.style.marginLeft = "6px", this.verticalCustomInput.style.display = "none", L.appendChild(this.verticalCustomInput), this.verticalUnit = document.createElement("span"), this.verticalUnit.innerHTML = "px", this.verticalUnit.style.marginLeft = "6px", this.verticalUnit.style.display = "none", L.appendChild(this.verticalUnit);
var R = document.createElement("div");
R.classList.add("KG_Form_Item"), A.appendChild(R);
var W = document.createElement("label");
W.setAttribute("data-l10n-id", "watermark_horizontal"), W.classList.add("KG_Form_Label"), R.appendChild(W), this.horizontalSelect = document.createElement("select"), this.horizontalSelect.classList.add("kgInput"), R.appendChild(this.horizontalSelect);
for (var V = 0; V < horizontalOptions.length; V++) {
var F = document.createElement("option");
F.setAttribute("data-l10n-id", "watermark_horizontal_option_" + horizontalOptions[V].value), F.value = horizontalOptions[V].value, this.horizontalSelect.appendChild(F)
}
this.horizontalCustomInput = document.createElement("input"), this.horizontalCustomInput.classList.add("kgInput"), this.horizontalCustomInput.type = "number", this.horizontalCustomInput.style.marginLeft = "6px", this.horizontalCustomInput.style.display = "none", R.appendChild(this.horizontalCustomInput), this.horizontalUnit = document.createElement("span"), this.horizontalUnit.innerHTML = "px", this.horizontalUnit.style.marginLeft = "6px", this.horizontalUnit.style.display = "none", R.appendChild(this.horizontalUnit);
var G = document.createElement("div");
G.classList.add("KG_Watermark_PreviewContainer"), r.appendChild(G);
var B = document.createElement("fieldset");
B.classList.add("KG_Form_Fieldset"), G.appendChild(B);
var K = document.createElement("legend");
K.setAttribute("data-l10n-id", "watermark_preview"), K.classList.add("KG_Form_Legend"), B.appendChild(K), this.previewCanvas = document.createElement("canvas"), B.appendChild(this.previewCanvas);
var j = document.createElement("div");
j.classList.add("KG_Form_Footer"), n.appendChild(j), this.cancelBtn = document.createElement("button"), this.cancelBtn.setAttribute("data-l10n-id", "password_cancel"), this.cancelBtn.classList.add("btn"), j.appendChild(this.cancelBtn), this.okBtn = document.createElement("button"), this.okBtn.setAttribute("data-l10n-id", "password_ok"), this.okBtn.classList.add("btn"), this.okBtn.classList.add("btn-primary"), this.okBtn.style.marginLeft = "15px", j.appendChild(this.okBtn), this.app.l10n.translate(this.container)
}
}, {
key: "reset", value: function () {
var e = this.watermarkConfig, t = e.text, n = (e.file, e.font), r = e.size, i = e.color, a = e.rotate,
o = e.opacity, s = e.isTiled, l = e.density, c = e.vertical, u = e.horizontal;
this.textRadio.checked = !0, this.textContainer.classList.add("kg_radio_wrapper-checked"), this.fileContainer.classList.remove("kg_radio_wrapper-checked"), this.disableText(!1), this.disableFile(!0), this.textInput.value = t, this.fontSelect.value = this.fontList[0].title || n, this.fontSizeInput.value = r, this.colorInput.jscolor.fromString(i), this.fileForm.reset(), this.fileNameInput.value = "", this.fileBase64 = "", -1 != [45, 0, -45].indexOf(a) ? (this.rotateSelect.value = a, this.rotateCustomInput.style.display = "none") : (this.rotateSelect.value = "custom", this.rotateCustomInput.style.display = "inline", this.rotateUnit.style.display = "inline"), this.rotateCustomInput.value = +a, this.opacityInput.value = +o, this.fullScreenCheckBox.checked = s || !1, s ? (this.fullScreenContainer.classList.add("kg_checkbox_wrapper-checked"), this.disablePosition(!1), this.disablePosition(!0)) : (this.fullScreenContainer.classList.remove("kg_checkbox_wrapper-checked"), this.disableDensity(!0), this.disablePosition(!1)), this.densityInput.value = +l, -1 != ["top", "middle", "bottom"].indexOf(c) ? (this.verticalSelect.value = c, this.verticalCustomInput.value = 0, this.verticalCustomInput.style.display = "none", this.verticalUnit.style.display = "none") : (this.verticalSelect.value = "custom", this.verticalCustomInput.value = +c, this.verticalCustomInput.style.display = "inline", this.verticalUnit.style.display = "inline"), -1 != ["left", "center", "right"].indexOf(u) ? (this.horizontalSelect.value = u, this.horizontalCustomInput.value = 0, this.horizontalCustomInput.style.display = "none", this.horizontalUnit.style.display = "none") : (this.horizontalSelect.value = "custom", this.horizontalCustomInput.value = +u, this.horizontalCustomInput.style.display = "inline", this.horizontalUnit.style.display = "inline")
}
}, {
key: "init", value: function init() {
var _this = this, _window$KGPdfViewerWe = window.KGPdfViewerWebApp.btnPositionConfig,
toolbar = _window$KGPdfViewerWe.toolbar, sidebar = _window$KGPdfViewerWe.sidebar;
toolbar.indexOf("watermark") > -1 && (this.toolbarBtn.removeAttribute("hidden"), this.toolbarBtn.addEventListener("click", this.open)), sidebar.indexOf("watermark") > -1 && (this.secondaryToolbarBtn.removeAttribute("hidden"), this.secondaryToolbarBtn.addEventListener("click", this.open)), this.textContainer.addEventListener("click", function (e) {
e.currentTarget.querySelector('input[type="radio"]').value === _this.textRadio.value && (_this.textRadio.checked = !0, _this.textContainer.classList.add("kg_radio_wrapper-checked"), _this.fileContainer.classList.remove("kg_radio_wrapper-checked"), _this.disableFile(!0), _this.disableText(!1), _this.drawPreview())
}), this.textInput.addEventListener("input", function (e) {
_this.textInput.classList.remove("KG_Input_Error"), _this.drawPreview()
}), this.fontSelect.addEventListener("change", function (e) {
!0 === _this.textRadio.checked && _this.drawPreview()
}), this.fontSizeInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.fontSizeInput.value = defaultFontSize), t <= 12 && (_this.fontSizeInput.value = 12), !0 === _this.textRadio.checked && _this.drawPreview()
}), this.colorInput.addEventListener("change", function (e) {
!0 === _this.textRadio.checked && _this.drawPreview()
}), this.fileContainer.addEventListener("click", function (e) {
e.currentTarget.querySelector('input[type="radio"]').value === _this.fileRadio.value && (_this.fileRadio.checked = !0, _this.textContainer.classList.remove("kg_radio_wrapper-checked"), _this.fileContainer.classList.add("kg_radio_wrapper-checked"), _this.disableFile(!1), _this.disableText(!0), _this.drawPreview())
}), this.fileUploadBtn.addEventListener("click", function (e) {
_this.fileNameInput.classList.remove("KG_Input_Error"), _this.fileInput.click()
}), this.fileInput.addEventListener("change", function (e) {
var KGAlertPrompt = _this.app.KGAlertPrompt;
KGAlertPrompt.closeCallback = function () {
return _this.overlayManager.open(_this.overlayName)
}, new Promise(function (resolve) {
if ("function" == typeof FileReader && _this.fileInput.files) {
var file = _this.fileInput.files[0];
if (!/image\/\w+/.test(file.type)) {
switch (_this.app.l10n._lang) {
case"zh-TW":
KGAlertPrompt.open("請上傳圖片文件!");
break;
case"en-US":
KGAlertPrompt.open("Please upload an image file!");
break;
default:
KGAlertPrompt.open("请上传图片文件!")
}
return
}
var reader = new FileReader;
reader.onload = function (e) {
_this.fileBase64 = e.target.result, resolve(file.name)
}, reader.readAsDataURL(file)
} else {
var value = e.target.value, fileName = value.split("\\")[value.split("\\").length - 1],
fileType = fileName.split(".")[fileName.split(".").length - 1].toLocaleLowerCase();
if (-1 === ["jpg", "jpeg", "gif", "svg", "png"].indexOf(fileType)) {
switch (_this.app.l10n._lang) {
case"zh-TW":
KGAlertPrompt.open("請上傳壹個圖片文件。");
break;
case"en-US":
KGAlertPrompt.open("Please upload an image file.");
break;
default:
KGAlertPrompt.open("请上传一个图片文件。")
}
return
}
_this.fileForm.submit();
var times = 0, timer = setInterval(function () {
times++;
var iframeBody = _this.iframe.contentWindow.document.body, response = void 0;
if (response = iframeBody.childNodes.length > 0 ? iframeBody.childNodes[0].innerHTML : iframeBody.innerHTML, response) {
var result = eval("(" + response + ")");
result && result.status && (_this.fileBase64 = "data:image/" + fileType + ";base64," + result.dataBase64), clearInterval(timer), _this.iframe.contentWindow.document.body.innerHTML = "", resolve(fileName)
}
if (times >= 8) {
switch (_this.app.l10n._lang) {
case"zh-TW":
KGAlertPrompt.open("圖片文件轉換失敗。");
break;
case"en-US":
KGAlertPrompt.open("Image file conversion failed.");
break;
default:
tipPrompt.open("图片文件转换失败。")
}
clearInterval(timer)
}
}, 500)
}
}).then(function (e) {
_this.fileNameInput.value = e, !0 === _this.fileRadio.checked && _this.drawPreview()
}).finally(function () {
_this.fileForm.reset()
})
}), this.rotateSelect.addEventListener("change", function (e) {
"custom" === e.target.value ? (_this.rotateCustomInput.style.display = "inline", _this.rotateUnit.style.display = "inline") : (_this.rotateCustomInput.style.display = "none", _this.rotateUnit.style.display = "none"), _this.drawPreview()
}), this.rotateCustomInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.rotateCustomInput.value = defaultRotate), _this.drawPreview()
}), this.opacityInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.opacityInput.value = defaultOpacity), t < 0 && (_this.opacityInput.value = 0), t > 100 && (_this.opacityInput.value = 100), _this.drawPreview()
}), this.fullScreenContainer.addEventListener("click", function (e) {
_this.fullScreenCheckBox.checked = !_this.fullScreenCheckBox.checked, _this.fullScreenCheckBox.checked ? (_this.fullScreenContainer.classList.add("kg_checkbox_wrapper-checked"), _this.disableDensity(!1), _this.disablePosition(!0)) : (_this.fullScreenContainer.classList.remove("kg_checkbox_wrapper-checked"), _this.disableDensity(!0), _this.disablePosition(!1)), _this.drawPreview()
}), this.densityInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) ? _this.densityInput.value = defaultDensity : t <= 0 ? _this.densityInput.value = 1 : t > 100 && (_this.densityInput.value = 100), _this.drawPreview()
}), this.verticalSelect.addEventListener("change", function (e) {
_this.verticalCustomInput.style.display = "custom" === e.target.value ? "inline" : "none", _this.verticalUnit.style.display = "custom" === e.target.value ? "inline" : "none", _this.drawPreview()
}), this.verticalCustomInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.verticalCustomInput.value = 0), _this.drawPreview()
}), this.horizontalSelect.addEventListener("change", function (e) {
_this.horizontalCustomInput.style.display = "custom" === e.target.value ? "inline" : "none", _this.horizontalUnit.style.display = "custom" === e.target.value ? "inline" : "none", _this.drawPreview()
}), this.horizontalCustomInput.addEventListener("input", function (e) {
var t = Number(e.target.value);
isNaN(t) && (_this.horizontalCustomInput.value = 0), _this.drawPreview()
}), this.okBtn.addEventListener("click", this.onOk), this.cancelBtn.addEventListener("click", this.close), this.closeBtn.addEventListener("click", this.close)
}
}, {
key: "open", value: function () {
var e = this;
return this.app.secondaryToolbar.close(), this.getFontList().then(function () {
return e.overlayManager.open(e.overlayName)
}).then(function () {
var t = e.app.KGWatermarkConfirm;
t.container.classList.contains("hidden") ? e.reset() : t.hide(), e.drawPreview()
}).catch(function () {
e.app.KGPdfViewerWebApp.getTipPrompt().close()
})
}
}, {
key: "close", value: function () {
var e = this;
return this.overlayManager.close(this.overlayName).then(function () {
e.watermarkTime && e.deleteWatermarkFromDocument()
})
}
}, {
key: "getFontList", value: function () {
var e = this;
if (0 === this.fontList.length) {
var t = window.KGPdfViewerWebApp.getTipPrompt();
switch (this.app.l10n._lang) {
case"zh-TW":
t.open("正在獲取字體...");
break;
case"en-US":
t.open("Getting fonts...");
break;
default:
t.open("正在获取字体...")
}
return (0, _request.getFontList)().then(function (n) {
var r = [];
for (var i in e.fontSelect.innerHTML = "", n) if ("status" !== i) {
r.push({title: i, value: n[i]});
var a = document.createElement("option");
a.value = i, a.innerHTML = i, e.fontSelect.appendChild(a)
}
return e.fontList = r, t.close(), Promise.resolve()
})
}
return Promise.resolve()
}
}, {
key: "drawPreview", value: function () {
if (!(document.body.clientWidth < 720)) {
var e = this.app.pdfViewer.getPageView(this.app.page - 1), t = e.viewport.scale, n = e.width / t,
r = e.height / t, i = .5 * n, a = .5 * r;
return renderWaterMark(this.getWaterMarkConfig(n, r), this.previewCanvas, .5, i, a, e, !1)
}
}
}, {
key: "getWaterMarkConfig", value: function (e, t) {
var n = {};
this.textRadio.checked && (n.source = "text"), this.fileRadio.checked && (n.source = "file"), "text" === n.source && (n.text = (0, _utils.trim)(this.textInput.value), n.font = this.fontSelect.value || this.watermarkConfig.font, n.fontName = this.fontList.filter(function (e) {
return e.title === n.font
})[0].value, n.fontSize = Number(this.fontSizeInput.value), n.fontSize <= 0 && (n.fontSize = defaultFontSize), n.color = this.colorInput.style.backgroundColor), "file" === n.source && (n.file = this.fileBase64);
var r = this.rotateSelect.value;
if (n.rotate = "custom" === r ? Number(this.rotateCustomInput.value) % 360 : Number(r) % 360, n.rotate < 0 && (n.rotate = 360 + n.rotate), n.rotate = 0 !== n.rotate ? 360 - n.rotate : 0, n.opacity = Number(this.opacityInput.value) / 100, n.fullscreen = this.fullScreenCheckBox.checked ? "tile" : "no", "no" === n.fullscreen) {
n.position = {x: 0, y: 0};
var i = this.verticalSelect.value;
"custom" === i ? n.position.y = Number(this.verticalCustomInput.value) : "top" === i ? n.position.y = -t / 2 + 20 : "bottom" === i ? n.position.y = t / 2 - 20 : "middle" === i && (n.position.y = 0);
var a = this.horizontalSelect.value;
"custom" === a ? n.position.x = Number(this.horizontalCustomInput.value) : "left" === a ? n.position.x = -e / 2 + 20 : "right" === a ? n.position.x = e / 2 - 20 : "center" === a && (n.position.x = 0), n.leftBottomPosition = (0, _utils.leftTopTransformToLeftBottom)({
x: e / 2 + n.position.x,
y: t / 2 + n.position.y
}, t)
} else n.density = Number(this.densityInput.value), n.density <= 0 && (n.density = 1), n.density = n.density / 100;
return n
}
}, {
key: "onOk", value: function () {
var e = this, t = this.app.KGAlertPrompt;
if (t.closeCallback = function () {
return e.overlayManager.open(e.overlayName)
}, !this.textRadio.checked || this.textInput.value) {
if (!this.fileRadio.checked || this.fileBase64) {
for (var n = this.app.pagesCount, r = {}, i = 0; i < n; i++) {
var a = this.app.pdfViewer.getPageView(i), o = a.viewport.scale, s = a.width / o, l = a.height / o,
c = this.getWaterMarkConfig(s, l);
0 === i ? ("text" === c.source && (r.text = c.text, r.color = c.color.slice(4, -1).split(", ").join(","), r.fontName = c.fontName, r.fontSize = c.fontSize), "file" === c.source && (r.file = c.file.split("base64,")[c.file.split("base64,").length - 1]), "tile" === c.fullscreen && (r.density = c.density), "no" === c.fullscreen && (r.leftBottomPosition = [c.leftBottomPosition]), r.source = c.source, r.fullscreen = c.fullscreen, r.opacity = c.opacity, r.rotate = 0 !== c.rotate ? 360 - c.rotate : 0) : "no" === c.fullscreen && r.leftBottomPosition.push(c.leftBottomPosition)
}
var u = window.KGPdfViewerWebApp.getTipPrompt(), d = this.app.KGWatermarkConfirm;
return this.close().then(function () {
return e.watermarkTime = (new Date).getTime(), e.renderWatermarkOnDocument()
}).then(function () {
return new Promise(function (t) {
d.show(), d.okCallback = function () {
switch (e.app.l10n._lang) {
case"zh-TW":
u.open("正在添加水印...");
break;
case"en-US":
u.open("Adding watermark...");
break;
default:
u.open("正在添加水印...")
}
t(window.KGPdfViewerWebApp.addWatermark(r))
}, d.closeCallback = function () {
e.deleteWatermarkFromDocument(), t({status: !0})
}
})
}).then(function (t) {
if (u.overlayManager.active.indexOf("kgTipOverlay") > -1 && u.close(), !0 === t.status) d.hide(); else {
if (t.message) return Promise.reject(t.message);
switch (e.app.l10n._lang) {
case"zh-TW":
return Promise.reject("添加水印失敗,請聯系管理員處理。");
case"en-US":
return Promise.reject("Failed to add watermark, please contact the administrator。");
default:
return Promise.reject("添加水印失败,请联系管理员处理。")
}
}
}).catch(function (e) {
t.open(e)
}).finally(function () {
e.watermarkTime = null
})
}
switch (t.closeCallback = function () {
return e.overlayManager.open(e.overlayName).then(function () {
e.fileNameInput.classList.add("KG_Input_Error"), e.fileNameInput.focus()
})
}, this.app.l10n._lang) {
case"zh-TW":
t.open("水印文件不能為空。");
break;
case"en-US":
t.open("Watermark file cannot be empty.");
break;
default:
t.open("水印文件不能为空。")
}
} else switch (t.closeCallback = function () {
return e.overlayManager.open(e.overlayName).then(function () {
e.textInput.classList.add("KG_Input_Error"), e.textInput.focus()
})
}, this.app.l10n._lang) {
case"zh-TW":
t.open("水印文本不能為空。");
break;
case"en-US":
t.open("Watermark text cannot be empty.");
break;
default:
t.open("水印文本不能为空。")
}
}
}, {
key: "deleteWatermarkFromDocument", value: function () {
var e = this;
if (this.watermarkTime) {
for (var t = this.app.pagesCount, n = function (t) {
var n = e.app.pdfViewer.getPageView(t), r = n.canvas;
delete n.pdfPage.newWatermark[e.watermarkTime], r && (n.deleteStampCallback = function () {
var t = n.div.querySelector(".canvasWrapper"), r = n.div.querySelector(".textLayer");
t && n.div.removeChild(t), r && n.div.removeChild(r);
var i = e.app.pdfThumbnailViewer.getThumbnail(n.pdfPage.pageIndex);
i.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL, i.setImage(n)
}, n.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL, n.renderingQueue.renderView(n))
}, r = 0; r < t; r++) n(r);
this.watermarkTime = null
}
}
}, {
key: "renderWatermarkOnDocument", value: function () {
var e = this;
if (this.watermarkTime) {
for (var t = [], n = !!PDFJS.disableTextLayer || window.navigator.userAgent.indexOf("MSIE 9.0") > 0, r = this.app.pagesCount, i = function (r) {
var i = e.app.pdfViewer.getPageView(r), a = i.canvas, o = i.viewport.scale, s = i.width / o,
l = i.height / o, c = e.getWaterMarkConfig(s, l);
for (var u in null == i.pdfPage.newWatermark && (i.pdfPage.newWatermark = {}), i.pdfPage.newWatermark[e.watermarkTime] = {}, c) i.pdfPage.newWatermark[e.watermarkTime][u] = c[u];
if (3 == i.renderingState) {
var d = a.width / a.offsetWidth;
t.push(renderWaterMark(c, a, o * d, a.width, a.height, null, !n).then(function (e) {
return (0, _utils.renderTextLayerElements)(i, e)
}))
}
}, a = 0; a < r; a++) i(a);
return Promise.all(t)
}
}
}, {
key: "renderWatermarkOnlyWeb", value: function () {
var e = this;
return this.fontList = [{title: "黑体", value: "SIMHEI.TTF"}, {title: "楷体", value: "SIMKAI.TTF"}, {
title: "宋体",
value: "SIMSUN.TTC"
}, {
title: "微软雅黑",
value: "msyh.ttf"
}], this.reset(), this.watermarkTime = (new Date).getTime(), this.renderWatermarkOnDocument().then(function () {
e.watermarkTime = null, e.fontList = []
})
}
}]), KG_Watermark
}()
}, function (e, t, n) {
"use strict";
(function (e) {
var n, r, i, a, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
a = function () {
var e = "#1a1a1a", t = 4, n = 2, r = 6, i = .8, a = 1e5, o = 1, s = 2, l = 2, c = {}, u = null, d = [], h = !1,
p = {top: 0, right: 0, bottom: 0, left: 0};
function f(s) {
null == s.canvasId && k(new Error("canvaseId不能为空")), this.canvas = document.getElementById(s.canvasId), null == this.canvas && k(new Error("获取Canvas元素失败请检查canvasId是否正确")), s.onError && "function" == typeof s.onError && (this.onError = s.onError.bind(this)), this.setLineSize(s.lineSize || t), this.setLineMin(s.lineMin || n), this.setLineMax(s.lineMax || r), this.setPressure(s.linePressure || i), this.setLineColor(s.lineColor || e), this.setLineOpacity(s.lineOpacity || o), this.setSmoothness(s.smoothness || a), this.touchStartCallback = s.touchStartCallback || null, this.touchMoveCallback = s.touchMoveCallback || null, this.touchEndCallback = s.touchEndCallback || null, this.clearCanvasCallback = s.clearCanvasCallback || null, this.chirography = [], this.linePrack = [], this.bethelPoint = [], this.isMobile = 1 == window.KGPdfViewerWebApp.mobile, this.isMobile ? (this.canvas.addEventListener("touchstart", m.bind(this), !1), this.canvas.addEventListener("touchmove", v.bind(this), !1), this.canvas.addEventListener("touchend", g.bind(this), !1)) : (this.canvas.addEventListener("mousedown", m.bind(this), !1), this.canvas.addEventListener("mousemove", v.bind(this), !1), this.canvas.addEventListener("mouseup", g.bind(this), !1), this.canvas.addEventListener("mouseout", g.bind(this), !1))
}
function m(e) {
console.log(123124)
var t = e || window.event;
t.stopPropagation();
var n = this.isMobile ? "touchstart" : "mousedown";
if (t.type === n && t.target.id === this.canvas.id && !(this.isMobile && t.touches.length > 1 || this.isMobile && 1 !== t.touches.length)) {
if (!h) {
var r = this.isMobile ? t.touches[0] : {clientX: t.clientX, clientY: t.clientY}, i = y.call(this, r);
c = i;
var a = (new Date).getTime();
d.unshift({time: a, dis: 0, x: i.x, y: i.y}), p = {
top: i.y,
right: i.x,
bottom: i.y,
left: i.x
}, h = !0, this.ctx.fillStyle = this.lineColor, this.ctx.globalAlpha = this.lineOpacity
}
b.apply(this), null != this.touchStartCallback && "function" == typeof this.touchStartCallback && this.touchStartCallback()
}
}
function v(e) {
console.log(123124)
var t = e || window.event;
t.stopPropagation();
var n = this.isMobile ? "touchmove" : "mousemove";
if (t.type === n && t.target.id === this.canvas.id && !(this.isMobile && t.touches.length > 1) && (!this.isMobile || 1 === t.touches.length) && h) {
t.preventDefault();
var r = this.isMobile ? t.touches[0] : {clientX: t.clientX, clientY: t.clientY}, i = y.call(this, r);
i.y < p.top && (p.top = i.y), i.y < 0 && (p.top = 0), i.x > p.right && (p.right = i.x), this.canvas.width - i.x <= 0 && (p.right = this.canvas.width), i.y > p.bottom && (p.bottom = i.y), this.canvas.height - i.y <= 0 && (p.bottom = this.canvas.height), i.x < p.left && (p.left = i.x), i.x < 0 && (p.left = 0), u = c, c = i;
var a = (new Date).getTime();
d.unshift({
time: a,
dis: _(u, c),
x: i.x,
y: i.y
}), b.apply(this), null != this.touchMoveCallback && "function" == typeof this.touchMoveCallback && (console.log(this.touchMoveCallback), this.touchMoveCallback())
}
}
function g(e) {
var t, n = e || window.event;
if (n.stopPropagation(), t = this.isMobile ? "touchend" : "mouseout" === n.type ? "mouseout" : "mouseup", n.type === t && n.target.id === this.canvas.id && !(this.isMobile && n.touches.length > 1) && (!this.isMobile || n.touches.length <= 1) && h) {
var r = this.isMobile ? n.changedTouches[0] : {clientX: n.clientX, clientY: n.clientY}, i = y.call(this, r);
if (d.length > 2) {
u = c, c = i;
var a = (new Date).getTime();
d.unshift({time: a, dis: _(c, u), x: i.x, y: i.y})
}
b.apply(this), this.chirography.unshift({
lineSize: this.lineSize,
lineColor: this.lineColor
}), this.linePrack.unshift({points: d}), d = [], h = !1, null != this.touchEndCallback && "function" == typeof this.touchEndCallback && this.touchEndCallback()
}
}
function y(e) {
for (var t = {
x: 0,
y: 0
}, n = this.canvas.offsetLeft, r = this.canvas.offsetTop, i = this.canvas.parentNode, a = 0; a < 1e3 && "BODY" !== i.tagName; a++) n += i.offsetLeft, r += i.offsetTop, i = i.parentNode;
var o = document.body.scrollLeft || document.documentElement.scrollLeft,
c = document.body.scrollTop || document.documentElement.scrollTop, u = e.clientX - n + o,
d = e.clientY - r + c;
return t.x = u * s, t.y = d * l, t
}
function b() {
(function () {
if (d.length <= 1) return void (d[0].r = 1);
for (var e = _({x: d[0].x, y: d[0].y}, {
x: d[1].x,
y: d[1].y
}), t = 0, n = 0; n < d.length - 1 && e <= this.smoothness; n++) e += d[n].dis, t += d[n].time - d[n + 1].time;
d[0].r = Math.min(t / (1 * e) * this.pressure + this.lineMin, this.lineMax) * this.lineSize
}).apply(this), function () {
if (d.length <= 1) return;
var e, t, n, r, i, a, o, s, l;
2 === d.length && (e = d[1].x, r = d[1].y, n = d[1].x + .5 * (d[0].x - d[1].x), a = d[1].y + .5 * (d[0].y - d[1].y), t = e + .5 * (n - e), i = r + .5 * (a - r), o = d[1].r, l = d[1].r + .5 * (d[0].r - d[1].r), s = .5 * (o + l));
d.length > 2 && (e = d[2].x + .5 * (d[1].x - d[2].x), r = d[2].y + .5 * (d[1].y - d[2].y), t = d[1].x, i = d[1].y, n = t + .5 * (d[0].x - t), a = i + .5 * (d[0].y - i), o = d[2].r + .5 * (d[1].r - d[2].r), s = d[1].r, l = s + .5 * (d[0].r - s));
for (var c = [], u = 0; u < 5; u++) {
var h = u / 4, p = (1 - h) * (1 - h) * e + 2 * h * (1 - h) * t + h * h * n,
f = (1 - h) * (1 - h) * r + 2 * h * (1 - h) * i + h * h * a, m = o + (l - o) / 5 * u;
if (c.push({x: p, y: f, r: m}), 3 === c.length) {
var v = w.apply(this, [c[0].x, c[0].y, c[0].r, c[1].x, c[1].y, c[1].r, c[2].x, c[2].y, c[2].r]);
v[0].color = this.lineColor, S.apply(this, [v]), c = [{x: p, y: f, r: m}]
}
}
}.apply(this)
}
function w(e, t, n, r, i, a, o, s, l) {
var c, u, d, h, p, f, m, v, g, y = [];
c = r - e, h = u = (u = i - t) / (d = 2 * Math.sqrt(c * c + u * u + 1e-4)) * n, p = -(c = c / d * n), f = r - o, v = -(m = (m = i - s) / (d = 2 * Math.sqrt(f * f + m * m + 1e-4)) * l), g = f = f / d * l, y.push({
mx: e + h,
my: t + p,
color: this.lineColor
}), y.push({c1x: r + h, c1y: i + p, c2x: r + v, c2y: i + g, ex: o + v, ey: s + g}), y.push({
c1x: o + v - f,
c1y: s + g - m,
c2x: o - v - f,
c2y: s - g - m,
ex: o - v,
ey: s - g
}), y.push({c1x: r - v, c1y: i - g, c2x: r - h, c2y: i - p, ex: e - h, ey: t - p}), y.push({
c1x: e - h - c,
c1y: t - p - u,
c2x: e + h - c,
c2y: t + p - u,
ex: e + h,
ey: t + p
}), y[0].mx = y[0].mx.toFixed(1), y[0].mx = parseFloat(y[0].mx), y[0].my = y[0].my.toFixed(1), y[0].my = parseFloat(y[0].my);
for (var b = 1; b < y.length; b++) y[b].c1x = y[b].c1x.toFixed(1), y[b].c1x = parseFloat(y[b].c1x), y[b].c1y = y[b].c1y.toFixed(1), y[b].c1y = parseFloat(y[b].c1y), y[b].c2x = y[b].c2x.toFixed(1), y[b].c2x = parseFloat(y[b].c2x), y[b].c2y = y[b].c2y.toFixed(1), y[b].c2y = parseFloat(y[b].c2y), y[b].ex = y[b].ex.toFixed(1), y[b].ex = parseFloat(y[b].ex), y[b].ey = y[b].ey.toFixed(1), y[b].ey = parseFloat(y[b].ey);
return y
}
function S(e) {
this.ctx.beginPath(), this.ctx.moveTo(e[0].mx, e[0].my), this.ctx.fillStyle = e[0].color, this.ctx.strokeStyle = e[0].color;
for (var t = 1; t < e.length; t++) this.ctx.bezierCurveTo(e[t].c1x, e[t].c1y, e[t].c2x, e[t].c2y, e[t].ex, e[t].ey);
this.ctx.fill()
}
function _(e, t) {
var n = t.x - e.x, r = t.y - e.y;
return Math.sqrt(Math.pow(n, 2) + Math.pow(r, 2))
}
function k(e) {
this.onError && "function" == typeof this.onError ? this.onError(e) : console.error(e)
}
return f.prototype = {
setLineColor: function (e) {
e ? this.lineColor = e : k(new Error("设置线条颜色失败"))
}, setLineSize: function (e) {
isNaN(e) ? k(new Error("设置线条宽度失败")) : this.lineSize = e
}, isMobilePhone: function () {
var e = navigator.userAgent.toLowerCase(), t = "ipad" == e.match(/ipad/i), n = "iphone" == e.match(/iphone/i),
r = "ipod" == e.match(/ipd/i), i = "android" == e.match(/android/i),
a = "blackberry" == e.match(/blackberry/i), o = "symbianos" == e.match(/symbianos/i);
return !!(t || n || r || i || a || o)
}, setLineMin: function (e) {
!isNaN(e) && e >= 0 ? this.lineMin = e : k(new Error("设置最小线宽失败"))
}, setLineMax: function (e) {
!isNaN(e) && e >= 0 ? this.lineMax = e : k(new Error("设置最大线宽失败"))
}, setPressure: function (e) {
!isNaN(e) && e >= 0 ? this.pressure = e : k(new Error("设置压力失败"))
}, setSmoothness: function (e) {
!isNaN(e) && e >= 0 ? this.smoothness = e : k(new Error("设置光滑度失败"))
}, setLineOpacity: function (e) {
!isNaN(e) && e >= 0 && e <= 1 ? this.lineOpacity = e : k(new Error("设置图片透明度失败"))
}, setCanvasStyle: function (e, t, n, r, i, a, o) {
var c = this.canvas.parentNode;
this.canvas.width = 2 * e || 2 * c.clientWidth, this.canvas.height = 2 * t || 2 * c.clientHeight, this.canvas.style.width = e + "px" || c.clientWidth + "px", this.canvas.style.height = t + "px" || c.clientHeight + "px", this.canvas.style.top = n || 0, this.canvas.style.left = r || 0, this.canvas.style.marginLeft = i + "px" || 0, this.canvas.style.marginTop = a + "px" || 0, this.canvas.style.position = "absolute", this.canvas.style.border = o ? "none" : "1px solid #f0f0f0", this.ctx = this.canvas.getContext("2d"), this.ctx.fillStyle = "rgba(0, 0, 0, 1)", s = this.canvas.width / this.canvas.style.width.slice(0, -2), l = this.canvas.height / this.canvas.style.height.slice(0, -2)
}, saveImage: function () {
return this.canvas.toDataURL("image/png")
}, clearCanvas: function () {
this.canvas && this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.chirography.length > 0 && (this.chirography = []), this.linePrack.length > 0 && (this.linePrack = []), this.bethelPoint.length > 0 && (this.bethelPoint = []), h && (h = !1), this.clearCanvasCallback && "function" == typeof this.clearCanvasCallback && this.clearCanvasCallback()
}
}, f
}, "object" === o(t) && "object" === o(e) ? e.exports = a() : (r = [], void 0 === (i = "function" == typeof (n = a) ? n.apply(t, r) : n) || (e.exports = i))
}).call(t, n(61)(e))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
function i(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), Object.defineProperty(e, "prototype", {writable: !1}), t && a(e, t)
}
function a(e, t) {
return (a = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
return e.__proto__ = t, e
})(e, t)
}
function o(e) {
var t = function () {
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
if (Reflect.construct.sham) return !1;
if ("function" == typeof Proxy) return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {
})), !0
} catch (e) {
return !1
}
}();
return function () {
var n, r = s(e);
if (t) {
var i = s(this).constructor;
n = Reflect.construct(r, arguments, i)
} else n = r.apply(this, arguments);
return function (e, t) {
if (t && ("object" === g(t) || "function" == typeof t)) return t;
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
return function (e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}(e)
}(this, n)
}
}
function s(e) {
return (s = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function l() {
l = function () {
return e
};
var e = {}, t = Object.prototype, n = t.hasOwnProperty, r = "function" == typeof Symbol ? Symbol : {},
i = r.iterator || "@@iterator", a = r.asyncIterator || "@@asyncIterator", o = r.toStringTag || "@@toStringTag";
function s(e, t, n) {
return Object.defineProperty(e, t, {value: n, enumerable: !0, configurable: !0, writable: !0}), e[t]
}
try {
s({}, "")
} catch (e) {
s = function (e, t, n) {
return e[t] = n
}
}
function c(e, t, n, r) {
var i, a, o, s, l = t && t.prototype instanceof h ? t : h, c = Object.create(l.prototype), p = new P(r || []);
return c._invoke = (i = e, a = n, o = p, s = "suspendedStart", function (e, t) {
if ("executing" === s) throw new Error("Generator is already running");
if ("completed" === s) {
if ("throw" === e) throw t;
return {value: void 0, done: !0}
}
for (o.method = e, o.arg = t; ;) {
var n = o.delegate;
if (n) {
var r = _(n, o);
if (r) {
if (r === d) continue;
return r
}
}
if ("next" === o.method) o.sent = o._sent = o.arg; else if ("throw" === o.method) {
if ("suspendedStart" === s) throw s = "completed", o.arg;
o.dispatchException(o.arg)
} else "return" === o.method && o.abrupt("return", o.arg);
s = "executing";
var l = u(i, a, o);
if ("normal" === l.type) {
if (s = o.done ? "completed" : "suspendedYield", l.arg === d) continue;
return {value: l.arg, done: o.done}
}
"throw" === l.type && (s = "completed", o.method = "throw", o.arg = l.arg)
}
}), c
}
function u(e, t, n) {
try {
return {type: "normal", arg: e.call(t, n)}
} catch (e) {
return {type: "throw", arg: e}
}
}
e.wrap = c;
var d = {};
function h() {
}
function p() {
}
function f() {
}
var m = {};
s(m, i, function () {
return this
});
var v = Object.getPrototypeOf, y = v && v(v(C([])));
y && y !== t && n.call(y, i) && (m = y);
var b = f.prototype = h.prototype = Object.create(m);
function w(e) {
["next", "throw", "return"].forEach(function (t) {
s(e, t, function (e) {
return this._invoke(t, e)
})
})
}
function S(e, t) {
var r;
this._invoke = function (i, a) {
function o() {
return new t(function (r, o) {
!function r(i, a, o, s) {
var l = u(e[i], e, a);
if ("throw" !== l.type) {
var c = l.arg, d = c.value;
return d && "object" == g(d) && n.call(d, "__await") ? t.resolve(d.__await).then(function (e) {
r("next", e, o, s)
}, function (e) {
r("throw", e, o, s)
}) : t.resolve(d).then(function (e) {
c.value = e, o(c)
}, function (e) {
return r("throw", e, o, s)
})
}
s(l.arg)
}(i, a, r, o)
})
}
return r = r ? r.then(o, o) : o()
}
}
function _(e, t) {
var n = e.iterator[t.method];
if (void 0 === n) {
if (t.delegate = null, "throw" === t.method) {
if (e.iterator.return && (t.method = "return", t.arg = void 0, _(e, t), "throw" === t.method)) return d;
t.method = "throw", t.arg = new TypeError("The iterator does not provide a 'throw' method")
}
return d
}
var r = u(n, e.iterator, t.arg);
if ("throw" === r.type) return t.method = "throw", t.arg = r.arg, t.delegate = null, d;
var i = r.arg;
return i ? i.done ? (t[e.resultName] = i.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = void 0), t.delegate = null, d) : i : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, d)
}
function k(e) {
var t = {tryLoc: e[0]};
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t)
}
function x(e) {
var t = e.completion || {};
t.type = "normal", delete t.arg, e.completion = t
}
function P(e) {
this.tryEntries = [{tryLoc: "root"}], e.forEach(k, this), this.reset(!0)
}
function C(e) {
if (e) {
var t = e[i];
if (t) return t.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var r = -1, a = function t() {
for (; ++r < e.length;) if (n.call(e, r)) return t.value = e[r], t.done = !1, t;
return t.value = void 0, t.done = !0, t
};
return a.next = a
}
}
return {next: A}
}
function A() {
return {value: void 0, done: !0}
}
return p.prototype = f, s(b, "constructor", f), s(f, "constructor", p), p.displayName = s(f, o, "GeneratorFunction"), e.isGeneratorFunction = function (e) {
var t = "function" == typeof e && e.constructor;
return !!t && (t === p || "GeneratorFunction" === (t.displayName || t.name))
}, e.mark = function (e) {
return Object.setPrototypeOf ? Object.setPrototypeOf(e, f) : (e.__proto__ = f, s(e, o, "GeneratorFunction")), e.prototype = Object.create(b), e
}, e.awrap = function (e) {
return {__await: e}
}, w(S.prototype), s(S.prototype, a, function () {
return this
}), e.AsyncIterator = S, e.async = function (t, n, r, i, a) {
void 0 === a && (a = Promise);
var o = new S(c(t, n, r, i), a);
return e.isGeneratorFunction(n) ? o : o.next().then(function (e) {
return e.done ? e.value : o.next()
})
}, w(b), s(b, o, "Generator"), s(b, i, function () {
return this
}), s(b, "toString", function () {
return "[object Generator]"
}), e.keys = function (e) {
var t = [];
for (var n in e) t.push(n);
return t.reverse(), function n() {
for (; t.length;) {
var r = t.pop();
if (r in e) return n.value = r, n.done = !1, n
}
return n.done = !0, n
}
}, e.values = C, P.prototype = {
constructor: P, reset: function (e) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(x), !e) for (var t in this) "t" === t.charAt(0) && n.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0)
}, stop: function () {
this.done = !0;
var e = this.tryEntries[0].completion;
if ("throw" === e.type) throw e.arg;
return this.rval
}, dispatchException: function (e) {
if (this.done) throw e;
var t = this;
function r(n, r) {
return o.type = "throw", o.arg = e, t.next = n, r && (t.method = "next", t.arg = void 0), !!r
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var a = this.tryEntries[i], o = a.completion;
if ("root" === a.tryLoc) return r("end");
if (a.tryLoc <= this.prev) {
var s = n.call(a, "catchLoc"), l = n.call(a, "finallyLoc");
if (s && l) {
if (this.prev < a.catchLoc) return r(a.catchLoc, !0);
if (this.prev < a.finallyLoc) return r(a.finallyLoc)
} else if (s) {
if (this.prev < a.catchLoc) return r(a.catchLoc, !0)
} else {
if (!l) throw new Error("try statement without catch or finally");
if (this.prev < a.finallyLoc) return r(a.finallyLoc)
}
}
}
}, abrupt: function (e, t) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var i = this.tryEntries[r];
if (i.tryLoc <= this.prev && n.call(i, "finallyLoc") && this.prev < i.finallyLoc) {
var a = i;
break
}
}
a && ("break" === e || "continue" === e) && a.tryLoc <= t && t <= a.finallyLoc && (a = null);
var o = a ? a.completion : {};
return o.type = e, o.arg = t, a ? (this.method = "next", this.next = a.finallyLoc, d) : this.complete(o)
}, complete: function (e, t) {
if ("throw" === e.type) throw e.arg;
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), d
}, finish: function (e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), x(n), d
}
}, catch: function (e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.tryLoc === e) {
var r = n.completion;
if ("throw" === r.type) {
var i = r.arg;
x(n)
}
return i
}
}
throw new Error("illegal catch attempt")
}, delegateYield: function (e, t, n) {
return this.delegate = {
iterator: C(e),
resultName: t,
nextLoc: n
}, "next" === this.method && (this.arg = void 0), d
}
}, e
}
function c(e, t, n, r, i, a, o) {
try {
var s = e[a](o), l = s.value
} catch (e) {
return void n(e)
}
s.done ? t(l) : Promise.resolve(l).then(r, i)
}
function u(e) {
return function () {
var t = this, n = arguments;
return new Promise(function (r, i) {
var a = e.apply(t, n);
function o(e) {
c(a, r, i, o, s, "next", e)
}
function s(e) {
c(a, r, i, o, s, "throw", e)
}
o(void 0)
})
}
}
function d(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
})), n.push.apply(n, r)
}
return n
}
function h(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? d(Object(n), !0).forEach(function (t) {
p(e, t, n[t])
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : d(Object(n)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
})
}
return e
}
function p(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function f(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
function m(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
function v(e, t, n) {
return t && m(e.prototype, t), n && m(e, n), Object.defineProperty(e, "prototype", {writable: !1}), e
}
function g(e) {
"@babel/helpers - typeof";
return (g = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : r(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : r(e)
})(e)
}
var y = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {},
b = function (e) {
return e && e.Math == Math && e
},
w = b("object" == ("undefined" == typeof globalThis ? "undefined" : g(globalThis)) && globalThis) || b("object" == ("undefined" == typeof window ? "undefined" : g(window)) && window) || b("object" == ("undefined" == typeof self ? "undefined" : g(self)) && self) || b("object" == g(y) && y) || function () {
return this
}() || Function("return this")(), S = {}, _ = function (e) {
try {
return !!e()
} catch (e) {
return !0
}
}, k = !_(function () {
return 7 != Object.defineProperty({}, 1, {
get: function () {
return 7
}
})[1]
}), x = !_(function () {
var e = function () {
}.bind();
return "function" != typeof e || e.hasOwnProperty("prototype")
}), P = x, C = Function.prototype.call, A = P ? C.bind(C) : function () {
return C.apply(C, arguments)
}, T = {}, E = {}.propertyIsEnumerable, D = Object.getOwnPropertyDescriptor, I = D && !E.call({1: 2}, 1);
T.f = I ? function (e) {
var t = D(this, e);
return !!t && t.enumerable
} : E;
var L, O, M = function (e, t) {
return {enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t}
}, N = x, R = Function.prototype, W = R.bind, V = R.call, F = N && W.bind(V, V), G = N ? function (e) {
return e && F(e)
} : function (e) {
return e && function () {
return V.apply(e, arguments)
}
}, B = G, K = B({}.toString), j = B("".slice), z = function (e) {
return j(K(e), 8, -1)
}, U = _, q = z, H = Object, Y = G("".split), X = U(function () {
return !H("z").propertyIsEnumerable(0)
}) ? function (e) {
return "String" == q(e) ? Y(e, "") : H(e)
} : H, J = TypeError, Q = function (e) {
if (void 0 == e) throw J("Can't call method on " + e);
return e
}, $ = X, Z = Q, ee = function (e) {
return $(Z(e))
}, te = function (e) {
return "function" == typeof e
}, ne = te, re = function (e) {
return "object" == g(e) ? null !== e : ne(e)
}, ie = w, ae = te, oe = function (e, t) {
return arguments.length < 2 ? (n = ie[e], ae(n) ? n : void 0) : ie[e] && ie[e][t];
var n
}, se = G({}.isPrototypeOf), le = oe("navigator", "userAgent") || "", ce = w, ue = le, de = ce.process, he = ce.Deno,
pe = de && de.versions || he && he.version, fe = pe && pe.v8;
fe && (O = (L = fe.split("."))[0] > 0 && L[0] < 4 ? 1 : +(L[0] + L[1])), !O && ue && (!(L = ue.match(/Edge\/(\d+)/)) || L[1] >= 74) && (L = ue.match(/Chrome\/(\d+)/)) && (O = +L[1]);
var me = O, ve = me, ge = _, ye = !!Object.getOwnPropertySymbols && !ge(function () {
var e = Symbol();
return !String(e) || !(Object(e) instanceof Symbol) || !Symbol.sham && ve && ve < 41
}), be = ye && !Symbol.sham && "symbol" == g(Symbol.iterator), we = oe, Se = te, _e = se, ke = Object,
xe = be ? function (e) {
return "symbol" == g(e)
} : function (e) {
var t = we("Symbol");
return Se(t) && _e(t.prototype, ke(e))
}, Pe = String, Ce = function (e) {
try {
return Pe(e)
} catch (e) {
return "Object"
}
}, Ae = te, Te = Ce, Ee = TypeError, De = function (e) {
if (Ae(e)) return e;
throw Ee(Te(e) + " is not a function")
}, Ie = De, Le = function (e, t) {
var n = e[t];
return null == n ? void 0 : Ie(n)
}, Oe = A, Me = te, Ne = re, Re = TypeError, We = {exports: {}}, Ve = w, Fe = Object.defineProperty,
Ge = function (e, t) {
try {
Fe(Ve, e, {value: t, configurable: !0, writable: !0})
} catch (n) {
Ve[e] = t
}
return t
}, Be = Ge, Ke = w["__core-js_shared__"] || Be("__core-js_shared__", {}), je = Ke;
(We.exports = function (e, t) {
return je[e] || (je[e] = void 0 !== t ? t : {})
})("versions", []).push({
version: "3.23.1",
mode: "global",
copyright: "© 2014-2022 Denis Pushkarev (zloirock.ru)",
license: "https://github.com/zloirock/core-js/blob/v3.23.1/LICENSE",
source: "https://github.com/zloirock/core-js"
});
var ze = Q, Ue = Object, qe = function (e) {
return Ue(ze(e))
}, He = qe, Ye = G({}.hasOwnProperty), Xe = Object.hasOwn || function (e, t) {
return Ye(He(e), t)
}, Je = G, Qe = 0, $e = Math.random(), Ze = Je(1..toString), et = function (e) {
return "Symbol(" + (void 0 === e ? "" : e) + ")_" + Ze(++Qe + $e, 36)
}, tt = w, nt = Xe, rt = et, it = ye, at = be, ot = (0, We.exports)("wks"), st = tt.Symbol, lt = st && st.for,
ct = at ? st : st && st.withoutSetter || rt, ut = function (e) {
if (!nt(ot, e) || !it && "string" != typeof ot[e]) {
var t = "Symbol." + e;
it && nt(st, e) ? ot[e] = st[e] : ot[e] = at && lt ? lt(t) : ct(t)
}
return ot[e]
}, dt = A, ht = re, pt = xe, ft = Le, mt = function (e, t) {
var n, r;
if ("string" === t && Me(n = e.toString) && !Ne(r = Oe(n, e))) return r;
if (Me(n = e.valueOf) && !Ne(r = Oe(n, e))) return r;
if ("string" !== t && Me(n = e.toString) && !Ne(r = Oe(n, e))) return r;
throw Re("Can't convert object to primitive value")
}, vt = TypeError, gt = ut("toPrimitive"), yt = function (e, t) {
if (!ht(e) || pt(e)) return e;
var n, r = ft(e, gt);
if (r) {
if (void 0 === t && (t = "default"), n = dt(r, e, t), !ht(n) || pt(n)) return n;
throw vt("Can't convert object to primitive value")
}
return void 0 === t && (t = "number"), mt(e, t)
}, bt = xe, wt = function (e) {
var t = yt(e, "string");
return bt(t) ? t : t + ""
}, St = re, _t = w.document, kt = St(_t) && St(_t.createElement), xt = function (e) {
return kt ? _t.createElement(e) : {}
}, Pt = xt, Ct = !k && !_(function () {
return 7 != Object.defineProperty(Pt("div"), "a", {
get: function () {
return 7
}
}).a
}), At = k, Tt = A, Et = T, Dt = M, It = ee, Lt = wt, Ot = Xe, Mt = Ct, Nt = Object.getOwnPropertyDescriptor;
S.f = At ? Nt : function (e, t) {
if (e = It(e), t = Lt(t), Mt) try {
return Nt(e, t)
} catch (e) {
}
if (Ot(e, t)) return Dt(!Tt(Et.f, e, t), e[t])
};
var Rt = {}, Wt = k && _(function () {
return 42 != Object.defineProperty(function () {
}, "prototype", {value: 42, writable: !1}).prototype
}), Vt = re, Ft = String, Gt = TypeError, Bt = function (e) {
if (Vt(e)) return e;
throw Gt(Ft(e) + " is not an object")
}, Kt = k, jt = Ct, zt = Wt, Ut = Bt, qt = wt, Ht = TypeError, Yt = Object.defineProperty,
Xt = Object.getOwnPropertyDescriptor;
Rt.f = Kt ? zt ? function (e, t, n) {
if (Ut(e), t = qt(t), Ut(n), "function" == typeof e && "prototype" === t && "value" in n && "writable" in n && !n.writable) {
var r = Xt(e, t);
r && r.writable && (e[t] = n.value, n = {
configurable: "configurable" in n ? n.configurable : r.configurable,
enumerable: "enumerable" in n ? n.enumerable : r.enumerable,
writable: !1
})
}
return Yt(e, t, n)
} : Yt : function (e, t, n) {
if (Ut(e), t = qt(t), Ut(n), jt) try {
return Yt(e, t, n)
} catch (e) {
}
if ("get" in n || "set" in n) throw Ht("Accessors not supported");
return "value" in n && (e[t] = n.value), e
};
var Jt = Rt, Qt = M, $t = k ? function (e, t, n) {
return Jt.f(e, t, Qt(1, n))
} : function (e, t, n) {
return e[t] = n, e
}, Zt = {exports: {}}, en = k, tn = Xe, nn = Function.prototype, rn = en && Object.getOwnPropertyDescriptor,
an = tn(nn, "name"), on = {
EXISTS: an, PROPER: an && "something" === function () {
}.name, CONFIGURABLE: an && (!en || en && rn(nn, "name").configurable)
}, sn = te, ln = Ke, cn = G(Function.toString);
sn(ln.inspectSource) || (ln.inspectSource = function (e) {
return cn(e)
});
var un, dn, hn, pn = ln.inspectSource, fn = te, mn = pn, vn = w.WeakMap, gn = fn(vn) && /native code/.test(mn(vn)),
yn = et, bn = (0, We.exports)("keys"), wn = function (e) {
return bn[e] || (bn[e] = yn(e))
}, Sn = {}, _n = gn, kn = w, xn = G, Pn = re, Cn = $t, An = Xe, Tn = Ke, En = wn, Dn = Sn, In = kn.TypeError,
Ln = kn.WeakMap;
if (_n || Tn.state) {
var On = Tn.state || (Tn.state = new Ln), Mn = xn(On.get), Nn = xn(On.has), Rn = xn(On.set);
un = function (e, t) {
if (Nn(On, e)) throw new In("Object already initialized");
return t.facade = e, Rn(On, e, t), t
}, dn = function (e) {
return Mn(On, e) || {}
}, hn = function (e) {
return Nn(On, e)
}
} else {
var Wn = En("state");
Dn[Wn] = !0, un = function (e, t) {
if (An(e, Wn)) throw new In("Object already initialized");
return t.facade = e, Cn(e, Wn, t), t
}, dn = function (e) {
return An(e, Wn) ? e[Wn] : {}
}, hn = function (e) {
return An(e, Wn)
}
}
var Vn = {
set: un, get: dn, has: hn, enforce: function (e) {
return hn(e) ? dn(e) : un(e, {})
}, getterFor: function (e) {
return function (t) {
var n;
if (!Pn(t) || (n = dn(t)).type !== e) throw In("Incompatible receiver, " + e + " required");
return n
}
}
}, Fn = _, Gn = te, Bn = Xe, Kn = k, jn = on.CONFIGURABLE, zn = pn, Un = Vn.enforce, qn = Vn.get,
Hn = Object.defineProperty, Yn = Kn && !Fn(function () {
return 8 !== Hn(function () {
}, "length", {value: 8}).length
}), Xn = String(String).split("String"), Jn = Zt.exports = function (e, t, n) {
"Symbol(" === String(t).slice(0, 7) && (t = "[" + String(t).replace(/^Symbol\(([^)]*)\)/, "$1") + "]"), n && n.getter && (t = "get " + t), n && n.setter && (t = "set " + t), (!Bn(e, "name") || jn && e.name !== t) && Hn(e, "name", {
value: t,
configurable: !0
}), Yn && n && Bn(n, "arity") && e.length !== n.arity && Hn(e, "length", {value: n.arity});
try {
n && Bn(n, "constructor") && n.constructor ? Kn && Hn(e, "prototype", {writable: !1}) : e.prototype && (e.prototype = void 0)
} catch (e) {
}
var r = Un(e);
return Bn(r, "source") || (r.source = Xn.join("string" == typeof t ? t : "")), e
};
Function.prototype.toString = Jn(function () {
return Gn(this) && qn(this).source || zn(this)
}, "toString");
var Qn = te, $n = Rt, Zn = Zt.exports, er = Ge, tr = function (e, t, n, r) {
r || (r = {});
var i = r.enumerable, a = void 0 !== r.name ? r.name : t;
return Qn(n) && Zn(n, a, r), r.global ? i ? e[t] = n : er(t, n) : (r.unsafe ? e[t] && (i = !0) : delete e[t], i ? e[t] = n : $n.f(e, t, {
value: n,
enumerable: !1,
configurable: !r.nonConfigurable,
writable: !r.nonWritable
})), e
}, nr = {}, rr = Math.ceil, ir = Math.floor, ar = Math.trunc || function (e) {
var t = +e;
return (t > 0 ? ir : rr)(t)
}, or = function (e) {
var t = +e;
return t != t || 0 === t ? 0 : ar(t)
}, sr = or, lr = Math.max, cr = Math.min, ur = or, dr = Math.min, hr = function (e) {
return e > 0 ? dr(ur(e), 9007199254740991) : 0
}, pr = function (e) {
return hr(e.length)
}, fr = ee, mr = function (e, t) {
var n = sr(e);
return n < 0 ? lr(n + t, 0) : cr(n, t)
}, vr = pr, gr = function (e) {
return function (t, n, r) {
var i, a = fr(t), o = vr(a), s = mr(r, o);
if (e && n != n) {
for (; o > s;) if ((i = a[s++]) != i) return !0
} else for (; o > s; s++) if ((e || s in a) && a[s] === n) return e || s || 0;
return !e && -1
}
}, yr = Xe, br = ee, wr = {includes: gr(!0), indexOf: gr(!1)}.indexOf, Sr = Sn, _r = G([].push),
kr = function (e, t) {
var n, r = br(e), i = 0, a = [];
for (n in r) !yr(Sr, n) && yr(r, n) && _r(a, n);
for (; t.length > i;) yr(r, n = t[i++]) && (~wr(a, n) || _r(a, n));
return a
},
xr = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"],
Pr = kr, Cr = xr.concat("length", "prototype");
nr.f = Object.getOwnPropertyNames || function (e) {
return Pr(e, Cr)
};
var Ar = {};
Ar.f = Object.getOwnPropertySymbols;
var Tr = oe, Er = nr, Dr = Ar, Ir = Bt, Lr = G([].concat), Or = Xe, Mr = Tr("Reflect", "ownKeys") || function (e) {
var t = Er.f(Ir(e)), n = Dr.f;
return n ? Lr(t, n(e)) : t
}, Nr = S, Rr = Rt, Wr = function (e, t, n) {
for (var r = Mr(t), i = Rr.f, a = Nr.f, o = 0; o < r.length; o++) {
var s = r[o];
Or(e, s) || n && Or(n, s) || i(e, s, a(t, s))
}
}, Vr = _, Fr = te, Gr = /#|\.prototype\./, Br = function (e, t) {
var n = jr[Kr(e)];
return n == Ur || n != zr && (Fr(t) ? Vr(t) : !!t)
}, Kr = Br.normalize = function (e) {
return String(e).replace(Gr, ".").toLowerCase()
}, jr = Br.data = {}, zr = Br.NATIVE = "N", Ur = Br.POLYFILL = "P", qr = Br, Hr = w, Yr = S.f, Xr = $t, Jr = tr,
Qr = Ge, $r = Wr, Zr = qr, ei = function (e, t) {
var n, r, i, a, o, s = e.target, l = e.global, c = e.stat;
if (n = l ? Hr : c ? Hr[s] || Qr(s, {}) : (Hr[s] || {}).prototype) for (r in t) {
if (a = t[r], i = e.dontCallGetSet ? (o = Yr(n, r)) && o.value : n[r], !Zr(l ? r : s + (c ? "." : "#") + r, e.forced) && void 0 !== i) {
if (g(a) == g(i)) continue;
$r(a, i)
}
(e.sham || i && i.sham) && Xr(a, "sham", !0), Jr(n, r, a, e)
}
}, ti = Xe, ni = te, ri = qe, ii = !_(function () {
function e() {
}
return e.prototype.constructor = null, Object.getPrototypeOf(new e) !== e.prototype
}), ai = wn("IE_PROTO"), oi = Object, si = oi.prototype, li = ii ? oi.getPrototypeOf : function (e) {
var t = ri(e);
if (ti(t, ai)) return t[ai];
var n = t.constructor;
return ni(n) && t instanceof n ? n.prototype : t instanceof oi ? si : null
}, ci = te, ui = String, di = TypeError, hi = G, pi = Bt, fi = function (e) {
if ("object" == g(e) || ci(e)) return e;
throw di("Can't set " + ui(e) + " as a prototype")
}, mi = Object.setPrototypeOf || ("__proto__" in {} ? function () {
var e, t = !1, n = {};
try {
(e = hi(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set))(n, []), t = n instanceof Array
} catch (e) {
}
return function (n, r) {
return pi(n), fi(r), t ? e(n, r) : n.__proto__ = r, n
}
}() : void 0), vi = {}, gi = kr, yi = xr, bi = k, wi = Wt, Si = Rt, _i = Bt, ki = ee,
xi = Object.keys || function (e) {
return gi(e, yi)
};
vi.f = bi && !wi ? Object.defineProperties : function (e, t) {
_i(e);
for (var n, r = ki(t), i = xi(t), a = i.length, o = 0; a > o;) Si.f(e, n = i[o++], r[n]);
return e
};
var Pi, Ci = oe("document", "documentElement"), Ai = Bt, Ti = vi, Ei = xr, Di = Sn, Ii = Ci, Li = xt,
Oi = wn("IE_PROTO"), Mi = function () {
}, Ni = function (e) {
return "<script>" + e + "<\/script>"
}, Ri = function (e) {
e.write(Ni("")), e.close();
var t = e.parentWindow.Object;
return e = null, t
}, Wi = function () {
try {
Pi = new ActiveXObject("htmlfile")
} catch (e) {
}
var e, t;
Wi = "undefined" != typeof document ? document.domain && Pi ? Ri(Pi) : ((t = Li("iframe")).style.display = "none", Ii.appendChild(t), t.src = String("javascript:"), (e = t.contentWindow.document).open(), e.write(Ni("document.F=Object")), e.close(), e.F) : Ri(Pi);
for (var n = Ei.length; n--;) delete Wi.prototype[Ei[n]];
return Wi()
};
Di[Oi] = !0;
var Vi = Object.create || function (e, t) {
var n;
return null !== e ? (Mi.prototype = Ai(e), n = new Mi, Mi.prototype = null, n[Oi] = e) : n = Wi(), void 0 === t ? n : Ti.f(n, t)
}, Fi = Error, Gi = G("".replace), Bi = String(Fi("zxcasd").stack), Ki = /\n\s*at [^:]*:[^\n]*/, ji = Ki.test(Bi),
zi = re, Ui = $t, qi = De, Hi = x, Yi = G(G.bind), Xi = function (e, t) {
return qi(e), void 0 === t ? e : Hi ? Yi(e, t) : function () {
return e.apply(t, arguments)
}
}, Ji = {}, Qi = Ji, $i = ut("iterator"), Zi = Array.prototype, ea = {};
ea[ut("toStringTag")] = "z";
var ta = "[object z]" === String(ea), na = ta, ra = te, ia = z, aa = ut("toStringTag"), oa = Object,
sa = "Arguments" == ia(function () {
return arguments
}()), la = na ? ia : function (e) {
var t, n, r;
return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (n = function (e, t) {
try {
return e[t]
} catch (e) {
}
}(t = oa(e), aa)) ? n : sa ? ia(t) : "Object" == (r = ia(t)) && ra(t.callee) ? "Arguments" : r
}, ca = la, ua = Le, da = Ji, ha = ut("iterator"), pa = function (e) {
if (void 0 != e) return ua(e, ha) || ua(e, "@@iterator") || da[ca(e)]
}, fa = A, ma = De, va = Bt, ga = Ce, ya = pa, ba = TypeError, wa = A, Sa = Bt, _a = Le, ka = Xi, xa = A, Pa = Bt,
Ca = Ce, Aa = function (e) {
return void 0 !== e && (Qi.Array === e || Zi[$i] === e)
}, Ta = pr, Ea = se, Da = function (e, t) {
var n = arguments.length < 2 ? ya(e) : t;
if (ma(n)) return va(fa(n, e));
throw ba(ga(e) + " is not iterable")
}, Ia = pa, La = function (e, t, n) {
var r, i;
Sa(e);
try {
if (!(r = _a(e, "return"))) {
if ("throw" === t) throw n;
return n
}
r = wa(r, e)
} catch (e) {
i = !0, r = e
}
if ("throw" === t) throw n;
if (i) throw r;
return Sa(r), n
}, Oa = TypeError, Ma = function (e, t) {
this.stopped = e, this.result = t
}, Na = Ma.prototype, Ra = function (e, t, n) {
var r, i, a, o, s, l, c, u = n && n.that, d = !(!n || !n.AS_ENTRIES), h = !(!n || !n.IS_ITERATOR),
p = !(!n || !n.INTERRUPTED), f = ka(t, u), m = function (e) {
return r && La(r, "normal", e), new Ma(!0, e)
}, v = function (e) {
return d ? (Pa(e), p ? f(e[0], e[1], m) : f(e[0], e[1])) : p ? f(e, m) : f(e)
};
if (h) r = e; else {
if (!(i = Ia(e))) throw Oa(Ca(e) + " is not iterable");
if (Aa(i)) {
for (a = 0, o = Ta(e); o > a; a++) if ((s = v(e[a])) && Ea(Na, s)) return s;
return new Ma(!1)
}
r = Da(e, i)
}
for (l = r.next; !(c = xa(l, r)).done;) {
try {
s = v(c.value)
} catch (e) {
La(r, "throw", e)
}
if ("object" == g(s) && s && Ea(Na, s)) return s
}
return new Ma(!1)
}, Wa = la, Va = String, Fa = function (e) {
if ("Symbol" === Wa(e)) throw TypeError("Cannot convert a Symbol value to a string");
return Va(e)
}, Ga = Fa, Ba = M, Ka = ei, ja = se, za = li, Ua = mi, qa = Wr, Ha = Vi, Ya = $t, Xa = M, Ja = function (e, t) {
if (ji && "string" == typeof e && !Fi.prepareStackTrace) for (; t--;) e = Gi(e, Ki, "");
return e
}, Qa = function (e, t) {
zi(t) && "cause" in t && Ui(e, "cause", t.cause)
}, $a = Ra, Za = function (e, t) {
return void 0 === e ? arguments.length < 2 ? "" : t : Ga(e)
}, eo = !_(function () {
var e = Error("a");
return !("stack" in e) || (Object.defineProperty(e, "stack", Ba(1, 7)), 7 !== e.stack)
}), to = ut("toStringTag"), no = Error, ro = [].push, io = function (e, t) {
var n, r = arguments.length > 2 ? arguments[2] : void 0, i = ja(ao, this);
Ua ? n = Ua(new no, i ? za(this) : ao) : (n = i ? this : Ha(ao), Ya(n, to, "Error")), void 0 !== t && Ya(n, "message", Za(t)), eo && Ya(n, "stack", Ja(n.stack, 1)), Qa(n, r);
var a = [];
return $a(e, ro, {that: a}), Ya(n, "errors", a), n
};
Ua ? Ua(io, no) : qa(io, no, {name: !0});
var ao = io.prototype = Ha(no.prototype, {constructor: Xa(1, io), message: Xa(1, ""), name: Xa(1, "AggregateError")});
Ka({global: !0, constructor: !0, arity: 2}, {AggregateError: io});
var oo = ut, so = Vi, lo = Rt.f, co = oo("unscopables"), uo = Array.prototype;
void 0 == uo[co] && lo(uo, co, {configurable: !0, value: so(null)});
var ho, po, fo, mo = _, vo = te, go = li, yo = tr, bo = ut("iterator"), wo = !1;
[].keys && ("next" in (fo = [].keys()) ? (po = go(go(fo))) !== Object.prototype && (ho = po) : wo = !0), (void 0 == ho || mo(function () {
var e = {};
return ho[bo].call(e) !== e
})) && (ho = {}), vo(ho[bo]) || yo(ho, bo, function () {
return this
});
var So = {IteratorPrototype: ho, BUGGY_SAFARI_ITERATORS: wo}, _o = Rt.f, ko = Xe, xo = ut("toStringTag"),
Po = function (e, t, n) {
e && !n && (e = e.prototype), e && !ko(e, xo) && _o(e, xo, {configurable: !0, value: t})
}, Co = So.IteratorPrototype, Ao = Vi, To = M, Eo = Po, Do = Ji, Io = function () {
return this
}, Lo = ei, Oo = A, Mo = te, No = function (e, t, n, r) {
var i = t + " Iterator";
return e.prototype = Ao(Co, {next: To(+!r, n)}), Eo(e, i, !1), Do[i] = Io, e
}, Ro = li, Wo = mi, Vo = Po, Fo = $t, Go = tr, Bo = Ji, Ko = on.PROPER, jo = on.CONFIGURABLE,
zo = So.IteratorPrototype, Uo = So.BUGGY_SAFARI_ITERATORS, qo = ut("iterator"), Ho = function () {
return this
}, Yo = function (e, t, n, r, i, a, o) {
No(n, t, r);
var s, l, c, u = function (e) {
if (e === i && m) return m;
if (!Uo && e in p) return p[e];
switch (e) {
case"keys":
case"values":
case"entries":
return function () {
return new n(this, e)
}
}
return function () {
return new n(this)
}
}, d = t + " Iterator", h = !1, p = e.prototype, f = p[qo] || p["@@iterator"] || i && p[i], m = !Uo && f || u(i),
v = "Array" == t && p.entries || f;
if (v && (s = Ro(v.call(new e))) !== Object.prototype && s.next && (Ro(s) !== zo && (Wo ? Wo(s, zo) : Mo(s[qo]) || Go(s, qo, Ho)), Vo(s, d, !0)), Ko && "values" == i && f && "values" !== f.name && (jo ? Fo(p, "name", "values") : (h = !0, m = function () {
return Oo(f, this)
})), i) if (l = {
values: u("values"),
keys: a ? m : u("keys"),
entries: u("entries")
}, o) for (c in l) !Uo && !h && c in p || Go(p, c, l[c]); else Lo({target: t, proto: !0, forced: Uo || h}, l);
return p[qo] !== m && Go(p, qo, m, {name: i}), Bo[t] = m, l
}, Xo = ee, Jo = function (e) {
uo[co][e] = !0
}, Qo = Ji, $o = Vn, Zo = Rt.f, es = Yo, ts = k, ns = $o.set, rs = $o.getterFor("Array Iterator");
es(Array, "Array", function (e, t) {
ns(this, {type: "Array Iterator", target: Xo(e), index: 0, kind: t})
}, function () {
var e = rs(this), t = e.target, n = e.kind, r = e.index++;
return !t || r >= t.length ? (e.target = void 0, {value: void 0, done: !0}) : "keys" == n ? {
value: r,
done: !1
} : "values" == n ? {value: t[r], done: !1} : {value: [r, t[r]], done: !1}
}, "values");
var is = Qo.Arguments = Qo.Array;
if (Jo("keys"), Jo("values"), Jo("entries"), ts && "values" !== is.name) try {
Zo(is, "name", {value: "values"})
} catch (e) {
}
var as = la, os = ta ? {}.toString : function () {
return "[object " + as(this) + "]"
};
ta || tr(Object.prototype, "toString", os, {unsafe: !0});
var ss = "process" == z(w.process), ls = oe, cs = Rt, us = k, ds = ut("species"), hs = se, ps = TypeError, fs = G,
ms = _, vs = te, gs = la, ys = pn, bs = function () {
}, ws = [], Ss = oe("Reflect", "construct"), _s = /^\s*(?:class|function)\b/, ks = fs(_s.exec), xs = !_s.exec(bs),
Ps = function (e) {
if (!vs(e)) return !1;
try {
return Ss(bs, ws, e), !0
} catch (e) {
return !1
}
}, Cs = function (e) {
if (!vs(e)) return !1;
switch (gs(e)) {
case"AsyncFunction":
case"GeneratorFunction":
case"AsyncGeneratorFunction":
return !1
}
try {
return xs || !!ks(_s, ys(e))
} catch (e) {
return !0
}
};
Cs.sham = !0;
var As, Ts, Es, Ds, Is = !Ss || ms(function () {
var e;
return Ps(Ps.call) || !Ps(Object) || !Ps(function () {
e = !0
}) || e
}) ? Cs : Ps, Ls = Ce, Os = TypeError, Ms = Bt, Ns = function (e) {
if (Is(e)) return e;
throw Os(Ls(e) + " is not a constructor")
}, Rs = ut("species"), Ws = function (e, t) {
var n, r = Ms(e).constructor;
return void 0 === r || void 0 == (n = Ms(r)[Rs]) ? t : Ns(n)
}, Vs = x, Fs = Function.prototype, Gs = Fs.apply, Bs = Fs.call,
Ks = "object" == ("undefined" == typeof Reflect ? "undefined" : g(Reflect)) && Reflect.apply || (Vs ? Bs.bind(Gs) : function () {
return Bs.apply(Gs, arguments)
}), js = G([].slice), zs = TypeError, Us = /(?:ipad|iphone|ipod).*applewebkit/i.test(le), qs = w, Hs = Ks, Ys = Xi,
Xs = te, Js = Xe, Qs = _, $s = Ci, Zs = js, el = xt, tl = function (e, t) {
if (e < t) throw zs("Not enough arguments");
return e
}, nl = Us, rl = ss, il = qs.setImmediate, al = qs.clearImmediate, ol = qs.process, sl = qs.Dispatch,
ll = qs.Function, cl = qs.MessageChannel, ul = qs.String, dl = 0, hl = {};
try {
As = qs.location
} catch (e) {
}
var pl = function (e) {
if (Js(hl, e)) {
var t = hl[e];
delete hl[e], t()
}
}, fl = function (e) {
return function () {
pl(e)
}
}, ml = function (e) {
pl(e.data)
}, vl = function (e) {
qs.postMessage(ul(e), As.protocol + "//" + As.host)
};
il && al || (il = function (e) {
tl(arguments.length, 1);
var t = Xs(e) ? e : ll(e), n = Zs(arguments, 1);
return hl[++dl] = function () {
Hs(t, void 0, n)
}, Ts(dl), dl
}, al = function (e) {
delete hl[e]
}, rl ? Ts = function (e) {
ol.nextTick(fl(e))
} : sl && sl.now ? Ts = function (e) {
sl.now(fl(e))
} : cl && !nl ? (Ds = (Es = new cl).port2, Es.port1.onmessage = ml, Ts = Ys(Ds.postMessage, Ds)) : qs.addEventListener && Xs(qs.postMessage) && !qs.importScripts && As && "file:" !== As.protocol && !Qs(vl) ? (Ts = vl, qs.addEventListener("message", ml, !1)) : Ts = "onreadystatechange" in el("script") ? function (e) {
$s.appendChild(el("script")).onreadystatechange = function () {
$s.removeChild(this), pl(e)
}
} : function (e) {
setTimeout(fl(e), 0)
});
var gl, yl, bl, wl, Sl, _l, kl, xl, Pl = {set: il, clear: al}, Cl = w,
Al = /ipad|iphone|ipod/i.test(le) && void 0 !== Cl.Pebble, Tl = /web0s(?!.*chrome)/i.test(le), El = w, Dl = Xi,
Il = S.f, Ll = Pl.set, Ol = Us, Ml = Al, Nl = Tl, Rl = ss, Wl = El.MutationObserver || El.WebKitMutationObserver,
Vl = El.document, Fl = El.process, Gl = El.Promise, Bl = Il(El, "queueMicrotask"), Kl = Bl && Bl.value;
Kl || (gl = function () {
var e, t;
for (Rl && (e = Fl.domain) && e.exit(); yl;) {
t = yl.fn, yl = yl.next;
try {
t()
} catch (e) {
throw yl ? wl() : bl = void 0, e
}
}
bl = void 0, e && e.enter()
}, Ol || Rl || Nl || !Wl || !Vl ? !Ml && Gl && Gl.resolve ? ((kl = Gl.resolve(void 0)).constructor = Gl, xl = Dl(kl.then, kl), wl = function () {
xl(gl)
}) : Rl ? wl = function () {
Fl.nextTick(gl)
} : (Ll = Dl(Ll, El), wl = function () {
Ll(gl)
}) : (Sl = !0, _l = Vl.createTextNode(""), new Wl(gl).observe(_l, {characterData: !0}), wl = function () {
_l.data = Sl = !Sl
}));
var jl = Kl || function (e) {
var t = {fn: e, next: void 0};
bl && (bl.next = t), yl || (yl = t, wl()), bl = t
}, zl = w, Ul = function (e) {
try {
return {error: !1, value: e()}
} catch (e) {
return {error: !0, value: e}
}
}, ql = function () {
this.head = null, this.tail = null
};
ql.prototype = {
add: function (e) {
var t = {item: e, next: null};
this.head ? this.tail.next = t : this.head = t, this.tail = t
}, get: function () {
var e = this.head;
if (e) return this.head = e.next, this.tail === e && (this.tail = null), e.item
}
};
var Hl = ql, Yl = w.Promise, Xl = w, Jl = Yl, Ql = te, $l = qr, Zl = pn, ec = ut,
tc = "object" == ("undefined" == typeof window ? "undefined" : g(window)) && "object" != ("undefined" == typeof Deno ? "undefined" : g(Deno)),
nc = me;
Jl && Jl.prototype;
var rc = ec("species"), ic = !1, ac = Ql(Xl.PromiseRejectionEvent), oc = {
CONSTRUCTOR: $l("Promise", function () {
var e = Zl(Jl), t = e !== String(Jl);
if (!t && 66 === nc) return !0;
if (nc >= 51 && /native code/.test(e)) return !1;
var n = new Jl(function (e) {
e(1)
}), r = function (e) {
e(function () {
}, function () {
})
};
return (n.constructor = {})[rc] = r, !(ic = n.then(function () {
}) instanceof r) || !t && tc && !ac
}), REJECTION_EVENT: ac, SUBCLASSING: ic
}, sc = {}, lc = De;
sc.f = function (e) {
return new function (e) {
var t, n;
this.promise = new e(function (e, r) {
if (void 0 !== t || void 0 !== n) throw TypeError("Bad Promise constructor");
t = e, n = r
}), this.resolve = lc(t), this.reject = lc(n)
}(e)
};
var cc, uc, dc, hc = ei, pc = ss, fc = w, mc = A, vc = tr, gc = mi, yc = Po, bc = function (e) {
var t = ls(e), n = cs.f;
us && t && !t[ds] && n(t, ds, {
configurable: !0, get: function () {
return this
}
})
}, wc = De, Sc = te, _c = re, kc = function (e, t) {
if (hs(t, e)) return e;
throw ps("Incorrect invocation")
}, xc = Ws, Pc = Pl.set, Cc = jl, Ac = function (e, t) {
var n = zl.console;
n && n.error && (1 == arguments.length ? n.error(e) : n.error(e, t))
}, Tc = Ul, Ec = Hl, Dc = Vn, Ic = Yl, Lc = sc, Oc = oc.CONSTRUCTOR, Mc = oc.REJECTION_EVENT, Nc = oc.SUBCLASSING,
Rc = Dc.getterFor("Promise"), Wc = Dc.set, Vc = Ic && Ic.prototype, Fc = Ic, Gc = Vc, Bc = fc.TypeError,
Kc = fc.document, jc = fc.process, zc = Lc.f, Uc = zc, qc = !!(Kc && Kc.createEvent && fc.dispatchEvent),
Hc = function (e) {
var t;
return !(!_c(e) || !Sc(t = e.then)) && t
}, Yc = function (e, t) {
var n, r, i, a = t.value, o = 1 == t.state, s = o ? e.ok : e.fail, l = e.resolve, c = e.reject, u = e.domain;
try {
s ? (o || (2 === t.rejection && Zc(t), t.rejection = 1), !0 === s ? n = a : (u && u.enter(), n = s(a), u && (u.exit(), i = !0)), n === e.promise ? c(Bc("Promise-chain cycle")) : (r = Hc(n)) ? mc(r, n, l, c) : l(n)) : c(a)
} catch (e) {
u && !i && u.exit(), c(e)
}
}, Xc = function (e, t) {
e.notified || (e.notified = !0, Cc(function () {
for (var n, r = e.reactions; n = r.get();) Yc(n, e);
e.notified = !1, t && !e.rejection && Qc(e)
}))
}, Jc = function (e, t, n) {
var r, i;
qc ? ((r = Kc.createEvent("Event")).promise = t, r.reason = n, r.initEvent(e, !1, !0), fc.dispatchEvent(r)) : r = {
promise: t,
reason: n
}, !Mc && (i = fc["on" + e]) ? i(r) : "unhandledrejection" === e && Ac("Unhandled promise rejection", n)
}, Qc = function (e) {
mc(Pc, fc, function () {
var t, n = e.facade, r = e.value;
if ($c(e) && (t = Tc(function () {
pc ? jc.emit("unhandledRejection", r, n) : Jc("unhandledrejection", n, r)
}), e.rejection = pc || $c(e) ? 2 : 1, t.error)) throw t.value
})
}, $c = function (e) {
return 1 !== e.rejection && !e.parent
}, Zc = function (e) {
mc(Pc, fc, function () {
var t = e.facade;
pc ? jc.emit("rejectionHandled", t) : Jc("rejectionhandled", t, e.value)
})
}, eu = function (e, t, n) {
return function (r) {
e(t, r, n)
}
}, tu = function (e, t, n) {
e.done || (e.done = !0, n && (e = n), e.value = t, e.state = 2, Xc(e, !0))
}, nu = function e(t, n, r) {
if (!t.done) {
t.done = !0, r && (t = r);
try {
if (t.facade === n) throw Bc("Promise can't be resolved itself");
var i = Hc(n);
i ? Cc(function () {
var r = {done: !1};
try {
mc(i, n, eu(e, r, t), eu(tu, r, t))
} catch (e) {
tu(r, e, t)
}
}) : (t.value = n, t.state = 1, Xc(t, !1))
} catch (e) {
tu({done: !1}, e, t)
}
}
};
if (Oc && (Gc = (Fc = function (e) {
kc(this, Gc), wc(e), mc(cc, this);
var t = Rc(this);
try {
e(eu(nu, t), eu(tu, t))
} catch (e) {
tu(t, e)
}
}).prototype, (cc = function (e) {
Wc(this, {
type: "Promise",
done: !1,
notified: !1,
parent: !1,
reactions: new Ec,
rejection: !1,
state: 0,
value: void 0
})
}).prototype = vc(Gc, "then", function (e, t) {
var n = Rc(this), r = zc(xc(this, Fc));
return n.parent = !0, r.ok = !Sc(e) || e, r.fail = Sc(t) && t, r.domain = pc ? jc.domain : void 0, 0 == n.state ? n.reactions.add(r) : Cc(function () {
Yc(r, n)
}), r.promise
}), uc = function () {
var e = new cc, t = Rc(e);
this.promise = e, this.resolve = eu(nu, t), this.reject = eu(tu, t)
}, Lc.f = zc = function (e) {
return e === Fc || void 0 === e ? new uc(e) : Uc(e)
}, Sc(Ic) && Vc !== Object.prototype)) {
dc = Vc.then, Nc || vc(Vc, "then", function (e, t) {
var n = this;
return new Fc(function (e, t) {
mc(dc, n, e, t)
}).then(e, t)
}, {unsafe: !0});
try {
delete Vc.constructor
} catch (e) {
}
gc && gc(Vc, Gc)
}
hc({global: !0, constructor: !0, wrap: !0, forced: Oc}, {Promise: Fc}), yc(Fc, "Promise", !1), bc("Promise");
var ru = ut("iterator"), iu = !1;
try {
var au = 0, ou = {
next: function () {
return {done: !!au++}
}, return: function () {
iu = !0
}
};
ou[ru] = function () {
return this
}, Array.from(ou, function () {
throw 2
})
} catch (e) {
}
var su = Yl, lu = oc.CONSTRUCTOR || !function (e, t) {
if (!t && !iu) return !1;
var n = !1;
try {
var r = {};
r[ru] = function () {
return {
next: function () {
return {done: n = !0}
}
}
}, e(r)
} catch (e) {
}
return n
}(function (e) {
su.all(e).then(void 0, function () {
})
}), cu = A, uu = De, du = sc, hu = Ul, pu = Ra;
ei({target: "Promise", stat: !0, forced: lu}, {
all: function (e) {
var t = this, n = du.f(t), r = n.resolve, i = n.reject, a = hu(function () {
var n = uu(t.resolve), a = [], o = 0, s = 1;
pu(e, function (e) {
var l = o++, c = !1;
s++, cu(n, t, e).then(function (e) {
c || (c = !0, a[l] = e, --s || r(a))
}, i)
}), --s || r(a)
});
return a.error && i(a.value), n.promise
}
});
var fu = ei, mu = oc.CONSTRUCTOR, vu = Yl, gu = oe, yu = te, bu = tr, wu = vu && vu.prototype;
if (fu({target: "Promise", proto: !0, forced: mu, real: !0}, {
catch: function (e) {
return this.then(void 0, e)
}
}), yu(vu)) {
var Su = gu("Promise").prototype.catch;
wu.catch !== Su && bu(wu, "catch", Su, {unsafe: !0})
}
var _u = A, ku = De, xu = sc, Pu = Ul, Cu = Ra;
ei({target: "Promise", stat: !0, forced: lu}, {
race: function (e) {
var t = this, n = xu.f(t), r = n.reject, i = Pu(function () {
var i = ku(t.resolve);
Cu(e, function (e) {
_u(i, t, e).then(n.resolve, r)
})
});
return i.error && r(i.value), n.promise
}
});
var Au = A, Tu = sc;
ei({target: "Promise", stat: !0, forced: oc.CONSTRUCTOR}, {
reject: function (e) {
var t = Tu.f(this);
return Au(t.reject, void 0, e), t.promise
}
});
var Eu = Bt, Du = re, Iu = sc, Lu = function (e, t) {
if (Eu(e), Du(t) && t.constructor === e) return t;
var n = Iu.f(e);
return (0, n.resolve)(t), n.promise
}, Ou = ei, Mu = oc.CONSTRUCTOR, Nu = Lu;
oe("Promise"), Ou({target: "Promise", stat: !0, forced: Mu}, {
resolve: function (e) {
return Nu(this, e)
}
});
var Ru = A, Wu = De, Vu = sc, Fu = Ul, Gu = Ra;
ei({target: "Promise", stat: !0}, {
allSettled: function (e) {
var t = this, n = Vu.f(t), r = n.resolve, i = n.reject, a = Fu(function () {
var n = Wu(t.resolve), i = [], a = 0, o = 1;
Gu(e, function (e) {
var s = a++, l = !1;
o++, Ru(n, t, e).then(function (e) {
l || (l = !0, i[s] = {status: "fulfilled", value: e}, --o || r(i))
}, function (e) {
l || (l = !0, i[s] = {status: "rejected", reason: e}, --o || r(i))
})
}), --o || r(i)
});
return a.error && i(a.value), n.promise
}
});
var Bu = A, Ku = De, ju = oe, zu = sc, Uu = Ul, qu = Ra;
ei({target: "Promise", stat: !0}, {
any: function (e) {
var t = this, n = ju("AggregateError"), r = zu.f(t), i = r.resolve, a = r.reject, o = Uu(function () {
var r = Ku(t.resolve), o = [], s = 0, l = 1, c = !1;
qu(e, function (e) {
var u = s++, d = !1;
l++, Bu(r, t, e).then(function (e) {
d || c || (c = !0, i(e))
}, function (e) {
d || c || (d = !0, o[u] = e, --l || a(new n(o, "No one promise resolved")))
})
}), --l || a(new n(o, "No one promise resolved"))
});
return o.error && a(o.value), r.promise
}
});
var Hu = ei, Yu = Yl, Xu = _, Ju = oe, Qu = te, $u = Ws, Zu = Lu, ed = tr, td = Yu && Yu.prototype;
if (Hu({
target: "Promise", proto: !0, real: !0, forced: !!Yu && Xu(function () {
td.finally.call({
then: function () {
}
}, function () {
})
})
}, {
finally: function (e) {
var t = $u(this, Ju("Promise")), n = Qu(e);
return this.then(n ? function (n) {
return Zu(t, e()).then(function () {
return n
})
} : e, n ? function (n) {
return Zu(t, e()).then(function () {
throw n
})
} : e)
}
}), Qu(Yu)) {
var nd = Ju("Promise").prototype.finally;
td.finally !== nd && ed(td, "finally", nd, {unsafe: !0})
}
var rd = G, id = or, ad = Fa, od = Q, sd = rd("".charAt), ld = rd("".charCodeAt), cd = rd("".slice),
ud = function (e) {
return function (t, n) {
var r, i, a = ad(od(t)), o = id(n), s = a.length;
return o < 0 || o >= s ? e ? "" : void 0 : (r = ld(a, o)) < 55296 || r > 56319 || o + 1 === s || (i = ld(a, o + 1)) < 56320 || i > 57343 ? e ? sd(a, o) : r : e ? cd(a, o, o + 2) : i - 56320 + (r - 55296 << 10) + 65536
}
}, dd = {codeAt: ud(!1), charAt: ud(!0)}.charAt, hd = Fa, pd = Vn, fd = Yo, md = pd.set,
vd = pd.getterFor("String Iterator");
fd(String, "String", function (e) {
md(this, {type: "String Iterator", string: hd(e), index: 0})
}, function () {
var e, t = vd(this), n = t.string, r = t.index;
return r >= n.length ? {value: void 0, done: !0} : (e = dd(n, r), t.index += e.length, {value: e, done: !1})
}), w.Promise;
var gd, yd = "SetParamByName", bd = "WebGetKeyCount", wd = "WebOpenKey", Sd = "WebOpenKeyExt", _d = "WebKeyIsAdmin",
kd = "WebVerifyPin", xd = "WebGetKeySerialNumber", Pd = "WebGetKeyUnit", Cd = "WebGetCertData",
Ad = "WebGetSealCount", Td = "WebGetSealData", Ed = "WebCloseKey", Dd = "WebSign", Id = "printFile",
Ld = "getPrinterNameList", Od = "setNotifyAddress", Md = "InterfaceResultRequest", Nd = "isServiceBusy",
Rd = "https:" === window.location.protocol ? "https://local.kinggrid.com:9582" : "http://127.0.0.1:9581",
Wd = {exports: {}}, Vd = function (e, t) {
return function () {
for (var n = new Array(arguments.length), r = 0; r < n.length; r++) n[r] = arguments[r];
return e.apply(t, n)
}
}, Fd = Vd, Gd = Object.prototype.toString, Bd = (gd = Object.create(null), function (e) {
var t = Gd.call(e);
return gd[t] || (gd[t] = t.slice(8, -1).toLowerCase())
});
function Kd(e) {
return e = e.toLowerCase(), function (t) {
return Bd(t) === e
}
}
function jd(e) {
return Array.isArray(e)
}
function zd(e) {
return void 0 === e
}
var Ud = Kd("ArrayBuffer");
function qd(e) {
return null !== e && "object" === g(e)
}
function Hd(e) {
if ("object" !== Bd(e)) return !1;
var t = Object.getPrototypeOf(e);
return null === t || t === Object.prototype
}
var Yd = Kd("Date"), Xd = Kd("File"), Jd = Kd("Blob"), Qd = Kd("FileList");
function $d(e) {
return "[object Function]" === Gd.call(e)
}
var Zd = Kd("URLSearchParams");
function eh(e, t) {
if (null !== e && void 0 !== e) if ("object" !== g(e) && (e = [e]), jd(e)) for (var n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e); else for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.call(null, e[i], i, e)
}
var th, nh = (th = "undefined" != typeof Uint8Array && Object.getPrototypeOf(Uint8Array), function (e) {
return th && e instanceof th
}), rh = {
isArray: jd,
isArrayBuffer: Ud,
isBuffer: function (e) {
return null !== e && !zd(e) && null !== e.constructor && !zd(e.constructor) && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
},
isFormData: function (e) {
return e && ("function" == typeof FormData && e instanceof FormData || "[object FormData]" === Gd.call(e) || $d(e.toString) && "[object FormData]" === e.toString())
},
isArrayBufferView: function (e) {
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && Ud(e.buffer)
},
isString: function (e) {
return "string" == typeof e
},
isNumber: function (e) {
return "number" == typeof e
},
isObject: qd,
isPlainObject: Hd,
isUndefined: zd,
isDate: Yd,
isFile: Xd,
isBlob: Jd,
isFunction: $d,
isStream: function (e) {
return qd(e) && $d(e.pipe)
},
isURLSearchParams: Zd,
isStandardBrowserEnv: function () {
return ("undefined" == typeof navigator || "ReactNative" !== navigator.product && "NativeScript" !== navigator.product && "NS" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document
},
forEach: eh,
merge: function e() {
var t = {};
function n(n, r) {
Hd(t[r]) && Hd(n) ? t[r] = e(t[r], n) : Hd(n) ? t[r] = e({}, n) : jd(n) ? t[r] = n.slice() : t[r] = n
}
for (var r = 0, i = arguments.length; r < i; r++) eh(arguments[r], n);
return t
},
extend: function (e, t, n) {
return eh(t, function (t, r) {
e[r] = n && "function" == typeof t ? Fd(t, n) : t
}), e
},
trim: function (e) {
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
},
stripBOM: function (e) {
return 65279 === e.charCodeAt(0) && (e = e.slice(1)), e
},
inherits: function (e, t, n, r) {
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, n && Object.assign(e.prototype, n)
},
toFlatObject: function (e, t, n) {
var r, i, a, o = {};
t = t || {};
do {
for (i = (r = Object.getOwnPropertyNames(e)).length; i-- > 0;) o[a = r[i]] || (t[a] = e[a], o[a] = !0);
e = Object.getPrototypeOf(e)
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t
},
kindOf: Bd,
kindOfTest: Kd,
endsWith: function (e, t, n) {
e = String(e), (void 0 === n || n > e.length) && (n = e.length), n -= t.length;
var r = e.indexOf(t, n);
return -1 !== r && r === n
},
toArray: function (e) {
if (!e) return null;
var t = e.length;
if (zd(t)) return null;
for (var n = new Array(t); t-- > 0;) n[t] = e[t];
return n
},
isTypedArray: nh,
isFileList: Qd
}, ih = rh;
function ah(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]")
}
var oh = function (e, t, n) {
if (!t) return e;
var r;
if (n) r = n(t); else if (ih.isURLSearchParams(t)) r = t.toString(); else {
var i = [];
ih.forEach(t, function (e, t) {
null !== e && void 0 !== e && (ih.isArray(e) ? t += "[]" : e = [e], ih.forEach(e, function (e) {
ih.isDate(e) ? e = e.toISOString() : ih.isObject(e) && (e = JSON.stringify(e)), i.push(ah(t) + "=" + ah(e))
}))
}), r = i.join("&")
}
if (r) {
var a = e.indexOf("#");
-1 !== a && (e = e.slice(0, a)), e += (-1 === e.indexOf("?") ? "?" : "&") + r
}
return e
}, sh = rh;
function lh() {
this.handlers = []
}
lh.prototype.use = function (e, t, n) {
return this.handlers.push({
fulfilled: e,
rejected: t,
synchronous: !!n && n.synchronous,
runWhen: n ? n.runWhen : null
}), this.handlers.length - 1
}, lh.prototype.eject = function (e) {
this.handlers[e] && (this.handlers[e] = null)
}, lh.prototype.forEach = function (e) {
sh.forEach(this.handlers, function (t) {
null !== t && e(t)
})
};
var ch = lh, uh = rh, dh = rh;
function hh(e, t, n, r, i) {
Error.call(this), this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), i && (this.response = i)
}
dh.inherits(hh, Error, {
toJSON: function () {
return {
message: this.message,
name: this.name,
description: this.description,
number: this.number,
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
config: this.config,
code: this.code,
status: this.response && this.response.status ? this.response.status : null
}
}
});
var ph = hh.prototype, fh = {};
["ERR_BAD_OPTION_VALUE", "ERR_BAD_OPTION", "ECONNABORTED", "ETIMEDOUT", "ERR_NETWORK", "ERR_FR_TOO_MANY_REDIRECTS", "ERR_DEPRECATED", "ERR_BAD_RESPONSE", "ERR_BAD_REQUEST", "ERR_CANCELED"].forEach(function (e) {
fh[e] = {value: e}
}), Object.defineProperties(hh, fh), Object.defineProperty(ph, "isAxiosError", {value: !0}), hh.from = function (e, t, n, r, i, a) {
var o = Object.create(ph);
return dh.toFlatObject(e, o, function (e) {
return e !== Error.prototype
}), hh.call(o, e.message, t, n, r, i), o.name = e.name, a && Object.assign(o, a), o
};
var mh = hh, vh = {silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1}, gh = rh;
var yh = function (e, t) {
t = t || new FormData;
var n = [];
function r(e) {
return null === e ? "" : gh.isDate(e) ? e.toISOString() : gh.isArrayBuffer(e) || gh.isTypedArray(e) ? "function" == typeof Blob ? new Blob([e]) : Buffer.from(e) : e
}
return function e(i, a) {
if (gh.isPlainObject(i) || gh.isArray(i)) {
if (-1 !== n.indexOf(i)) throw Error("Circular reference detected in " + a);
n.push(i), gh.forEach(i, function (n, i) {
if (!gh.isUndefined(n)) {
var o, s = a ? a + "." + i : i;
if (n && !a && "object" === g(n)) if (gh.endsWith(i, "{}")) n = JSON.stringify(n); else if (gh.endsWith(i, "[]") && (o = gh.toArray(n))) return void o.forEach(function (e) {
!gh.isUndefined(e) && t.append(s, r(e))
});
e(n, s)
}
}), n.pop()
} else t.append(a, r(i))
}(e), t
}, bh = mh, wh = rh, Sh = wh.isStandardBrowserEnv() ? {
write: function (e, t, n, r, i, a) {
var o = [];
o.push(e + "=" + encodeURIComponent(t)), wh.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), wh.isString(r) && o.push("path=" + r), wh.isString(i) && o.push("domain=" + i), !0 === a && o.push("secure"), document.cookie = o.join("; ")
}, read: function (e) {
var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : null
}, remove: function (e) {
this.write(e, "", Date.now() - 864e5)
}
} : {
write: function () {
}, read: function () {
return null
}, remove: function () {
}
}, _h = function (e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)
}, kh = function (e, t) {
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
}, xh = function (e, t) {
return e && !_h(t) ? kh(e, t) : t
}, Ph = rh,
Ch = ["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"],
Ah = rh, Th = Ah.isStandardBrowserEnv() ? function () {
var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
function r(e) {
var r = e;
return t && (n.setAttribute("href", r), r = n.href), n.setAttribute("href", r), {
href: n.href,
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
host: n.host,
search: n.search ? n.search.replace(/^\?/, "") : "",
hash: n.hash ? n.hash.replace(/^#/, "") : "",
hostname: n.hostname,
port: n.port,
pathname: "/" === n.pathname.charAt(0) ? n.pathname : "/" + n.pathname
}
}
return e = r(window.location.href), function (t) {
var n = Ah.isString(t) ? r(t) : t;
return n.protocol === e.protocol && n.host === e.host
}
}() : function () {
return !0
}, Eh = mh;
function Dh(e) {
Eh.call(this, null == e ? "canceled" : e, Eh.ERR_CANCELED), this.name = "CanceledError"
}
rh.inherits(Dh, Eh, {__CANCEL__: !0});
var Ih = Dh, Lh = rh, Oh = function (e, t, n) {
var r = n.config.validateStatus;
n.status && r && !r(n.status) ? t(new bh("Request failed with status code " + n.status, [bh.ERR_BAD_REQUEST, bh.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n)) : e(n)
}, Mh = Sh, Nh = oh, Rh = xh, Wh = function (e) {
var t, n, r, i = {};
return e ? (Ph.forEach(e.split("\n"), function (e) {
if (r = e.indexOf(":"), t = Ph.trim(e.substr(0, r)).toLowerCase(), n = Ph.trim(e.substr(r + 1)), t) {
if (i[t] && Ch.indexOf(t) >= 0) return;
i[t] = "set-cookie" === t ? (i[t] ? i[t] : []).concat([n]) : i[t] ? i[t] + ", " + n : n
}
}), i) : i
}, Vh = Th, Fh = vh, Gh = mh, Bh = Ih, Kh = function (e) {
var t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || ""
}, jh = function (e) {
return new Promise(function (t, n) {
var r, i = e.data, a = e.headers, o = e.responseType;
function s() {
e.cancelToken && e.cancelToken.unsubscribe(r), e.signal && e.signal.removeEventListener("abort", r)
}
Lh.isFormData(i) && Lh.isStandardBrowserEnv() && delete a["Content-Type"];
var l = new XMLHttpRequest;
if (e.auth) {
var c = e.auth.username || "", u = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
a.Authorization = "Basic " + btoa(c + ":" + u)
}
var d = Rh(e.baseURL, e.url);
function h() {
if (l) {
var r = "getAllResponseHeaders" in l ? Wh(l.getAllResponseHeaders()) : null, i = {
data: o && "text" !== o && "json" !== o ? l.response : l.responseText,
status: l.status,
statusText: l.statusText,
headers: r,
config: e,
request: l
};
Oh(function (e) {
t(e), s()
}, function (e) {
n(e), s()
}, i), l = null
}
}
if (l.open(e.method.toUpperCase(), Nh(d, e.params, e.paramsSerializer), !0), l.timeout = e.timeout, "onloadend" in l ? l.onloadend = h : l.onreadystatechange = function () {
l && 4 === l.readyState && (0 !== l.status || l.responseURL && 0 === l.responseURL.indexOf("file:")) && setTimeout(h)
}, l.onabort = function () {
l && (n(new Gh("Request aborted", Gh.ECONNABORTED, e, l)), l = null)
}, l.onerror = function () {
n(new Gh("Network Error", Gh.ERR_NETWORK, e, l, l)), l = null
}, l.ontimeout = function () {
var t = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded", r = e.transitional || Fh;
e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(new Gh(t, r.clarifyTimeoutError ? Gh.ETIMEDOUT : Gh.ECONNABORTED, e, l)), l = null
}, Lh.isStandardBrowserEnv()) {
var p = (e.withCredentials || Vh(d)) && e.xsrfCookieName ? Mh.read(e.xsrfCookieName) : void 0;
p && (a[e.xsrfHeaderName] = p)
}
"setRequestHeader" in l && Lh.forEach(a, function (e, t) {
void 0 === i && "content-type" === t.toLowerCase() ? delete a[t] : l.setRequestHeader(t, e)
}), Lh.isUndefined(e.withCredentials) || (l.withCredentials = !!e.withCredentials), o && "json" !== o && (l.responseType = e.responseType), "function" == typeof e.onDownloadProgress && l.addEventListener("progress", e.onDownloadProgress), "function" == typeof e.onUploadProgress && l.upload && l.upload.addEventListener("progress", e.onUploadProgress), (e.cancelToken || e.signal) && (r = function (e) {
l && (n(!e || e && e.type ? new Bh : e), l.abort(), l = null)
}, e.cancelToken && e.cancelToken.subscribe(r), e.signal && (e.signal.aborted ? r() : e.signal.addEventListener("abort", r))), i || (i = null);
var f = Kh(d);
f && -1 === ["http", "https", "file"].indexOf(f) ? n(new Gh("Unsupported protocol " + f + ":", Gh.ERR_BAD_REQUEST, e)) : l.send(i)
})
}, zh = rh, Uh = function (e, t) {
uh.forEach(e, function (n, r) {
r !== t && r.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[r])
})
}, qh = mh, Hh = yh, Yh = {"Content-Type": "application/x-www-form-urlencoded"};
function Xh(e, t) {
!zh.isUndefined(e) && zh.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t)
}
var Jh, Qh = {
transitional: vh,
adapter: ("undefined" != typeof XMLHttpRequest ? Jh = jh : "undefined" != typeof process && "[object process]" === Object.prototype.toString.call(process) && (Jh = jh), Jh),
transformRequest: [function (e, t) {
if (Uh(t, "Accept"), Uh(t, "Content-Type"), zh.isFormData(e) || zh.isArrayBuffer(e) || zh.isBuffer(e) || zh.isStream(e) || zh.isFile(e) || zh.isBlob(e)) return e;
if (zh.isArrayBufferView(e)) return e.buffer;
if (zh.isURLSearchParams(e)) return Xh(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString();
var n, r = zh.isObject(e), i = t && t["Content-Type"];
if ((n = zh.isFileList(e)) || r && "multipart/form-data" === i) {
var a = this.env && this.env.FormData;
return Hh(n ? {"files[]": e} : e, a && new a)
}
return r || "application/json" === i ? (Xh(t, "application/json"), function (e, t, n) {
if (zh.isString(e)) try {
return (t || JSON.parse)(e), zh.trim(e)
} catch (e) {
if ("SyntaxError" !== e.name) throw e
}
return (n || JSON.stringify)(e)
}(e)) : e
}],
transformResponse: [function (e) {
var t = this.transitional || Qh.transitional, n = t && t.silentJSONParsing, r = t && t.forcedJSONParsing,
i = !n && "json" === this.responseType;
if (i || r && zh.isString(e) && e.length) try {
return JSON.parse(e)
} catch (e) {
if (i) {
if ("SyntaxError" === e.name) throw qh.from(e, qh.ERR_BAD_RESPONSE, this, null, this.response);
throw e
}
}
return e
}],
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {FormData: null},
validateStatus: function (e) {
return e >= 200 && e < 300
},
headers: {common: {Accept: "application/json, text/plain, */*"}}
};
zh.forEach(["delete", "get", "head"], function (e) {
Qh.headers[e] = {}
}), zh.forEach(["post", "put", "patch"], function (e) {
Qh.headers[e] = zh.merge(Yh)
});
var $h = Qh, Zh = rh, ep = $h, tp = function (e) {
return !(!e || !e.__CANCEL__)
}, np = rh, rp = function (e, t, n) {
var r = this || ep;
return Zh.forEach(n, function (n) {
e = n.call(r, e, t)
}), e
}, ip = tp, ap = $h, op = Ih;
function sp(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new op
}
var lp = rh, cp = function (e, t) {
t = t || {};
var n = {};
function r(e, t) {
return lp.isPlainObject(e) && lp.isPlainObject(t) ? lp.merge(e, t) : lp.isPlainObject(t) ? lp.merge({}, t) : lp.isArray(t) ? t.slice() : t
}
function i(n) {
return lp.isUndefined(t[n]) ? lp.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(e[n], t[n])
}
function a(e) {
if (!lp.isUndefined(t[e])) return r(void 0, t[e])
}
function o(n) {
return lp.isUndefined(t[n]) ? lp.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(void 0, t[n])
}
function s(n) {
return n in t ? r(e[n], t[n]) : n in e ? r(void 0, e[n]) : void 0
}
var l = {
url: a,
method: a,
data: a,
baseURL: o,
transformRequest: o,
transformResponse: o,
paramsSerializer: o,
timeout: o,
timeoutMessage: o,
withCredentials: o,
adapter: o,
responseType: o,
xsrfCookieName: o,
xsrfHeaderName: o,
onUploadProgress: o,
onDownloadProgress: o,
decompress: o,
maxContentLength: o,
maxBodyLength: o,
beforeRedirect: o,
transport: o,
httpAgent: o,
httpsAgent: o,
cancelToken: o,
socketPath: o,
responseEncoding: o,
validateStatus: s
};
return lp.forEach(Object.keys(e).concat(Object.keys(t)), function (e) {
var t = l[e] || i, r = t(e);
lp.isUndefined(r) && t !== s || (n[e] = r)
}), n
}, up = "0.27.2", dp = up, hp = mh, pp = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach(function (e, t) {
pp[e] = function (n) {
return g(n) === e || "a" + (t < 1 ? "n " : " ") + e
}
});
var fp = {};
pp.transitional = function (e, t, n) {
function r(e, t) {
return "[Axios v" + dp + "] Transitional option '" + e + "'" + t + (n ? ". " + n : "")
}
return function (n, i, a) {
if (!1 === e) throw new hp(r(i, " has been removed" + (t ? " in " + t : "")), hp.ERR_DEPRECATED);
return t && !fp[i] && (fp[i] = !0, console.warn(r(i, " has been deprecated since v" + t + " and will be removed in the near future"))), !e || e(n, i, a)
}
};
var mp = rh, vp = oh, gp = ch, yp = function (e) {
return sp(e), e.headers = e.headers || {}, e.data = rp.call(e, e.data, e.headers, e.transformRequest), e.headers = np.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers), np.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (t) {
delete e.headers[t]
}), (e.adapter || ap.adapter)(e).then(function (t) {
return sp(e), t.data = rp.call(e, t.data, t.headers, e.transformResponse), t
}, function (t) {
return ip(t) || (sp(e), t && t.response && (t.response.data = rp.call(e, t.response.data, t.response.headers, e.transformResponse))), Promise.reject(t)
})
}, bp = cp, wp = xh, Sp = {
assertOptions: function (e, t, n) {
if ("object" !== g(e)) throw new hp("options must be an object", hp.ERR_BAD_OPTION_VALUE);
for (var r = Object.keys(e), i = r.length; i-- > 0;) {
var a = r[i], o = t[a];
if (o) {
var s = e[a], l = void 0 === s || o(s, a, e);
if (!0 !== l) throw new hp("option " + a + " must be " + l, hp.ERR_BAD_OPTION_VALUE)
} else if (!0 !== n) throw new hp("Unknown option " + a, hp.ERR_BAD_OPTION)
}
}, validators: pp
}, _p = Sp.validators;
function kp(e) {
this.defaults = e, this.interceptors = {request: new gp, response: new gp}
}
kp.prototype.request = function (e, t) {
"string" == typeof e ? (t = t || {}).url = e : t = e || {}, (t = bp(this.defaults, t)).method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
var n = t.transitional;
void 0 !== n && Sp.assertOptions(n, {
silentJSONParsing: _p.transitional(_p.boolean),
forcedJSONParsing: _p.transitional(_p.boolean),
clarifyTimeoutError: _p.transitional(_p.boolean)
}, !1);
var r = [], i = !0;
this.interceptors.request.forEach(function (e) {
"function" == typeof e.runWhen && !1 === e.runWhen(t) || (i = i && e.synchronous, r.unshift(e.fulfilled, e.rejected))
});
var a, o = [];
if (this.interceptors.response.forEach(function (e) {
o.push(e.fulfilled, e.rejected)
}), !i) {
var s = [yp, void 0];
for (Array.prototype.unshift.apply(s, r), s = s.concat(o), a = Promise.resolve(t); s.length;) a = a.then(s.shift(), s.shift());
return a
}
for (var l = t; r.length;) {
var c = r.shift(), u = r.shift();
try {
l = c(l)
} catch (e) {
u(e);
break
}
}
try {
a = yp(l)
} catch (e) {
return Promise.reject(e)
}
for (; o.length;) a = a.then(o.shift(), o.shift());
return a
}, kp.prototype.getUri = function (e) {
e = bp(this.defaults, e);
var t = wp(e.baseURL, e.url);
return vp(t, e.params, e.paramsSerializer)
}, mp.forEach(["delete", "get", "head", "options"], function (e) {
kp.prototype[e] = function (t, n) {
return this.request(bp(n || {}, {method: e, url: t, data: (n || {}).data}))
}
}), mp.forEach(["post", "put", "patch"], function (e) {
function t(t) {
return function (n, r, i) {
return this.request(bp(i || {}, {
method: e,
headers: t ? {"Content-Type": "multipart/form-data"} : {},
url: n,
data: r
}))
}
}
kp.prototype[e] = t(), kp.prototype[e + "Form"] = t(!0)
});
var xp = kp, Pp = Ih;
function Cp(e) {
if ("function" != typeof e) throw new TypeError("executor must be a function.");
var t;
this.promise = new Promise(function (e) {
t = e
});
var n = this;
this.promise.then(function (e) {
if (n._listeners) {
var t, r = n._listeners.length;
for (t = 0; t < r; t++) n._listeners[t](e);
n._listeners = null
}
}), this.promise.then = function (e) {
var t, r = new Promise(function (e) {
n.subscribe(e), t = e
}).then(e);
return r.cancel = function () {
n.unsubscribe(t)
}, r
}, e(function (e) {
n.reason || (n.reason = new Pp(e), t(n.reason))
})
}
Cp.prototype.throwIfRequested = function () {
if (this.reason) throw this.reason
}, Cp.prototype.subscribe = function (e) {
this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [e]
}, Cp.prototype.unsubscribe = function (e) {
if (this._listeners) {
var t = this._listeners.indexOf(e);
-1 !== t && this._listeners.splice(t, 1)
}
}, Cp.source = function () {
var e;
return {
token: new Cp(function (t) {
e = t
}), cancel: e
}
};
var Ap = Cp, Tp = rh, Ep = rh, Dp = Vd, Ip = xp, Lp = cp;
var Op = function e(t) {
var n = new Ip(t), r = Dp(Ip.prototype.request, n);
return Ep.extend(r, Ip.prototype, n), Ep.extend(r, n), r.create = function (n) {
return e(Lp(t, n))
}, r
}($h);
Op.Axios = Ip, Op.CanceledError = Ih, Op.CancelToken = Ap, Op.isCancel = tp, Op.VERSION = up, Op.toFormData = yh, Op.AxiosError = mh, Op.Cancel = Op.CanceledError, Op.all = function (e) {
return Promise.all(e)
}, Op.spread = function (e) {
return function (t) {
return e.apply(null, t)
}
}, Op.isAxiosError = function (e) {
return Tp.isObject(e) && !0 === e.isAxiosError
}, Wd.exports = Op, Wd.exports.default = Op;
var Mp, Np, Rp = Wd.exports, Wp = function () {
function e(t) {
var n, r, i, a;
f(this, e), this.instance = Rp.create(t), this.interceptorsObj = t.interceptors, this.instance.interceptors.request.use(function (e) {
return e
}, function (e) {
return e
}), this.instance.interceptors.request.use(null === (n = this.interceptorsObj) || void 0 === n ? void 0 : n.requestInterceptors, null === (r = this.interceptorsObj) || void 0 === r ? void 0 : r.requestInterceptorsCatch), this.instance.interceptors.response.use(null === (i = this.interceptorsObj) || void 0 === i ? void 0 : i.responseInterceptors, null === (a = this.interceptorsObj) || void 0 === a ? void 0 : a.responseInterceptorsCatch), this.instance.interceptors.response.use(function (e) {
return e
}, function (e) {
return e
})
}
return v(e, [{
key: "request", value: function (e) {
var t = this;
return new Promise(function (n, r) {
var i;
null !== (i = e.interceptors) && void 0 !== i && i.requestInterceptors && (e = e.interceptors.requestInterceptors(e)), t.instance.request(e).then(function (t) {
var r;
null !== (r = e.interceptors) && void 0 !== r && r.responseInterceptors && (t = e.interceptors.responseInterceptors(t)), n(t)
}).catch(function (e) {
r(e)
})
})
}
}]), e
}(), Vp = {
method: "POST", timeout: 12e4, interceptors: {
requestInterceptors: function (e) {
return e
}, responseInterceptors: function (e) {
return e
}, responseInterceptorsCatch: function (e) {
switch (e.message) {
case"Network Error":
e.message = "请先安装客户端";
break;
case"timeout of ".concat(12e4, "ms exceeded"):
e.message = "".concat("金格组件服务异常:", "请求超时");
break;
default:
e.message = "".concat("金格组件服务异常:").concat(e.message)
}
throw e
}
}
}, Fp = new Wp(h({baseURL: Rd, headers: {"Content-Type": "text/plain;charset=UTF-8"}}, Vp)), Gp = new Wp(h({
baseURL: "http://127.0.0.1:7089/components",
headers: {"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"}
}, Vp)), Bp = (Mp = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, Fp.request(t);
case 2:
if (!(n = e.sent).isAxiosError) {
e.next = 7;
break
}
throw n;
case 7:
return e.abrupt("return", n.data);
case 8:
case"end":
return e.stop()
}
}, e)
})), function (e) {
return Mp.apply(this, arguments)
}), Kp = (Np = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, Gp.request(t);
case 2:
if (!(n = e.sent).isAxiosError) {
e.next = 7;
break
}
throw n;
case 7:
return e.abrupt("return", n.data);
case 8:
case"end":
return e.stop()
}
}, e)
})), function (e) {
return Np.apply(this, arguments)
}), jp = function () {
function e(t) {
var n = t.onError;
f(this, e), this.caller = "", this.keyHandle = "", this.onError = n, this.userCode = ""
}
return v(e, [{
key: "invoke", value: function () {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
var r = this;
return new Promise(function (e, n) {
var i = [];
if (t.length > 1) for (var a = 1; a < t.length; a++) {
var o = t[a], s = g(o), l = null != o ? o.toString() : "null", c = null;
switch (s) {
case"boolean":
c = {type: "BOOL", value: l};
break;
case"number":
c = {type: "LONG", value: l};
break;
default:
c = {type: "BSTR", value: l}
}
i.push(c)
}
var u = {MethodCall: {caller: r.caller, function: t[0], params: i}};
r.userCode && (u.usercode = r.userCode);
var d = JSON.stringify(u), h = "value=".concat(d, "&t=").concat((new Date).getTime());
"WebCloseKey" === t[0] && (r.keyHandle = ""), Bp({url: "/MethodCall", data: h}).then(function (t) {
"none" !== t.value ? e(t.value) : n(new Error("".concat("金格组件服务异常:", "请求失败")))
})
})
}
}]), e
}(), zp = function (e) {
i(n, jp);
var t = o(n);
function n() {
return f(this, n), t.apply(this, arguments)
}
return v(n)
}(), Up = function (e) {
i(n, jp);
var t = o(n);
function n(e) {
var r, i = e.onError;
return f(this, n), (r = t.call(this, {onError: i})).progid = "ISIGNATURESERVER.iSignatureServerCtrl.1", r.interface = "2015DB05-ABB5-4924-A66FA88D7919C782", r
}
return v(n, [{
key: "init", value: function () {
var e = u(l().mark(function e() {
var t, n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return this.caller = "", e.prev = 1, t = "value=".concat(JSON.stringify({
GetInterface: {
progid: this.progid,
interface: this.interface
}
}), "&t=").concat((new Date).getTime()), e.next = 5, Bp({url: "/GetInterface", data: t});
case 5:
if (0 != (null === (n = e.sent) || void 0 === n ? void 0 : n.value)) {
e.next = 10;
break
}
throw new Error("ISIGNATURESERVER.iSignatureServerCtrl.1 控件初始化失败");
case 10:
return this.caller = n.value, e.abrupt("return", this.caller);
case 12:
e.next = 17;
break;
case 14:
return e.prev = 14, e.t0 = e.catch(1), e.abrupt("return", this.onError(e.t0));
case 17:
case"end":
return e.stop()
}
}, e, this, [[1, 14]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "setParam", value: function () {
var e = u(l().mark(function e(t, n) {
var r;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(yd, t, n);
case 3:
if (!(r = e.sent) || !r.result) {
e.next = 8;
break
}
return e.abrupt("return", r.result);
case 8:
return e.next = 10, this.WebGetLastErrorMsg("设置参数失败");
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function (t, n) {
return e.apply(this, arguments)
}
}()
}, {
key: "getKeyCount", value: function () {
var e = u(l().mark(function e() {
var t, n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(bd);
case 3:
if (t = e.sent, 0 !== (n = Number(t))) {
e.next = 9;
break
}
throw new Error("您没有插密钥盘,请插入密钥盘后重试。");
case 9:
if (!(n > 0)) {
e.next = 13;
break
}
return e.abrupt("return", n);
case 13:
return e.next = 15, this.WebGetLastErrorMsg("获取密钥盘数量失败");
case 15:
e.next = 20;
break;
case 17:
return e.prev = 17, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 20:
case"end":
return e.stop()
}
}, e, this, [[0, 17]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "openKey", value: function () {
var e = u(l().mark(function e() {
var t, n, r = arguments;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return t = r.length > 0 && void 0 !== r[0] ? r[0] : 0, this.keyHandle = "", e.prev = 2, e.next = 5, this.invoke(wd, t);
case 5:
if (!(n = e.sent)) {
e.next = 11;
break
}
return this.keyHandle = n, e.abrupt("return", this.keyHandle);
case 11:
return e.next = 13, this.WebGetLastErrorMsg("开启密钥盘失败");
case 13:
e.next = 18;
break;
case 15:
return e.prev = 15, e.t0 = e.catch(2), e.abrupt("return", this.onError(e.t0));
case 18:
case"end":
return e.stop()
}
}, e, this, [[2, 15]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "openKeyExt", value: function () {
var e = u(l().mark(function e() {
var t, n, r = arguments;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return t = r.length > 0 && void 0 !== r[0] ? r[0] : 0, this.keyHandle = "", e.prev = 2, e.next = 5, this.invoke(Sd, t);
case 5:
if (!(n = e.sent)) {
e.next = 11;
break
}
return this.keyHandle = n, e.abrupt("return", this.keyHandle);
case 11:
return e.next = 13, this.WebGetLastErrorMsg("开启密钥盘失败");
case 13:
e.next = 18;
break;
case 15:
return e.prev = 15, e.t0 = e.catch(2), e.abrupt("return", this.onError(e.t0));
case 18:
case"end":
return e.stop()
}
}, e, this, [[2, 15]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "closeKey", value: function () {
var e = u(l().mark(function e() {
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Ed, this.keyHandle);
case 3:
if ("0" !== e.sent) {
e.next = 8;
break
}
return e.abrupt("return", !0);
case 8:
return e.next = 10, this.WebGetLastErrorMsg("关闭密钥盘失败");
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "verifyPin", value: function () {
var e = u(l().mark(function e(t) {
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
if (e.prev = 0, t) {
e.next = 5;
break
}
throw new Error("密钥盘密码不能为空");
case 5:
return e.next = 7, this.invoke(kd, this.keyHandle, t);
case 7:
if ("0" !== e.sent) {
e.next = 12;
break
}
return e.abrupt("return", !0);
case 12:
return e.next = 14, this.WebGetLastErrorMsg("验章密码失败");
case 14:
e.next = 19;
break;
case 16:
return e.prev = 16, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 19:
case"end":
return e.stop()
}
}, e, this, [[0, 16]])
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "isAdmin", value: function () {
var e = u(l().mark(function e() {
var t;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(_d, this.keyHandle);
case 3:
if ("true" !== (t = e.sent)) {
e.next = 8;
break
}
return e.abrupt("return", !0);
case 8:
if ("false" !== t) {
e.next = 12;
break
}
return e.abrupt("return", !1);
case 12:
return e.next = 14, this.WebGetLastErrorMsg("检测密钥盘用户身份失败");
case 14:
e.next = 19;
break;
case 16:
return e.prev = 16, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 19:
case"end":
return e.stop()
}
}, e, this, [[0, 16]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "getKeySN", value: function () {
var e = u(l().mark(function e() {
var t;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(xd, this.keyHandle);
case 3:
if (!(t = e.sent) || "none" === t) {
e.next = 8;
break
}
return e.abrupt("return", t);
case 8:
return e.next = 10, this.WebGetLastErrorMsg("获取密钥盘序列号失败");
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "getUnitName", value: function () {
var e = u(l().mark(function e() {
var t;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Pd, this.keyHandle);
case 3:
if (!(t = e.sent) || "none" === t) {
e.next = 8;
break
}
return e.abrupt("return", t);
case 8:
return e.next = 10, this.WebGetLastErrorMsg("获取用章单位失败");
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "getCertData", value: function () {
var e = u(l().mark(function e() {
var t;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Cd, this.keyHandle, 0);
case 3:
if (!(t = e.sent) || "none" === t) {
e.next = 8;
break
}
return e.abrupt("return", Promise.resolve(t));
case 8:
return e.next = 10, this.WebGetLastErrorMsg("获取证书失败");
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "getSealCount", value: function () {
var e = u(l().mark(function e() {
var t, n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Ad, this.keyHandle);
case 3:
if (t = e.sent, n = Number(t), isNaN(n)) {
e.next = 13;
break
}
if (!(n > 0)) {
e.next = 10;
break
}
return e.abrupt("return", n);
case 10:
throw new Error("密钥盘中不存在印章");
case 11:
e.next = 15;
break;
case 13:
return e.next = 15, this.WebGetLastErrorMsg("获取印章数量失败");
case 15:
e.next = 20;
break;
case 17:
return e.prev = 17, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 20:
case"end":
return e.stop()
}
}, e, this, [[0, 17]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "getSealData", value: function () {
var e = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Td, this.keyHandle, t);
case 3:
if (!(n = e.sent) || "none" === n || "-1" === n) {
e.next = 8;
break
}
return e.abrupt("return", n);
case 8:
return e.next = 10, this.WebGetLastErrorMsg("获取印章失败(印章索引:".concat(t, ""));
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "sign", value: function () {
var e = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Dd, this.keyHandle, t);
case 3:
if (!(n = e.sent) || "none" === n || "-1" === n) {
e.next = 8;
break
}
return e.abrupt("return", n);
case 8:
return e.next = 10, this.WebGetLastErrorMsg("数据签名失败");
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "WebGetDefContainerName", value: function () {
var e = u(l().mark(function e() {
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.abrupt("return", Promise.resolve("Kinggrid"));
case 1:
case"end":
return e.stop()
}
}, e)
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "WebGetLastErrorMsg", value: function () {
var e = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, this.invoke("WebGetLastErrorMsg");
case 2:
if (!(n = e.sent) || "none" === n) {
e.next = 7;
break
}
throw new Error(n);
case 7:
throw new Error(t);
case 8:
case"end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "getSeals", value: function () {
var e = u(l().mark(function e(t) {
var n, r, i, a, o, s, c, u, d;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
if (n = {keySN: "", unitName: "", cert: "", seals: []}, this.caller) {
e.next = 4;
break
}
return e.next = 4, this.init();
case 4:
return e.next = 6, this.setParam("APPCODE", "");
case 6:
if (e.sent) {
e.next = 9;
break
}
return e.abrupt("return");
case 9:
return e.next = 11, this.getKeyCount();
case 11:
if (r = e.sent) {
e.next = 14;
break
}
return e.abrupt("return");
case 14:
if (!(r > 1)) {
e.next = 16;
break
}
return e.abrupt("return", this.onError(new Error("您插入了不止一把密钥盘,请拔出多余的密钥盘后重试。")));
case 16:
return e.next = 18, this.openKey(0);
case 18:
if (e.sent) {
e.next = 21;
break
}
return e.abrupt("return");
case 21:
return e.next = 23, this.isAdmin();
case 23:
if (!0 !== (i = e.sent)) {
e.next = 26;
break
}
return e.abrupt("return", this.onError(new Error("您插入了不止一把密钥盘,请拔出多余的密钥盘后重试。")));
case 26:
if (!1 !== i) {
e.next = 64;
break
}
return e.next = 29, this.verifyPin(t);
case 29:
if (e.sent) {
e.next = 32;
break
}
return e.abrupt("return");
case 32:
return e.next = 34, this.getKeySN();
case 34:
if (a = e.sent) {
e.next = 37;
break
}
return e.abrupt("return");
case 37:
return n.keySN = a, e.next = 40, this.getUnitName();
case 40:
if (o = e.sent) {
e.next = 43;
break
}
return e.abrupt("return");
case 43:
return n.unitName = o, e.next = 46, this.getCertData();
case 46:
if (s = e.sent) {
e.next = 49;
break
}
return e.abrupt("return");
case 49:
return n.cert = s, e.next = 52, this.getSealCount();
case 52:
if (c = e.sent) {
e.next = 55;
break
}
return e.abrupt("return");
case 55:
u = 0;
case 56:
if (!(u < c)) {
e.next = 64;
break
}
return e.next = 59, this.getSealData(u);
case 59:
d = e.sent, n.seals.push(d);
case 61:
u++, e.next = 56;
break;
case 64:
return e.next = 66, this.closeKey();
case 66:
if (!(n.keySN && n.unitName && n.cert && n.seals.length)) {
e.next = 68;
break
}
return e.abrupt("return", n);
case 68:
case"end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "dataSign", value: function () {
var e = u(l().mark(function e(t, n, r) {
var i, a, o, s, c, u;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
if (i = {cert: "", signedData: ""}, this.caller) {
e.next = 4;
break
}
return e.next = 4, this.init();
case 4:
return e.next = 6, this.setParam("APPCODE", "");
case 6:
if (e.sent) {
e.next = 9;
break
}
return e.abrupt("return");
case 9:
return e.next = 11, this.getKeyCount();
case 11:
if (a = e.sent) {
e.next = 14;
break
}
return e.abrupt("return");
case 14:
if (!(a > 1)) {
e.next = 16;
break
}
return e.abrupt("return", this.onError(new Error("您插入了不止一把密钥盘,请拔出多余的密钥盘后重试。")));
case 16:
return e.next = 18, this.openKey(0);
case 18:
if (e.sent) {
e.next = 21;
break
}
return e.abrupt("return");
case 21:
return e.next = 23, this.isAdmin();
case 23:
if (!0 !== (o = e.sent)) {
e.next = 26;
break
}
return e.abrupt("return", this.onError(new Error("您插入了不止一把密钥盘,请拔出多余的密钥盘后重试。")));
case 26:
if (!1 !== o) {
e.next = 51;
break
}
return e.next = 29, this.verifyPin(t);
case 29:
if (e.sent) {
e.next = 32;
break
}
return e.abrupt("return");
case 32:
return e.next = 34, this.getKeySN();
case 34:
if (s = e.sent) {
e.next = 37;
break
}
return e.abrupt("return");
case 37:
if (n === s) {
e.next = 39;
break
}
return e.abrupt("return", this.onError(new Error("密钥盘已更换,请插入正确的密钥盘后重试。")));
case 39:
return e.next = 41, this.getCertData();
case 41:
if (c = e.sent) {
e.next = 44;
break
}
return e.abrupt("return");
case 44:
return i.cert = c, e.next = 47, this.sign(r);
case 47:
if (u = e.sent) {
e.next = 50;
break
}
return e.abrupt("return");
case 50:
i.signedData = u;
case 51:
return e.next = 53, this.closeKey();
case 53:
if (!i.signedData || !i.cert) {
e.next = 55;
break
}
return e.abrupt("return", i);
case 55:
case"end":
return e.stop()
}
}, e, this)
}));
return function (t, n, r) {
return e.apply(this, arguments)
}
}()
}, {
key: "randomSign", value: function () {
var e = u(l().mark(function e(t, n) {
var r, i, a, o, s;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
if (r = {keySN: "", signedData: ""}, this.caller) {
e.next = 4;
break
}
return e.next = 4, this.init();
case 4:
return e.next = 6, this.setParam("APPCODE", "");
case 6:
if (e.sent) {
e.next = 9;
break
}
return e.abrupt("return");
case 9:
return e.next = 11, this.getKeyCount();
case 11:
if (i = e.sent) {
e.next = 14;
break
}
return e.abrupt("return");
case 14:
if (!(i > 1)) {
e.next = 16;
break
}
return e.abrupt("return", this.onError(new Error("您插入了不止一把密钥盘,请拔出多余的密钥盘后重试。")));
case 16:
return e.next = 18, this.openKey(0);
case 18:
if (e.sent) {
e.next = 21;
break
}
return e.abrupt("return");
case 21:
return e.next = 23, this.isAdmin();
case 23:
if (!0 !== (a = e.sent)) {
e.next = 26;
break
}
return e.abrupt("return", this.onError(new Error("您插入了不止一把密钥盘,请拔出多余的密钥盘后重试。")));
case 26:
if (!1 !== a) {
e.next = 44;
break
}
return e.next = 29, this.verifyPin(t);
case 29:
if (e.sent) {
e.next = 32;
break
}
return e.abrupt("return");
case 32:
return e.next = 34, this.getKeySN();
case 34:
if (o = e.sent) {
e.next = 37;
break
}
return e.abrupt("return");
case 37:
return r.keySN = o, e.next = 40, this.sign(n);
case 40:
if (s = e.sent) {
e.next = 43;
break
}
return e.abrupt("return");
case 43:
r.signedData = s;
case 44:
return e.next = 46, this.closeKey();
case 46:
if (!r.keySN || !r.signedData) {
e.next = 48;
break
}
return e.abrupt("return", r);
case 48:
case"end":
return e.stop()
}
}, e, this)
}));
return function (t, n) {
return e.apply(this, arguments)
}
}()
}]), n
}(), qp = function (e) {
i(n, jp);
var t = o(n);
function n() {
return f(this, n), t.apply(this, arguments)
}
return v(n)
}(), Hp = function (e) {
i(n, jp);
var t = o(n);
function n() {
return f(this, n), t.apply(this, arguments)
}
return v(n)
}(), Yp = function (e) {
i(n, jp);
var t = o(n);
function n() {
return f(this, n), t.apply(this, arguments)
}
return v(n)
}(), Xp = {action: "exe", component: "SRComponentClient"}, Jp = function () {
function e(t) {
var n = t.onError;
f(this, e), this.onError = n
}
return v(e, [{
key: "printFile", value: function () {
var e = u(l().mark(function e(t) {
var n, r, i, a, o, s, c, u, d;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return n = t.fileUrl, r = t.copies, i = t.printerName, a = t.pageArea, o = t.signStatus, s = t.printType, c = t.customParam, u = t.collateCopies, e.next = 3, Kp({
data: h(h({}, Xp), {}, {
interface: Id,
params: {
fileUrl: n,
copies: r,
printerName: i,
pageArea: a,
signsatus: o,
printType: s || 0,
collateCopies: u ? 1 : 0,
customParam: c
}
})
});
case 3:
if (0 !== (d = e.sent).code) {
e.next = 16;
break
}
if (0 !== d.return_data.ret_code) {
e.next = 9;
break
}
return e.abrupt("return", d.return_data || !0);
case 9:
if (5 !== d.return_data.ret_code) {
e.next = 13;
break
}
return e.abrupt("return", d.return_data || !1);
case 13:
return e.abrupt("return", this.onError(new Error(d.return_data.msg || "打印失败")));
case 14:
e.next = 17;
break;
case 16:
return e.abrupt("return", this.onError(new Error(d.msg || "打印失败")));
case 17:
case"end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "getPrinterList", value: function () {
var e = u(l().mark(function e() {
var t;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, Kp({data: h(h({}, Xp), {}, {interface: Ld, params: {}})});
case 2:
if (0 !== (t = e.sent).code) {
e.next = 11;
break
}
if (0 !== t.return_data.ret_code) {
e.next = 8;
break
}
return e.abrupt("return", t.return_data.msg);
case 8:
return e.abrupt("return", this.onError(new Error(t.return_data.msg || "获取失败")));
case 9:
e.next = 12;
break;
case 11:
return e.abrupt("return", this.onError(new Error(t.msg || "获取失败")));
case 12:
case"end":
return e.stop()
}
}, e, this)
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "resultRequest", value: function () {
var e = u(l().mark(function e() {
var t;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, Kp({data: h(h({}, Xp), {}, {interface: Md, params: {}})});
case 2:
if (0 !== (t = e.sent).code) {
e.next = 11;
break
}
if (0 !== t.return_data.ret_code && 5 !== t.return_data.ret_code) {
e.next = 8;
break
}
return e.abrupt("return", t.return_data);
case 8:
return e.abrupt("return", this.onError(new Error(t.return_data.msg || "获取失败")));
case 9:
e.next = 12;
break;
case 11:
return e.abrupt("return", this.onError(new Error(t.msg || "获取失败")));
case 12:
case"end":
return e.stop()
}
}, e, this)
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "isServiceBusy", value: function () {
var e = u(l().mark(function e() {
var t;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, Kp({data: h(h({}, Xp), {}, {interface: Nd, params: {}})});
case 2:
if (0 !== (t = e.sent).code) {
e.next = 11;
break
}
if (0 !== t.return_data.ret_code) {
e.next = 8;
break
}
return e.abrupt("return", t.return_data.msg);
case 8:
return e.abrupt("return", this.onError(new Error(t.return_data.msg || "获取失败")));
case 9:
e.next = 12;
break;
case 11:
return e.abrupt("return", this.onError(new Error(t.msg || "获取失败")));
case 12:
case"end":
return e.stop()
}
}, e, this)
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "setNotifyAddress", value: function () {
var e = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, Kp({data: h(h({}, Xp), {}, {interface: Od, params: {uri: t}})});
case 2:
if (0 !== (n = e.sent).code) {
e.next = 11;
break
}
if (0 !== n.return_data.ret_code) {
e.next = 8;
break
}
return e.abrupt("return", n.return_data.msg || !0);
case 8:
return e.abrupt("return", this.onError(new Error(n.return_data.msg || "设置失败")));
case 9:
e.next = 12;
break;
case 11:
return e.abrupt("return", this.onError(new Error(n.msg || "设置失败")));
case 12:
case"end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}]), e
}(), Qp = "TG_GetCAProviderList", $p = "TG_GetCertList", Zp = "TG_SignData", ef = function (e) {
i(n, jp);
var t = o(n);
function n(e) {
var r, i = e.onError, a = e.userCode;
return f(this, n), (r = t.call(this, {onError: i})).progid = "TGCertMgrCtrl", r.interface = "0DADE507-64D6-4306-956A-2ED144FF0ED1", r.userCode = a, r
}
return v(n, [{
key: "init", value: function () {
var e = u(l().mark(function e() {
var t, n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return this.caller = "", e.prev = 1, t = "value=".concat(JSON.stringify({
GetInterface: {
progid: this.progid,
interface: this.interface
}, usercode: this.userCode
}), "&t=").concat((new Date).getTime()), e.next = 5, Bp({url: "/GetInterface", data: t});
case 5:
if (0 != (null === (n = e.sent) || void 0 === n ? void 0 : n.value)) {
e.next = 10;
break
}
throw new Error("TGCertMsgCtrl 控件初始化失败");
case 10:
return this.caller = n.value, e.abrupt("return", this.caller);
case 12:
e.next = 17;
break;
case 14:
return e.prev = 14, e.t0 = e.catch(1), e.abrupt("return", this.onError(e.t0));
case 17:
case"end":
return e.stop()
}
}, e, this, [[1, 14]])
}));
return function () {
return e.apply(this, arguments)
}
}()
}, {
key: "GetLastError", value: function () {
var e = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.next = 2, this.invoke("GetLastError");
case 2:
if (!(n = e.sent) || "none" === n) {
e.next = 7;
break
}
throw new Error(n);
case 7:
throw new Error(t);
case 8:
case"end":
return e.stop()
}
}, e, this)
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "getCAProviderList", value: function () {
var e = u(l().mark(function e(t) {
var n, r;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Qp, t);
case 3:
if (n = e.sent, !(r = n.CAProviderList)) {
e.next = 9;
break
}
return e.abrupt("return", r);
case 9:
throw new Error("获取CA列表失败");
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "getCertList", value: function () {
var e = u(l().mark(function e(t) {
var n, r;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke($p, t);
case 3:
if (n = e.sent, !(r = n.certData)) {
e.next = 9;
break
}
return e.abrupt("return", r);
case 9:
throw new Error(JSON.stringify(n));
case 10:
e.next = 15;
break;
case 12:
return e.prev = 12, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 15:
case"end":
return e.stop()
}
}, e, this, [[0, 12]])
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "signData", value: function () {
var e = u(l().mark(function e(t) {
var n;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
return e.prev = 0, e.next = 3, this.invoke(Zp, t);
case 3:
if (0 !== (n = e.sent).errorCode) {
e.next = 8;
break
}
return e.abrupt("return", n.signValueB64);
case 8:
throw new Error(JSON.stringify(n));
case 9:
e.next = 14;
break;
case 11:
return e.prev = 11, e.t0 = e.catch(0), e.abrupt("return", this.onError(e.t0));
case 14:
case"end":
return e.stop()
}
}, e, this, [[0, 11]])
}));
return function (t) {
return e.apply(this, arguments)
}
}()
}, {
key: "keySNSign", value: function () {
var e = u(l().mark(function e() {
var t, n, r, i, a, o, s, c, u, d;
return l().wrap(function (e) {
for (; ;) switch (e.prev = e.next) {
case 0:
if (t = {keySn: "", signData: "", keyOwner: ""}, this.caller) {
e.next = 4;
break
}
return e.next = 4, this.init();
case 4:
return n = JSON.stringify({CAType: "0"}), e.next = 7, this.getCAProviderList(n);
case 7:
if ((r = e.sent) && 0 !== r.length) {
e.next = 10;
break
}
return e.abrupt("return");
case 10:
return (i = {}).providerName = r[0].providerName, i.CAType = "0", a = {
algorithmType: 0,
isCheckValid: 1,
publisher: ""
}, i.filterCondition = JSON.stringify(a), e.next = 17, this.getCertList(JSON.stringify(i));
case 17:
if ((o = e.sent) && 0 !== o.length) {
e.next = 20;
break
}
return e.abrupt("return");
case 20:
return t.keySn = o[0].ukeySN, t.keyOwner = o[0].certSubjectO, s = window.btoa(t.keySn), (c = {}).providerName = r[0].providerName, c.CAType = "0", c.certSN = o[0].certSerial, c.originalB64 = s, c.signType = "131072", c.hashOid = "", c.fileName = "文件名称.pdf", (u = []).push({sealId: ""}), c.ExtData = u, c.isUseCachePin = 1, e.next = 37, this.signData(JSON.stringify(c));
case 37:
if (d = e.sent) {
e.next = 40;
break
}
return e.abrupt("return");
case 40:
if (t.signData = d, !(t.keySn && t.keyOwner && t.signData)) {
e.next = 43;
break
}
return e.abrupt("return", t);
case 43:
return e.abrupt("return", null);
case 44:
case"end":
return e.stop()
}
}, e, this)
}));
return function () {
return e.apply(this, arguments)
}
}()
}]), n
}();
t.ISignatureServerCtrl = Up, t.IWebAssist = zp, t.IWebAuth = Yp, t.KGCryptCOMAPI = qp, t.KGSignatureManager = Hp, t.SRComponent = Jp, t.TGCertMsgCtrl = ef
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFCursorTools = t.CursorTool = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(419);
var o = {SELECT: 0, HAND: 1, ZOOM: 2}, s = function () {
function e(t) {
var n = this, i = t.container, s = t.eventBus, l = t.preferences;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.container = i, this.eventBus = s, this.active = o.SELECT, this.activeBeforePresentationMode = null, this.handTool = new a.GrabToPan({element: this.container}), this._addEventListeners(), Promise.all([l.get("cursorToolOnLoad"), l.get("enableHandToolOnLoad")]).then(function (e) {
var t = r(e, 2), i = t[0];
!0 === t[1] && (l.set("enableHandToolOnLoad", !1), i === o.SELECT && (i = o.HAND, l.set("cursorToolOnLoad", i).catch(function () {
}))), n.switchTool(i)
}).catch(function () {
})
}
return i(e, [{
key: "switchTool", value: function (e) {
var t = this;
if (null === this.activeBeforePresentationMode && e !== this.active) {
var n = function () {
switch (t.active) {
case o.SELECT:
break;
case o.HAND:
t.handTool.deactivate();
break;
case o.ZOOM:
}
};
switch (e) {
case o.SELECT:
n();
break;
case o.HAND:
n(), this.handTool.activate();
break;
case o.ZOOM:
default:
return void console.error('switchTool: "' + e + '" is an unsupported value.')
}
this.active = e, this._dispatchEvent()
}
}
}, {
key: "_dispatchEvent", value: function () {
this.eventBus.dispatch("cursortoolchanged", {source: this, tool: this.active})
}
}, {
key: "_addEventListeners", value: function () {
var e = this;
this.eventBus.on("switchcursortool", function (t) {
e.switchTool(t.tool)
}), this.eventBus.on("presentationmodechanged", function (t) {
if (!t.switchInProgress) {
var n = void 0;
t.active ? (n = e.active, e.switchTool(o.SELECT), e.activeBeforePresentationMode = n) : (n = e.activeBeforePresentationMode, e.activeBeforePresentationMode = null, e.switchTool(n))
}
})
}
}, {
key: "activeTool", get: function () {
return this.active
}
}]), e
}();
t.CursorTool = o, t.PDFCursorTools = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFFindController = t.FindState = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(14), a = n(9);
var o = {FOUND: 0, NOT_FOUND: 1, WRAPPED: 2, PENDING: 3}, s = {
"": "'",
"": "'",
"": "'",
"": "'",
"“": '"',
"”": '"',
"„": '"',
"‟": '"',
"¼": "1/4",
"½": "1/2",
"¾": "3/4"
}, l = function () {
function e(t) {
var n = t.pdfViewer;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.pdfViewer = n, this.onUpdateResultsCount = null, this.onUpdateState = null, this.reset();
var r = Object.keys(s).join("");
this.normalizationRegex = new RegExp("[" + r + "]", "g")
}
return r(e, [{
key: "reset", value: function () {
var e = this;
this.startedTextExtraction = !1, this.extractTextPromises = [], this.pendingFindMatches = Object.create(null), this.active = !1, this.pageContents = [], this.pageMatches = [], this.pageMatchesLength = null, this.matchCount = 0, this.selected = {
pageIdx: -1,
matchIdx: -1
}, this.offset = {
pageIdx: null,
matchIdx: null
}, this.pagesToSearch = null, this.resumePageIdx = null, this.state = null, this.dirtyMatch = !1, this.findTimeout = null, this._firstPagePromise = new Promise(function (t) {
e.resolveFirstPage = t
})
}
}, {
key: "normalize", value: function (e) {
return e.replace(this.normalizationRegex, function (e) {
return s[e]
})
}
}, {
key: "_prepareMatches", value: function (e, t, n) {
function r(e, t) {
var n = e[t], r = e[t + 1];
if (t < e.length - 1 && n.match === r.match) return n.skipped = !0, !0;
for (var i = t - 1; i >= 0; i--) {
var a = e[i];
if (!a.skipped) {
if (a.match + a.matchLength < n.match) break;
if (a.match + a.matchLength >= n.match + n.matchLength) return n.skipped = !0, !0
}
}
return !1
}
e.sort(function (e, t) {
return e.match === t.match ? e.matchLength - t.matchLength : e.match - t.match
});
for (var i = 0, a = e.length; i < a; i++) r(e, i) || (t.push(e[i].match), n.push(e[i].matchLength))
}
}, {
key: "calcFindPhraseMatch", value: function (e, t, n) {
for (var r = [], i = e.length, a = -i; -1 !== (a = n.indexOf(e, a + i));) r.push(a);
this.pageMatches[t] = r
}
}, {
key: "calcFindWordMatch", value: function (e, t, n) {
for (var r = [], i = e.match(/\S+/g), a = 0, o = i.length; a < o; a++) for (var s = i[a], l = s.length, c = -l; -1 !== (c = n.indexOf(s, c + l));) r.push({
match: c,
matchLength: l,
skipped: !1
});
this.pageMatchesLength || (this.pageMatchesLength = []), this.pageMatchesLength[t] = [], this.pageMatches[t] = [], this._prepareMatches(r, this.pageMatches[t], this.pageMatchesLength[t])
}
}, {
key: "calcFindMatch", value: function (e) {
var t = this.normalize(this.pageContents[e]), n = this.normalize(this.state.query),
r = this.state.caseSensitive, i = this.state.phraseSearch;
0 !== n.length && (r || (t = t.toLowerCase(), n = n.toLowerCase()), i ? this.calcFindPhraseMatch(n, e, t) : this.calcFindWordMatch(n, e, t), this.updatePage(e), this.resumePageIdx === e && (this.resumePageIdx = null, this.nextPageMatch()), this.pageMatches[e].length > 0 && (this.matchCount += this.pageMatches[e].length, this.updateUIResultsCount()))
}
}, {
key: "extractText", value: function () {
var e = this;
if (!this.startedTextExtraction) {
this.startedTextExtraction = !0, this.pageContents.length = 0;
for (var t = Promise.resolve(), n = function (n, r) {
var a = (0, i.createPromiseCapability)();
e.extractTextPromises[n] = a.promise, t = t.then(function () {
return e.pdfViewer.getPageTextContent(n).then(function (t) {
for (var r = t.items, i = [], o = 0, s = r.length; o < s; o++) i.push(r[o].str);
e.pageContents[n] = i.join(""), a.resolve(n)
}, function (t) {
console.error("Unable to get page " + (n + 1) + " text content", t), e.pageContents[n] = "", a.resolve(n)
})
})
}, r = 0, a = this.pdfViewer.pagesCount; r < a; r++) n(r)
}
}
}, {
key: "executeCommand", value: function (e, t) {
var n = this;
null !== this.state && "findagain" === e || (this.dirtyMatch = !0), this.state = t, this.updateUIState(o.PENDING), this._firstPagePromise.then(function () {
n.extractText(), clearTimeout(n.findTimeout), "find" === e ? n.findTimeout = setTimeout(n.nextMatch.bind(n), 250) : n.nextMatch()
})
}
}, {
key: "updatePage", value: function (e) {
this.selected.pageIdx === e && (this.pdfViewer.currentPageNumber = e + 1);
var t = this.pdfViewer.getPageView(e);
t.textLayer && t.textLayer.updateMatches()
}
}, {
key: "nextMatch", value: function () {
var e = this, t = this.state.findPrevious, n = this.pdfViewer.currentPageNumber - 1,
r = this.pdfViewer.pagesCount;
if (this.active = !0, this.dirtyMatch) {
this.dirtyMatch = !1, this.selected.pageIdx = this.selected.matchIdx = -1, this.offset.pageIdx = n, this.offset.matchIdx = null, this.hadMatch = !1, this.resumePageIdx = null, this.pageMatches = [], this.matchCount = 0, this.pageMatchesLength = null;
for (var i = 0; i < r; i++) this.updatePage(i), i in this.pendingFindMatches || (this.pendingFindMatches[i] = !0, this.extractTextPromises[i].then(function (t) {
delete e.pendingFindMatches[t], e.calcFindMatch(t)
}))
}
if ("" !== this.state.query) {
if (!this.resumePageIdx) {
var a = this.offset;
if (this.pagesToSearch = r, null !== a.matchIdx) {
var s = this.pageMatches[a.pageIdx].length;
if (!t && a.matchIdx + 1 < s || t && a.matchIdx > 0) return this.hadMatch = !0, a.matchIdx = t ? a.matchIdx - 1 : a.matchIdx + 1, void this.updateMatch(!0);
this.advanceOffsetPage(t)
}
this.nextPageMatch()
}
} else this.updateUIState(o.FOUND)
}
}, {
key: "matchesReady", value: function (e) {
var t = this.offset, n = e.length, r = this.state.findPrevious;
return n ? (this.hadMatch = !0, t.matchIdx = r ? n - 1 : 0, this.updateMatch(!0), !0) : (this.advanceOffsetPage(r), !!(t.wrapped && (t.matchIdx = null, this.pagesToSearch < 0)) && (this.updateMatch(!1), !0))
}
}, {
key: "updateMatchPosition", value: function (e, t, n, r) {
if (this.selected.matchIdx === t && this.selected.pageIdx === e) {
var i = {top: -50, left: -400};
(0, a.scrollIntoView)(n[r], i, !0)
}
}
}, {
key: "nextPageMatch", value: function () {
null !== this.resumePageIdx && console.error("There can only be one pending page.");
var e = null;
do {
var t = this.offset.pageIdx;
if (!(e = this.pageMatches[t])) {
this.resumePageIdx = t;
break
}
} while (!this.matchesReady(e))
}
}, {
key: "advanceOffsetPage", value: function (e) {
var t = this.offset, n = this.extractTextPromises.length;
t.pageIdx = e ? t.pageIdx - 1 : t.pageIdx + 1, t.matchIdx = null, this.pagesToSearch--, (t.pageIdx >= n || t.pageIdx < 0) && (t.pageIdx = e ? n - 1 : 0, t.wrapped = !0)
}
}, {
key: "updateMatch", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = o.NOT_FOUND,
n = this.offset.wrapped;
if (this.offset.wrapped = !1, e) {
var r = this.selected.pageIdx;
this.selected.pageIdx = this.offset.pageIdx, this.selected.matchIdx = this.offset.matchIdx, t = n ? o.WRAPPED : o.FOUND, -1 !== r && r !== this.selected.pageIdx && this.updatePage(r)
}
this.updateUIState(t, this.state.findPrevious), -1 !== this.selected.pageIdx && this.updatePage(this.selected.pageIdx)
}
}, {
key: "updateUIResultsCount", value: function () {
this.onUpdateResultsCount && this.onUpdateResultsCount(this.matchCount)
}
}, {
key: "updateUIState", value: function (e, t) {
this.onUpdateState && this.onUpdateState(e, t, this.matchCount)
}
}]), e
}();
t.FindState = o, t.PDFFindController = l
}, function (e, t, n) {
"use strict";
var r = "";
"undefined" == typeof Symbol && n(190);
var i = void 0, a = void 0;
function o() {
var e = {
appContainer: document.body,
mainContainer: document.getElementById("viewerContainer"),
viewerContainer: document.getElementById("viewer"),
eventBus: null,
toolbar: {
container: document.getElementById("toolbarViewer"),
numPages: document.getElementById("numPages"),
pageNumber: document.getElementById("pageNumber"),
scaleSelectContainer: document.getElementById("scaleSelectContainer"),
scaleSelect: document.getElementById("scaleSelect"),
customScaleOption: document.getElementById("customScaleOption"),
previous: document.getElementById("previous"),
next: document.getElementById("next"),
zoomIn: document.getElementById("zoomIn"),
zoomOut: document.getElementById("zoomOut"),
viewFind: document.getElementById("viewFind"),
stamp: document.getElementById("stamp"),
kgSignature: document.getElementById("kgSignature"),
print: document.getElementById("print"),
viewBookmark: document.getElementById("viewBookmark"),
kgAnnotation: document.getElementById("KG_Annotation"),
kgDocSign: document.getElementById("kgDocSign"),
kgStampMask: document.getElementById("KG_StampMask")
},
secondaryToolbar: {
toolbar: document.getElementById("secondaryToolbar"),
toggleButton: document.getElementById("secondaryToolbarToggle"),
toolbarButtonContainer: document.getElementById("secondaryToolbarButtonContainer"),
printButton: document.getElementById("secondaryPrint"),
firstPageButton: document.getElementById("firstPage"),
lastPageButton: document.getElementById("lastPage"),
pageRotateCwButton: document.getElementById("pageRotateCw"),
pageRotateCcwButton: document.getElementById("pageRotateCcw"),
cursorSelectToolButton: document.getElementById("cursorSelectTool"),
cursorHandToolButton: document.getElementById("cursorHandTool"),
documentPropertiesButton: document.getElementById("documentProperties"),
secondaryStamp: document.getElementById("secondaryStamp"),
secondaryKgSignature: document.getElementById("secondaryKgSignature"),
secondaryKgAnnotation: document.getElementById("secondaryKG_Annotation"),
secondaryKgDocSign: document.getElementById("secondaryKgDocSign")
},
fullscreen: {
contextFirstPage: document.getElementById("contextFirstPage"),
contextLastPage: document.getElementById("contextLastPage"),
contextPageRotateCw: document.getElementById("contextPageRotateCw"),
contextPageRotateCcw: document.getElementById("contextPageRotateCcw")
},
sidebar: {
mainContainer: document.getElementById("mainContainer"),
outerContainer: document.getElementById("outerContainer"),
toggleButton: document.getElementById("sidebarToggle"),
thumbnailButton: document.getElementById("viewThumbnail"),
outlineButton: document.getElementById("viewOutline"),
attachmentsButton: document.getElementById("viewAttachments"),
kgAnnotationsButton: document.getElementById("viewKgAnnotations"),
thumbnailView: document.getElementById("thumbnailView"),
outlineView: document.getElementById("outlineView"),
attachmentsView: document.getElementById("attachmentsView"),
kgAnnotationsView: document.getElementById("kgAnnotationsView")
},
findBar: {
bar: document.getElementById("findbar"),
toggleButton: document.getElementById("viewFind"),
findField: document.getElementById("findInput"),
highlightAllCheckbox: document.getElementById("findHighlightAll"),
caseSensitiveCheckbox: document.getElementById("findMatchCase"),
findMsg: document.getElementById("findMsg"),
findResultsCount: document.getElementById("findResultsCount"),
findStatusIcon: document.getElementById("findStatusIcon"),
findPreviousButton: document.getElementById("findPrevious"),
findNextButton: document.getElementById("findNext")
},
passwordOverlay: {
overlayName: "passwordOverlay",
container: document.getElementById("passwordOverlay"),
label: document.getElementById("passwordText"),
input: document.getElementById("password"),
submitButton: document.getElementById("passwordSubmit"),
cancelButton: document.getElementById("passwordCancel")
},
documentProperties: {
overlayName: "documentPropertiesOverlay",
container: document.getElementById("documentPropertiesOverlay"),
closeButton: document.getElementById("documentPropertiesClose"),
fields: {
fileName: document.getElementById("fileNameField"),
fileSize: document.getElementById("fileSizeField"),
fileType: document.getElementById("fileType"),
title: document.getElementById("titleField"),
author: document.getElementById("authorField"),
subject: document.getElementById("subjectField"),
keywords: document.getElementById("keywordsField"),
creationDate: document.getElementById("creationDateField"),
modificationDate: document.getElementById("modificationDateField"),
creator: document.getElementById("creatorField"),
producer: document.getElementById("producerField"),
version: document.getElementById("versionField"),
pageCount: document.getElementById("pageCountField")
}
},
kgpasswordOverlay: {
overlayName: "kgpasswordOverlay",
container: document.getElementById("kgpasswordOverlay"),
label: document.getElementById("kgpasswordText"),
input: document.getElementById("kgpassword"),
submitButton: document.getElementById("kgpasswordSubmit"),
cancelButton: document.getElementById("kgpasswordCancel")
},
selectSealOverlay: {
overlayName: "selectSealOverlay",
container: document.getElementById("selectSealOverlay"),
submitButton: document.getElementById("selectSealSubmit"),
cancelButton: document.getElementById("selectSealCancel"),
img: document.getElementById("sealImg"),
sealLeft: document.getElementById("kg-seal-left"),
sealRight: document.getElementById("kg-seal-right")
},
errorWrapper: {
container: document.getElementById("errorWrapper"),
errorMessage: document.getElementById("errorMessage"),
closeButton: document.getElementById("errorClose"),
errorMoreInfo: document.getElementById("errorMoreInfo"),
moreInfoButton: document.getElementById("errorShowMore"),
lessInfoButton: document.getElementById("errorShowLess")
},
printContainer: document.getElementById("printContainer"),
openFileInputName: "fileInput",
debuggerScriptPath: "./debugger.js",
defaultUrl: r,
kgConfirmOverlay: {
overlayName: "kgConfirmOverlay",
container: document.getElementById("kgConfirmOverlay"),
okButton: document.getElementById("kgConfirmPromptOk"),
cancelButton: document.getElementById("kgConfirmPromptCancel")
},
KG_VerifySealPrompt: {
overlayName: "KG_VerifySealPromptOverlay",
container: document.getElementById("KG_VerifySealPromptOverlay")
},
KG_AdditionText: {
overlayName: "KG_AdditionTextOverlay",
container: document.getElementById("KG_AdditionTextOverlay")
},
KG_Captcha: {overlayName: "KG_CaptchaOverlay", container: document.getElementById("KG_CaptchaOverlay")},
KG_StampConfirm: {
overlayName: "KG_StampConfirmOverlay",
container: document.getElementById("KG_StampConfirmOverlay")
},
KG_TextConfirm: {
overlayName: "KG_TextConfirmOverlay",
container: document.getElementById("KG_TextConfirmOverlay")
},
KG_DocSignConfirm: {
overlayName: "KG_DocSignConfirmOverlay",
container: document.getElementById("KG_DocSignConfirmOverlay")
},
KG_Watermark: {
overlayName: "KG_WatermarkOverlay",
container: document.getElementById("KG_WatermarkOverlay"),
toolbarBtn: document.getElementById("KG_WatermarkToolbarBtn"),
secondaryToolbarBtn: document.getElementById("secondaryKG_WatermarkToolbarBtn")
},
KG_SignaturePad: {
overlayName: "KG_SignaturePadOverlay",
container: document.getElementById("KG_SignaturePadOverlay")
},
KG_WatermarkConfirm: {
overlayName: "KG_WatermarkConfirmOverlay",
container: document.getElementById("KG_WatermarkConfirmOverlay")
},
KG_AlertPrompt: {
overlayName: "KG_AlertPromptOverlay",
container: document.getElementById("KG_AlertPromptOverlay")
},
KG_ProgressPrompt: {
overlayName: "KG_ProgressPromptOverlay",
container: document.getElementById("KG_ProgressPromptOverlay")
},
KG_BlockChain: {
overlayName: "KG_BlockChainPromptOverlay",
container: document.getElementById("KG_BlockChainPromptOverlay")
},
KG_BlockChain_V2: {
overlayName: "KG_BlockChain_V2_PromptOverlay",
container: document.getElementById("KG_BlockChain_V2_PromptOverlay")
},
KG_GuideTip: {container: document.getElementById("KG_GuideTipOverlay")},
KG_PagingSeal: {overlayName: "KG_PagingSealOverlay", container: document.getElementById("KG_PagingSealOverlay")},
KG_Download: {
download: document.getElementById("KG_Download"),
secondaryDownload: document.getElementById("secondaryKG_Download")
},
KG_FJRS: {
button: document.getElementById("kgScanFjrs"),
secondaryButton: document.getElementById("secondaryKgScanFjrs"),
qrCodeOverlayName: "KG_FJRS_QrCodeOverlay",
qrCodeContainer: document.getElementById("KG_FJRS_QrCodeOverlay")
},
KG_DocSign: {
overlayName: "KG_DocSignToolOverlay",
container: document.getElementById("KG_DocSignToolOverlay"),
button: document.getElementById("kgDocSign"),
secondaryButton: document.getElementById("secondaryKgDocSign")
},
KG_StampMask: {button: document.getElementById("KG_StampMask")},
KG_ScanStamp: {
companySignBtn: document.getElementById("kgScan"),
secondaryCompanySignBtn: document.getElementById("secondaryKgScan"),
personSignBtn: document.getElementById("KG_PersonSign"),
secondaryPersonSignBtn: document.getElementById("secondaryKG_PersonSign"),
companyContinuitySignBtn: document.getElementById("kgScan_continuity"),
secondaryCompanyContinuitySignBtn: document.getElementById("secondarykgScan_continuity"),
companyPagingSealSignBtn: document.getElementById("kgScan_pagingSeal"),
secondaryCompanyPagingSealSignBtn: document.getElementById("secondarykgScan_pagingSeal"),
companySinglePageSealSignBtn: document.getElementById("kgScan_singlePageSeal"),
secondaryCompanySinglePageSealSignBtn: document.getElementById("secondarykgScan_singlePageSeal"),
qrCodeOverlayName: "KG_QrCodeOverlay",
qrCodeContainer: document.getElementById("KG_QrCodeOverlay")
},
KG_ScanStamp_V2: {
organize: document.getElementById("KG_V2_Organize"),
secondaryOrganize: document.getElementById("secondary_KG_V2_Organize"),
person: document.getElementById("KG_V2_Person"),
secondaryPerson: document.getElementById("secondary_KG_V2_Person"),
overlayName: "KG_V2_UnifyPlatformOverlay",
iframe: document.getElementById("KG_V2_Iframe"),
container: document.getElementById("KG_V2_UnifyPlatformOverlay")
},
KG_Finger_Print: {
button: document.getElementById("KG_Finger_Print"),
secondaryButton: document.getElementById("secondary_KG_Finger_Print")
},
KG_iWebAuthScan: {
scanButton: document.getElementById("KG_iWebAuthScan"),
secondaryScanButton: document.getElementById("secondaryKG_iWebAuthScan"),
ukeyButton: document.getElementById("KG_iWebAuthUkey"),
secondaryUkeyButton: document.getElementById("secondaryKG_iWebAuthUkey")
},
KG_UkeyStamp: {
button: document.getElementById("KG_Ukey"),
secondaryButton: document.getElementById("secondaryKG_Ukey")
},
KG_CertValidity: {
overlayName: "KG_CertValidityOverlay",
container: document.getElementById("KG_CertValidityOverlay")
},
KG_ProductInfo: {
overlayName: "KG_ProductInfoOverlay",
button: document.getElementById("KG_ProductInfo"),
container: document.getElementById("KG_ProductInfoOverlay")
},
KG_PrepareStamp: {
button: document.getElementById("KG_PrepareStamp"),
secondaryButton: document.getElementById("secondaryKG_PrepareStamp")
},
KG_SecretSeal: {
button: document.getElementById("KG_SecretSeal"),
secondaryButton: document.getElementById("secondaryKG_SecretSeal")
},
KG_IndicateSeal: {
overlayName: "KG_IndicateSealOverlay",
container: document.getElementById("KG_IndicateSealOverlay"),
button: document.getElementById("KG_IndicateSeal"),
secondaryButton: document.getElementById("secondaryKG_IndicateSeal")
},
KG_OpenLocalFile: {
button: document.getElementById("KG_OpenLocalFile"),
secondaryButton: document.getElementById("secondaryKG_OpenLocalFile")
},
kgTextToSeal: {
overlayName: "kgTextToSealOverlay",
container: document.getElementById("kgTextToSealOverlay"),
docSave: document.getElementById("docSave"),
secondaryDocSave: document.getElementById("secondaryDocSave"),
docSaveAs: document.getElementById("docSaveAs"),
secondaryDocSaveAs: document.getElementById("secondaryDocSaveAs"),
textToSealCanvasContainer: document.getElementById("textToSealCanvasContainer"),
indicateSealCanvasContainer: document.getElementById("indicateSealCanvasContainer"),
invariantSealCanvasContainer: document.getElementById("invariantSealCanvasContainer"),
textToSealCanvas: document.getElementById("textToSealCanvas"),
indicateSealCanvas: document.getElementById("indicateSealCanvas"),
invariantSealCanvas: document.getElementById("invariantSealCanvas"),
textToSealContainer: document.getElementById("textToSealContainer"),
textToSealText: document.getElementById("textToSealText"),
textToSealNum: document.getElementById("textToSealNum"),
textToSealDate: document.getElementById("textToSealDate"),
textToSealColor: document.getElementById("textToSealColor"),
indicateSealContainer: document.getElementById("indicateSealContainer"),
indicateSealText: document.getElementById("indicateSealText"),
indicateSealNum: document.getElementById("indicateSealNum"),
indicateSealDate: document.getElementById("indicateSealDate"),
indicateSealColor: document.getElementById("indicateSealColor"),
invariantSealContainer: document.getElementById("invariantSealContainer"),
button: document.getElementById("textToSeal"),
secondaryButton: document.getElementById("secondaryTextToSeal"),
exportBtn: document.getElementById("exportAnnotations"),
secondaryExportBtn: document.getElementById("secondaryExportAnnotations"),
showTextToSealBtn: document.getElementById("showTextToSeal"),
showIndicateSealBtn: document.getElementById("showIndicateSeal"),
showInvariantSealBtn: document.getElementById("showInvariantSeal"),
okButton: document.getElementById("kgTextToSealOk"),
cancelButton: document.getElementById("kgTextToSealCancel")
},
KG_Annotation: {overlayName: "KG_AnnotationOverlay", container: document.getElementById("KG_AnnotationOverlay")}
};
i.PDFViewerApplication.run(e), a.KGPdfViewerWebApp.PDFViewerApplication = i.PDFViewerApplication, i.PDFViewerApplication.KGPdfViewerWebApp = a.KGPdfViewerWebApp, window.afterWebPdfLoad && window.afterWebPdfLoad()
}
i = n(120), a = n(177), n(469), n(470), n(475), "interactive" === document.readyState || "complete" === document.readyState ? o() : document.addEventListener("DOMContentLoaded", o, !0)
}, function (e, t, n) {
"use strict";
if (n(191), n(377), n(378), global._babelPolyfill) throw new Error("only one instance of babel-polyfill is allowed");
global._babelPolyfill = !0;
var r = "defineProperty";
function i(e, t, n) {
e[t] || Object[r](e, t, {writable: !0, configurable: !0, value: n})
}
i(String.prototype, "padLeft", "".padStart), i(String.prototype, "padRight", "".padEnd), "pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (e) {
[][e] && i(Array, e, Function.call.bind([][e]))
})
}, function (e, t, n) {
"use strict";
n(192), n(195), n(196), n(197), n(198), n(199), n(200), n(201), n(202), n(203), n(204), n(205), n(206), n(207), n(208), n(209), n(210), n(96), n(211), n(212), n(213), n(214), n(215), n(216), n(217), n(218), n(219), n(220), n(138), n(140), n(221), n(222), n(223), n(224), n(225), n(226), n(227), n(228), n(229), n(230), n(231), n(232), n(233), n(234), n(235), n(236), n(237), n(238), n(239), n(240), n(241), n(242), n(243), n(244), n(245), n(143), n(246), n(247), n(248), n(249), n(250), n(251), n(252), n(253), n(254), n(255), n(256), n(257), n(258), n(259), n(260), n(261), n(262), n(263), n(264), n(265), n(266), n(268), n(269), n(271), n(272), n(273), n(274), n(275), n(276), n(277), n(279), n(280), n(281), n(282), n(283), n(284), n(285), n(286), n(287), n(288), n(289), n(290), n(291), n(111), n(292),n(148),n(293),n(149),n(294),n(295),n(296),n(297),n(150),n(153),n(155),n(117),n(298),n(299),n(300),n(301),n(302),n(158),n(303),n(304),n(305),n(306),n(307),n(308),n(309),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(321),n(322),n(323),n(324),n(325),n(326),n(327),n(328),n(329),n(330),n(331),n(332),n(333),n(334),n(335),n(336),n(337),n(338),n(339),n(340),n(341),n(342),n(343),n(344),n(165),n(345),n(346),n(347),n(166),n(348),n(349),n(350),n(351),n(352),n(353),n(354),n(355),n(356),n(357),n(358),n(359),n(360),n(361),n(362),n(363),n(168),n(169),n(364),n(365),n(366),n(367),n(368),n(369),n(370),n(371),n(372),n(373),n(374),n(375),n(376),n(119),e.exports = n(13)
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(3), a = n(22), o = n(8), s = n(0), l = n(19), c = n(40).KEY, u = n(4), d = n(64), h = n(57), p = n(45),
f = n(6), m = n(127), v = n(91), g = n(194), y = n(73), b = n(1), w = n(5), S = n(11), _ = n(23), k = n(30),
x = n(44), P = n(48), C = n(130), A = n(24), T = n(72), E = n(10), D = n(46), I = A.f, L = E.f, O = C.f,
M = i.Symbol, N = i.JSON, R = N && N.stringify, W = f("_hidden"), V = f("toPrimitive"), F = {}.propertyIsEnumerable,
G = d("symbol-registry"), B = d("symbols"), K = d("op-symbols"), j = Object.prototype,
z = "function" == typeof M && !!T.f, U = i.QObject, q = !U || !U.prototype || !U.prototype.findChild,
H = o && u(function () {
return 7 != P(L({}, "a", {
get: function () {
return L(this, "a", {value: 7}).a
}
})).a
}) ? function (e, t, n) {
var r = I(j, t);
r && delete j[t], L(e, t, n), r && e !== j && L(j, t, r)
} : L, Y = function (e) {
var t = B[e] = P(M.prototype);
return t._k = e, t
}, X = z && "symbol" == r(M.iterator) ? function (e) {
return "symbol" == (void 0 === e ? "undefined" : r(e))
} : function (e) {
return e instanceof M
}, J = function (e, t, n) {
return e === j && J(K, t, n), b(e), t = k(t, !0), b(n), a(B, t) ? (n.enumerable ? (a(e, W) && e[W][t] && (e[W][t] = !1), n = P(n, {enumerable: x(0, !1)})) : (a(e, W) || L(e, W, x(1, {})), e[W][t] = !0), H(e, t, n)) : L(e, t, n)
}, Q = function (e, t) {
b(e);
for (var n, r = g(t = _(t)), i = 0, a = r.length; a > i;) J(e, n = r[i++], t[n]);
return e
}, $ = function (e) {
var t = F.call(this, e = k(e, !0));
return !(this === j && a(B, e) && !a(K, e)) && (!(t || !a(this, e) || !a(B, e) || a(this, W) && this[W][e]) || t)
}, Z = function (e, t) {
if (e = _(e), t = k(t, !0), e !== j || !a(B, t) || a(K, t)) {
var n = I(e, t);
return !n || !a(B, t) || a(e, W) && e[W][t] || (n.enumerable = !0), n
}
}, ee = function (e) {
for (var t, n = O(_(e)), r = [], i = 0; n.length > i;) a(B, t = n[i++]) || t == W || t == c || r.push(t);
return r
}, te = function (e) {
for (var t, n = e === j, r = O(n ? K : _(e)), i = [], o = 0; r.length > o;) !a(B, t = r[o++]) || n && !a(j, t) || i.push(B[t]);
return i
};
z || (l((M = function () {
if (this instanceof M) throw TypeError("Symbol is not a constructor!");
var e = p(arguments.length > 0 ? arguments[0] : void 0);
return o && q && H(j, e, {
configurable: !0, set: function t(n) {
this === j && t.call(K, n), a(this, W) && a(this[W], e) && (this[W][e] = !1), H(this, e, x(1, n))
}
}), Y(e)
}).prototype, "toString", function () {
return this._k
}), A.f = Z, E.f = J, n(49).f = C.f = ee, n(66).f = $, T.f = te, o && !n(39) && l(j, "propertyIsEnumerable", $, !0), m.f = function (e) {
return Y(f(e))
}), s(s.G + s.W + s.F * !z, {Symbol: M});
for (var ne = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","), re = 0; ne.length > re;) f(ne[re++]);
for (var ie = D(f.store), ae = 0; ie.length > ae;) v(ie[ae++]);
s(s.S + s.F * !z, "Symbol", {
for: function (e) {
return a(G, e += "") ? G[e] : G[e] = M(e)
}, keyFor: function (e) {
if (!X(e)) throw TypeError(e + " is not a symbol!");
for (var t in G) if (G[t] === e) return t
}, useSetter: function () {
q = !0
}, useSimple: function () {
q = !1
}
}), s(s.S + s.F * !z, "Object", {
create: function (e, t) {
return void 0 === t ? P(e) : Q(P(e), t)
},
defineProperty: J,
defineProperties: Q,
getOwnPropertyDescriptor: Z,
getOwnPropertyNames: ee,
getOwnPropertySymbols: te
});
var oe = u(function () {
T.f(1)
});
s(s.S + s.F * oe, "Object", {
getOwnPropertySymbols: function (e) {
return T.f(S(e))
}
}), N && s(s.S + s.F * (!z || u(function () {
var e = M();
return "[null]" != R([e]) || "{}" != R({a: e}) || "{}" != R(Object(e))
})), "JSON", {
stringify: function (e) {
for (var t, n, r = [e], i = 1; arguments.length > i;) r.push(arguments[i++]);
if (n = t = r[1], (w(t) || void 0 !== e) && !X(e)) return y(t) || (t = function (e, t) {
if ("function" == typeof n && (t = n.call(this, e, t)), !X(t)) return t
}), r[1] = t, R.apply(N, r)
}
}), M.prototype[V] || n(18)(M.prototype, V, M.prototype.valueOf), h(M, "Symbol"), h(Math, "Math", !0), h(i.JSON, "JSON", !0)
}, function (e, t, n) {
"use strict";
e.exports = n(64)("native-function-to-string", Function.toString)
}, function (e, t, n) {
"use strict";
var r = n(46), i = n(72), a = n(66);
e.exports = function (e) {
var t = r(e), n = i.f;
if (n) for (var o, s = n(e), l = a.f, c = 0; s.length > c;) l.call(e, o = s[c++]) && t.push(o);
return t
}
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Object", {create: n(48)})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S + r.F * !n(8), "Object", {defineProperty: n(10).f})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S + r.F * !n(8), "Object", {defineProperties: n(129)})
}, function (e, t, n) {
"use strict";
var r = n(23), i = n(24).f;
n(32)("getOwnPropertyDescriptor", function () {
return function (e, t) {
return i(r(e), t)
}
})
}, function (e, t, n) {
"use strict";
var r = n(11), i = n(25);
n(32)("getPrototypeOf", function () {
return function (e) {
return i(r(e))
}
})
}, function (e, t, n) {
"use strict";
var r = n(11), i = n(46);
n(32)("keys", function () {
return function (e) {
return i(r(e))
}
})
}, function (e, t, n) {
"use strict";
n(32)("getOwnPropertyNames", function () {
return n(130).f
})
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(40).onFreeze;
n(32)("freeze", function (e) {
return function (t) {
return e && r(t) ? e(i(t)) : t
}
})
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(40).onFreeze;
n(32)("seal", function (e) {
return function (t) {
return e && r(t) ? e(i(t)) : t
}
})
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(40).onFreeze;
n(32)("preventExtensions", function (e) {
return function (t) {
return e && r(t) ? e(i(t)) : t
}
})
}, function (e, t, n) {
"use strict";
var r = n(5);
n(32)("isFrozen", function (e) {
return function (t) {
return !r(t) || !!e && e(t)
}
})
}, function (e, t, n) {
"use strict";
var r = n(5);
n(32)("isSealed", function (e) {
return function (t) {
return !r(t) || !!e && e(t)
}
})
}, function (e, t, n) {
"use strict";
var r = n(5);
n(32)("isExtensible", function (e) {
return function (t) {
return !!r(t) && (!e || e(t))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S + r.F, "Object", {assign: n(131)})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Object", {is: n(132)})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Object", {setPrototypeOf: n(95).set})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.P, "Function", {bind: n(133)})
}, function (e, t, n) {
"use strict";
var r = n(10).f, i = Function.prototype, a = /^\s*function ([^ (]*)/;
"name" in i || n(8) && r(i, "name", {
configurable: !0, get: function () {
try {
return ("" + this).match(a)[1]
} catch (e) {
return ""
}
}
})
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(25), a = n(6)("hasInstance"), o = Function.prototype;
a in o || n(10).f(o, a, {
value: function (e) {
if ("function" != typeof this || !r(e)) return !1;
if (!r(this.prototype)) return e instanceof this;
for (; e = i(e);) if (this.prototype === e) return !0;
return !1
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(135);
r(r.G + r.F * (parseInt != i), {parseInt: i})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(136);
r(r.G + r.F * (parseFloat != i), {parseFloat: i})
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(22), a = n(27), o = n(98), s = n(30), l = n(4), c = n(49).f, u = n(24).f, d = n(10).f,
h = n(59).trim, p = r.Number, f = p, m = p.prototype, v = "Number" == a(n(48)(m)), g = "trim" in String.prototype,
y = function (e) {
var t = s(e, !1);
if ("string" == typeof t && t.length > 2) {
var n, r, i, a = (t = g ? t.trim() : h(t, 3)).charCodeAt(0);
if (43 === a || 45 === a) {
if (88 === (n = t.charCodeAt(2)) || 120 === n) return NaN
} else if (48 === a) {
switch (t.charCodeAt(1)) {
case 66:
case 98:
r = 2, i = 49;
break;
case 79:
case 111:
r = 8, i = 55;
break;
default:
return +t
}
for (var o, l = t.slice(2), c = 0, u = l.length; c < u; c++) if ((o = l.charCodeAt(c)) < 48 || o > i) return NaN;
return parseInt(l, r)
}
}
return +t
};
if (!p(" 0o1") || !p("0b1") || p("+0x1")) {
p = function (e) {
var t = arguments.length < 1 ? 0 : e, n = this;
return n instanceof p && (v ? l(function () {
m.valueOf.call(n)
}) : "Number" != a(n)) ? o(new f(y(t)), n, p) : y(t)
};
for (var b, w = n(8) ? c(f) : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","), S = 0; w.length > S; S++) i(f, b = w[S]) && !i(p, b) && d(p, b, u(f, b));
p.prototype = m, m.constructor = p, n(19)(r, "Number", p)
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(28), a = n(137), o = n(99), s = 1..toFixed, l = Math.floor, c = [0, 0, 0, 0, 0, 0],
u = "Number.toFixed: incorrect invocation!", d = function (e, t) {
for (var n = -1, r = t; ++n < 6;) r += e * c[n], c[n] = r % 1e7, r = l(r / 1e7)
}, h = function (e) {
for (var t = 6, n = 0; --t >= 0;) n += c[t], c[t] = l(n / e), n = n % e * 1e7
}, p = function () {
for (var e = 6, t = ""; --e >= 0;) if ("" !== t || 0 === e || 0 !== c[e]) {
var n = String(c[e]);
t = "" === t ? n : t + o.call("0", 7 - n.length) + n
}
return t
}, f = function e(t, n, r) {
return 0 === n ? r : n % 2 == 1 ? e(t, n - 1, r * t) : e(t * t, n / 2, r)
};
r(r.P + r.F * (!!s && ("0.000" !== 8e-5.toFixed(3) || "1" !== .9.toFixed(0) || "1.25" !== 1.255.toFixed(2) || "1000000000000000128" !== (0xde0b6b3a7640080).toFixed(0)) || !n(4)(function () {
s.call({})
})), "Number", {
toFixed: function (e) {
var t, n, r, s, l = a(this, u), c = i(e), m = "", v = "0";
if (c < 0 || c > 20) throw RangeError(u);
if (l != l) return "NaN";
if (l <= -1e21 || l >= 1e21) return String(l);
if (l < 0 && (m = "-", l = -l), l > 1e-21) if (n = (t = function (e) {
for (var t = 0, n = e; n >= 4096;) t += 12, n /= 4096;
for (; n >= 2;) t += 1, n /= 2;
return t
}(l * f(2, 69, 1)) - 69) < 0 ? l * f(2, -t, 1) : l / f(2, t, 1), n *= 4503599627370496, (t = 52 - t) > 0) {
for (d(0, n), r = c; r >= 7;) d(1e7, 0), r -= 7;
for (d(f(10, r, 1), 0), r = t - 1; r >= 23;) h(1 << 23), r -= 23;
h(1 << r), d(1, 1), h(2), v = p()
} else d(0, n), d(1 << -t, 0), v = p() + o.call("0", c);
return v = c > 0 ? m + ((s = v.length) <= c ? "0." + o.call("0", c - s) + v : v.slice(0, s - c) + "." + v.slice(s - c)) : m + v
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(4), a = n(137), o = 1..toPrecision;
r(r.P + r.F * (i(function () {
return "1" !== o.call(1, void 0)
}) || !i(function () {
o.call({})
})), "Number", {
toPrecision: function (e) {
var t = a(this, "Number#toPrecision: incorrect invocation!");
return void 0 === e ? o.call(t) : o.call(t, e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Number", {EPSILON: Math.pow(2, -52)})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(3).isFinite;
r(r.S, "Number", {
isFinite: function (e) {
return "number" == typeof e && i(e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(139), a = Math.abs;
r(r.S, "Number", {
isSafeInteger: function (e) {
return i(e) && a(e) <= 9007199254740991
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Number", {MAX_SAFE_INTEGER: 9007199254740991})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Number", {MIN_SAFE_INTEGER: -9007199254740991})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(136);
r(r.S + r.F * (Number.parseFloat != i), "Number", {parseFloat: i})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(135);
r(r.S + r.F * (Number.parseInt != i), "Number", {parseInt: i})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(141), a = Math.sqrt, o = Math.acosh;
r(r.S + r.F * !(o && 710 == Math.floor(o(Number.MAX_VALUE)) && o(1 / 0) == 1 / 0), "Math", {
acosh: function (e) {
return (e = +e) < 1 ? NaN : e > 94906265.62425156 ? Math.log(e) + Math.LN2 : i(e - 1 + a(e - 1) * a(e + 1))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = Math.asinh;
r(r.S + r.F * !(i && 1 / i(0) > 0), "Math", {
asinh: function e(t) {
return isFinite(t = +t) && 0 != t ? t < 0 ? -e(-t) : Math.log(t + Math.sqrt(t * t + 1)) : t
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = Math.atanh;
r(r.S + r.F * !(i && 1 / i(-0) < 0), "Math", {
atanh: function (e) {
return 0 == (e = +e) ? e : Math.log((1 + e) / (1 - e)) / 2
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(100);
r(r.S, "Math", {
cbrt: function (e) {
return i(e = +e) * Math.pow(Math.abs(e), 1 / 3)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
clz32: function (e) {
return (e >>>= 0) ? 31 - Math.floor(Math.log(e + .5) * Math.LOG2E) : 32
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = Math.exp;
r(r.S, "Math", {
cosh: function (e) {
return (i(e = +e) + i(-e)) / 2
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(101);
r(r.S + r.F * (i != Math.expm1), "Math", {expm1: i})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {fround: n(142)})
}, function (e, t, n) {
"use strict";
var r = n(0), i = Math.abs;
r(r.S, "Math", {
hypot: function (e, t) {
for (var n, r, a = 0, o = 0, s = arguments.length, l = 0; o < s;) l < (n = i(arguments[o++])) ? (a = a * (r = l / n) * r + 1, l = n) : a += n > 0 ? (r = n / l) * r : n;
return l === 1 / 0 ? 1 / 0 : l * Math.sqrt(a)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = Math.imul;
r(r.S + r.F * n(4)(function () {
return -5 != i(4294967295, 5) || 2 != i.length
}), "Math", {
imul: function (e, t) {
var n = +e, r = +t, i = 65535 & n, a = 65535 & r;
return 0 | i * a + ((65535 & n >>> 16) * a + i * (65535 & r >>> 16) << 16 >>> 0)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
log10: function (e) {
return Math.log(e) * Math.LOG10E
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {log1p: n(141)})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
log2: function (e) {
return Math.log(e) / Math.LN2
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {sign: n(100)})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(101), a = Math.exp;
r(r.S + r.F * n(4)(function () {
return -2e-17 != !Math.sinh(-2e-17)
}), "Math", {
sinh: function (e) {
return Math.abs(e = +e) < 1 ? (i(e) - i(-e)) / 2 : (a(e - 1) - a(-e - 1)) * (Math.E / 2)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(101), a = Math.exp;
r(r.S, "Math", {
tanh: function (e) {
var t = i(e = +e), n = i(-e);
return t == 1 / 0 ? 1 : n == 1 / 0 ? -1 : (t - n) / (a(e) + a(-e))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
trunc: function (e) {
return (e > 0 ? Math.floor : Math.ceil)(e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(47), a = String.fromCharCode, o = String.fromCodePoint;
r(r.S + r.F * (!!o && 1 != o.length), "String", {
fromCodePoint: function (e) {
for (var t, n = [], r = arguments.length, o = 0; r > o;) {
if (t = +arguments[o++], i(t, 1114111) !== t) throw RangeError(t + " is not a valid code point");
n.push(t < 65536 ? a(t) : a(55296 + ((t -= 65536) >> 10), t % 1024 + 56320))
}
return n.join("")
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(23), a = n(7);
r(r.S, "String", {
raw: function (e) {
for (var t = i(e.raw), n = a(t.length), r = arguments.length, o = [], s = 0; n > s;) o.push(String(t[s++])), s < r && o.push(String(arguments[s]));
return o.join("")
}
})
}, function (e, t, n) {
"use strict";
n(59)("trim", function (e) {
return function () {
return e(this, 3)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(74)(!1);
r(r.P, "String", {
codePointAt: function (e) {
return i(this, e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(7), a = n(104), o = "".endsWith;
r(r.P + r.F * n(105)("endsWith"), "String", {
endsWith: function (e) {
var t = a(this, e, "endsWith"), n = arguments.length > 1 ? arguments[1] : void 0, r = i(t.length),
s = void 0 === n ? r : Math.min(i(n), r), l = String(e);
return o ? o.call(t, l, s) : t.slice(s - l.length, s) === l
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(104);
r(r.P + r.F * n(105)("includes"), "String", {
includes: function (e) {
return !!~i(this, e, "includes").indexOf(e, arguments.length > 1 ? arguments[1] : void 0)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.P, "String", {repeat: n(99)})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(7), a = n(104), o = "".startsWith;
r(r.P + r.F * n(105)("startsWith"), "String", {
startsWith: function (e) {
var t = a(this, e, "startsWith"), n = i(Math.min(arguments.length > 1 ? arguments[1] : void 0, t.length)),
r = String(e);
return o ? o.call(t, r, n) : t.slice(n, n + r.length) === r
}
})
}, function (e, t, n) {
"use strict";
n(20)("anchor", function (e) {
return function (t) {
return e(this, "a", "name", t)
}
})
}, function (e, t, n) {
"use strict";
n(20)("big", function (e) {
return function () {
return e(this, "big", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("blink", function (e) {
return function () {
return e(this, "blink", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("bold", function (e) {
return function () {
return e(this, "b", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("fixed", function (e) {
return function () {
return e(this, "tt", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("fontcolor", function (e) {
return function (t) {
return e(this, "font", "color", t)
}
})
}, function (e, t, n) {
"use strict";
n(20)("fontsize", function (e) {
return function (t) {
return e(this, "font", "size", t)
}
})
}, function (e, t, n) {
"use strict";
n(20)("italics", function (e) {
return function () {
return e(this, "i", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("link", function (e) {
return function (t) {
return e(this, "a", "href", t)
}
})
}, function (e, t, n) {
"use strict";
n(20)("small", function (e) {
return function () {
return e(this, "small", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("strike", function (e) {
return function () {
return e(this, "strike", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("sub", function (e) {
return function () {
return e(this, "sub", "", "")
}
})
}, function (e, t, n) {
"use strict";
n(20)("sup", function (e) {
return function () {
return e(this, "sup", "", "")
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Date", {
now: function () {
return (new Date).getTime()
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(11), a = n(30);
r(r.P + r.F * n(4)(function () {
return null !== new Date(NaN).toJSON() || 1 !== Date.prototype.toJSON.call({
toISOString: function () {
return 1
}
})
}), "Date", {
toJSON: function (e) {
var t = i(this), n = a(t);
return "number" != typeof n || isFinite(n) ? t.toISOString() : null
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(267);
r(r.P + r.F * (Date.prototype.toISOString !== i), "Date", {toISOString: i})
}, function (e, t, n) {
"use strict";
var r = n(4), i = Date.prototype.getTime, a = Date.prototype.toISOString, o = function (e) {
return e > 9 ? e : "0" + e
};
e.exports = r(function () {
return "0385-07-25T07:06:39.999Z" != a.call(new Date(-5e13 - 1))
}) || !r(function () {
a.call(new Date(NaN))
}) ? function () {
if (!isFinite(i.call(this))) throw RangeError("Invalid time value");
var e = this, t = e.getUTCFullYear(), n = e.getUTCMilliseconds(), r = t < 0 ? "-" : t > 9999 ? "+" : "";
return r + ("00000" + Math.abs(t)).slice(r ? -6 : -4) + "-" + o(e.getUTCMonth() + 1) + "-" + o(e.getUTCDate()) + "T" + o(e.getUTCHours()) + ":" + o(e.getUTCMinutes()) + ":" + o(e.getUTCSeconds()) + "." + (n > 99 ? n : "0" + o(n)) + "Z"
} : a
}, function (e, t, n) {
"use strict";
var r = Date.prototype, i = r.toString, a = r.getTime;
new Date(NaN) + "" != "Invalid Date" && n(19)(r, "toString", function () {
var e = a.call(this);
return e == e ? i.call(this) : "Invalid Date"
})
}, function (e, t, n) {
"use strict";
var r = n(6)("toPrimitive"), i = Date.prototype;
r in i || n(18)(i, r, n(270))
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(30);
e.exports = function (e) {
if ("string" !== e && "number" !== e && "default" !== e) throw TypeError("Incorrect hint");
return i(r(this), "number" != e)
}
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Array", {isArray: n(73)})
}, function (e, t, n) {
"use strict";
var r = n(26), i = n(0), a = n(11), o = n(144), s = n(106), l = n(7), c = n(107), u = n(108);
i(i.S + i.F * !n(76)(function (e) {
Array.from(e)
}), "Array", {
from: function (e) {
var t, n, i, d, h = a(e), p = "function" == typeof this ? this : Array, f = arguments.length,
m = f > 1 ? arguments[1] : void 0, v = void 0 !== m, g = 0, y = u(h);
if (v && (m = r(m, f > 2 ? arguments[2] : void 0, 2)), void 0 == y || p == Array && s(y)) for (n = new p(t = l(h.length)); t > g; g++) c(n, g, v ? m(h[g], g) : h[g]); else for (d = y.call(h), n = new p; !(i = d.next()).done; g++) c(n, g, v ? o(d, m, [i.value, g], !0) : i.value);
return n.length = g, n
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(107);
r(r.S + r.F * n(4)(function () {
function e() {
}
return !(Array.of.call(e) instanceof e)
}), "Array", {
of: function () {
for (var e = 0, t = arguments.length, n = new ("function" == typeof this ? this : Array)(t); t > e;) i(n, e, arguments[e++]);
return n.length = t, n
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(23), a = [].join;
r(r.P + r.F * (n(65) != Object || !n(29)(a)), "Array", {
join: function (e) {
return a.call(i(this), void 0 === e ? "," : e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(94), a = n(27), o = n(47), s = n(7), l = [].slice;
r(r.P + r.F * n(4)(function () {
i && l.call(i)
}), "Array", {
slice: function (e, t) {
var n = s(this.length), r = a(this);
if (t = void 0 === t ? n : t, "Array" == r) return l.call(this, e, t);
for (var i = o(e, n), c = o(t, n), u = s(c - i), d = new Array(u), h = 0; h < u; h++) d[h] = "String" == r ? this.charAt(i + h) : this[i + h];
return d
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(15), a = n(11), o = n(4), s = [].sort, l = [1, 2, 3];
r(r.P + r.F * (o(function () {
l.sort(void 0)
}) || !o(function () {
l.sort(null)
}) || !n(29)(s)), "Array", {
sort: function (e) {
return void 0 === e ? s.call(a(this)) : s.call(a(this), i(e))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(33)(0), a = n(29)([].forEach, !0);
r(r.P + r.F * !a, "Array", {
forEach: function (e) {
return i(this, e, arguments[1])
}
})
}, function (e, t, n) {
"use strict";
var r = n(5), i = n(73), a = n(6)("species");
e.exports = function (e) {
var t;
return i(e) && ("function" != typeof (t = e.constructor) || t !== Array && !i(t.prototype) || (t = void 0), r(t) && null === (t = t[a]) && (t = void 0)), void 0 === t ? Array : t
}
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(33)(1);
r(r.P + r.F * !n(29)([].map, !0), "Array", {
map: function (e) {
return i(this, e, arguments[1])
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(33)(2);
r(r.P + r.F * !n(29)([].filter, !0), "Array", {
filter: function (e) {
return i(this, e, arguments[1])
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(33)(3);
r(r.P + r.F * !n(29)([].some, !0), "Array", {
some: function (e) {
return i(this, e, arguments[1])
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(33)(4);
r(r.P + r.F * !n(29)([].every, !0), "Array", {
every: function (e) {
return i(this, e, arguments[1])
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(145);
r(r.P + r.F * !n(29)([].reduce, !0), "Array", {
reduce: function (e) {
return i(this, e, arguments.length, arguments[1], !1)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(145);
r(r.P + r.F * !n(29)([].reduceRight, !0), "Array", {
reduceRight: function (e) {
return i(this, e, arguments.length, arguments[1], !0)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(71)(!1), a = [].indexOf, o = !!a && 1 / [1].indexOf(1, -0) < 0;
r(r.P + r.F * (o || !n(29)(a)), "Array", {
indexOf: function (e) {
return o ? a.apply(this, arguments) || 0 : i(this, e, arguments[1])
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(23), a = n(28), o = n(7), s = [].lastIndexOf, l = !!s && 1 / [1].lastIndexOf(1, -0) < 0;
r(r.P + r.F * (l || !n(29)(s)), "Array", {
lastIndexOf: function (e) {
if (l) return s.apply(this, arguments) || 0;
var t = i(this), n = o(t.length), r = n - 1;
for (arguments.length > 1 && (r = Math.min(r, a(arguments[1]))), r < 0 && (r = n + r); r >= 0; r--) if (r in t && t[r] === e) return r || 0;
return -1
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.P, "Array", {copyWithin: n(146)}), n(41)("copyWithin")
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.P, "Array", {fill: n(110)}), n(41)("fill")
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(33)(5), a = !0;
"find" in [] && Array(1).find(function () {
a = !1
}), r(r.P + r.F * a, "Array", {
find: function (e) {
return i(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
}), n(41)("find")
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(33)(6), a = "findIndex", o = !0;
a in [] && Array(1)[a](function () {
o = !1
}), r(r.P + r.F * o, "Array", {
findIndex: function (e) {
return i(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
}), n(41)(a)
}, function (e, t, n) {
"use strict";
n(50)("Array")
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(98), a = n(10).f, o = n(49).f, s = n(75), l = n(67), c = r.RegExp, u = c, d = c.prototype,
h = /a/g, p = /a/g, f = new c(h) !== h;
if (n(8) && (!f || n(4)(function () {
return p[n(6)("match")] = !1, c(h) != h || c(p) == p || "/a/i" != c(h, "i")
}))) {
c = function (e, t) {
var n = this instanceof c, r = s(e), a = void 0 === t;
return !n && r && e.constructor === c && a ? e : i(f ? new u(r && !a ? e.source : e, t) : u((r = e instanceof c) ? e.source : e, r && a ? l.call(e) : t), n ? this : d, c)
};
for (var m = function (e) {
e in c || a(c, e, {
configurable: !0, get: function () {
return u[e]
}, set: function (t) {
u[e] = t
}
})
}, v = o(u), g = 0; v.length > g;) m(v[g++]);
d.constructor = c, c.prototype = d, n(19)(r, "RegExp", c)
}
n(50)("RegExp")
}, function (e, t, n) {
"use strict";
n(149);
var r = n(1), i = n(67), a = n(8), o = /./.toString, s = function (e) {
n(19)(RegExp.prototype, "toString", e, !0)
};
n(4)(function () {
return "/a/b" != o.call({source: "a", flags: "b"})
}) ? s(function () {
var e = r(this);
return "/".concat(e.source, "/", "flags" in e ? e.flags : !a && e instanceof RegExp ? i.call(e) : void 0)
}) : "toString" != o.name && s(function () {
return o.call(this)
})
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(7), a = n(113), o = n(77);
n(78)("match", 1, function (e, t, n, s) {
return [function (n) {
var r = e(this), i = void 0 == n ? void 0 : n[t];
return void 0 !== i ? i.call(n, r) : new RegExp(n)[t](String(r))
}, function (e) {
var t = s(n, e, this);
if (t.done) return t.value;
var l = r(e), c = String(this);
if (!l.global) return o(l, c);
var u = l.unicode;
l.lastIndex = 0;
for (var d, h = [], p = 0; null !== (d = o(l, c));) {
var f = String(d[0]);
h[p] = f, "" === f && (l.lastIndex = a(c, i(l.lastIndex), u)), p++
}
return 0 === p ? null : h
}]
})
}, function (e, t, n) {
"use strict";
var r = n(1), i = (n(11), n(7)), a = n(28), o = n(113), s = n(77), l = Math.max, c = Math.min;
Math.floor;
n(78)("replace", 2, function (e, t, n, u) {
return [function (r, i) {
var a = e(this), o = void 0 == r ? void 0 : r[t];
return void 0 !== o ? o.call(r, a, i) : n.call(String(a), r, i)
}, function (e, t) {
var d = u(n, e, this, t);
if (d.done) return d.value;
var h = r(e), p = String(this), f = "function" == typeof t;
f || (t = String(t));
var m = h.global;
if (m) {
var v = h.unicode;
h.lastIndex = 0
}
for (var g = []; ;) {
var y = s(h, p);
if (null === y) break;
if (g.push(y), !m) break;
"" === String(y[0]) && (h.lastIndex = o(p, i(h.lastIndex), v))
}
for (var b, w = "", S = 0, _ = 0; _ < g.length; _++) {
y = g[_];
for (var k = String(y[0]), x = l(c(a(y.index), p.length), 0), P = [], C = 1; C < y.length; C++) P.push(void 0 === (b = y[C]) ? b : String(b));
var A = y.groups;
if (f) {
var T = [k].concat(P, x, p);
void 0 !== A && T.push(A);
var E = String(t.apply(void 0, T))
} else E = getSubstitution(k, p, x, P, A, t);
x >= S && (w += p.slice(S, x) + E, S = x + k.length)
}
return w + p.slice(S)
}]
})
}, function (e, t, n) {
"use strict";
var r = n(1), i = n(132), a = n(77);
n(78)("search", 1, function (e, t, n, o) {
return [function (n) {
var r = e(this), i = void 0 == n ? void 0 : n[t];
return void 0 !== i ? i.call(n, r) : new RegExp(n)[t](String(r))
}, function (e) {
var t = o(n, e, this);
if (t.done) return t.value;
var s = r(e), l = String(this), c = s.lastIndex;
i(c, 0) || (s.lastIndex = 0);
var u = a(s, l);
return i(s.lastIndex, c) || (s.lastIndex = c), null === u ? -1 : u.index
}]
})
}, function (e, t, n) {
"use strict";
var r = n(75), i = n(1), a = n(68), o = n(113), s = n(7), l = n(77), c = n(112), u = n(4), d = Math.min, h = [].push,
p = !u(function () {
RegExp(4294967295, "y")
});
n(78)("split", 2, function (e, t, n, u) {
var f;
return f = "c" == "abbc".split(/(b)*/)[1] || 4 != "test".split(/(?:)/, -1).length || 2 != "ab".split(/(?:ab)*/).length || 4 != ".".split(/(.?)(.?)/).length || ".".split(/()()/).length > 1 || "".split(/.?/).length ? function (e, t) {
var i = String(this);
if (void 0 === e && 0 === t) return [];
if (!r(e)) return n.call(i, e, t);
for (var a, o, s, l = [], u = (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.unicode ? "u" : "") + (e.sticky ? "y" : ""), d = 0, p = void 0 === t ? 4294967295 : t >>> 0, f = new RegExp(e.source, u + "g"); (a = c.call(f, i)) && !((o = f.lastIndex) > d && (l.push(i.slice(d, a.index)), a.length > 1 && a.index < i.length && h.apply(l, a.slice(1)), s = a[0].length, d = o, l.length >= p));) f.lastIndex === a.index && f.lastIndex++;
return d === i.length ? !s && f.test("") || l.push("") : l.push(i.slice(d)), l.length > p ? l.slice(0, p) : l
} : "0".split(void 0, 0).length ? function (e, t) {
return void 0 === e && 0 === t ? [] : n.call(this, e, t)
} : n, [function (n, r) {
var i = e(this), a = void 0 == n ? void 0 : n[t];
return void 0 !== a ? a.call(n, i, r) : f.call(String(i), n, r)
}, function (e, t) {
var r = u(f, e, this, t, f !== n);
if (r.done) return r.value;
var c = i(e), h = String(this), m = a(c, RegExp), v = c.unicode,
g = (c.ignoreCase ? "i" : "") + (c.multiline ? "m" : "") + (c.unicode ? "u" : "") + (p ? "y" : "g"),
y = new m(p ? c : "^(?:" + c.source + ")", g), b = void 0 === t ? 4294967295 : t >>> 0;
if (0 === b) return [];
if (0 === h.length) return null === l(y, h) ? [h] : [];
for (var w = 0, S = 0, _ = []; S < h.length;) {
y.lastIndex = p ? S : 0;
var k, x = l(y, p ? h : h.slice(S));
if (null === x || (k = d(s(y.lastIndex + (p ? 0 : S)), h.length)) === w) S = o(h, S, v); else {
if (_.push(h.slice(w, S)), _.length === b) return _;
for (var P = 1; P <= x.length - 1; P++) if (_.push(x[P]), _.length === b) return _;
S = w = k
}
}
return _.push(h.slice(w)), _
}]
})
}, function (e, t, n) {
"use strict";
var r = n(156), i = n(54);
n(80)("WeakSet", function (e) {
return function () {
return e(this, arguments.length > 0 ? arguments[0] : void 0)
}
}, {
add: function (e) {
return r.def(i(this, "WeakSet"), e, !0)
}
}, r, !1, !0)
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(81), a = n(118), o = n(1), s = n(47), l = n(7), c = n(5), u = n(3).ArrayBuffer, d = n(68),
h = a.ArrayBuffer, p = a.DataView, f = i.ABV && u.isView, m = h.prototype.slice, v = i.VIEW;
r(r.G + r.W + r.F * (u !== h), {ArrayBuffer: h}), r(r.S + r.F * !i.CONSTR, "ArrayBuffer", {
isView: function (e) {
return f && f(e) || c(e) && v in e
}
}), r(r.P + r.U + r.F * n(4)(function () {
return !new h(2).slice(1, void 0).byteLength
}), "ArrayBuffer", {
slice: function (e, t) {
if (void 0 !== m && void 0 === t) return m.call(o(this), e);
for (var n = o(this).byteLength, r = s(e, n), i = s(void 0 === t ? n : t, n), a = new (d(this, h))(l(i - r)), c = new p(this), u = new p(a), f = 0; r < i;) u.setUint8(f++, c.getUint8(r++));
return a
}
}), n(50)("ArrayBuffer")
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.G + r.W + r.F * !n(81).ABV, {DataView: n(118).DataView})
}, function (e, t, n) {
"use strict";
n(35)("Int8", 1, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
n(35)("Uint8", 1, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
n(35)("Int16", 2, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
n(35)("Uint16", 2, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
n(35)("Int32", 4, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
n(35)("Uint32", 4, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
n(35)("Float32", 4, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
n(35)("Float64", 8, function (e) {
return function (t, n, r) {
return e(this, t, n, r)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(15), a = n(1), o = (n(3).Reflect || {}).apply, s = Function.apply;
r(r.S + r.F * !n(4)(function () {
o(function () {
})
}), "Reflect", {
apply: function (e, t, n) {
var r = i(e), l = a(n);
return o ? o(r, t, l) : s.call(r, t, l)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(48), a = n(15), o = n(1), s = n(5), l = n(4), c = n(133), u = (n(3).Reflect || {}).construct,
d = l(function () {
function e() {
}
return !(u(function () {
}, [], e) instanceof e)
}), h = !l(function () {
u(function () {
})
});
r(r.S + r.F * (d || h), "Reflect", {
construct: function (e, t) {
a(e), o(t);
var n = arguments.length < 3 ? e : a(arguments[2]);
if (h && !d) return u(e, t, n);
if (e == n) {
switch (t.length) {
case 0:
return new e;
case 1:
return new e(t[0]);
case 2:
return new e(t[0], t[1]);
case 3:
return new e(t[0], t[1], t[2]);
case 4:
return new e(t[0], t[1], t[2], t[3])
}
var r = [null];
return r.push.apply(r, t), new (c.apply(e, r))
}
var l = n.prototype, p = i(s(l) ? l : Object.prototype), f = Function.apply.call(e, p, t);
return s(f) ? f : p
}
})
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(0), a = n(1), o = n(30);
i(i.S + i.F * n(4)(function () {
Reflect.defineProperty(r.f({}, 1, {value: 1}), 1, {value: 2})
}), "Reflect", {
defineProperty: function (e, t, n) {
a(e), t = o(t, !0), a(n);
try {
return r.f(e, t, n), !0
} catch (e) {
return !1
}
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(24).f, a = n(1);
r(r.S, "Reflect", {
deleteProperty: function (e, t) {
var n = i(a(e), t);
return !(n && !n.configurable) && delete e[t]
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(1), a = function (e) {
this._t = i(e), this._i = 0;
var t, n = this._k = [];
for (t in e) n.push(t)
};
n(103)(a, "Object", function () {
var e, t = this._k;
do {
if (this._i >= t.length) return {value: void 0, done: !0}
} while (!((e = t[this._i++]) in this._t));
return {value: e, done: !1}
}), r(r.S, "Reflect", {
enumerate: function (e) {
return new a(e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(24), i = n(25), a = n(22), o = n(0), s = n(5), l = n(1);
o(o.S, "Reflect", {
get: function e(t, n) {
var o, c, u = arguments.length < 3 ? t : arguments[2];
return l(t) === u ? t[n] : (o = r.f(t, n)) ? a(o, "value") ? o.value : void 0 !== o.get ? o.get.call(u) : void 0 : s(c = i(t)) ? e(c, n, u) : void 0
}
})
}, function (e, t, n) {
"use strict";
var r = n(24), i = n(0), a = n(1);
i(i.S, "Reflect", {
getOwnPropertyDescriptor: function (e, t) {
return r.f(a(e), t)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(25), a = n(1);
r(r.S, "Reflect", {
getPrototypeOf: function (e) {
return i(a(e))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Reflect", {
has: function (e, t) {
return t in e
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(1), a = Object.isExtensible;
r(r.S, "Reflect", {
isExtensible: function (e) {
return i(e), !a || a(e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Reflect", {ownKeys: n(159)})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(1), a = Object.preventExtensions;
r(r.S, "Reflect", {
preventExtensions: function (e) {
i(e);
try {
return a && a(e), !0
} catch (e) {
return !1
}
}
})
}, function (e, t, n) {
"use strict";
var r = n(10), i = n(24), a = n(25), o = n(22), s = n(0), l = n(44), c = n(1), u = n(5);
s(s.S, "Reflect", {
set: function e(t, n, s) {
var d, h, p = arguments.length < 4 ? t : arguments[3], f = i.f(c(t), n);
if (!f) {
if (u(h = a(t))) return e(h, n, s, p);
f = l(0)
}
if (o(f, "value")) {
if (!1 === f.writable || !u(p)) return !1;
if (d = i.f(p, n)) {
if (d.get || d.set || !1 === d.writable) return !1;
d.value = s, r.f(p, n, d)
} else r.f(p, n, l(0, s));
return !0
}
return void 0 !== f.set && (f.set.call(p, s), !0)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(95);
i && r(r.S, "Reflect", {
setPrototypeOf: function (e, t) {
i.check(e, t);
try {
return i.set(e, t), !0
} catch (e) {
return !1
}
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(71)(!0);
r(r.P, "Array", {
includes: function (e) {
return i(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
}), n(41)("includes")
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(160), a = n(11), o = n(7), s = n(15), l = n(109);
r(r.P, "Array", {
flatMap: function (e) {
var t, n, r = a(this);
return s(e), t = o(r.length), n = l(r, 0), i(n, r, r, t, 0, 1, e, arguments[1]), n
}
}), n(41)("flatMap")
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(160), a = n(11), o = n(7), s = n(28), l = n(109);
r(r.P, "Array", {
flatten: function () {
var e = arguments[0], t = a(this), n = o(t.length), r = l(t, 0);
return i(r, t, t, n, 0, void 0 === e ? 1 : s(e)), r
}
}), n(41)("flatten")
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(74)(!0);
r(r.P, "String", {
at: function (e) {
return i(this, e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(161), a = n(79), o = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(a);
r(r.P + r.F * o, "String", {
padStart: function (e) {
return i(this, e, arguments.length > 1 ? arguments[1] : void 0, !0)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(161), a = n(79), o = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(a);
r(r.P + r.F * o, "String", {
padEnd: function (e) {
return i(this, e, arguments.length > 1 ? arguments[1] : void 0, !1)
}
})
}, function (e, t, n) {
"use strict";
n(59)("trimLeft", function (e) {
return function () {
return e(this, 1)
}
}, "trimStart")
}, function (e, t, n) {
"use strict";
n(59)("trimRight", function (e) {
return function () {
return e(this, 2)
}
}, "trimEnd")
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(31), a = n(7), o = n(75), s = n(67), l = RegExp.prototype, c = function (e, t) {
this._r = e, this._s = t
};
n(103)(c, "RegExp String", function () {
var e = this._r.exec(this._s);
return {value: e, done: null === e}
}), r(r.P, "String", {
matchAll: function (e) {
if (i(this), !o(e)) throw TypeError(e + " is not a regexp!");
var t = String(this), n = "flags" in l ? String(e.flags) : s.call(e),
r = new RegExp(e.source, ~n.indexOf("g") ? n : "g" + n);
return r.lastIndex = a(e.lastIndex), new c(r, t)
}
})
}, function (e, t, n) {
"use strict";
n(91)("asyncIterator")
}, function (e, t, n) {
"use strict";
n(91)("observable")
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(159), a = n(23), o = n(24), s = n(107);
r(r.S, "Object", {
getOwnPropertyDescriptors: function (e) {
for (var t, n, r = a(e), l = o.f, c = i(r), u = {}, d = 0; c.length > d;) void 0 !== (n = l(r, t = c[d++])) && s(u, t, n);
return u
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(162)(!1);
r(r.S, "Object", {
values: function (e) {
return i(e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(162)(!0);
r(r.S, "Object", {
entries: function (e) {
return i(e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(11), a = n(15), o = n(10);
n(8) && r(r.P + n(82), "Object", {
__defineGetter__: function (e, t) {
o.f(i(this), e, {get: a(t), enumerable: !0, configurable: !0})
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(11), a = n(15), o = n(10);
n(8) && r(r.P + n(82), "Object", {
__defineSetter__: function (e, t) {
o.f(i(this), e, {set: a(t), enumerable: !0, configurable: !0})
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(11), a = n(30), o = n(25), s = n(24).f;
n(8) && r(r.P + n(82), "Object", {
__lookupGetter__: function (e) {
var t, n = i(this), r = a(e, !0);
do {
if (t = s(n, r)) return t.get
} while (n = o(n))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(11), a = n(30), o = n(25), s = n(24).f;
n(8) && r(r.P + n(82), "Object", {
__lookupSetter__: function (e) {
var t, n = i(this), r = a(e, !0);
do {
if (t = s(n, r)) return t.set
} while (n = o(n))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.P + r.R, "Map", {toJSON: n(163)("Map")})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.P + r.R, "Set", {toJSON: n(163)("Set")})
}, function (e, t, n) {
"use strict";
n(83)("Map")
}, function (e, t, n) {
"use strict";
n(83)("Set")
}, function (e, t, n) {
"use strict";
n(83)("WeakSet")
}, function (e, t, n) {
"use strict";
n(84)("Map")
}, function (e, t, n) {
"use strict";
n(84)("Set")
}, function (e, t, n) {
"use strict";
n(84)("WeakSet")
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.G, {global: n(3)})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "System", {global: n(3)})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(27);
r(r.S, "Error", {
isError: function (e) {
return "Error" === i(e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
clamp: function (e, t, n) {
return Math.min(n, Math.max(t, e))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {DEG_PER_RAD: Math.PI / 180})
}, function (e, t, n) {
"use strict";
var r = n(0), i = 180 / Math.PI;
r(r.S, "Math", {
degrees: function (e) {
return e * i
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(167), a = n(142);
r(r.S, "Math", {
fscale: function (e, t, n, r, o) {
return a(i(e, t, n, r, o))
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
iaddh: function (e, t, n, r) {
var i = e >>> 0, a = n >>> 0;
return (t >>> 0) + (r >>> 0) + ((i & a | (i | a) & ~(i + a >>> 0)) >>> 31) | 0
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
isubh: function (e, t, n, r) {
var i = e >>> 0, a = n >>> 0;
return (t >>> 0) - (r >>> 0) - ((~i & a | ~(i ^ a) & i - a >>> 0) >>> 31) | 0
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
imulh: function (e, t) {
var n = +e, r = +t, i = 65535 & n, a = 65535 & r, o = n >> 16, s = r >> 16, l = (o * a >>> 0) + (i * a >>> 16);
return o * s + (l >> 16) + ((i * s >>> 0) + (65535 & l) >> 16)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {RAD_PER_DEG: 180 / Math.PI})
}, function (e, t, n) {
"use strict";
var r = n(0), i = Math.PI / 180;
r(r.S, "Math", {
radians: function (e) {
return e * i
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {scale: n(167)})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
umulh: function (e, t) {
var n = +e, r = +t, i = 65535 & n, a = 65535 & r, o = n >>> 16, s = r >>> 16, l = (o * a >>> 0) + (i * a >>> 16);
return o * s + (l >>> 16) + ((i * s >>> 0) + (65535 & l) >>> 16)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0);
r(r.S, "Math", {
signbit: function (e) {
return (e = +e) != e ? e : 0 == e ? 1 / e == 1 / 0 : e > 0
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = r.key, o = r.set;
r.exp({
defineMetadata: function (e, t, n, r) {
o(e, t, i(n), a(r))
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = r.key, o = r.map, s = r.store;
r.exp({
deleteMetadata: function (e, t) {
var n = arguments.length < 3 ? void 0 : a(arguments[2]), r = o(i(t), n, !1);
if (void 0 === r || !r.delete(e)) return !1;
if (r.size) return !0;
var l = s.get(t);
return l.delete(n), !!l.size || s.delete(t)
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = n(25), o = r.has, s = r.get, l = r.key;
r.exp({
getMetadata: function (e, t) {
return function e(t, n, r) {
if (o(t, n, r)) return s(t, n, r);
var i = a(n);
return null !== i ? e(t, i, r) : void 0
}(e, i(t), arguments.length < 3 ? void 0 : l(arguments[2]))
}
})
}, function (e, t, n) {
"use strict";
var r = n(155), i = n(164), a = n(36), o = n(1), s = n(25), l = a.keys, c = a.key;
a.exp({
getMetadataKeys: function (e) {
return function e(t, n) {
var a = l(t, n), o = s(t);
if (null === o) return a;
var c = e(o, n);
return c.length ? a.length ? i(new r(a.concat(c))) : c : a
}(o(e), arguments.length < 2 ? void 0 : c(arguments[1]))
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = r.get, o = r.key;
r.exp({
getOwnMetadata: function (e, t) {
return a(e, i(t), arguments.length < 3 ? void 0 : o(arguments[2]))
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = r.keys, o = r.key;
r.exp({
getOwnMetadataKeys: function (e) {
return a(i(e), arguments.length < 2 ? void 0 : o(arguments[1]))
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = n(25), o = r.has, s = r.key;
r.exp({
hasMetadata: function (e, t) {
return function e(t, n, r) {
if (o(t, n, r)) return !0;
var i = a(n);
return null !== i && e(t, i, r)
}(e, i(t), arguments.length < 3 ? void 0 : s(arguments[2]))
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = r.has, o = r.key;
r.exp({
hasOwnMetadata: function (e, t) {
return a(e, i(t), arguments.length < 3 ? void 0 : o(arguments[2]))
}
})
}, function (e, t, n) {
"use strict";
var r = n(36), i = n(1), a = n(15), o = r.key, s = r.set;
r.exp({
metadata: function (e, t) {
return function (n, r) {
s(e, t, (void 0 !== r ? i : a)(n), o(r))
}
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(115)(), a = n(3).process, o = "process" == n(27)(a);
r(r.G, {
asap: function (e) {
var t = o && a.domain;
i(t ? t.bind(e) : e)
}
})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(3), a = n(13), o = n(115)(), s = n(6)("observable"), l = n(15), c = n(1), u = n(51), d = n(53),
h = n(18), p = n(52), f = p.RETURN, m = function (e) {
return null == e ? void 0 : l(e)
}, v = function (e) {
var t = e._c;
t && (e._c = void 0, t())
}, g = function (e) {
return void 0 === e._o
}, y = function (e) {
g(e) || (e._o = void 0, v(e))
}, b = function (e, t) {
c(e), this._c = void 0, this._o = e, e = new w(this);
try {
var n = t(e), r = n;
null != n && ("function" == typeof n.unsubscribe ? n = function () {
r.unsubscribe()
} : l(n), this._c = n)
} catch (t) {
return void e.error(t)
}
g(this) && v(this)
};
b.prototype = d({}, {
unsubscribe: function () {
y(this)
}
});
var w = function (e) {
this._s = e
};
w.prototype = d({}, {
next: function (e) {
var t = this._s;
if (!g(t)) {
var n = t._o;
try {
var r = m(n.next);
if (r) return r.call(n, e)
} catch (e) {
try {
y(t)
} finally {
throw e
}
}
}
}, error: function (e) {
var t = this._s;
if (g(t)) throw e;
var n = t._o;
t._o = void 0;
try {
var r = m(n.error);
if (!r) throw e;
e = r.call(n, e)
} catch (e) {
try {
v(t)
} finally {
throw e
}
}
return v(t), e
}, complete: function (e) {
var t = this._s;
if (!g(t)) {
var n = t._o;
t._o = void 0;
try {
var r = m(n.complete);
e = r ? r.call(n, e) : void 0
} catch (e) {
try {
v(t)
} finally {
throw e
}
}
return v(t), e
}
}
});
var S = function (e) {
u(this, S, "Observable", "_f")._f = l(e)
};
d(S.prototype, {
subscribe: function (e) {
return new b(e, this._f)
}, forEach: function (e) {
var t = this;
return new (a.Promise || i.Promise)(function (n, r) {
l(e);
var i = t.subscribe({
next: function (t) {
try {
return e(t)
} catch (e) {
r(e), i.unsubscribe()
}
}, error: r, complete: n
})
})
}
}), d(S, {
from: function (e) {
var t = "function" == typeof this ? this : S, n = m(c(e)[s]);
if (n) {
var r = c(n.call(e));
return r.constructor === t ? r : new t(function (e) {
return r.subscribe(e)
})
}
return new t(function (t) {
var n = !1;
return o(function () {
if (!n) {
try {
if (p(e, !1, function (e) {
if (t.next(e), n) return f
}) === f) return
} catch (e) {
if (n) throw e;
return void t.error(e)
}
t.complete()
}
}), function () {
n = !0
}
})
}, of: function () {
for (var e = 0, t = arguments.length, n = new Array(t); e < t;) n[e] = arguments[e++];
return new ("function" == typeof this ? this : S)(function (e) {
var t = !1;
return o(function () {
if (!t) {
for (var r = 0; r < n.length; ++r) if (e.next(n[r]), t) return;
e.complete()
}
}), function () {
t = !0
}
})
}
}), h(S.prototype, s, function () {
return this
}), r(r.G, {Observable: S}), n(50)("Observable")
}, function (e, t, n) {
"use strict";
var r = n(3), i = n(0), a = n(79), o = [].slice, s = /MSIE .\./.test(a), l = function (e) {
return function (t, n) {
var r = arguments.length > 2, i = !!r && o.call(arguments, 2);
return e(r ? function () {
("function" == typeof t ? t : Function(t)).apply(this, i)
} : t, n)
}
};
i(i.G + i.B + i.F * s, {setTimeout: l(r.setTimeout), setInterval: l(r.setInterval)})
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(114);
r(r.G + r.B, {setImmediate: i.set, clearImmediate: i.clear})
}, function (e, t, n) {
"use strict";
(function (e) {
var t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
!function (n) {
var r, i = Object.prototype, a = i.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {},
s = o.iterator || "@@iterator", l = o.asyncIterator || "@@asyncIterator", c = o.toStringTag || "@@toStringTag",
u = "object" === t(e), d = n.regeneratorRuntime;
if (d) u && (e.exports = d); else {
(d = n.regeneratorRuntime = u ? e.exports : {}).wrap = S;
var h = "suspendedStart", p = "suspendedYield", f = "executing", m = "completed", v = {}, g = {};
g[s] = function () {
return this
};
var y = Object.getPrototypeOf, b = y && y(y(L([])));
b && b !== i && a.call(b, s) && (g = b);
var w = P.prototype = k.prototype = Object.create(g);
x.prototype = w.constructor = P, P.constructor = x, P[c] = x.displayName = "GeneratorFunction", d.isGeneratorFunction = function (e) {
var t = "function" == typeof e && e.constructor;
return !!t && (t === x || "GeneratorFunction" === (t.displayName || t.name))
}, d.mark = function (e) {
return Object.setPrototypeOf ? Object.setPrototypeOf(e, P) : (e.__proto__ = P, c in e || (e[c] = "GeneratorFunction")), e.prototype = Object.create(w), e
}, d.awrap = function (e) {
return {__await: e}
}, C(A.prototype), A.prototype[l] = function () {
return this
}, d.AsyncIterator = A, d.async = function (e, t, n, r) {
var i = new A(S(e, t, n, r));
return d.isGeneratorFunction(t) ? i : i.next().then(function (e) {
return e.done ? e.value : i.next()
})
}, C(w), w[c] = "Generator", w[s] = function () {
return this
}, w.toString = function () {
return "[object Generator]"
}, d.keys = function (e) {
var t = [];
for (var n in e) t.push(n);
return t.reverse(), function n() {
for (; t.length;) {
var r = t.pop();
if (r in e) return n.value = r, n.done = !1, n
}
return n.done = !0, n
}
}, d.values = L, I.prototype = {
constructor: I, reset: function (e) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = r, this.done = !1, this.delegate = null, this.method = "next", this.arg = r, this.tryEntries.forEach(D), !e) for (var t in this) "t" === t.charAt(0) && a.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = r)
}, stop: function () {
this.done = !0;
var e = this.tryEntries[0].completion;
if ("throw" === e.type) throw e.arg;
return this.rval
}, dispatchException: function (e) {
if (this.done) throw e;
var t = this;
function n(n, i) {
return s.type = "throw", s.arg = e, t.next = n, i && (t.method = "next", t.arg = r), !!i
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var o = this.tryEntries[i], s = o.completion;
if ("root" === o.tryLoc) return n("end");
if (o.tryLoc <= this.prev) {
var l = a.call(o, "catchLoc"), c = a.call(o, "finallyLoc");
if (l && c) {
if (this.prev < o.catchLoc) return n(o.catchLoc, !0);
if (this.prev < o.finallyLoc) return n(o.finallyLoc)
} else if (l) {
if (this.prev < o.catchLoc) return n(o.catchLoc, !0)
} else {
if (!c) throw new Error("try statement without catch or finally");
if (this.prev < o.finallyLoc) return n(o.finallyLoc)
}
}
}
}, abrupt: function (e, t) {
for (var n = this.tryEntries.length - 1; n >= 0; --n) {
var r = this.tryEntries[n];
if (r.tryLoc <= this.prev && a.call(r, "finallyLoc") && this.prev < r.finallyLoc) {
var i = r;
break
}
}
i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc && (i = null);
var o = i ? i.completion : {};
return o.type = e, o.arg = t, i ? (this.method = "next", this.next = i.finallyLoc, v) : this.complete(o)
}, complete: function (e, t) {
if ("throw" === e.type) throw e.arg;
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), v
}, finish: function (e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), D(n), v
}
}, catch: function (e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.tryLoc === e) {
var r = n.completion;
if ("throw" === r.type) {
var i = r.arg;
D(n)
}
return i
}
}
throw new Error("illegal catch attempt")
}, delegateYield: function (e, t, n) {
return this.delegate = {
iterator: L(e),
resultName: t,
nextLoc: n
}, "next" === this.method && (this.arg = r), v
}
}
}
function S(e, t, n, r) {
var i = t && t.prototype instanceof k ? t : k, a = Object.create(i.prototype), o = new I(r || []);
return a._invoke = function (e, t, n) {
var r = h;
return function (i, a) {
if (r === f) throw new Error("Generator is already running");
if (r === m) {
if ("throw" === i) throw a;
return O()
}
for (n.method = i, n.arg = a; ;) {
var o = n.delegate;
if (o) {
var s = T(o, n);
if (s) {
if (s === v) continue;
return s
}
}
if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) {
if (r === h) throw r = m, n.arg;
n.dispatchException(n.arg)
} else "return" === n.method && n.abrupt("return", n.arg);
r = f;
var l = _(e, t, n);
if ("normal" === l.type) {
if (r = n.done ? m : p, l.arg === v) continue;
return {value: l.arg, done: n.done}
}
"throw" === l.type && (r = m, n.method = "throw", n.arg = l.arg)
}
}
}(e, n, o), a
}
function _(e, t, n) {
try {
return {type: "normal", arg: e.call(t, n)}
} catch (e) {
return {type: "throw", arg: e}
}
}
function k() {
}
function x() {
}
function P() {
}
function C(e) {
["next", "throw", "return"].forEach(function (t) {
e[t] = function (e) {
return this._invoke(t, e)
}
})
}
function A(e) {
function r(n, i, o, s) {
var l = _(e[n], e, i);
if ("throw" !== l.type) {
var c = l.arg, u = c.value;
return u && "object" === (void 0 === u ? "undefined" : t(u)) && a.call(u, "__await") ? Promise.resolve(u.__await).then(function (e) {
r("next", e, o, s)
}, function (e) {
r("throw", e, o, s)
}) : Promise.resolve(u).then(function (e) {
c.value = e, o(c)
}, s)
}
s(l.arg)
}
var i;
"object" === t(n.process) && n.process.domain && (r = n.process.domain.bind(r)), this._invoke = function (e, t) {
function n() {
return new Promise(function (n, i) {
r(e, t, n, i)
})
}
return i = i ? i.then(n, n) : n()
}
}
function T(e, t) {
var n = e.iterator[t.method];
if (n === r) {
if (t.delegate = null, "throw" === t.method) {
if (e.iterator.return && (t.method = "return", t.arg = r, T(e, t), "throw" === t.method)) return v;
t.method = "throw", t.arg = new TypeError("The iterator does not provide a 'throw' method")
}
return v
}
var i = _(n, e.iterator, t.arg);
if ("throw" === i.type) return t.method = "throw", t.arg = i.arg, t.delegate = null, v;
var a = i.arg;
return a ? a.done ? (t[e.resultName] = a.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = r), t.delegate = null, v) : a : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, v)
}
function E(e) {
var t = {tryLoc: e[0]};
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t)
}
function D(e) {
var t = e.completion || {};
t.type = "normal", delete t.arg, e.completion = t
}
function I(e) {
this.tryEntries = [{tryLoc: "root"}], e.forEach(E, this), this.reset(!0)
}
function L(e) {
if (e) {
var t = e[s];
if (t) return t.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var n = -1, i = function t() {
for (; ++n < e.length;) if (a.call(e, n)) return t.value = e[n], t.done = !1, t;
return t.value = r, t.done = !0, t
};
return i.next = i
}
}
return {next: O}
}
function O() {
return {value: r, done: !0}
}
}("object" === ("undefined" == typeof global ? "undefined" : t(global)) ? global : "object" === ("undefined" == typeof window ? "undefined" : t(window)) ? window : "object" === ("undefined" == typeof self ? "undefined" : t(self)) ? self : void 0)
}).call(t, n(61)(e))
}, function (e, t, n) {
"use strict";
n(379), e.exports = n(13).RegExp.escape
}, function (e, t, n) {
"use strict";
var r = n(0), i = n(380)(/[\\^$*+?.()|[\]{}]/g, "\\$&");
r(r.S, "RegExp", {
escape: function (e) {
return i(e)
}
})
}, function (e, t, n) {
"use strict";
e.exports = function (e, t) {
var n = t === Object(t) ? function (e) {
return t[e]
} : t;
return function (t) {
return String(t).replace(e, n)
}
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFStampSeal = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(21), o = n(122), s = n(42), l = n(2), c = n(383), u = n(55), d = p(n(17)), h = p(n(34));
function p(e) {
return e && e.__esModule ? e : {default: e}
}
var f = u.iWebAssistError.getKeyInfo, m = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.KGPdfViewerWebApp = t, this.userCode = this.KGPdfViewerWebApp.userCode, this.imgTag = this.KGPdfViewerWebApp.imgTag, this.keyPwd = null, this.passwordPrompt = t.getPasswordPrompt(), this.getSealsFromServer = this.getSealsFromServer.bind(this), this.SCSJTT_getFirstSealFromServer = this.SCSJTT_getFirstSealFromServer.bind(this), this.getSealsFromKey_OFD = this.getSealsFromKey_OFD.bind(this), this.getSealsFromKey_PDF = this.getSealsFromKey_PDF.bind(this), this.transparentImg = this.transparentImg.bind(this), this.passwordPromptCallback = this.passwordPromptCallback.bind(this)
}
return i(e, [{
key: "createAddSealPromise", value: function () {
var e = this, t = (0, u.createCapability)(), n = this.KGPdfViewerWebApp, i = n.externalStampSeal,
a = n.externalUnit, o = n.sealOrigin, s = n.certOrigin, c = n.fileType, d = n.stampType, h = n.sealType,
p = n.externalSign, f = n.PDFViewerApplication;
return t.promise.then(function (t) {
var n = t.capability, i = t.sealdata, a = t.captcha;
if ("OFD" === c || 2 == d && "GM" == h) {
var p = function () {
e.KGPdfViewerWebApp.getTipPrompt().open("正在进行签章加盖...");
for (var t = [], r = void 0, c = function (e) {
var n = i[e];
"signature" == n.sealType ? 1 === o && 1 === s ? (r || (r = new u.iWebAssist({cilentType: "0"})), t.push(new Promise(function (e, t) {
r.promise.then(function () {
return r.makeGMV4Data(n)
}).then(function (r) {
r.result ? (n.version = 4, n.sealData = r.res, e(n)) : t(r.errmsg)
}).catch(function (e) {
(0, l.closeOverlay)().then(function () {
window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e)
})
})
}))) : t.push(window.KGPdfViewerWebApp.transformSignatureToGmSeal(n)) : t.push(n)
}, d = 0; d < i.length; d++) c(d);
return {
v: Promise.all(t).then(function (e) {
return Promise.resolve({capability: n, sealdata: e, captcha: a})
}).catch(function (e) {
n.resolve({status: !1}), f.KGAlertPrompt.open(e)
})
}
}();
if ("object" === (void 0 === p ? "undefined" : r(p))) return p.v
}
return Promise.resolve({capability: n, sealdata: i, captcha: a})
}).then(function (t) {
if (t) if (null != i) {
var n = t.sealdata.map(function (e) {
var t = f.pdfViewer.getPageView(Number(e.page) - 1).viewport.viewBox, n = (t[2], t[3]), r = n - e.top,
i = e.left + e.width, o = n - e.top - e.height, s = e.left;
switch (a) {
case"mm":
return e.top = (0, l.pxCovertToMM)(r), e.right = (0, l.pxCovertToMM)(i), e.bottom = (0, l.pxCovertToMM)(o), e.left = (0, l.pxCovertToMM)(s), e.width = (0, l.pxCovertToMM)(e.width), e.height = (0, l.pxCovertToMM)(e.height), e;
case"cm":
return e.top = (0, l.pxCovertToMM)(r) / 10, e.right = (0, l.pxCovertToMM)(i) / 10, e.bottom = (0, l.pxCovertToMM)(o) / 10, e.left = (0, l.pxCovertToMM)(s) / 10, e.width = (0, l.pxCovertToMM)(e.width) / 10, e.height = (0, l.pxCovertToMM)(e.height) / 10, e;
default:
return e.top = r, e.right = i, e.bottom = o, e.left = s, e
}
});
i(t.capability.resolve, n)
} else 1 == s && ("OFD" === c || "PDF" === c && 2 == d || null != p) ? e.KGPdfViewerWebApp.addOFDSeal(t) : (e.sealdata = t.sealdata, e.KGPdfViewerWebApp.addSeal(t, e.sigAndReWriteSigData.bind(e)))
}), t
}
}, {
key: "SCSJTT_getFirstSealFromServer", value: function (e, t) {
var n = this, r = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, i = function () {
var r = {
action: "getSeals",
keySN: window.KGPdfViewerWebApp.userId,
userCode: window.KGPdfViewerWebApp.userCode,
imgTag: window.KGPdfViewerWebApp.imgTag,
sealType: window.KGPdfViewerWebApp.sealType,
appCode: window.KGPdfViewerWebApp.appCode,
sealOrigin: window.KGPdfViewerWebApp.sealOrigin,
certOrigin: window.KGPdfViewerWebApp.certOrigin,
isEncrypt: window.KGPdfViewerWebApp.encryptPWd,
isUkey: window.KGPdfViewerWebApp.isUkey,
disable: !1,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
},
i = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt(e || n.keyPwd) : e || n.keyPwd;
if (window.KGPdfViewerWebApp.useCaptcha || window.KGPdfViewerWebApp.isUkey || window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) {
var o = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt("123456") : "123456";
r.useCaptcha = window.KGPdfViewerWebApp.useCaptcha, r.password = o
} else r.password = i;
a.myaxios.post(n.KGPdfViewerWebApp.getDocTypeUrl(), r).then(function (e) {
e.data.hasOwnProperty("sigWithDifferentCert") && (n.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert = e.data.sigWithDifferentCert), (0, l.closeOverlay)().then(function () {
if (e.data.seals) {
var n = e.data.seals[0];
n.signSN = d.default.stringify(h.default.parse(n.signSN)), t(n)
} else t([])
})
})
};
0 == window.KGPdfViewerWebApp.sealOrigin && 1 == window.KGPdfViewerWebApp.certOrigin && "GM" == window.KGPdfViewerWebApp.sealType ? (0, s.getCert)(this.keyPwd, function (e) {
return window.KGPdfViewerWebApp.cert = e, Promise.resolve()
}, i, function (e) {
(0, l.closeOverlay)().then(function () {
r.open(e || "获取证书失败")
})
}) : i()
}
}, {
key: "getSealsFromServer", value: function (e) {
var t = this, n = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
r = window.KGPdfViewerWebApp.passwordPrompt.pwdConfig, i = r.type, o = r.disable, c = function () {
var r = {
action: "getSeals",
keySN: window.KGPdfViewerWebApp.userId,
userCode: window.KGPdfViewerWebApp.userCode,
imgTag: window.KGPdfViewerWebApp.imgTag,
sealType: window.KGPdfViewerWebApp.sealType,
appCode: window.KGPdfViewerWebApp.appCode,
sealOrigin: window.KGPdfViewerWebApp.sealOrigin,
certOrigin: window.KGPdfViewerWebApp.certOrigin,
isEncrypt: window.KGPdfViewerWebApp.encryptPWd,
isUkey: window.KGPdfViewerWebApp.isUkey,
disable: o,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
if (!o && i && (r.verifyType = i), null != window.KGPdfViewerWebApp.filterSealNames) {
if (!Array.isArray(window.KGPdfViewerWebApp.filterSealNames)) return n.open("印章名称列表filterSealNames格式不正确");
r.filterSealNames = (0, l.unique)(window.KGPdfViewerWebApp.filterSealNames)
}
window.KGPdfViewerWebApp.isUkey && (r.esidList = window.KGPdfViewerWebApp.PDFViewerApplication.KG_UkeyStamp.esidList);
var s = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt(t.keyPwd) : t.keyPwd;
if (window.KGPdfViewerWebApp.useCaptcha || window.KGPdfViewerWebApp.isUkey || window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) {
var c = window.KGPdfViewerWebApp.encryptPWd ? window.KGPdfViewerWebApp.aesEncrypt("123456") : "123456";
r.useCaptcha = window.KGPdfViewerWebApp.useCaptcha, r.password = c
} else r.password = s;
a.myaxios.post(t.KGPdfViewerWebApp.getDocTypeUrl(), r).then(function (n) {
n.data.hasOwnProperty("sigWithDifferentCert") && (t.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert = n.data.sigWithDifferentCert), (0, l.closeOverlay)().then(function () {
window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer && n.data.status && n.data.seals.forEach(function (e) {
e.bSignByCalibrary = "1"
}), e(n.data)
})
})
};
0 == window.KGPdfViewerWebApp.sealOrigin && 1 == window.KGPdfViewerWebApp.certOrigin && "GM" == window.KGPdfViewerWebApp.sealType ? (0, s.getCert)(this.keyPwd, function (e) {
return window.KGPdfViewerWebApp.cert = e, Promise.resolve()
}, c, function (e) {
(0, l.closeOverlay)().then(function () {
n.open(e || "获取证书失败")
})
}) : c()
}
}, {
key: "getSealsFromKey_OFD", value: function (e) {
var t = this, n = function (e) {
return a.myaxios.post(t.KGPdfViewerWebApp.getDocTypeUrl(), e)
}, r = function (n, r, i) {
return (0, l.closeOverlay)().then(function () {
t.KGPdfViewerWebApp.keySN = i, t.KGPdfViewerWebApp.cert = r, e(n)
})
}, i = function (t) {
var n = t.message, r = t.defaultMsg;
return (0, l.closeOverlay)().then(function () {
e({status: !1, message: n, defaultMsg: r})
})
};
!0 === this.KGPdfViewerWebApp.useNFSSystem ? (0, o.getNFSSeals)(this.keyPwd, n, r, i) : (0, s.getOfdSeals)(this.keyPwd, n, r, i)
}
}, {
key: "getKeySN_PDF", value: function () {
var e = new u.iWebAssist({clientType: "0"});
return Promise.resolve(e.promise).then(function () {
return e.getKeyInfo()
}).then(function (e) {
if (!e.result) {
var t = e.errmsg || f[e.errcode] || f[e.errmsg] || "未知异常";
return Promise.reject(t)
}
return Promise.resolve(e.keysn)
})
}
}, {
key: "getSealsFromKey_PDF", value: function (e, t) {
var n = this, r = this.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
i = this.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS, o = new u.iWebAssist({clientType: "0"});
t && t.keySN ? Promise.resolve(o.promise).then(function () {
var i = t.keySN;
o.verifyPin(n.keyPwd, i).then(function (o) {
if (!o.result) {
var s = o.errmsg || {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败"
}[o.errcode] || "未知异常";
return n.KGPdfViewerWebApp.getTipPrompt().close(), r.open(s), void window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd()
}
if (null != t.seals && "" != t.seals) {
var l = {
action: "handleCilentSeal",
keySN: i,
unitName: t.orgname,
stampType: n.KGPdfViewerWebApp.stampType,
seals: t.seals
};
a.myaxios.post(n.KGPdfViewerWebApp.getDocTypeUrl(), l).then(function (t) {
e(t.data)
})
} else r.open(f[11])
})
}).finally(function () {
n.KGPdfViewerWebApp.getTipPrompt().close()
}) : Promise.resolve(o.promise).then(function () {
return i ? o.setParamByName("FJRSISPHONE", "0").then(function () {
return o.setParamByName("ISPHONE", "0")
}) : Promise.resolve()
}).then(function () {
return new Promise(function (e, t) {
n.userCode && o.setParamByName("USERCODE", n.userCode), (n.imgTag || "0" == n.imgTag) && o.setParamByName("SIGNTYPE", n.imgTag), e()
})
}).then(function () {
return o.getKeyInfo()
}).then(function (t) {
if (t.result) {
var i = t.usercode, s = t.seals, c = t.keysn, u = void 0;
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs) {
u = o.verifyPin(n.keyPwd, c).then(function (e) {
if (!e.result) {
var t = e.errmsg || {
"-1": "未安装签名组件",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key",
9: "网络连接失败"
}[e.errcode] || "未知异常";
return n.KGPdfViewerWebApp.getTipPrompt().close(), r.open(t), void window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd()
}
return Promise.resolve()
});
for (var d = 0, h = s.length; d < h; d++) s[d].usercode = i, s[d].sesealinfo && delete s[d].sesealinfo, s[d].certlist && delete s[d].certlist, s[d].signercert && delete s[d].signercert
} else {
u = Promise.resolve();
for (var p = 0, m = s.length; p < m; p++) s[p].usercode = i, s[p].imgdata = (0, l.parseCilentSealImgData)(s[p].imgdata), s[p].sesealinfo && delete s[p].sesealinfo, s[p].certlist && delete s[p].certlist, s[p].signercert && delete s[p].signercert
}
n.KGPdfViewerWebApp.userId = c, u.then(function () {
if (null != t.seals && "" != t.seals) {
var i = {
action: "handleCilentSeal",
keySN: c,
unitName: t.orgname,
stampType: n.KGPdfViewerWebApp.stampType,
seals: t.seals
};
a.myaxios.post(n.KGPdfViewerWebApp.getDocTypeUrl(), i).then(function (t) {
e(t.data)
})
} else r.open(f[11])
})
} else {
var v = t.errmsg || f[t.errcode] || f[t.errmsg] || "未知异常";
r.open(v)
}
}).finally(function () {
n.KGPdfViewerWebApp.getTipPrompt().close()
})
}
}, {
key: "transparentImg", value: function (e) {
var t = this;
return (0, l.closeOverlay)().then(function () {
return t.KGPdfViewerWebApp.getTipPrompt().open("正在获取印章...")
}).then(function () {
return new Promise(function (t) {
setTimeout(function () {
return t((0, c.transparent)(e.seal.imgdata))
}, 100)
})
}).then(function (e) {
return t.KGPdfViewerWebApp.getTipPrompt().close(), e
}).then(function (t) {
return e.seal.imgdata = t, e.seal.imgExt = "png", e
})
}
}, {
key: "passwordPromptCallback", value: function (e, t, n) {
var r = this;
this.keyPwd = e, 0 == this.KGPdfViewerWebApp.sealOrigin ? 1 == this.KGPdfViewerWebApp.certOrigin && null == this.KGPdfViewerWebApp.externalSign ? Promise.resolve("OFD" == this.KGPdfViewerWebApp.fileType ? (0, s.getKeySN)() : this.getKeySN_PDF()).then(function (e) {
r.KGPdfViewerWebApp.userId = e, r.getSealsFromServer(t)
}).catch(function (e) {
r.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.message)
}) : this.getSealsFromServer(t) : "OFD" === this.KGPdfViewerWebApp.fileType || "PDF" === this.KGPdfViewerWebApp.fileType && 2 == this.KGPdfViewerWebApp.stampType ? this.getSealsFromKey_OFD(t) : this.getSealsFromKey_PDF(t, n)
}
}, {
key: "getSealObjet", value: function (e) {
var t = this, n = this.KGPdfViewerWebApp, r = n.externalGetSeals, i = n.PDFViewerApplication,
a = n.externalUnit, o = n.imageTransparent, s = i.KGAlertPrompt, c = i.KG_FJRS, u = i.KG_ScanStamp,
p = i.pdfStamp, f = i.KG_UkeyStamp, m = i.KG_ScanStamp_V2, v = i.KG_Finger_Print,
g = window.KGPdfViewerWebApp.passwordPrompt.pwdConfig.disable;
return new Promise(function (n) {
"fingerPrint" == e ? v.stamp(n) : "scan_v2" == e ? m.stamp(n) : c && c.config.isScanStamp ? c.handleScanClick(n, t.getSealsFromServer) : u && "scan" === e ? (t.KGPdfViewerWebApp.systemStampMode = e, u.handleScanClick(n)) : !0 === t.KGPdfViewerWebApp.isUkey && "ukey" === e ? f.seals ? n({
status: !0,
seals: f.seals
}) : (t.KGPdfViewerWebApp.systemStampMode = e, t.getSealsFromServer(n)) : g || !0 === t.KGPdfViewerWebApp.useCaptcha ? t.getSealsFromServer(n) : null !== r ? r(n) : window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs && 1 === window.KGPdfViewerWebApp.certOrigin && 1 === window.KGPdfViewerWebApp.sealOrigin ? t.getKeySn().then(function (e) {
t.passwordPrompt.open(!0, "add"), t.passwordPrompt.setUpdateCallback(function (r) {
t.passwordPromptCallback(r, n, e)
})
}) : (t.passwordPrompt.open(!0, "add"), t.passwordPrompt.setUpdateCallback(function (e) {
t.passwordPromptCallback(e, n)
}))
}).then(function (n) {
return new Promise(function (i, c) {
if (n.status) if (t.passwordPrompt.remember(), null != r && (n.seals = n.seals.map(function (e) {
switch (a) {
case"mm":
return e.width = (0, l.mmCovertToPx)(e.width), e.height = (0, l.mmCovertToPx)(e.height), e;
case"cm":
return e.width = (0, l.mmCovertToPx)(10 * e.width), e.height = (0, l.mmCovertToPx)(10 * e.height), e;
default:
return e
}
})), null != r && 1 == n.seals.length) {
var u = {seal: n.seals[0]};
p.setSealData(u), i(u)
} else {
var f = t.KGPdfViewerWebApp.getSelectSealPrompt();
if (n.seals = t.filterSeals(n.seals), !n.seals.length && !t.KGPdfViewerWebApp.unifySealPlatformV2) {
return s.open("没有可用的印章!")
}
new Promise(function (r) {
if ((0, l.functionalJudgment)("secretSeal") && "secret" == e) {
for (var i = void 0, a = 0; a < n.seals.length && (i = n.seals[a]).hasOwnProperty("sealtag"); a++) ;
var o = document.createElement("canvas"), c = o.getContext("2d"), u = new Image;
u.src = t.KGPdfViewerWebApp.secretSealImg, u.onload = function () {
i.width = o.width = 72 * this.width / 96, i.height = o.height = 72 * this.height / 96, c.drawImage(u, 0, 0, i.width, i.height);
var e = o.toDataURL();
i.imgdata = e, i.imgExt = "png", i.isSecretSeal = !0, i.signSN = d.default.stringify(h.default.parse(i.signSN)), f.setSeals([i]), r()
}, u.onerror = function () {
s.open("加载暗章图片失败!")
}
} else {
var p = n.seals.map(function (e) {
return e.signSN = d.default.stringify(h.default.parse(e.signSN)), e
});
f.setSeals(p), r()
}
}).then(function () {
f.setUpdateCallback(function (e) {
var n = e.seal, r = {
isContinuityStampCheck: e.isContinuityStampCheck,
continuityRange: e.continuityRange,
isStampOfQfz: e.isStampOfQfz
};
!0 === o ? (r.seal = n, t.transparentImg(r).then(function (e) {
p.setSealData(e), i(e)
})) : (r.seal = n, p.setSealData(r), i(r))
}), (0, l.closeOverlay)().then(setTimeout(function () {
switch (p.stampSealType) {
case"default":
f.open();
break;
case"singleSeal":
f.singleSealNoSelectSealPrompt();
break;
case"pagingSeal":
f.pagingSealNoSelectSealPrompt(n.seals[0]);
break;
case"continuitySeal":
f.continuitySealNoSelectSealPrompt()
}
}, 50))
})
} else {
if (n.message && "密码错误" == n.message || n.defaultMsg && "密钥盘密码错误" == n.defaultMsg) window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), s.closeCallback = function () {
t.getSealObjet(e)
};
s.open(n.message || "获取印章失败")
}
})
})
}
}, {
key: "getKeySn", value: function () {
var e = this, t = this.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt,
n = this.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS, r = new u.iWebAssist({clientType: "0"});
return Promise.resolve(r.promise).then(function () {
return n ? r.setParamByName("FJRSISPHONE", "0").then(function () {
return r.setParamByName("ISPHONE", "0")
}) : Promise.resolve()
}).then(function () {
return new Promise(function (t, n) {
e.userCode && r.setParamByName("USERCODE", e.userCode), (e.imgTag || "0" == e.imgTag) && r.setParamByName("SIGNTYPE", e.imgTag), t()
})
}).then(function () {
return r.getKeyInfo()
}).then(function (r) {
if (r.result) {
for (var i = r.usercode, a = r.seals, o = r.keysn, s = 0, c = a.length; s < c; s++) a[s].usercode = i, n || (a[s].imgdata = (0, l.parseCilentSealImgData)(a[s].imgdata)), a[s].sesealinfo && delete a[s].sesealinfo, a[s].certlist && delete a[s].certlist, a[s].signercert && delete a[s].signercert;
return e.KGPdfViewerWebApp.userId = o, {
keySN: o,
seals: a,
orgname: r.orgname,
phoneshield: r.phoneshield,
result: r.result,
servertime: r.servertime,
sinopec: r.sinopec,
usercode: r.usercode
}
}
var u = r.errmsg || f[r.errcode] || f[r.errmsg] || "未知异常";
t.open(u)
}).finally(function () {
e.KGPdfViewerWebApp.getTipPrompt().close()
})
}
}, {
key: "sigAndReWriteSigData", value: function (e, t) {
var n = this.KGPdfViewerWebApp, r = n.stampType, i = n.userId, a = n.iWebAuth, o = this.keyPwd, s = this;
if (1 == r) if (a.scan || a.uKey) {
var l = window.KGPdfViewerWebApp.PDFViewerApplication.KG_IWebAuth, c = e[0].needSigMessage;
l.sign(c).then(function (n) {
var r = n.sigData, i = n.cert;
e[0].sigData = r, s.KGPdfViewerWebApp.reWriteSigData(e, i, t)
})
} else {
var p = new u.iWebAssist({clientType: "0"});
Promise.all([p.promise]).then(function () {
return p.getCspName()
}).then(function (n) {
var r = e;
(0, u.cryptAPISig)(n, o, r).then(function (e) {
if (e.result) {
var n = e.message.sigedData, r = e.message.cert;
s.KGPdfViewerWebApp.reWriteSigData(n, r, t)
} else s.KGPdfViewerWebApp.sigError(), e.message ? s.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.message) : e.warnning && s.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.warnning)
})
})
} else if (2 === r) ; else if (null != window.KGPdfViewerWebApp.externalSign) ; else if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer) window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.p7Sign(e); else {
var f = new u.iWebAssist({clientType: "0"});
Promise.all([f.promise]).then(function () {
var n = (0, u.createCapability)(), r = e;
!function e(t, a) {
if (t >= r.length) n.resolve({ret: !0, 0: r, 1: a}); else {
var l = r[t], c = l.sealtag;
Promise.resolve().then(function () {
if ("GB" === c) {
var e = void 0;
return f.setParamByName("CLEARGBSESEALINFO", "").then(function () {
return f.getKeyInfo()
}).then(function (t) {
return e = t.seals[0], f.setParamByName("GBSESEALINFO", e.sesealinfo)
}).then(function () {
return f.setParamByName("GBSIGNSN", e.signsn)
})
}
if ("GM" === c) {
var t = s.sealdata.filter(function (e) {
return "GM" === e.sealtag
})[0].signSN;
return f.setParamByName("ISGM", "1").then(function () {
return f.setParamByName("SIGNSN", d.default.parse(t).toString())
})
}
return Promise.resolve()
}).then(function () {
var e = s.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS;
return e ? e.config.isScanStamp ? f.setParamByName("FJRSTOKEN", e.token) : f.setParamByName("FJRSTOKEN", "undefined") : Promise.resolve()
}).then(function () {
return f.setParamByName("KEYSN", i)
}).then(function () {
f.sig_pkcs7(o, l.needSigMessage).then(function (r) {
r.result ? (l.certSignMsg = d.default.stringify(h.default.parse(r.signeddata)), void 0 === a && (a = r.certinfo.crtdata), e(t + 1, a)) : n.resolve({
ret: !1,
msg: r.errmsg || {
"-1": "未安装签名组件",
"-12": "获取证书失败",
"-13": "签名时,加载证书失败",
"-15": "签名数据不能为空",
"-16": "密码不能为空",
"-17": "解析证书失败",
"-2": "待验证pin的key和当前插入的key不匹配",
1: "没有检测到用户key",
2: "非法为授权的key",
3: "没有找到key驱动文件",
4: "插入太多的key",
7: "密码错误",
8: "非法授权key"
}[r.errcode]
})
})
}).then(function () {
"GB" === c && (f.setParamByName("GBSESEALINFO", ""), f.setParamByName("GBSIGNSN", ""))
})
}
}(0), n.promise.then(function (e) {
if (e.ret) {
var n = e[0], r = e[1], i = n;
s.KGPdfViewerWebApp.reWriteSigData(i, r, t)
} else s.KGPdfViewerWebApp.sigError(), s.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e.msg)
})
})
}
}
}, {
key: "filterSeals", value: function (e) {
var t = window.KGPdfViewerWebApp.filterSealNames;
if (!t) return e;
if (Array.isArray(t)) {
var n = Array.from(new Set(t));
return e = e.filter(function (e) {
return -1 !== n.indexOf(e.signName)
})
}
}
}]), e
}();
t.PDFStampSeal = m
}, function (e, t, n) {
"use strict";
var r, i, a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
!function (o) {
var s;
if (n(121) && (void 0 !== (i = "function" == typeof (r = o) ? r.call(t, n, t, e) : r) && (e.exports = i), s = !0), "object" == a(t) && (e.exports = o(), s = !0), !s) {
var l = window.Cookies, c = window.Cookies = o();
c.noConflict = function () {
return window.Cookies = l, c
}
}
}(function () {
function e() {
for (var e = 0, t = {}; e < arguments.length; e++) {
var n = arguments[e];
for (var r in n) t[r] = n[r]
}
return t
}
function t(e) {
return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent)
}
return function n(r) {
function i() {
}
function a(t, n, a) {
if ("undefined" != typeof document) {
"number" == typeof (a = e({path: "/"}, i.defaults, a)).expires && (a.expires = new Date(1 * new Date + 864e5 * a.expires)), a.expires = a.expires ? a.expires.toUTCString() : "";
try {
var o = JSON.stringify(n);
/^[\{\[]/.test(o) && (n = o)
} catch (e) {
}
n = r.write ? r.write(n, t) : encodeURIComponent(n + "").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), t = encodeURIComponent(t + "").replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
var s = "";
for (var l in a) a[l] && (s += "; " + l, !0 !== a[l] && (s += "=" + a[l].split(";")[0]));
return document.cookie = t + "=" + n + s
}
}
function o(e, n) {
if ("undefined" != typeof document) {
for (var i = {}, a = document.cookie ? document.cookie.split("; ") : [], o = 0; o < a.length; o++) {
var s = a[o].split("="), l = s.slice(1).join("=");
n || '"' !== l.charAt(0) || (l = l.slice(1, -1));
try {
var c = t(s[0]);
if (l = (r.read || r)(l, c) || t(l), n) try {
l = JSON.parse(l)
} catch (e) {
}
if (i[c] = l, e === c) break
} catch (e) {
}
}
return e ? i[e] : i
}
}
return i.set = a, i.get = function (e) {
return o(e, !1)
}, i.getJSON = function (e) {
return o(e, !0)
}, i.remove = function (t, n) {
a(t, "", e(n, {expires: -1}))
}, i.defaults = {}, i.withConverter = n, i
}(function () {
})
})
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.transparent = function (e) {
var t = document.createElement("canvas"), n = t.getContext("2d"), r = new Image, i = null,
a = new Promise(function (e) {
i = e
});
return r.onload = function () {
t.width = this.width, t.height = this.height, n.drawImage(r, 0, 0, this.width, this.height);
for (var a = n.getImageData(0, 0, 1, 1).data, o = n.getImageData(0, this.height - 1, 1, 1).data, s = (n.getImageData(this.width - 1, this.height - 1, 1, 1).data, n.getImageData(this.width - 1, 0, 1, 1).data), l = [a, o, s, s], c = !0, u = 0; u < l.length; u++) {
var d = l[u];
if (!(d[0] > 225 && d[1] > 225 && d[2] > 225 && d[3] > 225)) {
c = !1;
break
}
}
if (c) {
for (var h = 0; h < this.width; h++) for (var p = 0; p < this.height; p++) {
var f = n.getImageData(h, p, 1, 1), m = f.data;
m[0] > 225 && m[1] > 225 && m[2] > 225 && m[3] > 225 && (f.data[0] = 0, f.data[1] = 0, f.data[2] = 0, f.data[3] = 0, n.putImageData(f, h, p))
}
i(t.toDataURL())
} else i(e)
}, r.src = e, a
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.cryptAPICtrl = t.cryptAPISig = void 0;
var r = n(43), i = function () {
this.kg = new r.KG("KG_Crypt_COM_API.CryptAPICtrl.1", "FD5FA7DB-CBF7-4804-8147DE5A56CC8ADF"), this.promise = this.kg.init()
};
i.prototype = {
getCert: function (e) {
var t = this.kg, n = (0, r.createCapability)(), i = this;
return this.getCtnArray(e).then(function (r) {
i.begin(e).then(function (e) {
return t.invoke("KGCryptExportKey", 6, 1, 0)
}).then(function (e) {
t.invoke("KGCryptDestroyKey").then(function () {
return t.invoke("KGCryptFinalize", 0)
}).then(function () {
n.resolve(e)
})
})
}), n.promise
}, begin: function (e) {
var t = this.kg, n = (0, r.createCapability)();
return this.getCtnArray(e).then(function (n) {
return t.invoke("KGCryptInitialize", e, n[0], 1, 0)
}).then(function () {
return t.invoke("KGCryptGetUserKey", 2)
}).then(function (e) {
0 == e ? n.resolve(2) : t.invoke("KGCryptGetUserKey", 1).then(function (e) {
0 == e ? n.resolve(1) : n.resolve(-1)
})
}), n.promise
}, sig: function (e, t) {
var n = this.kg, i = (0, r.createCapability)();
return n.invoke("KGCryptCreateHash", 32772).then(function () {
return n.invoke("KGCryptSetHashValue", t, t.length)
}).then(function () {
return n.time = 45e3, n.invoke("KGCryptSignHash", e, 0)
}).then(function (e) {
n.invoke("KGCryptDestroyHash").then(function () {
"none" === e ? i.reject() : i.resolve(e)
})
}), i.promise
}, exportCert: function () {
return this.kg.invoke("KGCryptExportKey", 0, 1, 0)
}, end: function () {
var e = this.kg, t = (0, r.createCapability)();
return e.invoke("KGCryptFinalize", 0).then(function () {
t.resolve(0)
}), t.promise
}, setKeyPwd: function (e) {
void 0 === e && (e = "");
var t = function (e) {
for (var t = "", n = 0; n < e.length; n++) t += e.charCodeAt(n).toString(16);
return t
}(e) + "00";
return this.kg.invoke("KGCryptSetPin", t, t.length, 32)
}, getCtnArray: function (e) {
var t = this.kg, n = this, i = (0, r.createCapability)();
return t.invoke("KGCryptInitialize", e, "", 1, -268435424).then(function () {
return t.invoke("KGCryptGetContainers", 0)
}).then(function (e) {
t.invoke("KGCryptFinalize", 0).then(function () {
n.end().then(function () {
i.resolve(e.split("$n"))
})
})
}), i.promise
}
};
t.cryptAPISig = function (e, t, n) {
var a = new i, o = (0, r.createCapability)(), s = {result: !1};
return Promise.all([a.promise]).then(function () {
return a.begin(e)
}).then(function (e) {
if (o.promise.then(function () {
a.end()
}, function () {
a.end()
}), -1 == e) return s.message = "请插入密钥盘或者密钥盘中不存在证书!", void o.resolve(s);
(null == t ? Promise.resolve(0) : a.setKeyPwd(t)).then(function (t) {
if (0 != t) return s.message = "密钥盘密码错误或密钥盘被锁!", void o.resolve(s);
a.exportCert().then(function (t) {
if ("none" == t) return s.message = "获取签名证书失败!", void o.resolve(s);
var i = (0, r.createCapability)();
!function t(n, r) {
var l = n[r];
a.sig(e, l.needSigMessage).then(function (e) {
if (l.sigData = e, !l.sigData) return s.message = "签名失败!", void o.resolve(s);
r == n.length - 1 ? i.resolve(n) : t(n, r + 1)
}, function () {
s.warnning = "签名失败!", o.resolve(s)
})
}(n, 0), i.promise.then(function (e) {
s.result = !0, s.message = {cert: t, sigedData: e}, o.resolve(s)
})
})
})
}), o.promise
}, t.cryptAPICtrl = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.appConfig.kgConfirmOverlay.overlayName, this.container = t.appConfig.kgConfirmOverlay.container, this.okButton = t.appConfig.kgConfirmOverlay.okButton, this.cancelButton = t.appConfig.kgConfirmOverlay.cancelButton, this.okCallback = null, this.cancelCallback = null, this.overlayManager = n, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0)
}
return r(e, [{
key: "setContent", value: function (e) {
document.getElementById(this.overlayName).querySelector("p").innerHTML = e
}
}, {
key: "open", value: function () {
this.overlayManager.open(this.overlayName)
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.app.KG_ScanStamp && e.app.KG_ScanStamp.clearSealData(), e.cancelCallback && e.cancelCallback()
})
}
}, {
key: "ok", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.okCallback && e.okCallback()
})
}
}, {
key: "setOKCallback", value: function (e) {
this.okCallback = null != e ? e : null, this.okButton.onclick = this.ok.bind(this)
}
}, {
key: "setCancelCallback", value: function (e) {
this.cancelCallback = null != e ? e : null, this.cancelButton.onclick = this.close.bind(this)
}
}]), e
}();
t.default = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KGPasswordPrompt = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = s(n(17)), a = s(n(34)), o = n(2);
function s(e) {
return e && e.__esModule ? e : {default: e}
}
var l = function () {
function e(t, n, r) {
var i = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.overlayName, this.container = t.container, this.label = t.label, this.input = t.input, this.rememberPwd = document.getElementById("rememberPwd"), this.rememberPwdWrapper = this.container.querySelector(".kg_checkbox_wrapper"), this.rememberPwdWrapper.onclick = this.onRememberPwdWrapperClick.bind(this), this.pwd = null, this.submitButton = t.submitButton, this.cancelButton = t.cancelButton, this.overlayManager = n, this.l10n = r, this.tipMsg = document.getElementById("kg_tip_msg");
var a = window.KGPdfViewerWebApp, s = a.pwdConfig, l = a.pwdDefaultConfig;
this.pwdConfig = (0, o.mergerConfig)(l, s), this.updateCallback = null, this.submitButton.addEventListener("click", this.verify.bind(this), !1), this.cancelButton.addEventListener("click", this.close.bind(this)), this.input.addEventListener("keydown", function (e) {
i.input.classList.remove("KG_Input_Error"), i.container.querySelector(".kg_error_msg").style.visibility = "hidden", 13 === e.keyCode && i.verify()
}), this.container.getElementsByTagName("form")[0].addEventListener("submit", function (e) {
e.preventDefault()
}), this.closeBtn = this.container.querySelector(".kg_dialog_close"), this.closeBtn.addEventListener("click", this.close.bind(this)), !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) && (this.input.onblur = function (e) {
setTimeout(function () {
if ("INPUT" !== document.activeElement.tagName) {
var e = "pc";
/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) ? e = "ios" : /(Android)/i.test(navigator.userAgent) && (e = "android"), "ios" === e && document.activeElement.scrollIntoViewIfNeeded(!0)
}
}, 100)
}), this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0)
}
return r(e, [{
key: "onRememberPwdWrapperClick", value: function (e) {
this.rememberPwd.checked = !this.rememberPwd.checked, this.rememberPwd.checked ? this.rememberPwdWrapper.classList.add("kg_checkbox_wrapper-checked") : this.rememberPwdWrapper.classList.remove("kg_checkbox_wrapper-checked")
}
}, {
key: "open", value: function (e, t) {
var n = this;
return this.certValidity = e || !1, this.overlayManager.open(this.overlayName).then(function () {
n.pwd = n.getRememberedPwd(t);
var e = n.pwdConfig, r = e.defaultPwd, i = e.keepRemember, a = window.KGPdfViewerWebApp, o = a.password,
s = a.sealOrigin;
n.setTipMsg(n.pwdConfig), i && (n.rememberPwd.checked = !0, n.rememberPwdWrapper.classList.add("kg_checkbox_wrapper-checked")), (r || o) && 0 == s && (n.pwd = r || o), n.pwd ? (n.input.value = n.pwd, n.rememberPwd.checked = !0, n.rememberPwdWrapper.classList.add("kg_checkbox_wrapper-checked"), n.verify()) : (n.input.value = "", n.input.focus())
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.pwd || (e.rememberPwd.checked = !1, e.rememberPwdWrapper.classList.remove("kg_checkbox_wrapper-checked"), (0, o.deleteCookieAndStorage)("KG_Remember"), e.input.classList.remove("KG_Input_Error"), e.container.querySelector(".kg_error_msg").style.visibility = "hidden")
})
}
}, {
key: "verify", value: function () {
var e = this, t = this.input.value;
t && t.length > 0 ? this.overlayManager.close(this.overlayName).then(function () {
switch (e.l10n._lang) {
case"zh-TW":
window.KGPdfViewerWebApp.getTipPrompt().open("正在驗證密碼...");
break;
case"en-US":
window.KGPdfViewerWebApp.getTipPrompt().open("Verifying password...");
break;
default:
window.KGPdfViewerWebApp.getTipPrompt().open("正在验证密码...")
}
(0, o.functionalJudgment)("certValidity") && e.certValidity ? new Promise(function (e) {
window.KGPdfViewerWebApp.PDFViewerApplication.KG_CertValidity.verify(t, e)
}).then(function () {
e.updateCallback(t)
}) : e.updateCallback(t)
}) : (this.input.classList.add("KG_Input_Error"), this.container.querySelector(".kg_error_msg").style.visibility = "visible", this.input.focus())
}
}, {
key: "setUpdateCallback", value: function (e) {
this.updateCallback = e
}
}, {
key: "remember", value: function (e) {
if (this.pwd) this.rememberPwd.checked || this.clearRememberedPwd(); else if (this.rememberPwd.checked) {
var t = window.KGPdfViewerWebApp.userId;
window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs && "delete" === e && (t = window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN);
var n = window.KGPdfViewerWebApp.userCode, r = this.input.value,
s = t ? "userId=" + t + ";password=" + r : "userCode=" + n + ";password=" + r,
l = i.default.stringify(a.default.parse(s));
(0, o.setCookieOrStorage)("KG_Remember", l, {expires: 7})
}
}
}, {
key: "getRememberedPwd", value: function (e) {
var t = (0, o.getCookieOrStorage)("KG_Remember"), n = a.default.stringify(i.default.parse(t)),
r = n.split(";password=")[0].split("userId=")[1], s = n.split(";password=")[0].split("userCode=")[1],
l = n.split(";password=")[1];
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs) {
if ("add" === e) {
if (r === window.KGPdfViewerWebApp.userId || s === window.KGPdfViewerWebApp.userCode) return l
} else if ("delete" === e && (r === window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN || s === window.KGPdfViewerWebApp.userCode)) return l
} else if (r === window.KGPdfViewerWebApp.userId || s === window.KGPdfViewerWebApp.userCode) return l;
return !1
}
}, {
key: "clearRememberedPwd", value: function () {
(0, o.deleteCookieAndStorage)("KG_Remember"), this.rememberPwd.checked = !1, this.rememberPwdWrapper.classList.remove("kg_checkbox_wrapper-checked")
}
}, {
key: "setTipMsg", value: function (e) {
var t = e.tips, n = e.tipsColor;
t && (this.tipMsg.style.display = "block", this.tipMsg.innerHTML = t, this.tipMsg.style.color = n)
}
}]), e
}();
t.KGPasswordPrompt = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.SelectSealPrompt = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(2), a = n(55), o = n(42);
var s = function () {
function e(t, n, r) {
var a = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.overlayName, this.container = t.container, this.submitButton = t.submitButton, this.cancelButton = t.cancelButton, this.img = t.img, this.sealLeft = t.sealLeft, this.sealRight = t.sealRight, this.kgSealIdx = document.getElementById("kg-seal-idx"), this.kgSealTotalNumb = document.getElementById("kg-seal-totalNumb"), this.continuityStamp = document.getElementById("continuity-stamp"), this.continuityRange = document.getElementById("continuity-range"), this.continuityRange.onblur = i.scrollToResizeScreen, this.img.oncontextmenu = function (e) {
e.preventDefault()
}, this.img.onmousedown = function (e) {
e.preventDefault()
}, this.additionText = document.getElementById("addition-text"), this.showAdditionConfig = document.getElementById("show-addition-config"), this.pagingSealWrapper = document.getElementById("paging-seal-wrapper"), this.additionTextWrapper = document.getElementById("addition-text-wrapper"), this.noSealsWrapper = document.getElementById("kg_no_seals_wrapper"), this.sealsWrapper = document.getElementById("kg_seals_wrapper"), this.fileType = window.KGPdfViewerWebApp.fileType, this.stampType = window.KGPdfViewerWebApp.stampType, this.pagingSeal = document.getElementById("paging-seal"), this.showPagingSealConfig = document.getElementById("paging-seal-config"), this.closeBtn = this.container.querySelector(".kg_dialog_close"), this.close = this.close.bind(this), this.closeBtn.addEventListener("click", function () {
return a.close(!0)
}), this.overlayManager = n, this.l10n = r, this.updateCallback = null, this.reason = null, this.seals = null, this.sealIdx = 0, this.isQfz = !1, this.sigWithDifferentCert = !0, this.verify = this.verify.bind(this), this.clientVerify = this.clientVerify.bind(this), this.displaySealsWapper = this.displaySealsWapper.bind(this), this.submitButton.addEventListener("click", function () {
a.clientVerify().then(function (e) {
e && a.verify()
})
}, !1), this.cancelButton.addEventListener("click", function () {
var e = window.KGPdfViewerWebApp.PDFViewerApplication, t = e.pdfStamp, n = e.pagesCount, r = e.pdfViewer,
i = e.KGStampConfirm;
if (null != t) if (t.tempSeals.length) {
for (var o = 1; o < n; o++) {
var s = r.getPageView(o - 1).pdfPage.tempStamps;
for (var l in s) s.hasOwnProperty(l) && (s[l].querySelector(".deleteTempStampSection").style.display = "block")
}
i && i.show()
} else t.isStamp && t.cancelStamp();
a.deleteAllOriginImgData(), a.pagingSeal.checked && a.onPagingSealWrapperClick(), a.close(!0)
}), this.sealLeft.addEventListener("click", this.left.bind(this)), this.sealRight.addEventListener("click", this.right.bind(this)), this.overlayManager.register(this.overlayName, this.container, this.close, !1), this.hideStampBtnFunList = [], this.continuityStampWrapper = document.getElementById("continuity-stamp-wrapper"), this.KG_StampContinuity = document.getElementById("KG_StampContinuity");
var o = this.continuityStampWrapper.querySelector(".KG_StampContinuity_Tip");
this.KG_StampContinuity.addEventListener("mouseover", function () {
o.style.opacity = 1
}), this.KG_StampContinuity.addEventListener("mouseout", function () {
o.style.opacity = 0
}), window.KGPdfViewerWebApp.prepareStamp ? (this.continuityStampWrapper.setAttribute("hidden", !0), this.hideStampBtnFunList.push(function () {
a.continuityStampWrapper.setAttribute("hidden", !0)
})) : this.continuityStampWrapper.onclick = this.onContinuityStampWrapperClick.bind(this), null != window.KGPdfViewerWebApp.externalGetSeals && (this.continuityStampWrapper.setAttribute("hidden", !0), this.pagingSealWrapper.setAttribute("hidden", !0), this.additionTextWrapper.setAttribute("hidden", !0), this.hideStampBtnFunList.push(function () {
a.continuityStampWrapper.setAttribute("hidden", !0), a.pagingSealWrapper.setAttribute("hidden", !0), a.additionTextWrapper.setAttribute("hidden", !0)
})), window.KGPdfViewerWebApp.PDFViewerApplication.KG_SealPreLocation && (this.continuityStampWrapper.setAttribute("hidden", !0), this.pagingSealWrapper.setAttribute("hidden", !0), this.additionTextWrapper.setAttribute("hidden", !0), this.hideStampBtnFunList.push(function () {
a.continuityStampWrapper.setAttribute("hidden", !0), a.pagingSealWrapper.setAttribute("hidden", !0), a.additionTextWrapper.setAttribute("hidden", !0)
})), this.additionTextWrapper.onclick = this.onAdditionTextWrapperClick.bind(this), "OFD" === this.fileType || 2 == this.stampType ? this.additionTextWrapper.style.display = "none" : this.showAdditionConfig.onclick = function () {
var e = "origin" in a.seals[a.sealIdx] ? a.seals[a.sealIdx].origin.imgdata : a.seals[a.sealIdx].imgdata,
t = "origin" in a.seals[a.sealIdx] ? a.seals[a.sealIdx].origin.height : a.seals[a.sealIdx].height,
n = "origin" in a.seals[a.sealIdx] ? a.seals[a.sealIdx].origin.width : a.seals[a.sealIdx].width,
r = a.seals[a.sealIdx].imgExt, i = a.seals[a.sealIdx].selectSealInfo ? a.seals[a.sealIdx].selectSealInfo : {
textValue: "",
timePosition: window.KGPdfViewerWebApp.additionTextConfig.timePosition,
textPosition: window.KGPdfViewerWebApp.additionTextConfig.textPosition,
timeSize: window.KGPdfViewerWebApp.additionTextConfig.timeFontSize,
textSize: window.KGPdfViewerWebApp.additionTextConfig.fontSize,
color: window.KGPdfViewerWebApp.additionTextConfig.color,
font: window.KGPdfViewerWebApp.additionTextConfig.font,
percentY: window.KGPdfViewerWebApp.additionTextConfig.percentY
};
window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig.open(e, n, t, r, i)
}, this.pagingSealWrapper.onclick = this.onPagingSealWrapperClick.bind(this), 1 === window.KGPdfViewerWebApp.PDFViewerApplication.pagesCount ? this.pagingSealWrapper.style.display = "none" : (this.KGPagingSeal = window.KGPdfViewerWebApp.PDFViewerApplication.KGPagingSeal, this.KGPagingSeal ? this.showPagingSealConfig.onclick = function () {
var e = a.seals[a.sealIdx];
a.KGPagingSeal.open(e)
} : window.KGPdfViewerWebApp.prepareStamp && (this.showPagingSealConfig.onclick = function () {
a.KGPagingSeal = window.KGPdfViewerWebApp.PDFViewerApplication.KGPagingSeal;
var e = a.seals[a.sealIdx];
a.KGPagingSeal.open(e)
}))
}
return r(e, [{
key: "onContinuityStampWrapperClick", value: function (e) {
e && e.target.id === this.continuityRange.id || (this.continuityStamp.checked = !this.continuityStamp.checked, this.continuityStamp.checked ? (this.continuityStampWrapper.classList.add("kg_checkbox_wrapper-checked"), this.pagingSeal.checked && this.onPagingSealWrapperClick()) : this.continuityStampWrapper.classList.remove("kg_checkbox_wrapper-checked"))
}
}, {
key: "onAdditionTextWrapperClick", value: function (e) {
if (!e || e.target.id !== this.showAdditionConfig.id) {
this.additionText.checked = !this.additionText.checked;
var t = window.KGPdfViewerWebApp.additionTextConfig.isSelect;
if (this.additionText.checked) this.additionTextWrapper.classList.add("kg_checkbox_wrapper-checked"), this.pagingSeal.checked && this.onPagingSealWrapperClick(), this.showAdditionConfig.style.display = "block", this.saveOriginImgData(), this.showAdditionConfig.click(), this.seals[this.sealIdx].isSelect = !0; else this.additionTextWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.showAdditionConfig.style.display = "none", this.deleteOriginImgData(), t && (this.seals[this.sealIdx].imgdata = this.seals[this.sealIdx].origin.imgdata, this.seals[this.sealIdx].width = this.seals[this.sealIdx].origin.width, this.seals[this.sealIdx].height = this.seals[this.sealIdx].origin.height), this.img.src = this.seals[this.sealIdx].imgdata, this.seals[this.sealIdx].isSelect = !1, window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig.init()
}
}
}, {
key: "onPagingSealWrapperClick", value: function (e) {
e && e.target.id === this.showPagingSealConfig.id || (this.pagingSeal.checked = !this.pagingSeal.checked, this.pagingSeal.checked ? (this.pagingSealWrapper.classList.add("kg_checkbox_wrapper-checked"), this.continuityStamp.checked && this.onContinuityStampWrapperClick(), this.additionText.checked && this.deleteAllOriginImgData(), window.KGPdfViewerWebApp.additionTextConfig.isSelect && this.additionText.checked && this.onAdditionTextWrapperClick(), this.showPagingSealConfig.style.display = "block", this.showPagingSealConfig.click()) : (this.pagingSealWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.seals[this.sealIdx].hasOwnProperty("qfzSeal") && delete this.seals[this.sealIdx].qfzSeal, this.showPagingSealConfig.style.display = "none"))
}
}, {
key: "displaySealsWapper", value: function () {
this.seals.length ? (this.sealsWrapper.removeAttribute("hidden"), this.submitButton.removeAttribute("disabled"), this.noSealsWrapper.setAttribute("hidden", !0)) : (this.noSealsWrapper.removeAttribute("hidden"), this.sealsWrapper.setAttribute("hidden", !0), this.submitButton.setAttribute("disabled", !0))
}
}, {
key: "init", value: function () {
if (this.seals.length) {
if (this.sealIdx = 0, this.sealLeft.setAttribute("disabled", !0), this.kgSealIdx.innerHTML = "1", this.kgSealTotalNumb.innerHTML = this.seals.length, this.continuityRange.value = "1-" + window.KGPdfViewerWebApp.getNumPages(), 1 === this.seals.length ? this.sealRight.setAttribute("disabled", !0) : this.sealRight.removeAttribute("disabled"), this.seals[0].isSecretSeal) this.continuityStampWrapper.setAttribute("hidden", !0), this.pagingSealWrapper.setAttribute("hidden", !0), this.additionTextWrapper.setAttribute("hidden", !0); else {
this.continuityStampWrapper.removeAttribute("hidden"), this.pagingSealWrapper.removeAttribute("hidden"), this.additionTextWrapper.removeAttribute("hidden");
for (var e = 0, t = this.hideStampBtnFunList.length; e < t; e++) this.hideStampBtnFunList[e]()
}
this.img.src = this.seals[this.sealIdx].imgdata, this.additionTextCheckedAndAdditionConfigDisplay()
}
}
}, {
key: "open", value: function () {
var e = this;
this.overlayManager.open(this.overlayName).then(function () {
e.init()
})
}
}, {
key: "close", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
this.overlayManager._active.indexOf(this.overlayName) > -1 && this.overlayManager.close(this.overlayName).then(function () {
e && window.KGPdfViewerWebApp.cancelStampCallback()
})
}
}, {
key: "verify", value: function (e) {
e && e.preventDefault(), e && e.stopPropagation();
var t = void 0, n = void 0;
null != window.KGPdfViewerWebApp.continuityRange && (t = window.KGPdfViewerWebApp.continuityRange.beginPage, n = window.KGPdfViewerWebApp.continuityRange.endPage);
var r = window.KGPdfViewerWebApp.getNumPages();
(!t || t <= 0) && (t = 1), (!n || n > r) && (n = r);
var i = t + "-" + (n || r), a = this.continuityRange.value || i || "1-" + r;
if (/^\d+-\d+$/.test(a)) {
var o = a.split("-"), s = parseInt(o[0]), l = parseInt(o[1]);
if (s > l) {
var c = l;
return l = s, void (s = c)
}
s <= 0 && (s = 1), l > window.KGPdfViewerWebApp.getNumPages() && (l = window.KGPdfViewerWebApp.getNumPages());
var u = {};
for (var d in this.seals[this.sealIdx]) this.seals[this.sealIdx].hasOwnProperty(d) && (u[d] = this.seals[this.sealIdx][d]);
this.close();
var h = {
seal: u,
isContinuityStampCheck: this.continuityStamp.checked,
isStampOfQfz: this.pagingSeal.checked,
continuityRange: s + "-" + l
};
if (this.isQfz = this.pagingSeal.checked, this.deleteAllOriginImgData(), this.pagingSeal.checked && this.onPagingSealWrapperClick(), window.KGPdfViewerWebApp.stampMask) document.getElementById("KG_StampMask").setAttribute("style", "pointer-events: none");
return this.updateCallback(h)
}
this.continuityRange.focus()
}
}, {
key: "clientVerify", value: function () {
var e = this;
return new Promise(function (t) {
var n = void 0, r = window.KGPdfViewerWebApp, a = r.isSM, s = r.fileType, l = r.cilentSeals,
c = r.PDFViewerApplication.KGAlertPrompt;
if (a && "OFD" == s) {
var u = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp.pdfStampSeal.keyPwd, d = l[e.sealIdx];
(0, o.WebKGVerify)(d, "", u, function (e) {
n = e
}, function (e) {
return (0, i.closeOverlay)().then(function () {
return c.open(e)
})
}).then(function () {
t(n)
})
} else t(!0)
})
}
}, {
key: "left", value: function () {
if (this.sealIdx > 0) {
if (this.sealIdx--, this.kgSealIdx.innerHTML = this.sealIdx + 1, this.deleteAllOriginImgData(), this.additionTextCheckedAndAdditionConfigDisplay(), "PDF" === this.fileType) {
var e = window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig;
e && e.init()
}
this.pagingSeal.checked && this.onPagingSealWrapperClick(), this.img.src = this.seals[this.sealIdx].imgdata, this.sealRight.removeAttribute("disabled")
}
this.sealIdx <= 0 && this.sealLeft.setAttribute("disabled", !0)
}
}, {
key: "right", value: function () {
if (this.sealIdx < this.seals.length - 1) {
if (this.sealIdx++, this.kgSealIdx.innerHTML = this.sealIdx + 1, this.deleteAllOriginImgData(), this.additionTextCheckedAndAdditionConfigDisplay(), "PDF" === this.fileType) {
var e = window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig;
e && e.init()
}
this.pagingSeal.checked && this.onPagingSealWrapperClick(), this.img.src = this.seals[this.sealIdx].imgdata, this.sealLeft.removeAttribute("disabled")
}
this.sealIdx >= this.seals.length - 1 && this.sealRight.setAttribute("disabled", !0)
}
}, {
key: "setSeals", value: function (e) {
var t = window.KGPdfViewerWebApp.additionTextConfig.isSelect, n = window.KGPdfViewerWebApp.additionText;
this.seals = t && n ? this.sealsAddTextAndSaveOriginSeals(e) : e, this.displaySealsWapper()
}
}, {
key: "updateSeals", value: function (e) {
this.setSeals(e), this.init(), e.length && (this.continuityStamp.checked = !1, this.continuityStampWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.pagingSeal.checked = !1, this.pagingSealWrapper.classList.remove("kg_checkbox_wrapper-checked"), this.seals[this.sealIdx].hasOwnProperty("qfzSeal") && delete this.seals[this.sealIdx].qfzSeal, this.showPagingSealConfig.style.display = "none")
}
}, {
key: "sealsAddTextAndSaveOriginSeals", value: function (e) {
for (var t = window.KGPdfViewerWebApp.PDFViewerApplication.KGAdditionTextConfig, n = function (n) {
e[n].origin = {};
var r = new Image, i = new Image;
i.onload = function () {
t.imgExt = e[n].imgExt, t.sealImg = i, t.xRadio = e[n].width / r.width, t.yRadio = e[n].height / r.height;
var a = t.drawText();
e[n].imgdata = a.data, e[n].width = a.width, e[n].height = a.height
}, r.src = e[n].imgdata, r.onload = function () {
var t = e[n].imgdata;
i.src = t, e[n].origin.imgdata = t, e[n].origin.width = e[n].width, e[n].origin.height = e[n].height, e[n].isSelect = !0
}
}, r = 0; r < e.length; r++) n(r);
return e
}
}, {
key: "additionTextCheckedAndAdditionConfigDisplay", value: function () {
window.KGPdfViewerWebApp.additionTextConfig.isSelect && (this.seals[this.sealIdx].isSelect ? this.additionText.parentNode.classList.add("kg_checkbox_wrapper-checked") : this.additionText.parentNode.classList.remove("kg_checkbox_wrapper-checked"), this.showAdditionConfig.style.display = this.seals[this.sealIdx].isSelect ? "block" : "none", this.additionText.checked = !!this.seals[this.sealIdx].isSelect)
}
}, {
key: "setUpdateCallback", value: function (e, t) {
this.updateCallback = e, this.reason = t
}
}, {
key: "saveOriginImgData", value: function () {
window.KGPdfViewerWebApp.additionTextConfig.isSelect || (this.seals[this.sealIdx].origin = {
imgdata: this.seals[this.sealIdx].imgdata,
width: this.seals[this.sealIdx].width,
height: this.seals[this.sealIdx].height
})
}
}, {
key: "deleteOriginImgData", value: function () {
if (!window.KGPdfViewerWebApp.additionTextConfig.isSelect) {
for (var e in this.seals[this.sealIdx].origin) this.seals[this.sealIdx].origin.hasOwnProperty(e) && (this.seals[this.sealIdx][e] = this.seals[this.sealIdx].origin[e]);
delete this.seals[this.sealIdx].origin
}
}
}, {
key: "deleteAllOriginImgData", value: function () {
if (!window.KGPdfViewerWebApp.additionTextConfig.isSelect) {
for (var e = 0; e < this.seals.length; e++) {
for (var t in this.seals[e].origin) this.seals[e].origin.hasOwnProperty(t) && (this.seals[e][t] = this.seals[e].origin[t]);
delete this.seals[e].origin
}
this.additionText.checked && this.onAdditionTextWrapperClick()
}
}
}, {
key: "pagingSealNoSelectSealPrompt", value: function (e) {
var t = this, n = window.KGPdfViewerWebApp.PDFViewerApplication.KGPagingSeal;
this.pagingSeal.checked = !0, this.continuityStamp.checked = !1, this.capability = (0, a.createCapability)(), n.noSelectSealPrompt(e), this.capability.promise.then(function () {
t.verify(), t.pagingSeal.checked = !1
})
}
}, {
key: "continuitySealNoSelectSealPrompt", value: function () {
this.continuityStamp.checked = !0, this.pagingSeal.checked = !1, this.verify(), this.continuityStamp.checked = !1
}
}, {
key: "singleSealNoSelectSealPrompt", value: function () {
this.continuityStamp.checked = !1, this.pagingSeal.checked = !1, this.verify()
}
}]), e
}();
t.SelectSealPrompt = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = "kgTipOverlay", this.container = document.getElementById("kgTipOverlay"), this.kgTipMsg = document.getElementById("kgTipMsg"), this.overlayManager = n, this.l10n = r, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0).then(function () {
})
}
return r(e, [{
key: "open", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
t.kgTipMsg.querySelector("span").innerHTML = e
})
}
}, {
key: "reset", value: function (e) {
this.kgTipMsg.querySelector("span").innerHTML = e
}
}, {
key: "close", value: function () {
var e = this;
if (this.overlayManager.active.indexOf(this.overlayName) > -1) return this.overlayManager.close(this.overlayName).then(function () {
e.kgTipMsg.querySelector("span").innerHTML = ""
})
}
}]), e
}();
t.KGTipPrompt = i
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
if ("undefined" == typeof PDFJS || !PDFJS.compatibilityChecked) {
var i = n(181), a = "undefined" != typeof navigator && navigator.userAgent || "", o = /Android/.test(a),
s = /Android\s[0-2][^\d]/.test(a), l = /Android\s[0-4][^\d]/.test(a), c = a.indexOf("Chrom") >= 0,
u = (/Chrome\/(39|40)\./.test(a), a.indexOf("CriOS") >= 0), d = a.indexOf("Trident") >= 0,
h = /\b(iPad|iPhone|iPod)(?=;)/.test(a), p = a.indexOf("Opera") >= 0,
f = /Safari\//.test(a) && !/(Chrome\/|Android\s)/.test(a),
m = "object" === ("undefined" == typeof window ? "undefined" : r(window)) && "object" === ("undefined" == typeof document ? "undefined" : r(document));
"undefined" == typeof PDFJS && (i.PDFJS = {}), PDFJS.compatibilityChecked = !0, function () {
if ("undefined" == typeof Uint8ClampedArray && (i.Uint8ClampedArray = n(390)), "undefined" != typeof Uint8Array) return void 0 === Uint8Array.prototype.subarray && (Uint8Array.prototype.subarray = function (e, t) {
return new Uint8Array(this.slice(e, t))
}, Float32Array.prototype.subarray = function (e, t) {
return new Float32Array(this.slice(e, t))
}), void ("undefined" == typeof Float64Array && (i.Float64Array = Float32Array));
function e(e, t) {
return new l(this.slice(e, t))
}
function t(e, t) {
arguments.length < 2 && (t = 0);
for (var n = 0, r = e.length; n < r; ++n, ++t) this[t] = 255 & e[n]
}
function a(e, t) {
this.buffer = e, this.byteLength = e.length, this.length = t, function (e) {
for (; o < e;) Object.defineProperty(a.prototype, o, s(o)), o++
}(this.length)
}
a.prototype = Object.create(null);
var o = 0;
function s(e) {
return {
get: function () {
var t = this.buffer, n = e << 2;
return (t[n] | t[n + 1] << 8 | t[n + 2] << 16 | t[n + 3] << 24) >>> 0
}, set: function (t) {
var n = this.buffer, r = e << 2;
n[r] = 255 & t, n[r + 1] = t >> 8 & 255, n[r + 2] = t >> 16 & 255, n[r + 3] = t >>> 24 & 255
}
}
}
function l(n) {
var i, a, o;
if ("number" == typeof n) for (i = [], a = 0; a < n; ++a) i[a] = 0; else if ("slice" in n) i = n.slice(0); else for (i = [], a = 0, o = n.length; a < o; ++a) i[a] = n[a];
return i.subarray = e, i.buffer = i, i.byteLength = i.length, i.set = t, "object" === (void 0 === n ? "undefined" : r(n)) && n.buffer && (i.buffer = n.buffer), i
}
i.Uint8Array = l, i.Int8Array = l, i.Int32Array = l, i.Uint16Array = l, i.Float32Array = l, i.Float64Array = l, i.Uint32Array = function () {
if (3 === arguments.length) {
if (0 !== arguments[1]) throw new Error("offset !== 0 is not supported");
return new a(arguments[0], arguments[2])
}
return l.apply(this, arguments)
}
}(), function () {
if (m && window.CanvasPixelArray) {
var e = window.CanvasPixelArray.prototype;
"buffer" in e || (Object.defineProperty(e, "buffer", {
get: function () {
return this
}, enumerable: !1, configurable: !0
}), Object.defineProperty(e, "byteLength", {
get: function () {
return this.length
}, enumerable: !1, configurable: !0
}))
}
}(), i.URL || (i.URL = i.webkitURL), function () {
if (void 0 !== Object.defineProperty) {
var e = !0;
try {
m && Object.defineProperty(new Image, "id", {value: "test"});
var t = function () {
};
t.prototype = {
get id() {
}
}, Object.defineProperty(new t, "id", {value: "", configurable: !0, enumerable: !0, writable: !1})
} catch (t) {
e = !1
}
if (e) return
}
Object.defineProperty = function (e, t, n) {
delete e[t], "get" in n && e.__defineGetter__(t, n.get), "set" in n && e.__defineSetter__(t, n.set), "value" in n && (e.__defineSetter__(t, function (e) {
return this.__defineGetter__(t, function () {
return e
}), e
}), e[t] = n.value)
}
}(), function () {
if ("undefined" != typeof XMLHttpRequest) {
var e = XMLHttpRequest.prototype, t = new XMLHttpRequest;
"overrideMimeType" in t || Object.defineProperty(e, "overrideMimeType", {
value: function (e) {
}
}), "responseType" in t || (Object.defineProperty(e, "responseType", {
get: function () {
return this._responseType || "text"
}, set: function (e) {
"text" !== e && "arraybuffer" !== e || (this._responseType = e, "arraybuffer" === e && "function" == typeof this.overrideMimeType && this.overrideMimeType("text/plain; charset=x-user-defined"))
}
}), "undefined" == typeof VBArray ? Object.defineProperty(e, "response", {
get: function () {
if ("arraybuffer" !== this.responseType) return this.responseText;
var e, t = this.responseText, n = t.length, r = new Uint8Array(n);
for (e = 0; e < n; ++e) r[e] = 255 & t.charCodeAt(e);
return r.buffer
}
}) : Object.defineProperty(e, "response", {
get: function () {
return "arraybuffer" === this.responseType ? new Uint8Array(new VBArray(this.responseBody).toArray()) : this.responseText
}
}))
}
}(), function () {
if (!("btoa" in i)) {
var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
i.btoa = function (t) {
var n, r, i = "";
for (n = 0, r = t.length; n < r; n += 3) {
var a = 255 & t.charCodeAt(n), o = 255 & t.charCodeAt(n + 1), s = 255 & t.charCodeAt(n + 2),
l = (3 & a) << 4 | o >> 4, c = n + 1 < r ? (15 & o) << 2 | s >> 6 : 64, u = n + 2 < r ? 63 & s : 64;
i += e.charAt(a >> 2) + e.charAt(l) + e.charAt(c) + e.charAt(u)
}
return i
}
}
}(), function () {
if (!("atob" in i)) {
i.atob = function (e) {
if ((e = e.replace(/=+$/, "")).length % 4 == 1) throw new Error("bad atob input");
for (var t, n, r = 0, i = 0, a = ""; n = e.charAt(i++); ~n && (t = r % 4 ? 64 * t + n : n, r++ % 4) ? a += String.fromCharCode(255 & t >> (-2 * r & 6)) : 0) n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);
return a
}
}
}(), void 0 === Function.prototype.bind && (Function.prototype.bind = function (e) {
var t = this, n = Array.prototype.slice.call(arguments, 1);
return function () {
var r = n.concat(Array.prototype.slice.call(arguments));
return t.apply(e, r)
}
}), m && ("dataset" in document.createElement("div") || Object.defineProperty(HTMLElement.prototype, "dataset", {
get: function () {
if (this._dataset) return this._dataset;
for (var e = {}, t = 0, n = this.attributes.length; t < n; t++) {
var r = this.attributes[t];
"data-" === r.name.substring(0, 5) && (e[r.name.substring(5).replace(/\-([a-z])/g, function (e, t) {
return t.toUpperCase()
})] = r.value)
}
return Object.defineProperty(this, "_dataset", {value: e, writable: !1, enumerable: !1}), e
}, enumerable: !0
})), function () {
function e(e, t, n, r) {
var i = (e.className || "").split(/\s+/g);
"" === i[0] && i.shift();
var a = i.indexOf(t);
return a < 0 && n && i.push(t), a >= 0 && r && i.splice(a, 1), e.className = i.join(" "), a >= 0
}
if (m && !("classList" in document.createElement("div"))) {
var t = {
add: function (t) {
e(this.element, t, !0, !1)
}, contains: function (t) {
return e(this.element, t, !1, !1)
}, remove: function (t) {
e(this.element, t, !1, !0)
}, toggle: function (t) {
e(this.element, t, !0, !0)
}
};
Object.defineProperty(HTMLElement.prototype, "classList", {
get: function () {
if (this._classList) return this._classList;
var e = Object.create(t, {element: {value: this, writable: !1, enumerable: !0}});
return Object.defineProperty(this, "_classList", {value: e, writable: !1, enumerable: !1}), e
}, enumerable: !0
})
}
}(), function () {
if (!("undefined" == typeof importScripts || "console" in i)) {
var e = {}, t = {
log: function () {
var e = Array.prototype.slice.call(arguments);
i.postMessage({targetName: "main", action: "console_log", data: e})
}, error: function () {
var e = Array.prototype.slice.call(arguments);
i.postMessage({targetName: "main", action: "console_error", data: e})
}, time: function (t) {
e[t] = Date.now()
}, timeEnd: function (t) {
var n = e[t];
if (!n) throw new Error("Unknown timer name " + t);
this.log("Timer:", t, Date.now() - n)
}
};
i.console = t
}
}(), function () {
var e;
if (m) {
if ("console" in window) return "bind" in console.log ? void 0 : (console.log = (e = console.log, function (t) {
return e(t)
}), console.error = function (e) {
return function (t) {
return e(t)
}
}(console.error), void (console.warn = function (e) {
return function (t) {
return e(t)
}
}(console.warn)));
window.console = {
log: function () {
}, error: function () {
}, warn: function () {
}
}
}
}(), function () {
p && document.addEventListener("click", function (e) {
(function e(t) {
return t.disabled || t.parentNode && e(t.parentNode)
})(e.target) && e.stopPropagation()
}, !0)
}(), (d || u) && (PDFJS.disableCreateObjectURL = !0), "undefined" != typeof navigator && ("language" in navigator || (PDFJS.locale = navigator.userLanguage || "en-US")), (f || h) && (PDFJS.disableRange = !0, PDFJS.disableStream = !0), m && (history.pushState && !s || (PDFJS.disableHistory = !0)), function () {
if (m) if (window.CanvasPixelArray) "function" != typeof window.CanvasPixelArray.prototype.set && (window.CanvasPixelArray.prototype.set = function (e) {
for (var t = 0, n = this.length; t < n; t++) this[t] = e[t]
}); else {
var e, t = !1;
if (c ? t = (e = a.match(/Chrom(e|ium)\/([0-9]+)\./)) && parseInt(e[2]) < 21 : o ? t = l : f && (t = (e = a.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//)) && parseInt(e[1]) < 6), t) {
var n = window.CanvasRenderingContext2D.prototype, r = n.createImageData;
n.createImageData = function (e, t) {
var n = r.call(this, e, t);
return n.data.set = function (e) {
for (var t = 0, n = this.length; t < n; t++) this[t] = e[t]
}, n
}, n = null
}
}
}(), function () {
function e() {
window.requestAnimationFrame = function (e) {
return window.setTimeout(e, 20)
}, window.cancelAnimationFrame = function (e) {
window.clearTimeout(e)
}
}
m && (h ? e() : "requestAnimationFrame" in window || (window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame, window.requestAnimationFrame || e()))
}(), (h || o) && (PDFJS.maxCanvasPixels = 5242880), m && d && window.parent !== window && (PDFJS.disableFullscreen = !0), m && ("currentScript" in document || Object.defineProperty(document, "currentScript", {
get: function () {
var e = document.getElementsByTagName("script");
return e[e.length - 1]
}, enumerable: !0, configurable: !0
})), function () {
if (m) {
var e = document.createElement("input");
try {
e.type = "number"
} catch (r) {
var t = e.constructor.prototype, n = Object.getOwnPropertyDescriptor(t, "type");
Object.defineProperty(t, "type", {
get: function () {
return n.get.call(this)
}, set: function (e) {
n.set.call(this, "number" === e ? "text" : e)
}, enumerable: !0, configurable: !0
})
}
}
}(), function () {
if (m && document.attachEvent) {
var e = document.constructor.prototype, t = Object.getOwnPropertyDescriptor(e, "readyState");
Object.defineProperty(e, "readyState", {
get: function () {
var e = t.get.call(this);
return "interactive" === e ? "loading" : e
}, set: function (e) {
t.set.call(this, e)
}, enumerable: !0, configurable: !0
})
}
}(), m && void 0 === Element.prototype.remove && (Element.prototype.remove = function () {
this.parentNode && this.parentNode.removeChild(this)
}), Number.isNaN || (Number.isNaN = n(391)), Number.isInteger || (Number.isInteger = n(392)), i.Promise || (i.Promise = n(393)), i.WeakMap || (i.WeakMap = n(394)), function () {
var e = !1;
try {
if ("function" == typeof URL && "object" === r(URL.prototype) && "origin" in URL.prototype) {
var t = new URL("b", "http://a");
t.pathname = "c%20d", e = "http://a/c%20d" === t.href
}
} catch (e) {
}
if (!e) {
var n = Object.create(null);
n.ftp = 21, n.file = 0, n.gopher = 70, n.http = 80, n.https = 443, n.ws = 80, n.wss = 443;
var a = Object.create(null);
a["%2e"] = ".", a[".%2e"] = "..", a["%2e."] = "..", a["%2e%2e"] = "..";
var o, s = /[a-zA-Z]/, l = /[a-zA-Z0-9\+\-\.]/;
g.prototype = {
toString: function () {
return this.href
}, get href() {
if (this._isInvalid) return this._url;
var e = "";
return "" === this._username && null === this._password || (e = this._username + (null !== this._password ? ":" + this._password : "") + "@"), this.protocol + (this._isRelative ? "//" + e + this.host : "") + this.pathname + this._query + this._fragment
}, set href(e) {
v.call(this), m.call(this, e)
}, get protocol() {
return this._scheme + ":"
}, set protocol(e) {
this._isInvalid || m.call(this, e + ":", "scheme start")
}, get host() {
return this._isInvalid ? "" : this._port ? this._host + ":" + this._port : this._host
}, set host(e) {
!this._isInvalid && this._isRelative && m.call(this, e, "host")
}, get hostname() {
return this._host
}, set hostname(e) {
!this._isInvalid && this._isRelative && m.call(this, e, "hostname")
}, get port() {
return this._port
}, set port(e) {
!this._isInvalid && this._isRelative && m.call(this, e, "port")
}, get pathname() {
return this._isInvalid ? "" : this._isRelative ? "/" + this._path.join("/") : this._schemeData
}, set pathname(e) {
!this._isInvalid && this._isRelative && (this._path = [], m.call(this, e, "relative path start"))
}, get search() {
return this._isInvalid || !this._query || "?" === this._query ? "" : this._query
}, set search(e) {
!this._isInvalid && this._isRelative && (this._query = "?", "?" === e[0] && (e = e.slice(1)), m.call(this, e, "query"))
}, get hash() {
return this._isInvalid || !this._fragment || "#" === this._fragment ? "" : this._fragment
}, set hash(e) {
this._isInvalid || (this._fragment = "#", "#" === e[0] && (e = e.slice(1)), m.call(this, e, "fragment"))
}, get origin() {
var e;
if (this._isInvalid || !this._scheme) return "";
switch (this._scheme) {
case"data":
case"file":
case"javascript":
case"mailto":
return "null";
case"blob":
try {
return new g(this._schemeData).origin || "null"
} catch (e) {
}
return "null"
}
return (e = this.host) ? this._scheme + "://" + e : ""
}
};
var c = i.URL;
c && (g.createObjectURL = function (e) {
return c.createObjectURL.apply(c, arguments)
}, g.revokeObjectURL = function (e) {
c.revokeObjectURL(e)
}), i.URL = g
}
function u(e) {
return void 0 !== n[e]
}
function d() {
v.call(this), this._isInvalid = !0
}
function h(e) {
return "" === e && d.call(this), e.toLowerCase()
}
function p(e) {
var t = e.charCodeAt(0);
return t > 32 && t < 127 && -1 === [34, 35, 60, 62, 63, 96].indexOf(t) ? e : encodeURIComponent(e)
}
function f(e) {
var t = e.charCodeAt(0);
return t > 32 && t < 127 && -1 === [34, 35, 60, 62, 96].indexOf(t) ? e : encodeURIComponent(e)
}
function m(e, t, r) {
function i(e) {
b.push(e)
}
var c = t || "scheme start", m = 0, v = "", g = !1, y = !1, b = [];
e:for (; (e[m - 1] !== o || 0 === m) && !this._isInvalid;) {
var w = e[m];
switch (c) {
case"scheme start":
if (!w || !s.test(w)) {
if (t) {
i("Invalid scheme.");
break e
}
v = "", c = "no scheme";
continue
}
v += w.toLowerCase(), c = "scheme";
break;
case"scheme":
if (w && l.test(w)) v += w.toLowerCase(); else {
if (":" !== w) {
if (t) {
if (w === o) break e;
i("Code point not allowed in scheme: " + w);
break e
}
v = "", m = 0, c = "no scheme";
continue
}
if (this._scheme = v, v = "", t) break e;
u(this._scheme) && (this._isRelative = !0), c = "file" === this._scheme ? "relative" : this._isRelative && r && r._scheme === this._scheme ? "relative or authority" : this._isRelative ? "authority first slash" : "scheme data"
}
break;
case"scheme data":
"?" === w ? (this._query = "?", c = "query") : "#" === w ? (this._fragment = "#", c = "fragment") : w !== o && "\t" !== w && "\n" !== w && "\r" !== w && (this._schemeData += p(w));
break;
case"no scheme":
if (r && u(r._scheme)) {
c = "relative";
continue
}
i("Missing scheme."), d.call(this);
break;
case"relative or authority":
if ("/" !== w || "/" !== e[m + 1]) {
i("Expected /, got: " + w), c = "relative";
continue
}
c = "authority ignore slashes";
break;
case"relative":
if (this._isRelative = !0, "file" !== this._scheme && (this._scheme = r._scheme), w === o) {
this._host = r._host, this._port = r._port, this._path = r._path.slice(), this._query = r._query, this._username = r._username, this._password = r._password;
break e
}
if ("/" === w || "\\" === w) "\\" === w && i("\\ is an invalid code point."), c = "relative slash"; else if ("?" === w) this._host = r._host, this._port = r._port, this._path = r._path.slice(), this._query = "?", this._username = r._username, this._password = r._password, c = "query"; else {
if ("#" !== w) {
var S = e[m + 1], _ = e[m + 2];
("file" !== this._scheme || !s.test(w) || ":" !== S && "|" !== S || _ !== o && "/" !== _ && "\\" !== _ && "?" !== _ && "#" !== _) && (this._host = r._host, this._port = r._port, this._username = r._username, this._password = r._password, this._path = r._path.slice(), this._path.pop()), c = "relative path";
continue
}
this._host = r._host, this._port = r._port, this._path = r._path.slice(), this._query = r._query, this._fragment = "#", this._username = r._username, this._password = r._password, c = "fragment"
}
break;
case"relative slash":
if ("/" !== w && "\\" !== w) {
"file" !== this._scheme && (this._host = r._host, this._port = r._port, this._username = r._username, this._password = r._password), c = "relative path";
continue
}
"\\" === w && i("\\ is an invalid code point."), c = "file" === this._scheme ? "file host" : "authority ignore slashes";
break;
case"authority first slash":
if ("/" !== w) {
i("Expected '/', got: " + w), c = "authority ignore slashes";
continue
}
c = "authority second slash";
break;
case"authority second slash":
if (c = "authority ignore slashes", "/" !== w) {
i("Expected '/', got: " + w);
continue
}
break;
case"authority ignore slashes":
if ("/" !== w && "\\" !== w) {
c = "authority";
continue
}
i("Expected authority, got: " + w);
break;
case"authority":
if ("@" === w) {
g && (i("@ already seen."), v += "%40"), g = !0;
for (var k = 0; k < v.length; k++) {
var x = v[k];
if ("\t" !== x && "\n" !== x && "\r" !== x) if (":" !== x || null !== this._password) {
var P = p(x);
null !== this._password ? this._password += P : this._username += P
} else this._password = ""; else i("Invalid whitespace in authority.")
}
v = ""
} else {
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w) {
m -= v.length, v = "", c = "host";
continue
}
v += w
}
break;
case"file host":
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w) {
2 !== v.length || !s.test(v[0]) || ":" !== v[1] && "|" !== v[1] ? 0 === v.length ? c = "relative path start" : (this._host = h.call(this, v), v = "", c = "relative path start") : c = "relative path";
continue
}
"\t" === w || "\n" === w || "\r" === w ? i("Invalid whitespace in file host.") : v += w;
break;
case"host":
case"hostname":
if (":" !== w || y) {
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w) {
if (this._host = h.call(this, v), v = "", c = "relative path start", t) break e;
continue
}
"\t" !== w && "\n" !== w && "\r" !== w ? ("[" === w ? y = !0 : "]" === w && (y = !1), v += w) : i("Invalid code point in host/hostname: " + w)
} else if (this._host = h.call(this, v), v = "", c = "port", "hostname" === t) break e;
break;
case"port":
if (/[0-9]/.test(w)) v += w; else {
if (w === o || "/" === w || "\\" === w || "?" === w || "#" === w || t) {
if ("" !== v) {
var C = parseInt(v, 10);
C !== n[this._scheme] && (this._port = C + ""), v = ""
}
if (t) break e;
c = "relative path start";
continue
}
"\t" === w || "\n" === w || "\r" === w ? i("Invalid code point in port: " + w) : d.call(this)
}
break;
case"relative path start":
if ("\\" === w && i("'\\' not allowed in path."), c = "relative path", "/" !== w && "\\" !== w) continue;
break;
case"relative path":
var A;
if (w !== o && "/" !== w && "\\" !== w && (t || "?" !== w && "#" !== w)) "\t" !== w && "\n" !== w && "\r" !== w && (v += p(w)); else "\\" === w && i("\\ not allowed in relative path."), (A = a[v.toLowerCase()]) && (v = A), ".." === v ? (this._path.pop(), "/" !== w && "\\" !== w && this._path.push("")) : "." === v && "/" !== w && "\\" !== w ? this._path.push("") : "." !== v && ("file" === this._scheme && 0 === this._path.length && 2 === v.length && s.test(v[0]) && "|" === v[1] && (v = v[0] + ":"), this._path.push(v)), v = "", "?" === w ? (this._query = "?", c = "query") : "#" === w && (this._fragment = "#", c = "fragment");
break;
case"query":
t || "#" !== w ? w !== o && "\t" !== w && "\n" !== w && "\r" !== w && (this._query += f(w)) : (this._fragment = "#", c = "fragment");
break;
case"fragment":
w !== o && "\t" !== w && "\n" !== w && "\r" !== w && (this._fragment += w)
}
m++
}
}
function v() {
this._scheme = "", this._schemeData = "", this._username = "", this._password = null, this._host = "", this._port = "", this._path = [], this._query = "", this._fragment = "", this._isInvalid = !1, this._isRelative = !1
}
function g(e, t) {
void 0 === t || t instanceof g || (t = new g(String(t))), this._url = e, v.call(this);
var n = e.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, "");
m.call(this, n, null, t)
}
}()
}
}, function (e, t, n) {
"use strict";
n(158), e.exports = n(13).Uint8ClampedArray
}, function (e, t, n) {
"use strict";
n(140), e.exports = n(13).Number.isNaN
}, function (e, t, n) {
"use strict";
n(138), e.exports = n(13).Number.isInteger
}, function (e, t, n) {
"use strict";
n(96), n(143), n(119), n(150), n(168), n(169), e.exports = n(13).Promise
}, function (e, t, n) {
"use strict";
n(96), n(119), n(117), n(165), n(166), e.exports = n(13).WeakMap
}, function (e, t, n) {
"use strict";
var r = !1;
if ("undefined" != typeof ReadableStream) try {
new ReadableStream({
start: function (e) {
e.close()
}
}), r = !0
} catch (e) {
}
t.ReadableStream = r ? ReadableStream : n(396).ReadableStream
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
!function (e, t) {
for (var n in t) e[n] = t[n]
}(t, function (e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = t[r] = {i: r, l: !1, exports: {}};
return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports
}
return n.m = e, n.c = t, n.i = function (e) {
return e
}, n.d = function (e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: r})
}, n.n = function (e) {
var t = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return n.d(t, "a", t), t
}, n.o = function (e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 7)
}([function (e, t, n) {
var i = "function" == typeof Symbol && "symbol" === r(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : r(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : r(e)
}, a = n(1).assert;
function o(e) {
return "string" == typeof e || "symbol" === (void 0 === e ? "undefined" : i(e))
}
function s(e, t, n) {
if ("function" != typeof e) throw new TypeError("Argument is not a function");
return Function.prototype.apply.call(e, t, n)
}
t.typeIsObject = function (e) {
return "object" === (void 0 === e ? "undefined" : i(e)) && null !== e || "function" == typeof e
}, t.createDataProperty = function (e, n, r) {
a(t.typeIsObject(e)), Object.defineProperty(e, n, {value: r, writable: !0, enumerable: !0, configurable: !0})
}, t.createArrayFromList = function (e) {
return e.slice()
}, t.ArrayBufferCopy = function (e, t, n, r, i) {
new Uint8Array(e).set(new Uint8Array(n, r, i), t)
}, t.CreateIterResultObject = function (e, t) {
a("boolean" == typeof t);
var n = {};
return Object.defineProperty(n, "value", {
value: e,
enumerable: !0,
writable: !0,
configurable: !0
}), Object.defineProperty(n, "done", {value: t, enumerable: !0, writable: !0, configurable: !0}), n
}, t.IsFiniteNonNegativeNumber = function (e) {
return !Number.isNaN(e) && (e !== 1 / 0 && !(e < 0))
}, t.InvokeOrNoop = function (e, t, n) {
a(void 0 !== e), a(o(t)), a(Array.isArray(n));
var r = e[t];
if (void 0 !== r) return s(r, e, n)
}, t.PromiseInvokeOrNoop = function (e, n, r) {
a(void 0 !== e), a(o(n)), a(Array.isArray(r));
try {
return Promise.resolve(t.InvokeOrNoop(e, n, r))
} catch (e) {
return Promise.reject(e)
}
}, t.PromiseInvokeOrPerformFallback = function (e, t, n, r, i) {
a(void 0 !== e), a(o(t)), a(Array.isArray(n)), a(Array.isArray(i));
var l = void 0;
try {
l = e[t]
} catch (e) {
return Promise.reject(e)
}
if (void 0 === l) return r.apply(null, i);
try {
return Promise.resolve(s(l, e, n))
} catch (e) {
return Promise.reject(e)
}
}, t.TransferArrayBuffer = function (e) {
return e.slice()
}, t.ValidateAndNormalizeHighWaterMark = function (e) {
if (e = Number(e), Number.isNaN(e) || e < 0) throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");
return e
}, t.ValidateAndNormalizeQueuingStrategy = function (e, n) {
if (void 0 !== e && "function" != typeof e) throw new TypeError("size property of a queuing strategy must be a function");
return {size: e, highWaterMark: n = t.ValidateAndNormalizeHighWaterMark(n)}
}
}, function (e, t, n) {
function r(e) {
this.name = "AssertionError", this.message = e || "", this.stack = (new Error).stack
}
r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, e.exports = {
rethrowAssertionErrorRejection: function (e) {
e && e.constructor === r && setTimeout(function () {
throw e
}, 0)
}, AssertionError: r, assert: function (e, t) {
if (!e) throw new r(t)
}
}
}, function (e, t, n) {
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
function i(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var a = n(0), o = a.InvokeOrNoop, s = a.PromiseInvokeOrNoop, l = a.ValidateAndNormalizeQueuingStrategy,
c = a.typeIsObject, u = n(1), d = u.assert, h = u.rethrowAssertionErrorRejection, p = n(3), f = p.DequeueValue,
m = p.EnqueueValueWithSize, v = p.PeekQueueValue, g = p.ResetQueue, y = function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.size, a = n.highWaterMark,
o = void 0 === a ? 1 : a;
if (i(this, e), this._state = "writable", this._storedError = void 0, this._writer = void 0, this._writableStreamController = void 0, this._writeRequests = [], this._inFlightWriteRequest = void 0, this._closeRequest = void 0, this._inFlightCloseRequest = void 0, this._pendingAbortRequest = void 0, this._backpressure = !1, void 0 !== t.type) throw new RangeError("Invalid type is specified");
this._writableStreamController = new V(this, t, r, o), this._writableStreamController.__startSteps()
}
return r(e, [{
key: "abort", value: function (e) {
return !1 === w(this) ? Promise.reject(z("abort")) : !0 === S(this) ? Promise.reject(new TypeError("Cannot abort a stream that already has a writer")) : _(this, e)
}
}, {
key: "getWriter", value: function () {
if (!1 === w(this)) throw z("getWriter");
return b(this)
}
}, {
key: "locked", get: function () {
if (!1 === w(this)) throw z("locked");
return S(this)
}
}]), e
}();
function b(e) {
return new I(e)
}
function w(e) {
return !!c(e) && !!Object.prototype.hasOwnProperty.call(e, "_writableStreamController")
}
function S(e) {
return d(!0 === w(e), "IsWritableStreamLocked should only be used on known writable streams"), void 0 !== e._writer
}
function _(e, t) {
var n = e._state;
if ("closed" === n) return Promise.resolve(void 0);
if ("errored" === n) return Promise.reject(e._storedError);
var r = new TypeError("Requested to abort");
if (void 0 !== e._pendingAbortRequest) return Promise.reject(r);
d("writable" === n || "erroring" === n, "state must be writable or erroring");
var i = !1;
"erroring" === n && (i = !0, t = void 0);
var a = new Promise(function (n, r) {
e._pendingAbortRequest = {_resolve: n, _reject: r, _reason: t, _wasAlreadyErroring: i}
});
return !1 === i && x(e, r), a
}
function k(e, t) {
var n = e._state;
"writable" !== n ? (d("erroring" === n), P(e)) : x(e, t)
}
function x(e, t) {
d(void 0 === e._storedError, "stream._storedError === undefined"), d("writable" === e._state, "state must be writable");
var n = e._writableStreamController;
d(void 0 !== n, "controller must not be undefined"), e._state = "erroring", e._storedError = t;
var r = e._writer;
void 0 !== r && N(r, t), !1 === T(e) && !0 === n._started && P(e)
}
function P(e) {
d("erroring" === e._state, "stream._state === erroring"), d(!1 === T(e), "WritableStreamHasOperationMarkedInFlight(stream) === false"), e._state = "errored", e._writableStreamController.__errorSteps();
for (var t = e._storedError, n = 0; n < e._writeRequests.length; n++) {
e._writeRequests[n]._reject(t)
}
if (e._writeRequests = [], void 0 !== e._pendingAbortRequest) {
var r = e._pendingAbortRequest;
if (e._pendingAbortRequest = void 0, !0 === r._wasAlreadyErroring) return r._reject(t), void E(e);
e._writableStreamController.__abortSteps(r._reason).then(function () {
r._resolve(), E(e)
}, function (t) {
r._reject(t), E(e)
})
} else E(e)
}
function C(e) {
d(void 0 !== e._inFlightCloseRequest), e._inFlightCloseRequest._resolve(void 0), e._inFlightCloseRequest = void 0;
var t = e._state;
d("writable" === t || "erroring" === t), "erroring" === t && (e._storedError = void 0, void 0 !== e._pendingAbortRequest && (e._pendingAbortRequest._resolve(), e._pendingAbortRequest = void 0)), e._state = "closed";
var n = e._writer;
void 0 !== n && function (e) {
d(void 0 !== e._closedPromise_resolve, "writer._closedPromise_resolve !== undefined"), d(void 0 !== e._closedPromise_reject, "writer._closedPromise_reject !== undefined"), d("pending" === e._closedPromiseState, "writer._closedPromiseState is pending"), e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "resolved"
}(n), d(void 0 === e._pendingAbortRequest, "stream._pendingAbortRequest === undefined"), d(void 0 === e._storedError, "stream._storedError === undefined")
}
function A(e) {
return void 0 !== e._closeRequest || void 0 !== e._inFlightCloseRequest
}
function T(e) {
return void 0 !== e._inFlightWriteRequest || void 0 !== e._inFlightCloseRequest
}
function E(e) {
d("errored" === e._state, '_stream_.[[state]] is `"errored"`'), void 0 !== e._closeRequest && (d(void 0 === e._inFlightCloseRequest), e._closeRequest._reject(e._storedError), e._closeRequest = void 0);
var t = e._writer;
void 0 !== t && (Y(t, e._storedError), t._closedPromise.catch(function () {
}))
}
function D(e, t) {
d("writable" === e._state), d(!1 === A(e));
var n = e._writer;
void 0 !== n && t !== e._backpressure && (!0 === t ? function (e) {
d(void 0 === e._readyPromise_resolve, "writer._readyPromise_resolve === undefined"), d(void 0 === e._readyPromise_reject, "writer._readyPromise_reject === undefined"), e._readyPromise = new Promise(function (t, n) {
e._readyPromise_resolve = t, e._readyPromise_reject = n
}), e._readyPromiseState = "pending"
}(n) : (d(!1 === t), Q(n))), e._backpressure = t
}
e.exports = {
AcquireWritableStreamDefaultWriter: b,
IsWritableStream: w,
IsWritableStreamLocked: S,
WritableStream: y,
WritableStreamAbort: _,
WritableStreamDefaultControllerError: j,
WritableStreamDefaultWriterCloseWithErrorPropagation: function (e) {
var t = e._ownerWritableStream;
d(void 0 !== t);
var n = t._state;
if (!0 === A(t) || "closed" === n) return Promise.resolve();
if ("errored" === n) return Promise.reject(t._storedError);
return d("writable" === n || "erroring" === n), O(e)
},
WritableStreamDefaultWriterRelease: R,
WritableStreamDefaultWriterWrite: W,
WritableStreamCloseQueuedOrInFlight: A
};
var I = function () {
function e(t) {
if (i(this, e), !1 === w(t)) throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");
if (!0 === S(t)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");
this._ownerWritableStream = t, t._writer = this;
var n, r = t._state;
if ("writable" === r) !1 === A(t) && !0 === t._backpressure ? ((n = this)._readyPromise = new Promise(function (e, t) {
n._readyPromise_resolve = e, n._readyPromise_reject = t
}), n._readyPromiseState = "pending") : J(this), H(this); else if ("erroring" === r) X(this, t._storedError), this._readyPromise.catch(function () {
}), H(this); else if ("closed" === r) J(this), function (e) {
e._closedPromise = Promise.resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "resolved"
}(this); else {
d("errored" === r, "state must be errored");
var a = t._storedError;
X(this, a), this._readyPromise.catch(function () {
}), function (e, t) {
e._closedPromise = Promise.reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "rejected"
}(this, a), this._closedPromise.catch(function () {
})
}
}
return r(e, [{
key: "abort", value: function (e) {
return !1 === L(this) ? Promise.reject(U("abort")) : void 0 === this._ownerWritableStream ? Promise.reject(q("abort")) : function (e, t) {
var n = e._ownerWritableStream;
return d(void 0 !== n), _(n, t)
}(this, e)
}
}, {
key: "close", value: function () {
if (!1 === L(this)) return Promise.reject(U("close"));
var e = this._ownerWritableStream;
return void 0 === e ? Promise.reject(q("close")) : !0 === A(e) ? Promise.reject(new TypeError("cannot close an already-closing stream")) : O(this)
}
}, {
key: "releaseLock", value: function () {
if (!1 === L(this)) throw U("releaseLock");
var e = this._ownerWritableStream;
void 0 !== e && (d(void 0 !== e._writer), R(this))
}
}, {
key: "write", value: function (e) {
return !1 === L(this) ? Promise.reject(U("write")) : void 0 === this._ownerWritableStream ? Promise.reject(q("write to")) : W(this, e)
}
}, {
key: "closed", get: function () {
return !1 === L(this) ? Promise.reject(U("closed")) : this._closedPromise
}
}, {
key: "desiredSize", get: function () {
if (!1 === L(this)) throw U("desiredSize");
if (void 0 === this._ownerWritableStream) throw q("desiredSize");
return function (e) {
var t = e._ownerWritableStream, n = t._state;
if ("errored" === n || "erroring" === n) return null;
if ("closed" === n) return 0;
return F(t._writableStreamController)
}(this)
}
}, {
key: "ready", get: function () {
return !1 === L(this) ? Promise.reject(U("ready")) : this._readyPromise
}
}]), e
}();
function L(e) {
return !!c(e) && !!Object.prototype.hasOwnProperty.call(e, "_ownerWritableStream")
}
function O(e) {
var t = e._ownerWritableStream;
d(void 0 !== t);
var n = t._state;
if ("closed" === n || "errored" === n) return Promise.reject(new TypeError("The stream (in " + n + " state) is not in the writable state and cannot be closed"));
d("writable" === n || "erroring" === n), d(!1 === A(t));
var r, i = new Promise(function (e, n) {
var r = {_resolve: e, _reject: n};
t._closeRequest = r
});
return !0 === t._backpressure && "writable" === n && Q(e), r = t._writableStreamController, m(r, "close", 0), G(r), i
}
function M(e, t) {
"pending" === e._closedPromiseState ? Y(e, t) : function (e, t) {
d(void 0 === e._closedPromise_resolve, "writer._closedPromise_resolve === undefined"), d(void 0 === e._closedPromise_reject, "writer._closedPromise_reject === undefined"), d("pending" !== e._closedPromiseState, "writer._closedPromiseState is not pending"), e._closedPromise = Promise.reject(t), e._closedPromiseState = "rejected"
}(e, t), e._closedPromise.catch(function () {
})
}
function N(e, t) {
"pending" === e._readyPromiseState ? function (e, t) {
d(void 0 !== e._readyPromise_resolve, "writer._readyPromise_resolve !== undefined"), d(void 0 !== e._readyPromise_reject, "writer._readyPromise_reject !== undefined"), e._readyPromise_reject(t), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "rejected"
}(e, t) : function (e, t) {
d(void 0 === e._readyPromise_resolve, "writer._readyPromise_resolve === undefined"), d(void 0 === e._readyPromise_reject, "writer._readyPromise_reject === undefined"), e._readyPromise = Promise.reject(t), e._readyPromiseState = "rejected"
}(e, t), e._readyPromise.catch(function () {
})
}
function R(e) {
var t = e._ownerWritableStream;
d(void 0 !== t), d(t._writer === e);
var n = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
N(e, n), M(e, n), t._writer = void 0, e._ownerWritableStream = void 0
}
function W(e, t) {
var n = e._ownerWritableStream;
d(void 0 !== n);
var r = n._writableStreamController, i = function (e, t) {
var n = e._strategySize;
if (void 0 === n) return 1;
try {
return n(t)
} catch (t) {
return B(e, t), 1
}
}(r, t);
if (n !== e._ownerWritableStream) return Promise.reject(q("write to"));
var a = n._state;
if ("errored" === a) return Promise.reject(n._storedError);
if (!0 === A(n) || "closed" === a) return Promise.reject(new TypeError("The stream is closing or closed and cannot be written to"));
if ("erroring" === a) return Promise.reject(n._storedError);
d("writable" === a);
var o = function (e) {
return d(!0 === S(e)), d("writable" === e._state), new Promise(function (t, n) {
var r = {_resolve: t, _reject: n};
e._writeRequests.push(r)
})
}(n);
return function (e, t, n) {
var r = {chunk: t};
try {
m(e, r, n)
} catch (t) {
return void B(e, t)
}
var i = e._controlledWritableStream;
if (!1 === A(i) && "writable" === i._state) {
var a = K(e);
D(i, a)
}
G(e)
}(r, t, i), o
}
var V = function () {
function e(t, n, r, a) {
if (i(this, e), !1 === w(t)) throw new TypeError("WritableStreamDefaultController can only be constructed with a WritableStream instance");
if (void 0 !== t._writableStreamController) throw new TypeError("WritableStreamDefaultController instances can only be created by the WritableStream constructor");
this._controlledWritableStream = t, this._underlyingSink = n, this._queue = void 0, this._queueTotalSize = void 0, g(this), this._started = !1;
var o = l(r, a);
this._strategySize = o.size, this._strategyHWM = o.highWaterMark, D(t, K(this))
}
return r(e, [{
key: "error", value: function (e) {
if (!1 === function (e) {
if (!c(e)) return !1;
if (!Object.prototype.hasOwnProperty.call(e, "_underlyingSink")) return !1;
return !0
}(this)) throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");
"writable" === this._controlledWritableStream._state && j(this, e)
}
}, {
key: "__abortSteps", value: function (e) {
return s(this._underlyingSink, "abort", [e])
}
}, {
key: "__errorSteps", value: function () {
g(this)
}
}, {
key: "__startSteps", value: function () {
var e = this, t = o(this._underlyingSink, "start", [this]), n = this._controlledWritableStream;
Promise.resolve(t).then(function () {
d("writable" === n._state || "erroring" === n._state), e._started = !0, G(e)
}, function (t) {
d("writable" === n._state || "erroring" === n._state), e._started = !0, k(n, t)
}).catch(h)
}
}]), e
}();
function F(e) {
return e._strategyHWM - e._queueTotalSize
}
function G(e) {
var t = e._controlledWritableStream;
if (!1 !== e._started && void 0 === t._inFlightWriteRequest) {
var n = t._state;
if ("closed" !== n && "errored" !== n) if ("erroring" !== n) {
if (0 !== e._queue.length) {
var r = v(e);
"close" === r ? function (e) {
var t = e._controlledWritableStream;
(function (e) {
d(void 0 === e._inFlightCloseRequest), d(void 0 !== e._closeRequest), e._inFlightCloseRequest = e._closeRequest, e._closeRequest = void 0
})(t), f(e), d(0 === e._queue.length, "queue must be empty once the final write record is dequeued"), s(e._underlyingSink, "close", []).then(function () {
C(t)
}, function (e) {
!function (e, t) {
d(void 0 !== e._inFlightCloseRequest), e._inFlightCloseRequest._reject(t), e._inFlightCloseRequest = void 0, d("writable" === e._state || "erroring" === e._state), void 0 !== e._pendingAbortRequest && (e._pendingAbortRequest._reject(t), e._pendingAbortRequest = void 0), k(e, t)
}(t, e)
}).catch(h)
}(e) : function (e, t) {
var n = e._controlledWritableStream;
(function (e) {
d(void 0 === e._inFlightWriteRequest, "there must be no pending write request"), d(0 !== e._writeRequests.length, "writeRequests must not be empty"), e._inFlightWriteRequest = e._writeRequests.shift()
})(n), s(e._underlyingSink, "write", [t, e]).then(function () {
!function (e) {
d(void 0 !== e._inFlightWriteRequest), e._inFlightWriteRequest._resolve(void 0), e._inFlightWriteRequest = void 0
}(n);
var t = n._state;
if (d("writable" === t || "erroring" === t), f(e), !1 === A(n) && "writable" === t) {
var r = K(e);
D(n, r)
}
G(e)
}, function (e) {
!function (e, t) {
d(void 0 !== e._inFlightWriteRequest), e._inFlightWriteRequest._reject(t), e._inFlightWriteRequest = void 0, d("writable" === e._state || "erroring" === e._state), k(e, t)
}(n, e)
}).catch(h)
}(e, r.chunk)
}
} else P(t)
}
}
function B(e, t) {
"writable" === e._controlledWritableStream._state && j(e, t)
}
function K(e) {
return F(e) <= 0
}
function j(e, t) {
var n = e._controlledWritableStream;
d("writable" === n._state), x(n, t)
}
function z(e) {
return new TypeError("WritableStream.prototype." + e + " can only be used on a WritableStream")
}
function U(e) {
return new TypeError("WritableStreamDefaultWriter.prototype." + e + " can only be used on a WritableStreamDefaultWriter")
}
function q(e) {
return new TypeError("Cannot " + e + " a stream using a released writer")
}
function H(e) {
e._closedPromise = new Promise(function (t, n) {
e._closedPromise_resolve = t, e._closedPromise_reject = n, e._closedPromiseState = "pending"
})
}
function Y(e, t) {
d(void 0 !== e._closedPromise_resolve, "writer._closedPromise_resolve !== undefined"), d(void 0 !== e._closedPromise_reject, "writer._closedPromise_reject !== undefined"), d("pending" === e._closedPromiseState, "writer._closedPromiseState is pending"), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "rejected"
}
function X(e, t) {
e._readyPromise = Promise.reject(t), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "rejected"
}
function J(e) {
e._readyPromise = Promise.resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "fulfilled"
}
function Q(e) {
d(void 0 !== e._readyPromise_resolve, "writer._readyPromise_resolve !== undefined"), d(void 0 !== e._readyPromise_reject, "writer._readyPromise_reject !== undefined"), e._readyPromise_resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "fulfilled"
}
}, function (e, t, n) {
var r = n(0).IsFiniteNonNegativeNumber, i = n(1).assert;
t.DequeueValue = function (e) {
i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: DequeueValue should only be used on containers with [[queue]] and [[queueTotalSize]]."), i(e._queue.length > 0, "Spec-level failure: should never dequeue from an empty queue.");
var t = e._queue.shift();
return e._queueTotalSize -= t.size, e._queueTotalSize < 0 && (e._queueTotalSize = 0), t.value
}, t.EnqueueValueWithSize = function (e, t, n) {
if (i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: EnqueueValueWithSize should only be used on containers with [[queue]] and [[queueTotalSize]]."), n = Number(n), !r(n)) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");
e._queue.push({value: t, size: n}), e._queueTotalSize += n
}, t.PeekQueueValue = function (e) {
return i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: PeekQueueValue should only be used on containers with [[queue]] and [[queueTotalSize]]."), i(e._queue.length > 0, "Spec-level failure: should never peek at an empty queue."), e._queue[0].value
}, t.ResetQueue = function (e) {
i("_queue" in e && "_queueTotalSize" in e, "Spec-level failure: ResetQueue should only be used on containers with [[queue]] and [[queueTotalSize]]."), e._queue = [], e._queueTotalSize = 0
}
}, function (e, t, n) {
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
function i(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var a = n(0), o = a.ArrayBufferCopy, s = a.CreateIterResultObject, l = a.IsFiniteNonNegativeNumber,
c = a.InvokeOrNoop, u = a.PromiseInvokeOrNoop, d = a.TransferArrayBuffer,
h = a.ValidateAndNormalizeQueuingStrategy, p = a.ValidateAndNormalizeHighWaterMark, f = n(0),
m = f.createArrayFromList, v = f.createDataProperty, g = f.typeIsObject, y = n(1), b = y.assert,
w = y.rethrowAssertionErrorRejection, S = n(3), _ = S.DequeueValue, k = S.EnqueueValueWithSize, x = S.ResetQueue,
P = n(2), C = P.AcquireWritableStreamDefaultWriter, A = P.IsWritableStream, T = P.IsWritableStreamLocked,
E = P.WritableStreamAbort, D = P.WritableStreamDefaultWriterCloseWithErrorPropagation,
I = P.WritableStreamDefaultWriterRelease, L = P.WritableStreamDefaultWriterWrite,
O = P.WritableStreamCloseQueuedOrInFlight, M = function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.size, a = n.highWaterMark;
i(this, e), this._state = "readable", this._reader = void 0, this._storedError = void 0, this._disturbed = !1, this._readableStreamController = void 0;
var o = t.type;
if ("bytes" === String(o)) void 0 === a && (a = 0), this._readableStreamController = new he(this, t, a); else {
if (void 0 !== o) throw new RangeError("Invalid type is specified");
void 0 === a && (a = 1), this._readableStreamController = new re(this, t, r, a)
}
}
return r(e, [{
key: "cancel", value: function (e) {
return !1 === R(this) ? Promise.reject(Ee("cancel")) : !0 === W(this) ? Promise.reject(new TypeError("Cannot cancel a stream that already has a reader")) : B(this, e)
}
}, {
key: "getReader", value: function () {
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).mode;
if (!1 === R(this)) throw Ee("getReader");
if (void 0 === e) return N(this);
if ("byob" === (e = String(e))) return new J(this);
throw new RangeError("Invalid mode is specified")
}
}, {
key: "pipeThrough", value: function (e, t) {
var n = e.writable, r = e.readable;
return function (e) {
try {
Promise.prototype.then.call(e, void 0, function () {
})
} catch (e) {
}
}(this.pipeTo(n, t)), r
}
}, {
key: "pipeTo", value: function (e) {
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = n.preventClose,
i = n.preventAbort, a = n.preventCancel;
if (!1 === R(this)) return Promise.reject(Ee("pipeTo"));
if (!1 === A(e)) return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
if (r = Boolean(r), i = Boolean(i), a = Boolean(a), !0 === W(this)) return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream"));
if (!0 === T(e)) return Promise.reject(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream"));
var o = N(this), s = C(e), l = !1, c = Promise.resolve();
return new Promise(function (n, u) {
var d, h, p;
if (v(t, o._closedPromise, function (t) {
!1 === i ? g(function () {
return E(e, t)
}, !0, t) : y(!0, t)
}), v(e, s._closedPromise, function (e) {
!1 === a ? g(function () {
return B(t, e)
}, !0, e) : y(!0, e)
}), d = t, h = o._closedPromise, p = function () {
!1 === r ? g(function () {
return D(s)
}) : y()
}, "closed" === d._state ? p() : h.then(p).catch(w), !0 === O(e) || "closed" === e._state) {
var f = new TypeError("the destination writable stream closed before all data could be piped to it");
!1 === a ? g(function () {
return B(t, f)
}, !0, f) : y(!0, f)
}
function m() {
var e = c;
return c.then(function () {
return e !== c ? m() : void 0
})
}
function v(e, t, n) {
"errored" === e._state ? n(e._storedError) : t.catch(n).catch(w)
}
function g(t, n, r) {
function i() {
t().then(function () {
return b(n, r)
}, function (e) {
return b(!0, e)
}).catch(w)
}
!0 !== l && (l = !0, "writable" === e._state && !1 === O(e) ? m().then(i) : i())
}
function y(t, n) {
!0 !== l && (l = !0, "writable" === e._state && !1 === O(e) ? m().then(function () {
return b(t, n)
}).catch(w) : b(t, n))
}
function b(e, t) {
I(s), te(o), e ? u(t) : n(void 0)
}
(function e() {
return c = Promise.resolve(), !0 === l ? Promise.resolve() : s._readyPromise.then(function () {
return ne(o).then(function (e) {
var t = e.value;
!0 !== e.done && (c = L(s, t).catch(function () {
}))
})
}).then(e)
})().catch(function (e) {
c = Promise.resolve(), w(e)
})
})
}
}, {
key: "tee", value: function () {
if (!1 === R(this)) throw Ee("tee");
var e = V(this, !1);
return m(e)
}
}, {
key: "locked", get: function () {
if (!1 === R(this)) throw Ee("locked");
return W(this)
}
}]), e
}();
function N(e) {
return new X(e)
}
function R(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_readableStreamController")
}
function W(e) {
return b(!0 === R(e), "IsReadableStreamLocked should only be used on known readable streams"), void 0 !== e._reader
}
function V(e, t) {
b(!0 === R(e)), b("boolean" == typeof t);
var n = N(e), r = {closedOrErrored: !1, canceled1: !1, canceled2: !1, reason1: void 0, reason2: void 0};
r.promise = new Promise(function (e) {
r._resolve = e
});
var i = function () {
return function e() {
var t = e._reader, n = e._branch1, r = e._branch2, i = e._teeState;
return ne(t).then(function (e) {
b(g(e));
var t = e.value, a = e.done;
if (b("boolean" == typeof a), !0 === a && !1 === i.closedOrErrored && (!1 === i.canceled1 && oe(n), !1 === i.canceled2 && oe(r), i.closedOrErrored = !0), !0 !== i.closedOrErrored) {
var o = t, s = t;
!1 === i.canceled1 && se(n, o), !1 === i.canceled2 && se(r, s)
}
})
}
}();
i._reader = n, i._teeState = r, i._cloneForBranch2 = t;
var a = function () {
return function e(t) {
var n = e._stream, r = e._teeState;
r.canceled1 = !0;
r.reason1 = t;
if (!0 === r.canceled2) {
var i = m([r.reason1, r.reason2]), a = B(n, i);
r._resolve(a)
}
return r.promise
}
}();
a._stream = e, a._teeState = r;
var o = function () {
return function e(t) {
var n = e._stream, r = e._teeState;
r.canceled2 = !0;
r.reason2 = t;
if (!0 === r.canceled1) {
var i = m([r.reason1, r.reason2]), a = B(n, i);
r._resolve(a)
}
return r.promise
}
}();
o._stream = e, o._teeState = r;
var s = Object.create(Object.prototype);
v(s, "pull", i), v(s, "cancel", a);
var l = new M(s), c = Object.create(Object.prototype);
v(c, "pull", i), v(c, "cancel", o);
var u = new M(c);
return i._branch1 = l._readableStreamController, i._branch2 = u._readableStreamController, n._closedPromise.catch(function (e) {
!0 !== r.closedOrErrored && (le(i._branch1, e), le(i._branch2, e), r.closedOrErrored = !0)
}), [l, u]
}
function F(e) {
return b(!0 === Q(e._reader)), b("readable" === e._state || "closed" === e._state), new Promise(function (t, n) {
var r = {_resolve: t, _reject: n};
e._reader._readIntoRequests.push(r)
})
}
function G(e) {
return b(!0 === $(e._reader)), b("readable" === e._state), new Promise(function (t, n) {
var r = {_resolve: t, _reject: n};
e._reader._readRequests.push(r)
})
}
function B(e, t) {
return e._disturbed = !0, "closed" === e._state ? Promise.resolve(void 0) : "errored" === e._state ? Promise.reject(e._storedError) : (K(e), e._readableStreamController.__cancelSteps(t).then(function () {
}))
}
function K(e) {
b("readable" === e._state), e._state = "closed";
var t = e._reader;
if (void 0 !== t) {
if (!0 === $(t)) {
for (var n = 0; n < t._readRequests.length; n++) {
(0, t._readRequests[n]._resolve)(s(void 0, !0))
}
t._readRequests = []
}
!function (e) {
b(void 0 !== e._closedPromise_resolve), b(void 0 !== e._closedPromise_reject), e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}(t)
}
}
function j(e, t) {
b(!0 === R(e), "stream must be ReadableStream"), b("readable" === e._state, "state must be readable"), e._state = "errored", e._storedError = t;
var n = e._reader;
if (void 0 !== n) {
if (!0 === $(n)) {
for (var r = 0; r < n._readRequests.length; r++) {
n._readRequests[r]._reject(t)
}
n._readRequests = []
} else {
b(Q(n), "reader must be ReadableStreamBYOBReader");
for (var i = 0; i < n._readIntoRequests.length; i++) {
n._readIntoRequests[i]._reject(t)
}
n._readIntoRequests = []
}
Le(n, t), n._closedPromise.catch(function () {
})
}
}
function z(e, t, n) {
var r = e._reader;
b(r._readRequests.length > 0), r._readRequests.shift()._resolve(s(t, n))
}
function U(e) {
return e._reader._readIntoRequests.length
}
function q(e) {
return e._reader._readRequests.length
}
function H(e) {
var t = e._reader;
return void 0 !== t && !1 !== Q(t)
}
function Y(e) {
var t = e._reader;
return void 0 !== t && !1 !== $(t)
}
e.exports = {
ReadableStream: M,
IsReadableStreamDisturbed: function (e) {
return b(!0 === R(e), "IsReadableStreamDisturbed should only be used on known readable streams"), e._disturbed
},
ReadableStreamDefaultControllerClose: oe,
ReadableStreamDefaultControllerEnqueue: se,
ReadableStreamDefaultControllerError: le,
ReadableStreamDefaultControllerGetDesiredSize: ue
};
var X = function () {
function e(t) {
if (i(this, e), !1 === R(t)) throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");
if (!0 === W(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
Z(this, t), this._readRequests = []
}
return r(e, [{
key: "cancel", value: function (e) {
return !1 === $(this) ? Promise.reject(Ie("cancel")) : void 0 === this._ownerReadableStream ? Promise.reject(De("cancel")) : ee(this, e)
}
}, {
key: "read", value: function () {
return !1 === $(this) ? Promise.reject(Ie("read")) : void 0 === this._ownerReadableStream ? Promise.reject(De("read from")) : ne(this)
}
}, {
key: "releaseLock", value: function () {
if (!1 === $(this)) throw Ie("releaseLock");
if (void 0 !== this._ownerReadableStream) {
if (this._readRequests.length > 0) throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");
te(this)
}
}
}, {
key: "closed", get: function () {
return !1 === $(this) ? Promise.reject(Ie("closed")) : this._closedPromise
}
}]), e
}(), J = function () {
function e(t) {
if (i(this, e), !R(t)) throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");
if (!1 === pe(t._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");
if (W(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
Z(this, t), this._readIntoRequests = []
}
return r(e, [{
key: "cancel", value: function (e) {
return Q(this) ? void 0 === this._ownerReadableStream ? Promise.reject(De("cancel")) : ee(this, e) : Promise.reject(Oe("cancel"))
}
}, {
key: "read", value: function (e) {
return Q(this) ? void 0 === this._ownerReadableStream ? Promise.reject(De("read from")) : ArrayBuffer.isView(e) ? 0 === e.byteLength ? Promise.reject(new TypeError("view must have non-zero byteLength")) : function (e, t) {
var n = e._ownerReadableStream;
if (b(void 0 !== n), n._disturbed = !0, "errored" === n._state) return Promise.reject(n._storedError);
return function (e, t) {
var n = e._controlledReadableStream, r = 1;
t.constructor !== DataView && (r = t.constructor.BYTES_PER_ELEMENT);
var i = t.constructor, a = {
buffer: t.buffer,
byteOffset: t.byteOffset,
byteLength: t.byteLength,
bytesFilled: 0,
elementSize: r,
ctor: i,
readerType: "byob"
};
if (e._pendingPullIntos.length > 0) return a.buffer = d(a.buffer), e._pendingPullIntos.push(a), F(n);
if ("closed" === n._state) {
var o = new t.constructor(a.buffer, a.byteOffset, 0);
return Promise.resolve(s(o, !0))
}
if (e._queueTotalSize > 0) {
if (!0 === we(e, a)) {
var l = ye(a);
return _e(e), Promise.resolve(s(l, !1))
}
if (!0 === e._closeRequested) {
var c = new TypeError("Insufficient bytes to fill elements in the given buffer");
return Ae(e, c), Promise.reject(c)
}
}
a.buffer = d(a.buffer), e._pendingPullIntos.push(a);
var u = F(n);
return me(e), u
}(n._readableStreamController, t)
}(this, e) : Promise.reject(new TypeError("view must be an array buffer view")) : Promise.reject(Oe("read"))
}
}, {
key: "releaseLock", value: function () {
if (!Q(this)) throw Oe("releaseLock");
if (void 0 !== this._ownerReadableStream) {
if (this._readIntoRequests.length > 0) throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");
te(this)
}
}
}, {
key: "closed", get: function () {
return Q(this) ? this._closedPromise : Promise.reject(Oe("closed"))
}
}]), e
}();
function Q(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_readIntoRequests")
}
function $(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_readRequests")
}
function Z(e, t) {
e._ownerReadableStream = t, t._reader = e, "readable" === t._state ? function (e) {
e._closedPromise = new Promise(function (t, n) {
e._closedPromise_resolve = t, e._closedPromise_reject = n
})
}(e) : "closed" === t._state ? function (e) {
e._closedPromise = Promise.resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}(e) : (b("errored" === t._state, "state must be errored"), function (e, t) {
e._closedPromise = Promise.reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}(e, t._storedError), e._closedPromise.catch(function () {
}))
}
function ee(e, t) {
var n = e._ownerReadableStream;
return b(void 0 !== n), B(n, t)
}
function te(e) {
b(void 0 !== e._ownerReadableStream), b(e._ownerReadableStream._reader === e), "readable" === e._ownerReadableStream._state ? Le(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : function (e, t) {
b(void 0 === e._closedPromise_resolve), b(void 0 === e._closedPromise_reject), e._closedPromise = Promise.reject(t)
}(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), e._closedPromise.catch(function () {
}), e._ownerReadableStream._reader = void 0, e._ownerReadableStream = void 0
}
function ne(e) {
var t = e._ownerReadableStream;
return b(void 0 !== t), t._disturbed = !0, "closed" === t._state ? Promise.resolve(s(void 0, !0)) : "errored" === t._state ? Promise.reject(t._storedError) : (b("readable" === t._state), t._readableStreamController.__pullSteps())
}
var re = function () {
function e(t, n, r, a) {
if (i(this, e), !1 === R(t)) throw new TypeError("ReadableStreamDefaultController can only be constructed with a ReadableStream instance");
if (void 0 !== t._readableStreamController) throw new TypeError("ReadableStreamDefaultController instances can only be created by the ReadableStream constructor");
this._controlledReadableStream = t, this._underlyingSource = n, this._queue = void 0, this._queueTotalSize = void 0, x(this), this._started = !1, this._closeRequested = !1, this._pullAgain = !1, this._pulling = !1;
var o = h(r, a);
this._strategySize = o.size, this._strategyHWM = o.highWaterMark;
var s = this, l = c(n, "start", [this]);
Promise.resolve(l).then(function () {
s._started = !0, b(!1 === s._pulling), b(!1 === s._pullAgain), ae(s)
}, function (e) {
ce(s, e)
}).catch(w)
}
return r(e, [{
key: "close", value: function () {
if (!1 === ie(this)) throw Me("close");
if (!0 === this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
var e = this._controlledReadableStream._state;
if ("readable" !== e) throw new TypeError("The stream (in " + e + " state) is not in the readable state and cannot be closed");
oe(this)
}
}, {
key: "enqueue", value: function (e) {
if (!1 === ie(this)) throw Me("enqueue");
if (!0 === this._closeRequested) throw new TypeError("stream is closed or draining");
var t = this._controlledReadableStream._state;
if ("readable" !== t) throw new TypeError("The stream (in " + t + " state) is not in the readable state and cannot be enqueued to");
return se(this, e)
}
}, {
key: "error", value: function (e) {
if (!1 === ie(this)) throw Me("error");
var t = this._controlledReadableStream;
if ("readable" !== t._state) throw new TypeError("The stream is " + t._state + " and so cannot be errored");
le(this, e)
}
}, {
key: "__cancelSteps", value: function (e) {
return x(this), u(this._underlyingSource, "cancel", [e])
}
}, {
key: "__pullSteps", value: function () {
var e = this._controlledReadableStream;
if (this._queue.length > 0) {
var t = _(this);
return !0 === this._closeRequested && 0 === this._queue.length ? K(e) : ae(this), Promise.resolve(s(t, !1))
}
var n = G(e);
return ae(this), n
}
}, {
key: "desiredSize", get: function () {
if (!1 === ie(this)) throw Me("desiredSize");
return ue(this)
}
}]), e
}();
function ie(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_underlyingSource")
}
function ae(e) {
!1 !== function (e) {
var t = e._controlledReadableStream;
if ("closed" === t._state || "errored" === t._state) return !1;
if (!0 === e._closeRequested) return !1;
if (!1 === e._started) return !1;
if (!0 === W(t) && q(t) > 0) return !0;
if (ue(e) > 0) return !0;
return !1
}(e) && (!0 !== e._pulling ? (b(!1 === e._pullAgain), e._pulling = !0, u(e._underlyingSource, "pull", [e]).then(function () {
if (e._pulling = !1, !0 === e._pullAgain) return e._pullAgain = !1, ae(e)
}, function (t) {
ce(e, t)
}).catch(w)) : e._pullAgain = !0)
}
function oe(e) {
var t = e._controlledReadableStream;
b(!1 === e._closeRequested), b("readable" === t._state), e._closeRequested = !0, 0 === e._queue.length && K(t)
}
function se(e, t) {
var n = e._controlledReadableStream;
if (b(!1 === e._closeRequested), b("readable" === n._state), !0 === W(n) && q(n) > 0) z(n, t, !1); else {
var r = 1;
if (void 0 !== e._strategySize) {
var i = e._strategySize;
try {
r = i(t)
} catch (t) {
throw ce(e, t), t
}
}
try {
k(e, t, r)
} catch (t) {
throw ce(e, t), t
}
}
ae(e)
}
function le(e, t) {
var n = e._controlledReadableStream;
b("readable" === n._state), x(e), j(n, t)
}
function ce(e, t) {
"readable" === e._controlledReadableStream._state && le(e, t)
}
function ue(e) {
var t = e._controlledReadableStream._state;
return "errored" === t ? null : "closed" === t ? 0 : e._strategyHWM - e._queueTotalSize
}
var de = function () {
function e(t, n) {
i(this, e), this._associatedReadableByteStreamController = t, this._view = n
}
return r(e, [{
key: "respond", value: function (e) {
if (!1 === fe(this)) throw Ne("respond");
if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");
!function (e, t) {
if (t = Number(t), !1 === l(t)) throw new RangeError("bytesWritten must be a finite");
b(e._pendingPullIntos.length > 0), Pe(e, t)
}(this._associatedReadableByteStreamController, e)
}
}, {
key: "respondWithNewView", value: function (e) {
if (!1 === fe(this)) throw Ne("respond");
if (void 0 === this._associatedReadableByteStreamController) throw new TypeError("This BYOB request has been invalidated");
if (!ArrayBuffer.isView(e)) throw new TypeError("You can only respond with array buffer views");
!function (e, t) {
b(e._pendingPullIntos.length > 0);
var n = e._pendingPullIntos[0];
if (n.byteOffset + n.bytesFilled !== t.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");
if (n.byteLength !== t.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");
n.buffer = t.buffer, Pe(e, t.byteLength)
}(this._associatedReadableByteStreamController, e)
}
}, {
key: "view", get: function () {
return this._view
}
}]), e
}(), he = function () {
function e(t, n, r) {
if (i(this, e), !1 === R(t)) throw new TypeError("ReadableByteStreamController can only be constructed with a ReadableStream instance given a byte source");
if (void 0 !== t._readableStreamController) throw new TypeError("ReadableByteStreamController instances can only be created by the ReadableStream constructor given a byte source");
this._controlledReadableStream = t, this._underlyingByteSource = n, this._pullAgain = !1, this._pulling = !1, ve(this), this._queue = this._queueTotalSize = void 0, x(this), this._closeRequested = !1, this._started = !1, this._strategyHWM = p(r);
var a = n.autoAllocateChunkSize;
if (void 0 !== a && (!1 === Number.isInteger(a) || a <= 0)) throw new RangeError("autoAllocateChunkSize must be a positive integer");
this._autoAllocateChunkSize = a, this._pendingPullIntos = [];
var o = this, s = c(n, "start", [this]);
Promise.resolve(s).then(function () {
o._started = !0, b(!1 === o._pulling), b(!1 === o._pullAgain), me(o)
}, function (e) {
"readable" === t._state && Ae(o, e)
}).catch(w)
}
return r(e, [{
key: "close", value: function () {
if (!1 === pe(this)) throw Re("close");
if (!0 === this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
var e = this._controlledReadableStream._state;
if ("readable" !== e) throw new TypeError("The stream (in " + e + " state) is not in the readable state and cannot be closed");
!function (e) {
var t = e._controlledReadableStream;
if (b(!1 === e._closeRequested), b("readable" === t._state), e._queueTotalSize > 0) return void (e._closeRequested = !0);
if (e._pendingPullIntos.length > 0) {
var n = e._pendingPullIntos[0];
if (n.bytesFilled > 0) {
var r = new TypeError("Insufficient bytes to fill elements in the given buffer");
throw Ae(e, r), r
}
}
K(t)
}(this)
}
}, {
key: "enqueue", value: function (e) {
if (!1 === pe(this)) throw Re("enqueue");
if (!0 === this._closeRequested) throw new TypeError("stream is closed or draining");
var t = this._controlledReadableStream._state;
if ("readable" !== t) throw new TypeError("The stream (in " + t + " state) is not in the readable state and cannot be enqueued to");
if (!ArrayBuffer.isView(e)) throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");
!function (e, t) {
var n = e._controlledReadableStream;
b(!1 === e._closeRequested), b("readable" === n._state);
var r = t.buffer, i = t.byteOffset, a = t.byteLength, o = d(r);
if (!0 === Y(n)) if (0 === q(n)) be(e, o, i, a); else {
b(0 === e._queue.length);
var s = new Uint8Array(o, i, a);
z(n, s, !1)
} else !0 === H(n) ? (be(e, o, i, a), xe(e)) : (b(!1 === W(n), "stream must not be locked"), be(e, o, i, a))
}(this, e)
}
}, {
key: "error", value: function (e) {
if (!1 === pe(this)) throw Re("error");
var t = this._controlledReadableStream;
if ("readable" !== t._state) throw new TypeError("The stream is " + t._state + " and so cannot be errored");
Ae(this, e)
}
}, {
key: "__cancelSteps", value: function (e) {
this._pendingPullIntos.length > 0 && (this._pendingPullIntos[0].bytesFilled = 0);
return x(this), u(this._underlyingByteSource, "cancel", [e])
}
}, {
key: "__pullSteps", value: function () {
var e = this._controlledReadableStream;
if (b(!0 === Y(e)), this._queueTotalSize > 0) {
b(0 === q(e));
var t = this._queue.shift();
this._queueTotalSize -= t.byteLength, _e(this);
var n = void 0;
try {
n = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)
} catch (e) {
return Promise.reject(e)
}
return Promise.resolve(s(n, !1))
}
var r = this._autoAllocateChunkSize;
if (void 0 !== r) {
var i = void 0;
try {
i = new ArrayBuffer(r)
} catch (e) {
return Promise.reject(e)
}
var a = {
buffer: i,
byteOffset: 0,
byteLength: r,
bytesFilled: 0,
elementSize: 1,
ctor: Uint8Array,
readerType: "default"
};
this._pendingPullIntos.push(a)
}
var o = G(e);
return me(this), o
}
}, {
key: "byobRequest", get: function () {
if (!1 === pe(this)) throw Re("byobRequest");
if (void 0 === this._byobRequest && this._pendingPullIntos.length > 0) {
var e = this._pendingPullIntos[0],
t = new Uint8Array(e.buffer, e.byteOffset + e.bytesFilled, e.byteLength - e.bytesFilled);
this._byobRequest = new de(this, t)
}
return this._byobRequest
}
}, {
key: "desiredSize", get: function () {
if (!1 === pe(this)) throw Re("desiredSize");
return Te(this)
}
}]), e
}();
function pe(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_underlyingByteSource")
}
function fe(e) {
return !!g(e) && !!Object.prototype.hasOwnProperty.call(e, "_associatedReadableByteStreamController")
}
function me(e) {
!1 !== function (e) {
var t = e._controlledReadableStream;
if ("readable" !== t._state) return !1;
if (!0 === e._closeRequested) return !1;
if (!1 === e._started) return !1;
if (!0 === Y(t) && q(t) > 0) return !0;
if (!0 === H(t) && U(t) > 0) return !0;
if (Te(e) > 0) return !0;
return !1
}(e) && (!0 !== e._pulling ? (b(!1 === e._pullAgain), e._pulling = !0, u(e._underlyingByteSource, "pull", [e]).then(function () {
e._pulling = !1, !0 === e._pullAgain && (e._pullAgain = !1, me(e))
}, function (t) {
"readable" === e._controlledReadableStream._state && Ae(e, t)
}).catch(w)) : e._pullAgain = !0)
}
function ve(e) {
ke(e), e._pendingPullIntos = []
}
function ge(e, t) {
b("errored" !== e._state, "state must not be errored");
var n = !1;
"closed" === e._state && (b(0 === t.bytesFilled), n = !0);
var r = ye(t);
"default" === t.readerType ? z(e, r, n) : (b("byob" === t.readerType), function (e, t, n) {
var r = e._reader;
b(r._readIntoRequests.length > 0), r._readIntoRequests.shift()._resolve(s(t, n))
}(e, r, n))
}
function ye(e) {
var t = e.bytesFilled, n = e.elementSize;
return b(t <= e.byteLength), b(t % n == 0), new e.ctor(e.buffer, e.byteOffset, t / n)
}
function be(e, t, n, r) {
e._queue.push({buffer: t, byteOffset: n, byteLength: r}), e._queueTotalSize += r
}
function we(e, t) {
var n = t.elementSize, r = t.bytesFilled - t.bytesFilled % n,
i = Math.min(e._queueTotalSize, t.byteLength - t.bytesFilled), a = t.bytesFilled + i, s = a - a % n, l = i,
c = !1;
s > r && (l = s - t.bytesFilled, c = !0);
for (var u = e._queue; l > 0;) {
var d = u[0], h = Math.min(l, d.byteLength), p = t.byteOffset + t.bytesFilled;
o(t.buffer, p, d.buffer, d.byteOffset, h), d.byteLength === h ? u.shift() : (d.byteOffset += h, d.byteLength -= h), e._queueTotalSize -= h, Se(e, h, t), l -= h
}
return !1 === c && (b(0 === e._queueTotalSize, "queue must be empty"), b(t.bytesFilled > 0), b(t.bytesFilled < t.elementSize)), c
}
function Se(e, t, n) {
b(0 === e._pendingPullIntos.length || e._pendingPullIntos[0] === n), ke(e), n.bytesFilled += t
}
function _e(e) {
b("readable" === e._controlledReadableStream._state), 0 === e._queueTotalSize && !0 === e._closeRequested ? K(e._controlledReadableStream) : me(e)
}
function ke(e) {
void 0 !== e._byobRequest && (e._byobRequest._associatedReadableByteStreamController = void 0, e._byobRequest._view = void 0, e._byobRequest = void 0)
}
function xe(e) {
for (b(!1 === e._closeRequested); e._pendingPullIntos.length > 0;) {
if (0 === e._queueTotalSize) return;
var t = e._pendingPullIntos[0];
!0 === we(e, t) && (Ce(e), ge(e._controlledReadableStream, t))
}
}
function Pe(e, t) {
var n = e._pendingPullIntos[0], r = e._controlledReadableStream;
if ("closed" === r._state) {
if (0 !== t) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");
!function (e, t) {
t.buffer = d(t.buffer), b(0 === t.bytesFilled, "bytesFilled must be 0");
var n = e._controlledReadableStream;
if (!0 === H(n)) for (; U(n) > 0;) ge(n, Ce(e))
}(e, n)
} else b("readable" === r._state), function (e, t, n) {
if (n.bytesFilled + t > n.byteLength) throw new RangeError("bytesWritten out of range");
if (Se(e, t, n), !(n.bytesFilled < n.elementSize)) {
Ce(e);
var r = n.bytesFilled % n.elementSize;
if (r > 0) {
var i = n.byteOffset + n.bytesFilled, a = n.buffer.slice(i - r, i);
be(e, a, 0, a.byteLength)
}
n.buffer = d(n.buffer), n.bytesFilled -= r, ge(e._controlledReadableStream, n), xe(e)
}
}(e, t, n)
}
function Ce(e) {
var t = e._pendingPullIntos.shift();
return ke(e), t
}
function Ae(e, t) {
var n = e._controlledReadableStream;
b("readable" === n._state), ve(e), x(e), j(n, t)
}
function Te(e) {
var t = e._controlledReadableStream._state;
return "errored" === t ? null : "closed" === t ? 0 : e._strategyHWM - e._queueTotalSize
}
function Ee(e) {
return new TypeError("ReadableStream.prototype." + e + " can only be used on a ReadableStream")
}
function De(e) {
return new TypeError("Cannot " + e + " a stream using a released reader")
}
function Ie(e) {
return new TypeError("ReadableStreamDefaultReader.prototype." + e + " can only be used on a ReadableStreamDefaultReader")
}
function Le(e, t) {
b(void 0 !== e._closedPromise_resolve), b(void 0 !== e._closedPromise_reject), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0
}
function Oe(e) {
return new TypeError("ReadableStreamBYOBReader.prototype." + e + " can only be used on a ReadableStreamBYOBReader")
}
function Me(e) {
return new TypeError("ReadableStreamDefaultController.prototype." + e + " can only be used on a ReadableStreamDefaultController")
}
function Ne(e) {
return new TypeError("ReadableStreamBYOBRequest.prototype." + e + " can only be used on a ReadableStreamBYOBRequest")
}
function Re(e) {
return new TypeError("ReadableByteStreamController.prototype." + e + " can only be used on a ReadableByteStreamController")
}
}, function (e, t, n) {
var r = n(6), i = n(4), a = n(2);
t.TransformStream = r.TransformStream, t.ReadableStream = i.ReadableStream, t.IsReadableStreamDisturbed = i.IsReadableStreamDisturbed, t.ReadableStreamDefaultControllerClose = i.ReadableStreamDefaultControllerClose, t.ReadableStreamDefaultControllerEnqueue = i.ReadableStreamDefaultControllerEnqueue, t.ReadableStreamDefaultControllerError = i.ReadableStreamDefaultControllerError, t.ReadableStreamDefaultControllerGetDesiredSize = i.ReadableStreamDefaultControllerGetDesiredSize, t.AcquireWritableStreamDefaultWriter = a.AcquireWritableStreamDefaultWriter, t.IsWritableStream = a.IsWritableStream, t.IsWritableStreamLocked = a.IsWritableStreamLocked, t.WritableStream = a.WritableStream, t.WritableStreamAbort = a.WritableStreamAbort, t.WritableStreamDefaultControllerError = a.WritableStreamDefaultControllerError, t.WritableStreamDefaultWriterCloseWithErrorPropagation = a.WritableStreamDefaultWriterCloseWithErrorPropagation, t.WritableStreamDefaultWriterRelease = a.WritableStreamDefaultWriterRelease, t.WritableStreamDefaultWriterWrite = a.WritableStreamDefaultWriterWrite
}, function (e, t, n) {
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
function i(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var a = n(1).assert, o = n(0), s = o.InvokeOrNoop, l = o.PromiseInvokeOrPerformFallback, c = o.PromiseInvokeOrNoop,
u = o.typeIsObject, d = n(4), h = d.ReadableStream, p = d.ReadableStreamDefaultControllerClose,
f = d.ReadableStreamDefaultControllerEnqueue, m = d.ReadableStreamDefaultControllerError,
v = d.ReadableStreamDefaultControllerGetDesiredSize, g = n(2), y = g.WritableStream,
b = g.WritableStreamDefaultControllerError;
function w(e, t) {
if (!0 === e._errored) throw new TypeError("TransformStream is already errored");
if (!0 === e._readableClosed) throw new TypeError("Readable side is already closed");
var n = e._readableController;
try {
f(n, t)
} catch (t) {
throw e._readableClosed = !0, _(e, t), e._storedError
}
!0 === v(n) <= 0 && !1 === e._backpressure && P(e, !0)
}
function S(e) {
a(!1 === e._errored), a(!1 === e._readableClosed);
try {
p(e._readableController)
} catch (e) {
a(!1)
}
e._readableClosed = !0
}
function _(e, t) {
!1 === e._errored && k(e, t)
}
function k(e, t) {
a(!1 === e._errored), e._errored = !0, e._storedError = t, !1 === e._writableDone && b(e._writableController, t), !1 === e._readableClosed && m(e._readableController, t)
}
function x(e) {
return a(void 0 !== e._backpressureChangePromise, "_backpressureChangePromise should have been initialized"), !1 === e._backpressure ? Promise.resolve() : (a(!0 === e._backpressure, "_backpressure should have been initialized"), e._backpressureChangePromise)
}
function P(e, t) {
a(e._backpressure !== t, "TransformStreamSetBackpressure() should be called only when backpressure is changed"), void 0 !== e._backpressureChangePromise && e._backpressureChangePromise_resolve(t), e._backpressureChangePromise = new Promise(function (t) {
e._backpressureChangePromise_resolve = t
}), e._backpressureChangePromise.then(function (e) {
a(e !== t, "_backpressureChangePromise should be fulfilled only when backpressure is changed")
}), e._backpressure = t
}
function C(e, t) {
return w(t._controlledTransformStream, e), Promise.resolve()
}
function A(e) {
return !!u(e) && !!Object.prototype.hasOwnProperty.call(e, "_controlledTransformStream")
}
function T(e) {
return !!u(e) && !!Object.prototype.hasOwnProperty.call(e, "_transformStreamController")
}
var E = function () {
function e(t, n) {
i(this, e), this._transformStream = t, this._startPromise = n
}
return r(e, [{
key: "start", value: function (e) {
var t = this._transformStream;
return t._writableController = e, this._startPromise.then(function () {
return x(t)
})
}
}, {
key: "write", value: function (e) {
return function (e, t) {
a(!1 === e._errored), a(!1 === e._transforming), a(!1 === e._backpressure), e._transforming = !0;
var n = e._transformer, r = e._transformStreamController;
return l(n, "transform", [t, r], C, [t, r]).then(function () {
return e._transforming = !1, x(e)
}, function (t) {
return _(e, t), Promise.reject(t)
})
}(this._transformStream, e)
}
}, {
key: "abort", value: function () {
var e = this._transformStream;
e._writableDone = !0, k(e, new TypeError("Writable side aborted"))
}
}, {
key: "close", value: function () {
var e = this._transformStream;
return a(!1 === e._transforming), e._writableDone = !0, c(e._transformer, "flush", [e._transformStreamController]).then(function () {
return !0 === e._errored ? Promise.reject(e._storedError) : (!1 === e._readableClosed && S(e), Promise.resolve())
}).catch(function (t) {
return _(e, t), Promise.reject(e._storedError)
})
}
}]), e
}(), D = function () {
function e(t, n) {
i(this, e), this._transformStream = t, this._startPromise = n
}
return r(e, [{
key: "start", value: function (e) {
var t = this._transformStream;
return t._readableController = e, this._startPromise.then(function () {
return a(void 0 !== t._backpressureChangePromise, "_backpressureChangePromise should have been initialized"), !0 === t._backpressure ? Promise.resolve() : (a(!1 === t._backpressure, "_backpressure should have been initialized"), t._backpressureChangePromise)
})
}
}, {
key: "pull", value: function () {
var e = this._transformStream;
return a(!0 === e._backpressure, "pull() should be never called while _backpressure is false"), a(void 0 !== e._backpressureChangePromise, "_backpressureChangePromise should have been initialized"), P(e, !1), e._backpressureChangePromise
}
}, {
key: "cancel", value: function () {
var e = this._transformStream;
e._readableClosed = !0, k(e, new TypeError("Readable side canceled"))
}
}]), e
}(), I = function () {
function e(t) {
if (i(this, e), !1 === T(t)) throw new TypeError("TransformStreamDefaultController can only be constructed with a TransformStream instance");
if (void 0 !== t._transformStreamController) throw new TypeError("TransformStreamDefaultController instances can only be created by the TransformStream constructor");
this._controlledTransformStream = t
}
return r(e, [{
key: "enqueue", value: function (e) {
if (!1 === A(this)) throw O("enqueue");
w(this._controlledTransformStream, e)
}
}, {
key: "close", value: function () {
if (!1 === A(this)) throw O("close");
!function (e) {
if (!0 === e._errored) throw new TypeError("TransformStream is already errored");
if (!0 === e._readableClosed) throw new TypeError("Readable side is already closed");
S(e)
}(this._controlledTransformStream)
}
}, {
key: "error", value: function (e) {
if (!1 === A(this)) throw O("error");
!function (e, t) {
if (!0 === e._errored) throw new TypeError("TransformStream is already errored");
k(e, t)
}(this._controlledTransformStream, e)
}
}, {
key: "desiredSize", get: function () {
if (!1 === A(this)) throw O("desiredSize");
var e = this._controlledTransformStream._readableController;
return v(e)
}
}]), e
}(), L = function () {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
i(this, e), this._transformer = t;
var n = t.readableStrategy, r = t.writableStrategy;
this._transforming = !1, this._errored = !1, this._storedError = void 0, this._writableController = void 0, this._readableController = void 0, this._transformStreamController = void 0, this._writableDone = !1, this._readableClosed = !1, this._backpressure = void 0, this._backpressureChangePromise = void 0, this._backpressureChangePromise_resolve = void 0, this._transformStreamController = new I(this);
var o = void 0, l = new Promise(function (e) {
o = e
}), c = new D(this, l);
this._readable = new h(c, n);
var u = new E(this, l);
this._writable = new y(u, r), a(void 0 !== this._writableController), a(void 0 !== this._readableController), P(this, v(this._readableController) <= 0);
var d = this, p = s(t, "start", [d._transformStreamController]);
o(p), l.catch(function (e) {
!1 === d._errored && (d._errored = !0, d._storedError = e)
})
}
return r(e, [{
key: "readable", get: function () {
if (!1 === T(this)) throw M("readable");
return this._readable
}
}, {
key: "writable", get: function () {
if (!1 === T(this)) throw M("writable");
return this._writable
}
}]), e
}();
function O(e) {
return new TypeError("TransformStreamDefaultController.prototype." + e + " can only be used on a TransformStreamDefaultController")
}
function M(e) {
return new TypeError("TransformStream.prototype." + e + " can only be used on a TransformStream")
}
e.exports = {TransformStream: L}
}, function (e, t, n) {
e.exports = n(5)
}]))
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function (e) {
return e.defineLocale("zh-cn", {
months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
weekdaysMin: "日_一_二_三_四_五_六".split("_"),
longDateFormat: {
LT: "HH:mm",
LTS: "HH:mm:ss",
L: "YYYY/MM/DD",
LL: "YYYY年M月D日",
LLL: "YYYY年M月D日Ah点mm分",
LLLL: "YYYY年M月D日ddddAh点mm分",
l: "YYYY/M/D",
ll: "YYYY年M月D日",
lll: "YYYY年M月D日 HH:mm",
llll: "YYYY年M月D日dddd HH:mm"
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour: function (e, t) {
return 12 === e && (e = 0), "凌晨" === t || "早上" === t || "上午" === t ? e : "下午" === t || "晚上" === t ? e + 12 : e >= 11 ? e : e + 12
},
meridiem: function (e, t, n) {
var r = 100 * e + t;
return r < 600 ? "凌晨" : r < 900 ? "早上" : r < 1130 ? "上午" : r < 1230 ? "中午" : r < 1800 ? "下午" : "晚上"
},
calendar: {
sameDay: "[今天]LT",
nextDay: "[明天]LT",
nextWeek: "[下]ddddLT",
lastDay: "[昨天]LT",
lastWeek: "[上]ddddLT",
sameElse: "L"
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
ordinal: function (e, t) {
switch (t) {
case"d":
case"D":
case"DDD":
return e + "日";
case"M":
return e + "月";
case"w":
case"W":
return e + "周";
default:
return e
}
},
relativeTime: {
future: "%s内",
past: "%s前",
s: "几秒",
ss: "%d 秒",
m: "1 分钟",
mm: "%d 分钟",
h: "1 小时",
hh: "%d 小时",
d: "1 天",
dd: "%d 天",
M: "1 个月",
MM: "%d 个月",
y: "1 年",
yy: "%d 年"
},
week: {dow: 1, doy: 4}
})
}, "object" === s(t) && void 0 !== e ? o(n(56)) : (i = [n(56)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_AdditionText = void 0;
var r, i = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), a = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), o = n(56), s = (r = o) && r.__esModule ? r : {default: r}, l = n(2);
t.KG_AdditionText = function () {
function e(t, n, r) {
var i = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.init = this.init.bind(this), this.open = this.open.bind(this), this.onClose = this.onClose.bind(this), this.onOk = this.onOk.bind(this), this.clearCanvas = this.clearCanvas.bind(this), this.createDOM = this.createDOM.bind(this), this.drawText = this.drawText.bind(this), this.onPresetTextSelect = this.onPresetTextSelect.bind(this), this.onTextInputChange = this.onTextInputChange.bind(this), this.onTextSizeChange = this.onTextSizeChange.bind(this), this.onTextColorChange = this.onTextColorChange.bind(this), this.onTextColorInput = this.onTextColorInput.bind(this), this.onTextPositionSelect = this.onTextPositionSelect.bind(this), this.onTimePositionSelect = this.onTimePositionSelect.bind(this), this.onAdditionTimeSelect = this.onAdditionTimeSelect.bind(this), this.onTextFontChange = this.onTextFontChange.bind(this), this.onTimeSizeInput = this.onTimeSizeInput.bind(this), this.openMobileDialog = this.openMobileDialog.bind(this), this.onPercentInputY = this.onPercentInputY.bind(this), this.userAction = "KG_UserAction", this.additionTextConfig = {}, this.additionTextDefaultConfig = {}, null != window.KGPdfViewerWebApp.additionTextConfig && (this.additionTextConfig = window.KGPdfViewerWebApp.additionTextConfig), null != window.KGPdfViewerWebApp.additionTextDefaultConfig && (this.additionTextDefaultConfig = window.KGPdfViewerWebApp.additionTextDefaultConfig);
var a = function (e, t) {
for (var n in t) !0 === t.hasOwnProperty(n) && (e[n] = t[n]);
return e
}(this.additionTextDefaultConfig, this.additionTextConfig);
this.additionTextConfig = window.KGPdfViewerWebApp.additionTextConfig = a, this.maxLength = this.additionTextConfig.maxLength || 200, this.app = t, this.container = n.container, this.overlayName = n.overlayName, this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.onClose, !0), this.imgExt = "png", this.imgData = "", this.xRadio = 1, this.yRadio = 1, this.isMobile = (0, l.isMobile)() && !!window.KGPdfViewerWebApp.mobile, this.loactionMode = this.additionTextConfig.loaction, this.mobileDlgisOpen = !1, this.dragSealIsDown = !1, this.timeTextIsDown = !1, this.additionTextIsDown = !1, this.dragSealPointXY = [0, 0], this.timeTextPointXY = [0, 0], this.additionTextPointXY = [0, 0], this.previewCanvas = null, this.presetTextSelect = null, this.textInput = null, this.textSizeInput = null, this.textColorInput = null, this.textPositionSelect = null, this.timePositionSelect = null, this.additionTimeSelect = null, this.timeFontSelect = null, this.timeSizeInput = null, this.okBtn = null, this.cancelBtn = null, this.closeBtn = null, this.createDOM(), this.init();
var o = ("undefined" != typeof navigator && navigator.userAgent || "").indexOf("Trident") >= 0;
this.presetTextSelect.addEventListener("change", this.onPresetTextSelect), o && this.textInput.addEventListener("keyup", function (e) {
"8" === e.keyCode.toString() && i.onTextInputChange()
}), this.textInput.addEventListener("propertychange", this.onTextInputChange), this.textInput.addEventListener("input", this.onTextInputChange), this.textSizeInput.addEventListener("change", this.onTextSizeChange), this.textSizeInput.addEventListener("input", this.onTextSizeChange), this.textColorInput.addEventListener("change", this.onTextColorChange), this.textColorInput.addEventListener("input", this.onTextColorInput), this.textPositionSelect.addEventListener("change", this.onTextPositionSelect), this.timeFontSelect.addEventListener("change", this.onTextFontChange), this.timePositionSelect.addEventListener("change", this.onTimePositionSelect), this.additionTimeSelect.addEventListener("change", this.onAdditionTimeSelect), this.timeSizeInput.addEventListener("change", this.onTimeSizeInput), this.timeSizeInput.addEventListener("input", this.onTimeSizeInput), this.okBtn.addEventListener("click", this.onOk), this.cancelBtn.addEventListener("click", this.onClose), this.closeBtn.addEventListener("click", this.onClose), this.mobilePreview.addEventListener("click", this.openMobileDialog), this.percentInputY.addEventListener("click", this.onPercentInputY), this.percentInputY.addEventListener("change", this.onPercentInputY)
}
return a(e, [{
key: "createDOM", value: function () {
var e = this, t = [{label: "上", value: "top"}, {label: "下", value: "bottom"}, {
label: "左上",
value: "left_top"
}, {label: "左中", value: "left_center"}, {label: "左下", value: "left_bottom"}, {
label: "右上",
value: "right_top"
}, {label: "右中", value: "right_center"}, {label: "右下", value: "right_bottom"}, {label: "章内", value: "inside"}],
n = [{label: "上", value: "top"}, {label: "下", value: "bottom"}, {
label: "左上",
value: "left_top"
}, {label: "左中", value: "left_center"}, {label: "左下", value: "left_bottom"}, {
label: "右上",
value: "right_top"
}, {label: "右中", value: "right_center"}, {label: "右下", value: "right_bottom"}],
r = [{label: "宋体", value: "宋体"}, {label: "仿宋", value: "仿宋"}, {label: "黑体", value: "黑体"}, {
label: "楷体",
value: "楷体"
}], i = [{label: "固定定位", value: "固定定位", _value: "fixed"}, {label: "拖拽定位", value: "拖拽定位", _value: "drag"}],
a = document.createElement("div");
a.classList.add("kg_dialog_header"), this.container.appendChild(a);
var o = document.createElement("div");
o.classList.add("kg_dialog_title"), o.setAttribute("data-l10n-id", "additionText_title"), a.appendChild(o), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", a.appendChild(this.closeBtn);
var c = document.createElement("div");
c.classList.add("dialog"), this.container.appendChild(c), this.main_mobile = document.createElement("div"), this.main_mobile.classList.add("KG_Clearfix"), this.main_mobile.style.display = "none", c.appendChild(this.main_mobile);
var u = document.createElement("div");
u.classList.add("KG_Clearfix"), c.appendChild(u);
var d = document.createElement("div");
d.classList.add("KG_AdditionText_ConfigContainer"), this.configContainer = d, u.appendChild(d);
var h = document.createElement("fieldset");
h.classList.add("KG_Form_Fieldset"), d.appendChild(h);
var p = document.createElement("legend");
p.setAttribute("data-l10n-id", "additionText_additionTime"), p.classList.add("KG_Form_Legend"), h.appendChild(p);
var f = document.createElement("div");
f.classList.add("KG_Form_Item"), h.appendChild(f);
var m = document.createElement("label");
m.setAttribute("data-l10n-id", "additionText_timeFormat"), m.classList.add("KG_Form_Label"), f.appendChild(m), this.additionTimeSelect = document.createElement("select"), this.additionTimeSelect.classList.add("kgInput"), f.appendChild(this.additionTimeSelect);
var v = (0, s.default)(), g = [{
label: v.format("YYYY-MM-DD HH:mm:ss"),
value: v.format("YYYY-MM-DD HH:mm:ss"),
format: "YYYY-MM-DD HH:mm:ss"
}, {label: v.format("YYYY-MM-DD"), value: v.format("YYYY-MM-DD"), format: "YYYY-MM-DD"}];
"en-US" === this.app.l10n._lang ? (g.splice(0, 0, {label: "", value: ""}), g.push({
label: v.format("LL"),
value: v.format("LL"),
format: "LL"
}), g.push({label: v.format("LLL"), value: v.format("LLL"), format: "LLL"})) : (g.splice(0, 0, {
label: "无",
value: ""
}), g.push({
label: v.format("YYYY年MM月DD日"),
value: v.format("YYYY年MM月DD日"),
format: "YYYY年MM月DD日"
}), g.push({
label: v.format("YYYY年MM月DD日 HH:mm:ss"),
value: v.format("YYYY年MM月DD日 HH:mm:ss"),
format: "YYYY年MM月DD日 HH:mm:ss"
}));
for (var y = 0; y < g.length; y++) {
var b = document.createElement("option");
b.innerHTML = g[y].label, b.value = g[y].value, b.setAttribute("format", g[y].format), this.additionTextConfig.timeFormat == g[y].format && (this.additionTextConfig.timeFormat = g[y].value), this.additionTimeSelect.appendChild(b)
}
var w = document.createElement("div");
w.classList.add("KG_Form_Item"), h.appendChild(w);
var S = document.createElement("label");
S.setAttribute("data-l10n-id", "additionText_timeFontSize"), S.classList.add("KG_Form_Label"), w.appendChild(S), this.timeSizeInput = document.createElement("input"), this.timeSizeInput.classList.add("kgInput"), this.timeSizeInput.type = "number", w.appendChild(this.timeSizeInput);
var _ = document.createElement("div");
_.classList.add("KG_Form_Item"), h.appendChild(_);
var k = document.createElement("label");
k.setAttribute("data-l10n-id", "additionText_timePosition"), k.classList.add("KG_Form_Label"), _.appendChild(k), this.timePositionSelect = document.createElement("select"), this.timePositionSelect.classList.add("kgInput"), _.appendChild(this.timePositionSelect);
for (var x = 0; x < t.length; x++) {
var P = document.createElement("option");
P.setAttribute("data-l10n-id", "additionText_" + t[x].value), P.value = t[x].value, this.timePositionSelect.appendChild(P)
}
this.percentInputContainer = document.createElement("span"), this.percentInputY = document.createElement("input"), this.percentInputY.type = "number", this.percentInputY.min = "1", this.percentInputY.max = "100", this.percentInputY.classList.add("kgInput"), this.percentInputY.classList.add("precentInput"), this.percentInputContainer.appendChild(this.percentInputY);
var C = document.createElement("span");
C.style["vertical-align"] = "middle", C.innerHTML = "%", this.percentInputContainer.style.display = "none", this.percentInputContainer.appendChild(C), _.appendChild(this.percentInputContainer);
var A = document.createElement("div");
A.classList.add("KG_Form_Item"), h.appendChild(A);
var T = document.createElement("label");
T.setAttribute("data-l10n-id", "additionText_timeFont"), T.classList.add("KG_Form_Label"), A.appendChild(T), this.timeFontSelect = document.createElement("select"), this.timeFontSelect.classList.add("kgInput"), A.appendChild(this.timeFontSelect);
for (var E = 0; E < r.length; E++) {
var D = document.createElement("option");
D.value = r[E].value, D.label = r[E].label, D.innerHTML = r[E].value, this.timeFontSelect.appendChild(D)
}
var I = document.createElement("div");
I.classList.add("KG_Form_Item"), h.appendChild(I);
var L = document.createElement("label");
L.setAttribute("data-l10n-id", "additionText_locationMode"), L.classList.add("KG_Form_Label"), L.style["margin-top"] = "-3px", I.appendChild(L), this.timeLocationSelect = document.createElement("div"), this.timeLocationSelect.style.display = "inline-block", I.appendChild(this.timeLocationSelect);
for (var O = function (t) {
var n = document.createElement("div"), r = document.createElement("input"),
a = document.createElement("label"), o = i[t]._value, s = "kg-additionText-item-id-" + o;
n.classList.add("kg-additionText-raido-item"), n.classList.add("kg_raido_wrapper"), n.setAttribute("data-kg-id", s), r.setAttribute("name", "kg-additionText-options"), r.classList.add("kg-additionText-options"), r.setAttribute("data-kg-id", s), r.type = "radio", r.value = i[t]._value, r.setAttribute("id", s), a.innerHTML = i[t].value, a.setAttribute("for", s), a.setAttribute("data-kg-id", s), a.classList.add("kg-additionText-label"), e.additionTextConfig.loaction == o && r.setAttribute("checked", "checked");
var l = e;
n.addEventListener("click", function (e) {
"DIV" != e.target.tagName && (r.id == this.getAttribute("data-kg-id") ? this.classList.add("kg_radio_wrapper-checked") : this.classList.remove("kg_radio_wrapper-checked"), l.onLocationSelect(o))
}), n.appendChild(r), n.appendChild(a), e.timeLocationSelect.appendChild(n)
}, M = 0; M < i.length; M++) O(M);
this.mobilePreview = document.createElement("span"), this.mobilePreview.classList.add("kg-additionText-mobilePreview"), this.mobilePreview.innerHTML = "预览", this.isMobile && this.timeLocationSelect.appendChild(this.mobilePreview);
var N = document.createElement("fieldset");
N.classList.add("KG_Form_Fieldset"), d.appendChild(N);
var R = document.createElement("legend");
R.setAttribute("data-l10n-id", "additionText_additionText"), R.classList.add("KG_Form_Legend"), N.appendChild(R);
var W = document.createElement("div");
W.classList.add("KG_Form_Item"), N.appendChild(W);
var V = document.createElement("label");
V.setAttribute("data-l10n-id", "additionText_presetText"), V.classList.add("KG_Form_Label"), W.appendChild(V), this.presetTextSelect = document.createElement("select"), this.presetTextSelect.classList.add("kgInput");
var F = document.createElement("option");
F.value = "", "en-US" === this.app.l10n._lang ? F.innerHTML = "" : F.innerHTML = "无", this.presetTextSelect.appendChild(F), W.appendChild(this.presetTextSelect);
var G = this.additionTextConfig.presetTexts;
if (G instanceof Array && G.length > 0) for (var B = 0; B < G.length; B++) {
var K = document.createElement("option");
K.value = G[B], K.innerHTML = G[B], this.presetTextSelect.appendChild(K)
}
var j = ["宋体", "仿宋", "黑体", "楷体"];
this._FontList = [];
for (var z = 0; z < j.length; z++) {
(0, l.IsFontExist)(j) ? this._FontList.push(j[z]) : this._FontList.push("Microsoft YaHei")
}
var U = document.createElement("div");
U.classList.add("KG_Form_Item"), N.appendChild(U);
var q = document.createElement("label");
q.setAttribute("data-l10n-id", "additionText_text"), q.classList.add("KG_Form_Label"), U.appendChild(q), this.textInput = document.createElement("textarea"), this.textInput.classList.add("kgInput"), U.appendChild(this.textInput);
var H = document.createElement("div");
H.classList.add("KG_Form_Item"), N.appendChild(H);
var Y = document.createElement("label");
Y.setAttribute("data-l10n-id", "additionText_textSize"), Y.classList.add("KG_Form_Label"), H.appendChild(Y), this.textSizeInput = document.createElement("input"), this.textSizeInput.classList.add("kgInput"), this.textSizeInput.type = "number", H.appendChild(this.textSizeInput);
var X = document.createElement("div");
X.classList.add("KG_Form_Item"), N.appendChild(X);
var J = document.createElement("label");
J.setAttribute("data-l10n-id", "additionText_textColor"), J.classList.add("KG_Form_Label"), X.appendChild(J), this.textColorInput = document.createElement("input"), this.textColorInput.classList.add("kgInput"), this.textColorInput.classList.add("jscolor"), this.textColorInput.jscolor = new jscolor(this.textColorInput), X.appendChild(this.textColorInput);
var Q = document.createElement("div");
Q.classList.add("KG_Form_Item"), N.appendChild(Q);
var $ = document.createElement("label");
$.setAttribute("data-l10n-id", "additionText_textPosition"), $.classList.add("KG_Form_Label"), Q.appendChild($), this.textPositionSelect = document.createElement("select"), this.textPositionSelect.classList.add("kgInput"), Q.appendChild(this.textPositionSelect);
for (var Z = 0; Z < n.length; Z++) {
var ee = document.createElement("option");
ee.setAttribute("data-l10n-id", "additionText_" + n[Z].value), ee.value = n[Z].value, this.textPositionSelect.appendChild(ee)
}
var te = document.createElement("div");
te.classList.add("KG_AdditionText_PreviewContainer"), u.appendChild(te);
var ne = document.createElement("fieldset");
ne.classList.add("KG_Form_Fieldset"), te.appendChild(ne);
var re = document.createElement("legend");
re.setAttribute("data-l10n-id", "additionText_preveiw"), re.classList.add("KG_Form_Legend"), ne.appendChild(re), this.previewCanvas = document.createElement("canvas"), ne.appendChild(this.previewCanvas), this.previewCanvasDragWrapper = document.createElement("div"), this.previewCanvasDragWrapper.classList.add("kg-additionText-previewCanvasDragWarp"), this.previewCanvasDragWrapper.style.display = "none", !this.isMobile && ne.appendChild(this.previewCanvasDragWrapper), this.previewCanvasDragCanvas = document.createElement("canvas"), this.previewCanvasDragCanvas.classList.add("kg-additionText-previewCanvasDragCanvas"), this.previewCanvasDragCanvasCtx = this.previewCanvasDragCanvas.getContext("2d"), this.previewCanvasDragWrapper.appendChild(this.previewCanvasDragCanvas), this.dragSealDOM = document.createElement("div"), this.dragSealDOM.classList.add("kg-additionText-moveDom"), this.dragSealDOM_img = document.createElement("div"), this.dragSealDOM_img.classList.add("kg-additionText-dragSeal"), this.dragSealDOM.appendChild(this.dragSealDOM_img), this.previewCanvasDragWrapper.appendChild(this.dragSealDOM), this.timeTextDOM = document.createElement("div"), this.timeTextDOM.classList.add("kg-additionText-moveDom"), this.timeTextDOM_text = document.createElement("div"), this.timeTextDOM_text.classList.add("kg-additionText-text"), this.timeTextDOM.appendChild(this.timeTextDOM_text), this.previewCanvasDragWrapper.appendChild(this.timeTextDOM), this.additionTextDOM = document.createElement("div"), this.additionTextDOM.classList.add("kg-additionText-moveDom"), this.additionTextDOM_text = document.createElement("div"), this.additionTextDOM_text.classList.add("kg-additionText-text"), this.additionTextDOM.appendChild(this.additionTextDOM_text), this.previewCanvasDragWrapper.appendChild(this.additionTextDOM), this.mouseEventBindDOM(this.timeTextDOM, this.timeTextIsDown, "timeTextPointXY"), this.mouseEventBindDOM(this.additionTextDOM, this.additionTextIsDown, "additionTextPointXY"), this.mouseEventBindDOM(this.dragSealDOM, this.dragSealIsDown, "dragSealPointXY");
var ie = document.createElement("div");
if (ie.classList.add("KG_Form_Footer"), c.appendChild(ie), this.cancelBtn = document.createElement("button"), this.cancelBtn.setAttribute("data-l10n-id", "password_cancel"), this.cancelBtn.classList.add("btn"), ie.appendChild(this.cancelBtn), this.okBtn = document.createElement("button"), this.okBtn.setAttribute("data-l10n-id", "password_ok"), this.okBtn.classList.add("btn"), this.okBtn.classList.add("btn-primary"), this.okBtn.style.marginLeft = "15px", ie.appendChild(this.okBtn), this.isMobile) {
var ae = document.createElement("div");
ae.classList.add("KG_AdditionText_PreviewContainer_mobile"), this.main_mobile.appendChild(ae);
var oe = document.createElement("fieldset");
oe.classList.add("KG_Form_Fieldset", "KG_Form_Fieldse_mobile"), ae.appendChild(oe), oe.appendChild(re), oe.appendChild(this.previewCanvas), oe.appendChild(this.previewCanvasDragWrapper)
}
this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
var e = this.additionTextConfig.fontSize;
e && "number" == typeof e || (e = 24);
var t = this.additionTextConfig.timeFontSize, n = this.additionTextConfig.color,
r = this.additionTextConfig.timeFormat, i = this.additionTextConfig.textPosition,
a = this.additionTextConfig.timePosition, o = this.additionTextConfig.font,
s = this.additionTextConfig.defaultText, l = this.additionTextConfig.percentY;
n && "string" == typeof n ? (n = "#" === n[0] ? n.slice(1) : n, /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test("#" + n) || (n = "000")) : n = "000", r = this._getDefaultTimeFormat(r), this.textSizeInput.value = e, this.timeSizeInput.value = t, this.presetTextSelect.value = "", this.textInput.value = s, this.textColorInput.jscolor.fromString(n), this.textPositionSelect.value = i, this.additionTimeSelect.value = r, this.timePositionSelect.value = a, this.percentInputY.value = l, this.timeFontSelect.value = o, this.onLocationSelect(this.loactionMode), this.timeTextDOM_text.innerHTML = r, this.additionTextDOM_text.innerHTML = s, this.timeTextDOM_text.style.font = t + "px " + o, this.additionTextDOM_text.style.font = e + "px " + o, this.additionTextPointXY = [0, t], this.additionTextDOM.style.top = t + "px"
}
}, {
key: "_getDefaultTimeFormat", value: function (e) {
var t = this, n = function (e) {
for (var n = 0; n < t.additionTimeSelect.children.length; n++) if (t.additionTimeSelect.children[n].getAttribute("format") == e) return t.additionTimeSelect.children[n].value
};
switch (e) {
case"YYYY-MM-DD HH:mm:ss":
return n("YYYY-MM-DD HH:mm:ss");
case"YYYY-MM-DD":
return n("YYYY-MM-DD");
case"YYYY年MM月DD日":
return n("YYYY年MM月DD日");
case"YYYY年MM月DD日 HH:mm:ss":
return n("YYYY年MM月DD日 HH:mm:ss");
default:
return e
}
}
}, {
key: "getOffsetXY", value: function (e, t) {
for (var n = e, r = 0, i = 0; null !== n;) r += n.offsetTop, i += n.offsetLeft, n = n.offsetParent;
return {top: r = t.pageY - r, left: i = t.pageX - i}
}
}, {
key: "mouseEventBindDOM", value: function (e, t, n) {
var r = this, i = void 0, a = void 0, o = void 0, s = void 0, l = void 0, c = this.previewCanvasDragWrapper,
u = [this.additionTextDOM, this.timeTextDOM, this.dragSealDOM], d = function (n) {
if (u.map(function (e) {
e.style.pointerEvents = "none"
}), e.style.pointerEvents = "auto", r.isMobile) {
var i = r.getOffsetXY(e, n.touches[0]);
s = i.left, l = i.top
} else s = n.offsetX, l = n.offsetY;
t = !0
}, h = function (u) {
if (t) {
u.preventDefault();
var d = r.isMobile ? u.targetTouches[0] : u, h = d.clientX, p = d.clientY;
i = h - s, a = p - l, o = c.getBoundingClientRect(), i < o.left && (i = o.left), i >= o.right - e.offsetWidth && (i = o.right - e.offsetWidth), a < o.top && (a = o.top), a >= o.bottom - e.offsetHeight && (a = o.bottom - e.offsetHeight), i -= o.left, a -= o.top, e.style.left = i + "px", e.style.top = a + "px", e.classList.add("kg-additionTextDOM-moving"), r[n] = [i, a], r.drawSealAndText()
}
}, p = function (n) {
n.target == e.children[0] ? (u.map(function (e) {
e.style.pointerEvents = "auto"
}), t = !1, e.classList.remove("kg-additionTextDOM-moving")) : t = !1
};
e.addEventListener("mousedown", d), c.addEventListener("mousemove", h), c.addEventListener("mouseup", p), e.addEventListener("touchstart", d), c.addEventListener("touchmove", h), c.addEventListener("touchend", p)
}
}, {
key: "drawSealAndText", value: function () {
this.clearDragCanvas(), this.drawDragText(), this.drawSeal()
}
}, {
key: "calculateRect", value: function (e) {
var t = e.DOM, n = e.content, r = e.fontSize, i = e.fontFamily, a = e.isWordwrap, o = void 0 !== a && a,
s = e.maxHeight, c = e.maxWidth, u = void 0, d = void 0;
o ? (d = c, u = s) : (u = r, d = (0, l.computeTextWdith)(n, r, i)), t.style.width = d + "px", t.style.height = u + "px"
}
}, {
key: "drawSeal", value: function () {
var e = this.previewCanvasDragCanvasCtx, t = i(this.dragSealPointXY, 2), n = t[0], r = t[1];
this.dragSealDOM_img.style.width = this.sealImg.width + "px", this.dragSealDOM_img.style.height = this.sealImg.height + "px", this.dragSealDOM.style.left = n + "px", this.dragSealDOM.style.top = r + "px", e.drawImage(this.sealImg, n, r, this.sealImg.width, this.sealImg.height)
}
}, {
key: "cutBlankImage", value: function (e, t) {
for (var n = this, r = e.getContext("2d").getImageData(0, 0, e.width, e.height), i = r.data, a = r.width, o = 0, s = r.height, l = 0, c = 0; c < e.width; c++) for (var u = 0; u < r.height; u++) {
var d = 4 * (c + r.width * u);
(i[d] > 0 || i[d + 1] > 0 || i[d + 2] || i[d + 3] > 0) && (l = Math.max(u, l), o = Math.max(c, o), s = Math.min(u, s), a = Math.min(c, a))
}
a++, o++, s++, l++;
var h = e.toDataURL(this.imgExt), p = new Image;
p.src = h, p.onload = function () {
var e = document.createElement("canvas");
e.width = o - a, e.height = l - s, e.getContext("2d").drawImage(p, a, s, e.width, e.height, 0, 0, e.width, e.height), t({
data: e.toDataURL(n.imgExt, 1),
width: e.width * n.xRadio,
height: e.height * n.xRadio
})
}
}
}, {
key: "drawDragText", value: function () {
var e = void 0, t = 0, n = 0, r = this.timeFontSelect.value, a = this.previewCanvasDragCanvasCtx,
o = this.timeTextDOM_text.innerHTML, s = this.additionTextDOM_text.innerHTML.replace(/\n/g, "<br/>");
if (a.textAlign = "left", a.textBaseline = "top", a.fillStyle = "#" + this.textColorInput.value, o) {
a.save(), e = this.timeSizeInput.value, a.font = e + "px " + r;
var c = i(this.timeTextPointXY, 2), u = c[0], d = c[1], h = this.timeTextDOM_text;
a.fillText(o, u, d), a.restore(), this.calculateRect({DOM: h, fontSize: e, fontFamily: r, content: o})
}
if (s) {
a.save(), e = this.textSizeInput.value, a.font = e + "px " + r;
var p = i(this.additionTextPointXY, 2), f = p[0], m = p[1], v = this.additionTextDOM_text, g = !1;
if (-1 != s.indexOf("<br>")) {
var y = m, b = s.split("<br>");
n = 24 * b.length, g = !0, b.map(function (n) {
var i = (0, l.computeTextWdith)(n, e, r);
i > t && (t = i), a.fillText(n, f, y), y += 24
})
} else g = !1, a.fillText(s, f, m);
a.restore(), this.calculateRect({
DOM: v,
maxWidth: t,
maxHeight: n,
fontSize: e,
fontFamily: r,
isWordwrap: g,
content: s
})
}
}
}, {
key: "clearDragCanvas", value: function () {
var e = this.previewCanvasDragCanvas.getContext("2d"), t = this.previewCanvasDragCanvas.width,
n = this.previewCanvasDragCanvas.height;
e.clearRect(0, 0, t, n)
}
}, {
key: "onLocationSelect", value: function (e) {
this.loactionMode = e, this.restoreUserAction(), "fixed" == e ? (this.mobilePreview.style.display = "none", this.previewCanvas.style.display = "inline", this.previewCanvasDragWrapper.style.display = "none", this.timePositionSelect.removeAttribute("disabled"), this.textPositionSelect.removeAttribute("disabled"), this.percentInputY.removeAttribute("disabled"), this.sealImg && this.drawText()) : (this.previewCanvas.style.display = "none", this.mobilePreview.style.display = "inline", this.previewCanvasDragWrapper.style.display = "block", this.timePositionSelect.setAttribute("disabled", !0), this.textPositionSelect.setAttribute("disabled", !0), this.percentInputY.setAttribute("disabled", !0), this.initDragCanvas(), this.initSealPosition())
}
}, {
key: "openMobileDialog", value: function () {
this.isMobile && "drag" === this.loactionMode && (this.main_mobile.style.display = "block", this.configContainer.style.display = "none", this.initDragCanvas(), this.initSealPosition(), this.drawSealAndText(), this.mobileDlgisOpen = !0)
}
}, {
key: "closeMobileDialog", value: function () {
this.main_mobile.style.display = "none", this.configContainer.style.display = "block", this.mobileDlgisOpen = !1
}
}, {
key: "initDragCanvas", value: function () {
if (this.sealImg) {
var e = this.previewCanvasDragCanvas, t = this.previewCanvasDragWrapper.getBoundingClientRect(), n = t.width,
r = t.height;
e.style.width = Math.max(n, r) + "px", e.style.height = Math.max(n, r) + "px", e.style.top = "0px";
var i = e.getBoundingClientRect();
e.style.top = t.top - i.top + "px", e.width = Math.max(n, r), e.height = Math.max(n, r), this.drawSeal(), this.drawDragText()
}
}
}, {
key: "initSealPosition", value: function () {
if (this.sealImg) {
var e = i(this.dragSealPointXY, 2), t = e[0], n = e[1];
if (t <= 0 || n <= 0) {
var r = this.previewCanvasDragWrapper, a = (r.offsetWidth - this.sealImg.width) / 2,
o = (r.offsetHeight - this.sealImg.height) / 2;
this.dragSealPointXY = [a, o]
}
}
}
}, {
key: "onPresetTextSelect", value: function () {
var e = this.presetTextSelect.value;
e && e.length > this.maxLength && (e = e.slice(0, this.maxLength)), this.textInput.value = e, this.additionTextDOM_text.innerHTML = e, this.drawSealAndText(), this.drawText()
}
}, {
key: "onTextInputChange", value: function () {
var e = this.textInput.value;
e.length > this.maxLength && (this.textInput.value = e.slice(0, this.maxLength)), this.additionTextDOM_text.innerHTML = e.replace(/\n/g, "<br/>"), this.drawSealAndText(), this.drawText()
}
}, {
key: "onTextSizeChange", value: function () {
var e = Number(this.textSizeInput.value);
isNaN(e) && (this.textSizeInput.value = this.additionTextConfig.fontSize), e < 0 && (this.textSizeInput.value = 0), this.additionTextDOM_text.style.fontSize = this.textSizeInput.value + "px", this.drawSealAndText(), this.drawText()
}
}, {
key: "onTextColorChange", value: function () {
var e = this.textColorInput.value;
this.timeTextDOM_text.style.color = "#" + e, this.additionTextDOM_text.style.color = "#" + e, this.drawSealAndText(), this.drawText()
}
}, {
key: "onTextFontChange", value: function (e) {
this.timeFontSelect.value = e.target.value, this.timeTextDOM_text.style.fontFamily = e.target.value, this.additionTextDOM_text.style.fontFamily = e.target.value, this.drawSealAndText(), this.drawText()
}
}, {
key: "onTextColorInput", value: function () {
var e = this.textColorInput.value;
/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test("#" + e) && (this.textColorInput.jscolor.fromString(e), this.drawText())
}
}, {
key: "onTextPositionSelect", value: function () {
this.drawText()
}
}, {
key: "onTimePositionSelect", value: function () {
this.drawText()
}
}, {
key: "onAdditionTimeSelect", value: function (e) {
this.timeTextDOM_text.innerHTML = e.target.value, this.drawSealAndText(), this.drawText()
}
}, {
key: "onPercentInputY", value: function () {
this.drawText()
}
}, {
key: "onTimeSizeInput", value: function () {
var e = Number(this.timeSizeInput.value);
isNaN(e) && (this.timeSizeInput.value = this.additionTextConfig.fontSize), e < 0 && (this.timeSizeInput.value = 0), this.timeTextDOM_text.style.fontSize = this.timeSizeInput.value + "px", this.drawSealAndText(), this.drawText()
}
}, {
key: "clearCanvas", value: function () {
var e = this.previewCanvas.getContext("2d"), t = this.previewCanvas.width, n = this.previewCanvas.height;
e.clearRect(0, 0, t, n)
}
}, {
key: "showPercentInput", value: function () {
this.percentInputContainer.style.display = "inline", this.timePositionSelect.classList.add("kgInput_MinWidth")
}
}, {
key: "hidePercentInput", value: function () {
this.percentInputContainer.style.display = "none", this.timePositionSelect.classList.remove("kgInput_MinWidth")
}
}, {
key: "drawText", value: function () {
this.clearCanvas();
var e = -1 == this._FontList.indexOf(this.timeFontSelect.value) ? "Microsoft YaHei" : this.timeFontSelect.value,
t = this.textInput.value, n = Number(this.textSizeInput.value), r = this.textColorInput.value,
i = this.textPositionSelect.value, a = this.timePositionSelect.value, o = this.additionTimeSelect.value,
s = Number(this.timeSizeInput.value), c = this.percentInputY.value;
"inside" == a ? this.showPercentInput() : this.hidePercentInput();
var u = t.split("\n");
"" === u[0] && u.splice(0, 1), "" === u[u - 1] && u.splice(-1);
for (var d = u.length * n + .2 * n, h = 0, p = 0; p < u.length; p++) {
var f;
f = (0, l.computeTextWdith)(u[p], n, e), 0 === h ? h = f : f > h && (h = f)
}
var m = function (e, t, n, r, i, a, o, s, l) {
var c = 0, u = 0, d = 0, h = 0, p = 0, f = 0, m = "center", v = 0, g = 0, y = "center";
switch (i) {
case"top":
switch (m = "center", s) {
case"top":
u = t + r + o, d = ((c = Math.max(Math.max(e, n), a)) - e) / 2, h = r + o, p = c / 2, f = 0, v = c / 2, g = r, y = "center";
break;
case"bottom":
u = t + r + o, d = ((c = Math.max(Math.max(e, n), a)) - e) / 2, h = r, p = c / 2, f = 0, v = c / 2, g = t + r, y = "center";
break;
case"left_top":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? c - n / 2 - e / 2 : c - e, h = u - t, p = n > e ? c - n / 2 : c - e / 2, f = 0, v = n > e ? c - n / 2 - e / 2 : c - e, g = r || 0, y = "right";
break;
case"left_center":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r, d = n > e ? c - n / 2 - e / 2 : c - e, h = r > 5 ? u - t : (u - t) / 2, p = n > e ? c - n / 2 : c - e / 2, f = 0, v = n > e ? c - n / 2 - e / 2 : c - e, g = r > 5 ? (u - o + r) / 2 : (u - o) / 2, y = "right";
break;
case"left_bottom":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? c - n / 2 - e / 2 : c - e, h = r, p = n > e ? c - n / 2 : c - e / 2, f = 0, v = n > e ? c - n / 2 - e / 2 : c - e, g = u - o, y = "right";
break;
case"right_top":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? n / 2 - e / 2 : 0, h = u - t, p = n > e ? n / 2 : e / 2, f = 0, v = n > e ? n / 2 + e / 2 : e, g = r || 0, y = "left";
break;
case"right_center":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r, d = n > e ? n / 2 - e / 2 : 0, h = r > 5 ? u - t : (u - t) / 2, p = n > e ? n / 2 : e / 2, f = 0, v = n > e ? n / 2 + e / 2 : e, g = r > 5 ? (u - o + r) / 2 : (u - o) / 2, y = "left";
break;
case"right_bottom":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? n / 2 - e / 2 : 0, h = r, p = n > e ? n / 2 : e / 2, f = 0, v = n > e ? n / 2 + e / 2 : e, g = u - o, y = "left";
break;
case"inside":
u = r + t, p = (c = Math.max(e, n, a)) / 2, f = 0, v = (e - a) / 2 + (d = (c - e) / 2), g = (t - o) * l + (h = r), y = "left"
}
break;
case"bottom":
switch (m = "center", s) {
case"top":
u = t + r + o, d = ((c = Math.max(Math.max(e, n), a)) - e) / 2, h = o, p = c / 2, f = o + t, v = c / 2, g = 0, y = "center";
break;
case"bottom":
u = t + r + o, d = ((c = Math.max(Math.max(e, n), a)) - e) / 2, h = 0, p = c / 2, f = t + o, v = c / 2, g = t, y = "center";
break;
case"left_top":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? c - n / 2 - e / 2 : c - e, h = o || 0, p = n > e ? c - n / 2 : c - e / 2, f = t + o, v = n > e ? c - n / 2 - e / 2 : c - e, g = 0, y = "right";
break;
case"left_center":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r, d = n > e ? c - n / 2 - e / 2 : c - e, h = r > 5 ? 0 : (u - t) / 2, g = r > 5 ? (u - o + r) / 2 : (u - o) / 2, p = n > e ? c - n / 2 : c - e / 2, f = u - r, v = n > e ? c - n / 2 - e / 2 : c - e, g = r > 5 ? (t - r) / 2 : (u - o) / 2, y = "right";
break;
case"left_bottom":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? c - n / 2 - e / 2 : c - e, h = 0, p = n > e ? c - n / 2 : c - e / 2, f = r > 5 ? u - r : t, v = n > e ? c - n / 2 - e / 2 : c - e, g = t, y = "right";
break;
case"right_top":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? n / 2 - e / 2 : 0, h = o ? (u - t) / 2 : 0, p = n > e ? n / 2 : e / 2, f = t + o, v = n > e ? n / 2 + e / 2 : e, g = 0, y = "left";
break;
case"right_center":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r, d = n > e ? n / 2 - e / 2 : 0, h = r > 5 ? 0 : (u - t) / 2, p = n > e ? n / 2 : e / 2, f = u - r, v = n > e ? n / 2 + e / 2 : e, g = r > 5 ? (t - r) / 2 : (u - o) / 2, y = "left";
break;
case"right_bottom":
c = n / 2 > e / 2 + a ? n : n > e ? n / 2 + e / 2 + a : e + a, u = t + r + o, d = n > e ? n / 2 - e / 2 : 0, h = 0, p = n > e ? n / 2 : e / 2, f = r > 5 ? u - r : t, v = n > e ? n / 2 + e / 2 : e, g = t, y = "left";
break;
case"inside":
u = r + t, h = 0, p = (c = Math.max(e, n, a)) / 2, f = t, v = (e - a) / 2 + (d = (c - e) / 2), g = (t - o) * l, y = "left"
}
break;
case"left_top":
switch (m = "right", s) {
case"top":
c = a / 2 > e / 2 + n ? a : a > e ? a / 2 + e / 2 + n : e + n, u = t + r + o, d = a > e ? c - a / 2 - e / 2 : c - e, h = u - t, p = n, f = 0, v = a > e ? c - a / 2 : c - e / 2, g = r, y = "center";
break;
case"bottom":
c = a > e ? a + n : e + n, u = t + r + o, d = a > e ? c - a / 2 - e / 2 : c - e, h = r > 5 ? (u - t) / 2 : 0, p = a > e ? n + (a - e) / 2 : n, f = 0, v = n, g = u - o, y = "left";
break;
case"left_top":
c = a > n ? a + e : n + e, u = t + r + o, d = Math.max(n, a), h = u - t, p = c - e, f = 0, v = c - e, g = r > 5 ? o : 0, y = "right";
break;
case"left_center":
c = a > n ? a + e : n + e, u = t + r + o, d = Math.max(n, a), h = (u - t) / 2, p = c - e, f = 0, v = c - e, g = (u - o) / 2, y = "right";
break;
case"left_bottom":
c = a > n ? a + e : n + e, u = t + r + o, d = Math.max(n, a), h = (u - t) / 2, p = c - e, f = 0, v = c - e, g = u - o, y = "right";
break;
case"right_top":
c = a + n + e, d = n, h = (u = t + r + o) - t, p = n, f = 0, v = n + e, g = r > 5 ? o : 0, y = "left";
break;
case"right_center":
c = a + n + e, d = n, h = ((u = t + r + o) - t) / 2, p = n, f = 0, v = n + e, g = (u - o) / 2, y = "left";
break;
case"right_bottom":
c = a + n + e, d = n, h = ((u = t + r + o) - t) / 2, p = n, f = 0, v = n + e, g = u - o, y = "left";
break;
case"inside":
c = n + e, u = r + t, p = n, f = 0, v = (e - a) / 2 + (d = n), g = (t - o) * l + (h = r), y = "left"
}
break;
case"left_bottom":
switch (m = "right", s) {
case"top":
c = a / 2 > e / 2 + n ? a : a > e ? a / 2 + e / 2 + n : e + n, u = t + r + o, d = a > e ? c - a / 2 - e / 2 : c - e, h = o, p = n, f = u - r, v = a > e ? c - a / 2 : c - e / 2, g = 0, y = "center";
break;
case"bottom":
c = a > e ? a + n : e + n, u = t + r + o, d = a > e ? c - a / 2 - e / 2 : c - e, h = r > t ? r - t : 0, p = a > e ? n + (a - e) / 2 : n, f = u - r, v = n, g = r > t ? r : t, y = "left";
break;
case"left_top":
c = a > n ? a + e : n + e, u = t + r + o, d = Math.max(n, a), h = o ? (u - t) / 2 : 0, p = c - e, f = u - r, v = c - e, g = 0, y = "right";
break;
case"left_center":
c = a > n ? a + e : n + e, u = t + r + o, d = Math.max(n, a), h = o ? (u - t) / 2 : 0, p = c - e, f = u - r, v = c - e, g = (u - o) / 2, y = "right";
break;
case"left_bottom":
c = a > n ? a + e : n + e, u = t + r + o, d = Math.max(n, a), h = 0, p = n, f = u - r, v = c - e, g = u - o - r, y = "right";
break;
case"right_top":
c = a + n + e, u = t + r + o, d = n, h = o ? (u - t) / 2 : 0, p = n, f = u - r, v = n + e, g = 0, y = "left";
break;
case"right_center":
c = a + n + e, d = n, h = 0, p = n, f = (u = t + r) - r, v = n + e, g = (u - o - r) / 2, y = "left";
break;
case"right_bottom":
c = a + n + e, d = n, h = 0, p = n, f = (u = t + r + o) - r, v = n + e, g = u - o - r, y = "left";
break;
case"inside":
c = n + e, u = r + t, h = 0, p = n, f = t, v = (e - a) / 2 + (d = n), g = (t - o) * l, y = "left"
}
break;
case"right_top":
switch (m = "left", s) {
case"top":
c = a / 2 > e / 2 + n ? a : a > e ? a / 2 + e / 2 + n : e + n, u = t + r + o, d = a > e ? a / 2 - e / 2 : 0, h = u - t, p = a > e ? a / 2 + e / 2 : e, f = 0, v = a > e ? a / 2 : e / 2, g = r || 0, y = "center";
break;
case"bottom":
c = a > e ? a + n : e + n, u = t + r + o, d = a > e ? a / 2 - e / 2 : 0, h = r > 5 ? (u - t) / 2 : 0, p = a > e ? a / 2 + e / 2 : e, f = 0, v = a > e ? a / 2 : e / 2, g = u - o, y = "center";
break;
case"left_top":
c = a + n + e, d = a, h = (u = t + r + o) - t, p = a + e, f = 0, v = a, g = o, y = "right";
break;
case"left_center":
c = a + n + e, d = a, h = ((u = t + r + o) - t) / 2, p = a + e, f = 0, v = a, g = (u - o) / 2, y = "right";
break;
case"left_bottom":
c = a + n + e, d = a, h = ((u = t + r + o) - t) / 2, p = a + e, f = 0, v = a, g = u - o, y = "right";
break;
case"right_top":
c = a > n ? a + e : n + e, d = 0, h = (u = t + r + o) - t, p = e, f = 0, v = e, g = o, y = "left";
break;
case"right_center":
c = a > n ? a + e : n + e, d = 0, h = ((u = t + r + o) - t) / 2, p = e, f = 0, v = e, g = (u - o) / 2, y = "left";
break;
case"right_bottom":
c = a > n ? a + e : n + e, d = 0, h = ((u = t + r + o) - t) / 2, p = e, f = 0, v = e, g = u - o, y = "left";
break;
case"inside":
c = n + e, u = t + r, d = 0, p = e, f = 0, v = (e - a) / 2, g = (t - o) * l + (h = r), y = "left"
}
break;
case"right_bottom":
switch (m = "left", s) {
case"top":
c = a / 2 > e / 2 + n ? a : a > e ? a / 2 + e / 2 + n : e + n, u = t + r + o, d = a > e ? a / 2 - e / 2 : 0, h = o, p = a > e ? a / 2 + e / 2 : e, f = u - r, v = a > e ? a / 2 : e / 2, g = 0, y = "center";
break;
case"bottom":
c = a > e ? a + n : e + n, u = t + r + o, d = a > e ? a / 2 - e / 2 : 0, h = r > t ? r - t : 0, p = a > e ? a / 2 + e / 2 : e, f = t + o, v = a > e ? a / 2 : e / 2, g = r > t ? r : t, y = "center";
break;
case"left_top":
c = a + n + e, u = t + r + o, d = a, h = o ? (u - t) / 2 : 0, p = a + e, f = t + o, v = a, g = 0, y = "right";
break;
case"left_center":
c = a + n + e, u = t + r + o, d = a, h = o ? (u - t) / 2 : 0, p = a + e, f = t + o, v = a, g = (u - o) / 2, y = "right";
break;
case"left_bottom":
c = a + n + e, u = t + r + o, d = a, h = 0, p = a + e, f = t + o, v = a, g = t, y = "right";
break;
case"right_top":
c = a > n ? a + e : n + e, u = t + r + o, d = 0, h = o ? (u - t) / 2 : 0, p = e, f = t + o, v = e, g = 0, y = "left";
break;
case"right_center":
c = a > n ? a + e : n + e, u = t + r + o, d = 0, h = o ? (u - t) / 2 : 0, p = e, f = t + o, v = e, g = (u - o) / 2, y = "left";
break;
case"right_bottom":
c = a > n ? a + e : n + e, u = t + r + o, d = 0, h = 0, p = e, f = t + o, v = e, g = t, y = "left";
break;
case"inside":
c = n + e, u = t + r, d = 0, h = 0, p = e, f = t, v = (e - a) / 2, g = (t - o) * l, y = "left"
}
break;
case"left_center":
switch (m = "right", s) {
case"top":
c = a / 2 > e / 2 + n ? a : a > e ? a / 2 + e / 2 + n : e + n, u = t + o, d = a > e ? c - a / 2 - e / 2 : c - e, h = o, p = n, f = (u - r + o) / 2, v = a > e ? c - a / 2 : c - e / 2, g = 0, y = "center";
break;
case"bottom":
c = a > e ? a + n : e + n, u = t + o, d = a > e ? c - a / 2 - e / 2 : c - e, h = 0, p = a > e ? n + (a - e) / 2 : n, f = (u - r - o) / 2, v = n, g = u - o, y = "left";
break;
case"left_top":
c = a > n ? a + e : n + e, u = t + o, d = Math.max(n, a), h = (u - t) / 2, p = c - e, f = (u - r) / 2, v = c - e, g = 0, y = "right";
break;
case"left_center":
d = (c = a + e + n) - e, h = ((u = t + r + o) - t) / 2, p = n, f = (u - r) / 2, v = n + a, g = (u - o) / 2, y = "right";
break;
case"left_bottom":
c = a > n ? a + e : n + e, u = t + o, d = Math.max(n, a), h = (u - t) / 2, p = c - e, f = (u - r) / 2, v = c - e, g = u - o, y = "right";
break;
case"right_top":
c = a + n + e, d = n, h = ((u = t + o) - t) / 2, p = n, f = (u - r) / 2, v = n + e, g = 0, y = "left";
break;
case"right_center":
c = a + n + e, d = n, h = ((u = t) - t) / 2, p = n, f = (u - r) / 2, v = n + e, g = (u - o) / 2, y = "left";
break;
case"right_bottom":
c = a + n + e, d = n, h = ((u = t + o) - t) / 2, p = n, f = (u - r) / 2, v = n + e, g = u - o, y = "left";
break;
case"inside":
c = n + e, h = ((u = t) - t) / 2, p = n, f = (u - r) / 2, v = (e - a) / 2 + (d = n), g = (u - o) * l, y = "left"
}
break;
case"right_center":
switch (m = "left", s) {
case"top":
c = a / 2 > e / 2 + n ? a : a > e ? a / 2 + e / 2 + n : e + n, u = t + o, d = a > e ? a / 2 - e / 2 : 0, h = u - t, p = a > e ? a / 2 + e / 2 : e, f = (u - r + o) / 2, v = a > e ? a / 2 : e / 2, g = 0, y = "center";
break;
case"bottom":
c = a > e ? a + n : e + n, u = t + o, d = a > e ? a / 2 - e / 2 : 0, h = 0, p = a > e ? a / 2 + e / 2 : e, f = (u - r - o) / 2, v = a > e ? a / 2 : e / 2, g = u - o, y = "center";
break;
case"left_top":
c = a + n + e, d = a, h = (u = t + o) - t, p = a + e, f = (u - r + o) / 2, v = a, g = 0, y = "right";
break;
case"left_center":
c = a + n + e, d = a, h = ((u = t + o) - t) / 2, p = a + e, f = (u - r) / 2, v = a, g = (u - o) / 2, y = "right";
break;
case"left_bottom":
c = a + n + e, d = a, h = ((u = t + o) - t) / 2, p = a + e, f = (u - r + o) / 2, v = a, g = u - o, y = "right";
break;
case"right_top":
c = a > n ? a + e : n + e, d = 0, h = (u = t + o) - t, p = e, f = (u - r + o) / 2, v = e, g = 0, y = "left";
break;
case"right_center":
c = a + e + n, d = 0, h = ((u = t) - t) / 2, p = e + a, f = (u - r) / 2, v = e, g = (u - o) / 2, y = "left";
break;
case"right_bottom":
c = a > n ? a + e : n + e, d = 0, h = ((u = t + o) - t) / 2, p = e, f = (u - r + o) / 2, v = e, g = u - o, y = "left";
break;
case"inside":
c = n + e, d = 0, h = ((u = t) - t) / 2, p = e, f = (u - r) / 2, v = (e - a) / 2, g = (u - o) * l, y = "left"
}
}
return {
canvasWidth: c,
canvasHeight: u,
imgX: d,
imgY: h,
textX: p,
textY: f,
textAlign: m,
timeX: v,
timeY: g,
timeAlign: y
}
}(this.sealImg.width, this.sealImg.height, h, d, i, o ? (0, l.computeTextWdith)(o, s, e) : 0, o ? s + .2 * s : 0, a, c / 100);
this.previewCanvas.width = m.canvasWidth, this.previewCanvas.height = m.canvasHeight, this.previewCanvas.width < 324 && this.previewCanvas.height < 324 ? (this.previewCanvas.style.width = this.previewCanvas.width + "px", this.previewCanvas.style.height = this.previewCanvas.height + "px") : this.previewCanvas.width > this.previewCanvas.height ? (this.previewCanvas.style.width = "324px", this.previewCanvas.style.height = 324 / this.previewCanvas.width * this.previewCanvas.height + "px") : (this.previewCanvas.style.height = "324px", this.previewCanvas.style.width = 324 / this.previewCanvas.height * this.previewCanvas.width + "px");
var v = this.previewCanvas.getContext("2d");
if (o && (v.fillStyle = "#" + r, v.textAlign = m.timeAlign, v.font = s + "px bold, " + e, v.fillText(o, m.timeX, m.timeY + .9 * s)), v.drawImage(this.sealImg, 0, 0, this.sealImg.width, this.sealImg.height, m.imgX, m.imgY, this.sealImg.width, this.sealImg.height), u.length) {
v.fillStyle = "#" + r, v.textAlign = m.textAlign;
for (var g = 0; g < u.length; g++) v.font = n + "px bold, " + e, v.fillText(u[g], m.textX, m.textY + n * (g + .9))
}
return {
data: this.previewCanvas.toDataURL(this.imgExt, 1),
width: this.previewCanvas.width * this.xRadio,
height: this.previewCanvas.height * this.xRadio
}
}
}, {
key: "open", value: function (e, t, n, r, i) {
var a = this;
this.overlayManager.open(this.overlayName).then(function () {
var o = new Image, s = new Image;
o.onload = function () {
var e = (0, l.toTransparentImg)(o);
s.src = e
}, s.onload = function () {
a.imgExt = r, a.sealImg = s, a.xRadio = t / o.width, a.yRadio = n / o.height, a.drawText(), a.initSealPosition(), a.initDragCanvas()
}, a.selectSealInfo = i, a.restoreUserAction(), o.src = e, window.KGPdfViewerWebApp.selectSealPrompt.needToCloseOverlay = !0
})
}
}, {
key: "onOk", value: function () {
var e = this;
if (this.mobileDlgisOpen) this.closeMobileDialog(); else {
var t = window.KGPdfViewerWebApp.selectSealPrompt, n = t.sealIdx;
if ("fixed" == this.loactionMode) {
var r = this.previewCanvas;
t.img.src = r.toDataURL(this.imgExt, 1), t.seals[n].imgdata = r.toDataURL(this.imgExt, 1), t.seals[n].width = r.width * this.xRadio, t.seals[n].height = r.height * this.yRadio, this.storeUserAction()
} else new Promise(function (t) {
var n = e.previewCanvasDragCanvas;
e.cutBlankImage(n, t)
}).then(function (e) {
t.img.src = e.data, t.seals[n].imgdata = e.data, t.seals[n].width = e.width, t.seals[n].height = e.height
}), this.storeUserAction({
seal: [this.dragSealPointXY],
timeText: [this.timeSizeInput.value, this.timeTextPointXY],
additionText: [this.textSizeInput.value, this.additionTextPointXY]
});
this.onClose()
}
}
}, {
key: "onClose", value: function () {
var e = this;
this.mobileDlgisOpen ? this.closeMobileDialog() : this.overlayManager.close(this.overlayName).then(function () {
e.sealImg = null, e.clearCanvas(), e.init()
}).then(function () {
e.overlayManager.open(window.KGPdfViewerWebApp.selectSealPrompt.overlayName)
})
}
}, {
key: "storeUserAction", value: function (e) {
if ("drag" == this.loactionMode && e) {
var t = JSON.stringify(e);
(0, l.setCookieOrStorage)(this.userAction, t, {expires: 365})
} else {
var n = window.KGPdfViewerWebApp.selectSealPrompt;
if (this.additionTimeSelect.value) for (var r = 0; r < this.additionTimeSelect.children.length; r++) if (this.additionTimeSelect.children[r].value == this.additionTimeSelect.value) switch (r) {
case 1:
this.additionTextConfig.timeFormat = "YYYY-MM-DD HH:mm:ss";
break;
case 4:
this.additionTextConfig.timeFormat = "YYYY年MM月DD日 HH:mm:ss";
break;
case 2:
case 3:
this.additionTextConfig.timeFormat = this.additionTimeSelect.children[r].getAttribute("format")
}
n.seals[n.sealIdx].selectSealInfo = {
textValue: this.textInput.value || "",
timePosition: this.timePositionSelect.value,
textPosition: this.textPositionSelect.value,
timeSize: this.timeSizeInput.value,
textSize: this.textSizeInput.value,
color: (0, l.convertRGB)(this.textColorInput.jscolor.rgb),
font: this.timeFontSelect.value,
percentY: this.percentInputY.value
}
}
}
}, {
key: "restoreUserAction", value: function () {
var e = (0, l.getCookieOrStorage)(this.userAction);
if (e && this.selectSealInfo) if ("drag" == this.loactionMode) {
var t = JSON.parse(e), n = i(t.seal, 1)[0];
this.dragSealPointXY = n, this.dragSealDOM.style.left = n[0] + "px", this.dragSealDOM.style.top = n[1] + "px";
var r = i(t.timeText, 2), a = r[0], o = r[1];
this.timeSizeInput.value = a, this.timeTextPointXY = o, this.timeTextDOM.style.left = o[0] + "px", this.timeTextDOM.style.top = o[1] + "px";
var s = i(t.additionText, 2), c = s[0], u = s[1];
this.textSizeInput.value = c, this.additionTextPointXY = u, this.additionTextDOM.style.left = u[0] + "px", this.additionTextDOM.style.top = u[1] + "px"
} else {
var d = this.additionTextConfig.defaultText;
this.textInput.value = this.selectSealInfo.textValue || this.textInput.value || d, this.timePositionSelect.value = this.selectSealInfo.timePosition, this.textPositionSelect.value = this.selectSealInfo.textPosition, this.timeSizeInput.value = this.selectSealInfo.timeSize, this.textSizeInput.value = this.selectSealInfo.textSize, this.textColorInput.jscolor.fromString(this.selectSealInfo.color), this.timeFontSelect.value = this.selectSealInfo.font, this.percentInputY.value = this.selectSealInfo.percentY, this.timeLocationSelect.value = this.loactionMode
}
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_Captcha = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(86), a = n(2);
t.KG_Captcha = function () {
function e(t, n, r) {
var i = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.overlayName = n.overlayName, this.overlayManager = r, this.timer = null, this.time = 60, this.okCallback = null, this.cancelCallback = null, this.container = n.container, this.phoneContainer = null, this.input = null, this.captchaBtn = null, this.cancelBtn = null, this.okBtn = null, this.createDom = this.createDom.bind(this), this.createDom(), this.close = this.close.bind(this), this.overlayManager.register(this.overlayName, this.container, function () {
i.close(), i.cancelCallback && i.cancelCallback()
}, !0), this.init = this.init.bind(this), this.getCaptcha = this.getCaptcha.bind(this), this.reset = this.reset.bind(this), this.onOk = this.onOk.bind(this), this.init()
}
return r(e, [{
key: "createDom", value: function () {
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.container.appendChild(e);
var t = document.createElement("div");
t.classList.add("kg_dialog_title"), t.setAttribute("data-l10n-id", "captcha_title"), e.appendChild(t), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", e.appendChild(this.closeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.container.appendChild(n), this.phoneContainer = document.createElement("div"), n.appendChild(this.phoneContainer);
var r = document.createElement("form");
switch (n.appendChild(r), r.addEventListener("submit", function (e) {
e.preventDefault()
}), this.input = document.createElement("input"), this.input.classList.add("kgInput"), this.app.l10n._lang) {
case"zh-TW":
this.input.placeholder = "請輸入六位數驗證碼";
break;
case"en-US":
this.input.placeholder = "Please enter the six-digit captcha";
break;
default:
this.input.placeholder = "请输入六位数验证码"
}
r.appendChild(this.input), this.captchaBtn = document.createElement("button"), this.captchaBtn.classList.add("btn"), this.captchaBtn.setAttribute("data-l10n-id", "captcha_btn"), r.appendChild(this.captchaBtn);
var i = document.createElement("span");
i.classList.add("kg_error_msg"), i.setAttribute("data-l10n-id", "captcha_errMsg"), r.appendChild(i);
var a = document.createElement("div");
a.classList.add("KG_Captcha_BtnContainer"), n.appendChild(a), this.cancelBtn = document.createElement("button"), this.cancelBtn.setAttribute("data-l10n-id", "password_cancel"), this.cancelBtn.classList.add("btn"), a.appendChild(this.cancelBtn), this.okBtn = document.createElement("button"), this.okBtn.setAttribute("data-l10n-id", "password_ok"), this.okBtn.classList.add("btn"), this.okBtn.classList.add("btn-primary"), a.appendChild(this.okBtn), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
var e = this;
this.input.addEventListener("input", function () {
e.input.classList.remove("KG_Input_Error"), e.container.querySelector(".kg_error_msg").style.visibility = "hidden"
}), this.okBtn.addEventListener("click", this.onOk), this.cancelBtn.addEventListener("click", function () {
e.close(), e.cancelCallback && e.cancelCallback()
}), this.closeBtn.addEventListener("click", function () {
e.close(), e.cancelCallback && e.cancelCallback()
}), this.captchaBtn.addEventListener("click", this.getCaptcha)
}
}, {
key: "getCaptcha", value: function () {
var e = this, t = void 0;
switch (this.app.l10n._lang) {
case"zh-TW":
t = "秒";
break;
case"en-US":
t = "second";
break;
default:
t = "秒"
}
this.captchaBtn.innerHTML = this.time + t, this.captchaBtn.setAttribute("disabled", !0), this.captchaBtn.classList.add("btn-disabled"), this.timer = setInterval(function () {
e.time--, 0 !== e.time ? e.captchaBtn.innerHTML = e.time + t : e.reset()
}, 1e3), (0, i.sendCaptcha)().catch(function () {
e.reset(), e.app.KGAlertPrompt.closeCallback = function () {
return e.open()
}
})
}
}, {
key: "reset", value: function () {
clearInterval(this.timer), this.app.l10n.translate(this.captchaBtn), this.captchaBtn.removeAttribute("disabled"), this.captchaBtn.classList.remove("btn-disabled"), this.time = 60
}
}, {
key: "open", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
if (t.input.value = "", e) switch (t.app.l10n._lang) {
case"zh-TW":
t.phoneContainer.innerHTML = "驗證碼將發送至 " + e + " 手機";
break;
case"en-US":
t.phoneContainer.innerHTML = "The captcha will be sent to the " + e + " phone";
break;
default:
t.phoneContainer.innerHTML = "验证码将发送至 " + e + " 手机"
}
})
}
}, {
key: "close", value: function () {
var e = this;
return this.overlayManager.close(this.overlayName).then(function () {
e.reset(), e.input.classList.remove("KG_Input_Error"), e.container.querySelector(".kg_error_msg").style.visibility = "hidden"
})
}
}, {
key: "onOk", value: function () {
var e = this, t = (0, a.trim)(this.input.value);
t ? this.close().then(function () {
e.okCallback && e.okCallback(t)
}) : (this.input.focus(), this.input.classList.add("KG_Input_Error"), this.container.querySelector(".kg_error_msg").style.visibility = "visible")
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_StampConfirm = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.container = n.container, this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.setContainerWidth = this.setContainerWidth.bind(this), this.setContainerWidth(), this.createDOM = this.createDOM.bind(this), this.createDOM(), this.init = this.init.bind(this), this.okButtonClick = this.okButtonClick.bind(this), this.cancelButtonClick = this.cancelButtonClick.bind(this), this.init(), this.selectSealPrompt = null, this.sealDatas = [], this.capability = null
}
return r(e, [{
key: "createDOM", value: function () {
this.cancelButton = document.createElement("div"), this.cancelButton.classList.add("btn"), this.cancelButton.setAttribute("data-l10n-id", "password_cancel"), this.container.appendChild(this.cancelButton), this.okButton = document.createElement("div"), this.okButton.classList.add("btn"), this.okButton.classList.add("btn-primary"), this.okButton.setAttribute("data-l10n-id", "password_ok"), this.container.appendChild(this.okButton), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
this.okButton.addEventListener("click", this.okButtonClick), this.cancelButton.addEventListener("click", this.cancelButtonClick)
}
}, {
key: "setContainerWidth", value: function () {
this.container.style.width = document.getElementById("outerContainer").clientWidth + "px"
}
}, {
key: "captchaOk", value: function (e) {
this.sealDatas.length && this.capability && e && (this.app.pdfStamp.addStamp({
sealdata: this.sealDatas,
capability: this.capability,
captcha: e
}), this.hide())
}
}, {
key: "show", value: function () {
null == this.selectSealPrompt && (this.selectSealPrompt = window.KGPdfViewerWebApp.getSelectSealPrompt()), this.app.pdfStamp.isStamp = !0, this.container.classList.remove("hidden")
}
}, {
key: "hide", value: function () {
this.container.classList.add("hidden"), window.KGPdfViewerWebApp.stampMask
}
}, {
key: "okButtonClick", value: function (e) {
e && (e.stopPropagation(), e.preventDefault()), this.sealDatas.length && this.capability && (!0 === window.KGPdfViewerWebApp.useCaptcha ? (this.app.KGCaptcha.okCallback = this.captchaOk.bind(this), this.app.KGCaptcha.open(this.sealDatas[0].phone)) : (this.app.pdfStamp.addStamp({
sealdata: this.sealDatas,
capability: this.capability
}), this.hide())), document.getElementById("KG_StampMask").style["pointer-events"] = "auto"
}
}, {
key: "cancelButtonClick", value: function (e) {
e && (e.stopPropagation(), e.preventDefault()), this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData(), this.app.pdfStamp.cancelStamp(), this.app.pdfStamp.clearTempSeals(!0), this.hide(), document.getElementById("KG_StampMask").style["pointer-events"] = "auto"
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_WatermarkConfirm = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.container = n.container, this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.setContainerWidth = this.setContainerWidth.bind(this), this.setContainerWidth(), this.createDOM = this.createDOM.bind(this), this.createDOM(), this.okButtonClick = this.okButtonClick.bind(this), this.cancelButtonClick = this.cancelButtonClick.bind(this), this.init = this.init.bind(this), this.init()
}
return r(e, [{
key: "createDOM", value: function () {
this.cancelButton = document.createElement("div"), this.cancelButton.classList.add("btn"), this.cancelButton.setAttribute("data-l10n-id", "password_cancel"), this.container.appendChild(this.cancelButton), this.okButton = document.createElement("div"), this.okButton.classList.add("btn"), this.okButton.classList.add("btn-primary"), this.okButton.setAttribute("data-l10n-id", "password_ok"), this.container.appendChild(this.okButton), this.msg = document.createElement("span"), this.msg.innerHTML = "请点击您需要盖章的位置", this.msg.style.color = "#fff", this.msg.classList.add("hidden"), this.container.appendChild(this.msg), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
this.okButton.addEventListener("click", this.okButtonClick), this.cancelButton.addEventListener("click", this.cancelButtonClick)
}
}, {
key: "setContainerWidth", value: function () {
this.container.style.width = document.getElementById("outerContainer").clientWidth + "px"
}
}, {
key: "show", value: function () {
this.container.classList.remove("hidden")
}
}, {
key: "showMsg", value: function () {
this.okButton.classList.add("hidden"), this.cancelButton.classList.add("hidden"), this.msg.classList.remove("hidden")
}
}, {
key: "hide", value: function () {
this.container.classList.add("hidden")
}
}, {
key: "hideMsg", value: function () {
this.okButton.classList.remove("hidden"), this.cancelButton.classList.remove("hidden"), this.msg.classList.add("hidden")
}
}, {
key: "okButtonClick", value: function () {
this.okCallback && this.okCallback(), this.hide()
}
}, {
key: "cancelButtonClick", value: function () {
this.hide(), this.closeCallback && this.closeCallback()
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_TextConfirm = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.container = n.container, this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.setContainerWidth = this.setContainerWidth.bind(this), this.setContainerWidth(), this.createDOM = this.createDOM.bind(this), this.createDOM(), this.init = this.init.bind(this), this.okButtonClick = this.okButtonClick.bind(this), this.cancelButtonClick = this.cancelButtonClick.bind(this), this.init(), this.selectSealPrompt = null, this.sealDatas = [], this.capability = null
}
return r(e, [{
key: "createDOM", value: function () {
this.cancelButton = document.createElement("div"), this.cancelButton.classList.add("btn"), this.cancelButton.setAttribute("data-l10n-id", "password_cancel"), this.container.appendChild(this.cancelButton), this.okButton = document.createElement("div"), this.okButton.classList.add("btn"), this.okButton.classList.add("btn-primary"), this.okButton.setAttribute("data-l10n-id", "password_ok"), this.container.appendChild(this.okButton), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
this.okButton.addEventListener("click", this.okButtonClick), this.cancelButton.addEventListener("click", this.cancelButtonClick)
}
}, {
key: "setContainerWidth", value: function () {
this.container.style.width = document.getElementById("outerContainer").clientWidth + "px"
}
}, {
key: "show", value: function () {
this.container.classList.contains("hidden") && this.container.classList.remove("hidden")
}
}, {
key: "hide", value: function () {
this.container.classList.add("hidden")
}
}, {
key: "okButtonClick", value: function (e) {
e && (e.stopPropagation(), e.preventDefault());
var t = this.app.KGPdfViewerWebApp.PDFViewerApplication.KG_TextWidget.getTextWidgetValue();
this.app.KGPdfViewerWebApp.modifyText(t), this.hide()
}
}, {
key: "cancelButtonClick", value: function (e) {
e && (e.stopPropagation(), e.preventDefault()), this.hide()
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_DocSignConfirm = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.container = n.container, this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.setContainerWidth = this.setContainerWidth.bind(this), this.setContainerWidth(), this.createDOM = this.createDOM.bind(this), this.createDOM(), this.init = this.init.bind(this), this.okButtonClick = this.okButtonClick.bind(this), this.cancelButtonClick = this.cancelButtonClick.bind(this), this.init(), this.selectSealPrompt = null, this.sealDatas = [], this.capability = null
}
return r(e, [{
key: "createDOM", value: function () {
this.cancelButton = document.createElement("div"), this.cancelButton.classList.add("btn"), this.cancelButton.setAttribute("data-l10n-id", "password_cancel"), this.container.appendChild(this.cancelButton), this.okButton = document.createElement("div"), this.okButton.classList.add("btn"), this.okButton.classList.add("btn-primary"), this.okButton.setAttribute("data-l10n-id", "password_ok"), this.container.appendChild(this.okButton), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
this.okButton.addEventListener("click", this.okButtonClick), this.cancelButton.addEventListener("click", this.cancelButtonClick)
}
}, {
key: "setContainerWidth", value: function () {
this.container.style.width = document.getElementById("outerContainer").clientWidth + "px"
}
}, {
key: "show", value: function () {
this.container.classList.contains("hidden") && this.container.classList.remove("hidden")
}
}, {
key: "hide", value: function () {
this.container.classList.add("hidden")
}
}, {
key: "okButtonClick", value: function (e) {
e && (e.stopPropagation(), e.preventDefault()), this.app.KG_DocSign.onOk(), this.hide()
}
}, {
key: "cancelButtonClick", value: function (e) {
e && (e.stopPropagation(), e.preventDefault()), this.app.KG_DocSign.onClose(), this.hide()
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_PagingSeal = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(2);
function a(e, t) {
for (var n = [], r = Math.floor(e / t), i = e % t, a = 0; a < t; a++) n.push(r);
for (var o = 0; o < i; o++) n[o] += 1;
return n
}
t.KG_PagingSeal = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.init = this.init.bind(this), this.onBeginPageChange = this.onBeginPageChange.bind(this), this.onEndPageChange = this.onEndPageChange.bind(this), this.computePagesCount = this.computePagesCount.bind(this), this.disablePageType = this.disablePageType.bind(this), this.onAveragePageNumChange = this.onAveragePageNumChange.bind(this), this.onFirstPagePercentChange = this.onFirstPagePercentChange.bind(this), this.onOtherPageNumChange = this.onOtherPageNumChange.bind(this);
var a = window.KGPdfViewerWebApp, o = a.paginSealDefaultConfig, s = a.paginSealConfig, l = o;
a.scanStamp && s && (l = (0, i.mergerConfig)(l, s)), this.defaultConfig = l, this.reset = this.reset.bind(this), this.open = this.open.bind(this), this.onOk = this.onOk.bind(this), this.close = this.close.bind(this), this.app = t, this.overlayName = n.overlayName, this.overlayManager = r, this.container = n.container, this.init(), this.overlayManager.register(this.overlayName, this.container, this.close, !1)
}
return r(e, [{
key: "init", value: function () {
this.container.innerHTML = '\n <div class="kg_dialog_header">\n <div class="kg_dialog_title" data-l10n-id="pagingSeal_title">骑缝章</div>\n <button class="kg_dialog_close">×</button>\n </div>\n <div class="dialog">\n <fieldset class="KG_Form_Fieldset">\n <legend class="KG_Form_Legend" data-l10n-id="pagingSeal_pageRange">页面范围</legend>\n <div class="KG_Form_Item">\n <label class="KG_Form_Label" data-l10n-id="pagingSeal_beginPage">起始页:</label>\n <input class="kgInput" type="number" min="1" id="KG_PagingSeal_BeginPage">\n <label class="KG_Form_Label" data-l10n-id="pagingSeal_endPage">结束页:</label>\n <input class="kgInput" type="number" min="1" id="KG_PagingSeal_EndPage">\n </div>\n </fieldset>\n <fieldset class="KG_Form_Fieldset">\n <legend class="KG_Form_Legend" data-l10n-id="pagingSeal_pageRange">页面范围</legend>\n <div class="KG_Form_Item">\n <div class="kg_radio_wrapper">\n <input type="radio" name="KG_PagingSeal_Range" checked id="KG_PagingSeal_AllPage">\n <label class="KG_Form_Label" data-l10n-id="pagingSeal_allPage">全部页</label>\n </div>\n <div class="kg_radio_wrapper">\n <input type="radio" name="KG_PagingSeal_Range" checked id="KG_PagingSeal_OddPage">\n <label class="KG_Form_Label" data-l10n-id="pagingSeal_oddPage">奇数页</label>\n </div>\n <div class="kg_radio_wrapper">\n <input type="radio" name="KG_PagingSeal_Range" checked id="KG_PagingSeal_EvenPage">\n <label class="KG_Form_Label" data-l10n-id="pagingSeal_evenPage">偶数页</label>\n </div>\n </div>\n </fieldset>\n <fieldset class="KG_Form_Fieldset">\n <legend class="KG_Form_Legend" data-l10n-id="pagingSeal_pageConfig">印章设置</legend>\n <div class="KG_Form_Item kg_radio_wrapper">\n <input type="radio" name="KG_PagingSeal_Setting" id="KG_PagingSeal_Setting_1" checked>\n <label class="KG_Form_Label" data-l10n-id="pagingSeal_average">平均分配</label>\n </div>\n <div class="KG_Form_Item">\n <span data-l10n-id="pagingSeal_config_label_1">每</span>\n <input class="kgInput" type="number" min="2" max="30" value="2" id="KG_PagingSeal_AveragePageNum">\n <span data-l10n-id="pagingSeal_config_label_2">页平分一个骑缝章,如此循环。</span>\n </div>\n </fieldset>\n <fieldset class="KG_Form_Fieldset">\n <legend class="KG_Form_Legend" data-l10n-id="pagingSeal_pageConfig">印章设置</legend>\n <div class="KG_Form_Item kg_radio_wrapper">\n <input type="radio" name="KG_PagingSeal_Setting" id="KG_PagingSeal_Setting_2" checked>\n <label class="KG_Form_Label" data-l10n-id="pagingSeal_firstPage">首页占比</label>\n </div>\n <div class="KG_Form_Item">\n <span data-l10n-id="pagingSeal_config_label_3">首页占骑缝章比例为</span>\n <input class="kgInput" type="number" min="1" max="100" value="50" id="KG_PagingSeal_FirstPagePercent">\n %\n </div>\n <div class="KG_Form_Item">\n <span data-l10n-id="pagingSeal_config_label_4">其余每</span>\n <input class="kgInput" type="number" min="2" max="30" value="2" id="KG_PagingSeal_OtherPageNum">\n <span data-l10n-id="pagingSeal_config_label_5">页平分一个骑缝章,如此循环</span>\n </div>\n </fieldset>\n <div class="KG_Form_Footer">\n <button id="KG_PagingSeal_CancalBtn" class="btn" data-l10n-id="password_cancel">取 消</button>\n <button id="KG_PagingSeal_OkBtn" class="btn btn-primary" style="margin-left: 15px;" data-l10n-id="password_ok">确 定</button>\n </div>\n </div>\n ', this.app.l10n.translate(this.container), this.beginPageInput = this.container.querySelector("#KG_PagingSeal_BeginPage"), this.beginPageInput.onchange = this.onBeginPageChange, this.endPageInput = this.container.querySelector("#KG_PagingSeal_EndPage"), this.endPageInput.onchange = this.onEndPageChange, this.allPageRadio = this.container.querySelector("#KG_PagingSeal_AllPage"), this.allPageRadioWrapper = this.container.querySelectorAll(".kg_radio_wrapper")[0], this.oddPageRadio = this.container.querySelector("#KG_PagingSeal_OddPage"), this.oddPageRadioWrapper = this.container.querySelectorAll(".kg_radio_wrapper")[1], this.evenPageRadio = this.container.querySelector("#KG_PagingSeal_EvenPage"), this.evenPageRadioWrapper = this.container.querySelectorAll(".kg_radio_wrapper")[2], this.allPageRadioWrapper.onclick = this.oddPageRadioWrapper.onclick = this.evenPageRadioWrapper.onclick = this.onPageTypeChange.bind(this), this.setting1Radio = this.container.querySelector("#KG_PagingSeal_Setting_1"), this.setting1RadioWrapper = this.container.querySelectorAll(".kg_radio_wrapper")[3], this.setting2Radio = this.container.querySelector("#KG_PagingSeal_Setting_2"), this.setting2RadioWrapper = this.container.querySelectorAll(".kg_radio_wrapper")[4], this.setting1RadioWrapper.onclick = this.setting2RadioWrapper.onclick = this.disablePageSetting.bind(this), this.averagePageNumInput = this.container.querySelector("#KG_PagingSeal_AveragePageNum"), this.averagePageNumInput.onchange = this.onAveragePageNumChange, this.firstPagePercentInput = this.container.querySelector("#KG_PagingSeal_FirstPagePercent"), this.firstPagePercentInput.onchange = this.onFirstPagePercentChange, this.otherPageNumInput = this.container.querySelector("#KG_PagingSeal_OtherPageNum"), this.otherPageNumInput.onchange = this.onOtherPageNumChange.bind(this), this.cancelBtn = this.container.querySelector("#KG_PagingSeal_CancalBtn"), this.cancelBtn.onclick = this.close, this.okBtn = this.container.querySelector("#KG_PagingSeal_OkBtn"), this.okBtn.onclick = this.onOk, this.closeBtn = this.container.querySelector(".kg_dialog_close"), this.closeBtn.onclick = this.close
}
}, {
key: "reset", value: function () {
var e = void 0, t = this.app.KGAlertPrompt, n = this.defaultConfig, r = n.beginPage, i = n.range, a = n.setting,
o = n.otherPageNum, s = n.averagePageNum, l = n.firstPagePercent;
this.beginPageInput.value = r, this.beginPageInput.disabled = !1, e = this.defaultConfig.endPage && this.defaultConfig.endPage <= this.app.pagesCount ? this.defaultConfig.endPage : this.app.pagesCount, this.endPageInput.value = e, this.endPageInput.disabled = !1, this.allPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.oddPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.evenPageRadioWrapper.classList.remove("kg_radio_wrapper-checked");
var c = i + "Radio";
this[i + "RadioWrapper"].classList.add("kg_radio_wrapper-checked"), this[c].checked = !0, 1 == a ? (this.setting1Radio.checked = !0, this.setting1RadioWrapper.classList.add("kg_radio_wrapper-checked"), this.setting2RadioWrapper.classList.remove("kg_radio_wrapper-checked"), s && (s > this.app.pagesCount && (t.open("您设置的页码已超过当前文档页数"), this.isConfigError = !0), s < 2 && (t.open("不能小于2页分配一个印章"), this.isConfigError = !0))) : (this.setting2Radio.checked = !0, this.setting2RadioWrapper.classList.add("kg_radio_wrapper-checked"), this.setting1RadioWrapper.classList.remove("kg_radio_wrapper-checked"), o && (o > this.app.pagesCount && (t.open("您设置的页码已超过当前文档页数"), this.isConfigError = !0), o > 30 && (t.open("最多不能超过30页分配一个印章"), this.isConfigError = !0)), l && (l < 4 && (t.open("印章宽度最小不能小于4%"), l = 4, this.isConfigError = !0), l > 97 && (t.open("印章宽度最大不能超过97%"), l = 97, this.isConfigError = !0))), this.averagePageNumInput.value = s || 2, this.firstPagePercentInput.value = l || 50, this.otherPageNumInput.value = o || 2
}
}, {
key: "onBeginPageChange", value: function () {
var e = parseInt(this.beginPageInput.value), t = parseInt(this.endPageInput.value),
n = parseInt(this.averagePageNumInput.value), r = parseInt(this.otherPageNumInput.value),
i = this.computePagesCount();
isNaN(e) && (e = 1), e < 1 && (e = 1), e >= t && (e = t - 1), this.beginPageInput.value = e, n > i && (this.averagePageNumInput.value = 2), r > i - 1 && (this.otherPageNumInput.value = 2), this.disablePageType()
}
}, {
key: "onEndPageChange", value: function () {
var e = parseInt(this.beginPageInput.value), t = parseInt(this.endPageInput.value),
n = parseInt(this.averagePageNumInput.value), r = parseInt(this.otherPageNumInput.value),
i = this.computePagesCount(), a = this.app.pagesCount;
isNaN(t) && (t = a), t <= e && (t = e + 1), t > a && (t = a), this.endPageInput.value = t, n > i && (this.averagePageNumInput.value = 2), r > i - 1 && (this.otherPageNumInput.value = 2), this.disablePageType()
}
}, {
key: "resetAndDisablePageRange", value: function () {
var e = this.defaultConfig.beginPage;
this.beginPageInput.value = e, this.beginPageInput.disabled = !0;
var t = void 0;
t = this.defaultConfig.endPage && this.defaultConfig.endPage <= this.app.pagesCount ? this.defaultConfig.endPage : this.app.pagesCount, this.endPageInput.value = t, this.endPageInput.disabled = !0
}
}, {
key: "onPageTypeChange", value: function (e) {
switch (e.currentTarget.querySelector('input[type="radio"]').id) {
case this.allPageRadio.id:
this.allPageRadio.checked = !0, this.allPageRadioWrapper.classList.add("kg_radio_wrapper-checked"), this.oddPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.evenPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.beginPageInput.disabled = !1, this.endPageInput.disabled = !1;
break;
case this.oddPageRadio.id:
this.oddPageRadio.checked = !0, this.allPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.oddPageRadioWrapper.classList.add("kg_radio_wrapper-checked"), this.evenPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.resetAndDisablePageRange();
break;
case this.evenPageRadio.id:
this.evenPageRadio.checked = !0, this.allPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.oddPageRadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.evenPageRadioWrapper.classList.add("kg_radio_wrapper-checked"), this.resetAndDisablePageRange()
}
var t = parseInt(this.averagePageNumInput.value), n = parseInt(this.otherPageNumInput.value),
r = this.computePagesCount();
t > r && (this.averagePageNumInput.value = 2), n > r - 1 && (this.otherPageNumInput.value = 2)
}
}, {
key: "computePagesCount", value: function () {
var e = parseInt(this.beginPageInput.value), t = parseInt(this.endPageInput.value),
n = this.allPageRadio.checked, r = this.oddPageRadio.checked, i = this.evenPageRadio.checked, a = 0;
if (n && (a = t - e + 1), r) for (var o = e; o <= t; o++) o % 2 != 0 && (a += 1);
if (i) for (var s = e; s <= t; s++) s % 2 == 0 && (a += 1);
return a
}
}, {
key: "disablePageType", value: function () {
var e = parseInt(this.beginPageInput.value);
parseInt(this.endPageInput.value) - e <= 2 ? (this.oddPageRadio.disabled = !0, this.evenPageRadio.disabled = !0) : (this.oddPageRadio.disabled = !1, this.evenPageRadio.disabled = !1)
}
}, {
key: "disablePageSetting", value: function (e) {
if (e) switch (e.currentTarget.querySelector('input[type="radio"]').id) {
case this.setting1Radio.id:
this.setting1Radio.checked = !0, this.setting1RadioWrapper.classList.add("kg_radio_wrapper-checked"), this.setting2RadioWrapper.classList.remove("kg_radio_wrapper-checked");
break;
case this.setting2Radio.id:
this.setting2Radio.checked = !0, this.setting1RadioWrapper.classList.remove("kg_radio_wrapper-checked"), this.setting2RadioWrapper.classList.add("kg_radio_wrapper-checked")
}
!0 === this.setting1Radio.checked ? (this.firstPagePercentInput.disabled = !0, this.otherPageNumInput.disabled = !0, this.averagePageNumInput.disabled = !1) : (this.firstPagePercentInput.disabled = !1, this.otherPageNumInput.disabled = !1, this.averagePageNumInput.disabled = !0)
}
}, {
key: "onAveragePageNumChange", value: function () {
var e = parseInt(this.averagePageNumInput.value), t = this.computePagesCount(), n = this.app.KGAlertPrompt;
n.closeCallback = null, isNaN(e) && (n.open("请输入一个数字"), e = 2), e < 2 && (n.open("不能小于2页分配一个印章"), e = 2), e > 30 && (n.open("最多不能超过30页分配一个印章"), e = 30), e > t && (n.open("您设置的页码已超过当前文档页数"), e = 2), this.averagePageNumInput.value = e
}
}, {
key: "onFirstPagePercentChange", value: function (e) {
var t = parseInt(this.firstPagePercentInput.value), n = this.app.KGAlertPrompt;
n.closeCallback = null, isNaN(t) && (n.open("请输入一个数字"), t = 50), t < 4 && (n.open("印章宽度最小不能小于4%"), t = 4), t > 97 && (n.open("印章宽度最大不能超过97%"), t = 97), this.firstPagePercentInput.value = t
}
}, {
key: "onOtherPageNumChange", value: function () {
var e = parseInt(this.otherPageNumInput.value), t = this.computePagesCount(), n = this.app.KGAlertPrompt;
n.closeCallback = null, isNaN(e) && (n.open("请输入一个数字"), e = 2), e < 2 && (n.open("不能小于2页分配一个印章"), e = 2), e > 30 && (n.open("最多不能超过30页分配一个印章"), e = 30), e > t - 1 && (n.open("您设置的页码已超过当前文档页数"), e = 2), this.otherPageNumInput.value = e
}
}, {
key: "onOk", value: function () {
var e = this, t = {
qfzSeal: [],
imgExt: this.img.imgExt,
keySN: this.img.keySN,
signName: this.img.signName,
signSN: this.img.signSN,
unitName: this.img.unitName,
userName: this.img.userName,
pageAttr: {}
}, n = parseInt(this.beginPageInput.value), r = parseInt(this.endPageInput.value);
t.pageAttr.startPage = n, t.pageAttr.endPage = r, this.oddPageRadio.checked ? t.pageAttr.model = "oddPage" : this.evenPageRadio.checked ? t.pageAttr.model = "evenPage" : t.pageAttr.model = "allPage";
for (var i = n; i < r + 1; i++) this.oddPageRadio.checked ? i % 2 == 1 && t.qfzSeal.push({page: i}) : this.evenPageRadio.checked ? i % 2 == 0 && t.qfzSeal.push({page: i}) : t.qfzSeal.push({page: i});
var o = new Image;
o.src = this.img.imgdata, o.onload = function () {
var n = o.width, r = o.height, i = e.app.KGAlertPrompt;
if (i.closeCallback = null, e.setting1Radio.checked) {
var s = parseInt(e.averagePageNumInput.value), l = a(n, s), c = t.qfzSeal.length % s;
if (t.pageAttr.qfzModel = 1, 0 === c) for (var u = 0; u < t.qfzSeal.length; u++) t.qfzSeal[u].width = l[u % l.length]; else if (1 === c) {
var d = Math.max(t.qfzSeal.length - l.length - 1, 0);
if (0 === d) return void i.open("当前设置无法分配骑缝章");
for (var h = 0; h < d; h++) t.qfzSeal[h].width = l[h % l.length];
for (var p = a(n, l.length + 1), f = d; f < t.qfzSeal.length; f++) t.qfzSeal[f].width = p[f % d]
} else {
for (var m = t.qfzSeal.length - c, v = 0; v < m; v++) t.qfzSeal[v].width = l[v % l.length];
for (var g = a(n, c), y = m; y < t.qfzSeal.length; y++) t.qfzSeal[y].width = g[y % m]
}
}
if (e.setting2Radio.checked) {
var b = parseInt(e.firstPagePercentInput.value), w = parseInt(e.otherPageNumInput.value);
t.pageAttr.qfzModel = 2, t.pageAttr.number = w + 1, t.pageAttr.precent = Math.floor(b / 100 * 100) / 100, t.qfzSeal[0].width = Math.round(n * (b / 100));
for (var S = a(Math.round(n * (1 - b / 100)), Math.min(w, e.app.pagesCount - 1)), _ = 0; _ < S.length; _++) t.qfzSeal[_ + 1].width = S[_];
var k = [t.qfzSeal[0].width].concat(S), x = t.qfzSeal.length - k.length, P = S.length + 1, C = x % (w + 1);
if (0 === C) for (var A = 0; A < x; A++) t.qfzSeal[A + P].width = k[A % k.length]; else if (1 === C) {
var T = t.qfzSeal.length - k.length - 1;
if (0 === T) return void i.open("当前设置无法分配骑缝章");
for (var E = 0; E < T - P; E++) t.qfzSeal[E + P].width = k[E % k.length];
t.qfzSeal[T].width = k[0];
for (var D = a(n - k[0], k.length), I = T + 1; I < t.qfzSeal.length; I++) t.qfzSeal[I].width = D[(I - 1) % D.length]
} else {
for (var L = t.qfzSeal.length - C, O = 0; O < L - P; O++) t.qfzSeal[O + P].width = k[O % k.length];
t.qfzSeal[L].width = k[0];
for (var M = a(n - k[0], C - 1), N = L + 1, R = N; R < t.qfzSeal.length; R++) t.qfzSeal[R].width = M[R % N]
}
} else t.pageAttr.number = e.averagePageNumInput.value, t.pageAttr.precent = .5;
var W = 0;
t.qfzSeal.forEach(function (t) {
t.height = r;
var i = document.createElement("canvas");
i.width = t.width, i.height = t.height;
var a = i.getContext("2d");
a.fillStyle = "#fff", a.fillRect(0, 0, i.width, i.height), a.drawImage(o, W, 0, t.width, t.height, 0, 0, t.width, t.height), (W += t.width) >= n && (W = 0), t.imgdata = i.toDataURL("image/" + e.img.imgExt, 1), -1 === t.imgdata.indexOf("image/" + e.img.imgExt) && (t.imgdata = t.imgdata.replace(/image\/png/, "image/" + e.img.imgExt))
});
var V = window.KGPdfViewerWebApp.selectSealPrompt;
V.seals[V.sealIdx].pageAttr = t.pageAttr, V.seals[V.sealIdx].qfzSeal = t.qfzSeal, V.capability && V.capability.resolve(), e.needToCloseOverlay && e.close()
}
}
}, {
key: "open", value: function (e) {
var t = this;
this.overlayManager.open(this.overlayName).then(function () {
if (t.reset(), t.needToCloseOverlay = !0, t.img = e, t.img.imgExt || (t.img.imgExt = "png"), !t.hasInit) {
t.hasInit = !0;
var n = t.app.pagesCount;
t.beginPageInput.value = t.beginPageInput.min = t.endPageInput.min = 1, t.beginPageInput.max = t.endPageInput.max = t.endPageInput.value = n
}
t.disablePageType(), t.disablePageSetting()
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.needToCloseOverlay = !1;
var t = window.KGPdfViewerWebApp.selectSealPrompt;
t.seals[t.sealIdx].qfzSeal || (t.pagingSeal.checked = !1, t.showPagingSealConfig.style.display = "none", t.pagingSealWrapper.classList.remove("kg_checkbox_wrapper-checked"))
})
}
}, {
key: "noSelectSealPrompt", value: function (e) {
this.img = e, this.reset(), !this.isConfigError && this.onOk()
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t;
var r = window.KGPdfViewerWebApp.btnPositionConfig, i = r.toolbar, a = r.sidebar;
i.indexOf("download") > -1 && (this.downloadButton = n.download, this.downloadButton.removeAttribute("hidden"), this.downloadButton.addEventListener("click", this.download)), a.indexOf("download") > -1 && (this.secondaryButton = n.secondaryDownload, this.secondaryButton.removeAttribute("hidden"), this.secondaryButton.addEventListener("click", this.download))
}
return r(e, [{
key: "download", value: function () {
window.KGPdfViewerWebApp.downloadDoc()
}
}]), e
}();
t.KG_Download = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_GuideTip = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(2);
var a = "KG_GuideTip_NeverShow";
t.KG_GuideTip = function () {
function e(t, n) {
if (function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.container = n.container, this.title = this.container.querySelector(".KG_GuideTip_Title"), this.content = this.container.querySelector(".KG_GuideTip_Content"), this.closeBtn = this.container.querySelector(".KG_GuideTip_Close"), this.closeBtn.onclick = this.close.bind(this), this.nextBtn = this.container.querySelector(".KG_GuideTip_Next"), this.nextBtn.onclick = this.next.bind(this), this.neverShowBtn = this.container.querySelector(".KG_GuideTip_NeverShow"), this.neverShowBtn.onclick = this.closeAndNeverShow.bind(this), this.neverShow = !1, (0, i.getCookieOrStorage)(a) && (this.neverShow = !0), this.step = 0, this.steps = [{
title: {
"zh-CN": "左侧边栏",
"zh-TW": "左側邊欄",
"en-US": "Left sidebar"
},
content: {
"zh-CN": "点击展开左侧边栏,查看文档缩略图、大纲、附件和书签信息",
"zh-TW": "點擊展開左側邊欄,查看文檔縮略圖、大綱、附件和書簽信息",
"en-US": "Click to expand the left sidebar to view the document thumbnail, outline, attachment and bookmark information"
},
left: "4px",
arrow: "left"
}, {
title: {"zh-CN": "搜索", "zh-TW": "搜索", "en-US": "Search"},
content: {"zh-CN": "搜索文档", "zh-TW": "搜索文檔", "en-US": "Search documents"},
right: "52px",
arrow: "right"
}, {
title: {"zh-CN": "右侧边栏", "zh-TW": "右側邊欄", "en-US": "Right sidebar"},
content: {
"zh-CN": "点击展开右侧边栏,显示更多功能",
"zh-TW": "點擊展開右側邊欄,顯示更多功能",
"en-US": "Click to expand the right sidebar to show more functions"
},
right: "4px",
arrow: "right"
}], !this.neverShow) {
for (var r = window.KGPdfViewerWebApp.btnPositionConfig.toolbar, o = [{
title: {
"zh-CN": "电子签章",
"zh-TW": "電子簽章",
"en-US": "Electronic seal"
},
content: {"zh-CN": "加盖电子签章", "zh-TW": "加蓋電子簽章", "en-US": "Affix an electronic seal"},
key: "stamp",
condition: (0, i.functionalJudgment)("stamp") && r.indexOf("stamp") > -1
}, {
title: {"zh-CN": "预盖章", "zh-TW": "預蓋章", "en-US": "Prepare stamp"},
content: {"zh-CN": "预盖章", "zh-TW": "預蓋章", "en-US": "Prepare stamp"},
key: "prepareStamp",
condition: (0, i.functionalJudgment)("prepareStamp") && r.indexOf("prepareStamp") > -1
}, {
title: {"zh-CN": "手写签名", "zh-TW": "手寫簽名", "en-US": "Handwritten signature"},
content: {"zh-CN": "手写签名", "zh-TW": "手寫簽名", "en-US": "Handwritten signature"},
key: "signature",
condition: (0, i.functionalJudgment)("signature") && r.indexOf("signature") > -1
}, {
title: {"zh-CN": "下载文档", "zh-TW": "下載文檔", "en-US": "Download document"},
content: {"zh-CN": "下载文档", "zh-TW": "下載文檔", "en-US": "Download document"},
key: "download",
condition: (0, i.functionalJudgment)("download") && r.indexOf("download") > -1
}, {
title: {"zh-CN": "扫码签", "zh-TW": "掃碼簽", "en-US": "Scan code"},
content: {
"zh-CN": "扫码加盖电子签章",
"zh-TW": "掃碼加蓋電子簽章",
"en-US": "Scan the code and affix the electronic signature"
},
key: "scanStamp",
condition: (0, i.functionalJudgment)("scanStamp") && r.indexOf("scanStamp") > -1
}, {
title: {"zh-CN": "转文章", "zh-TW": "轉文章", "en-US": "Text to Seal"},
content: {"zh-CN": "加盖转文章", "zh-TW": "加蓋轉文章", "en-US": "Stamped to the article"},
key: "textToSeal",
condition: (0, i.functionalJudgment)("textToSeal") && r.indexOf("textToSeal") > -1
}, {
title: {"zh-CN": "导出批注数据", "zh-TW": "導出批註數據", "en-US": "Export annotation data"},
content: {"zh-CN": "导出批注数据", "zh-TW": "導出批註數據", "en-US": "Export annotation data"},
key: "exportAnnotations",
condition: (0, i.functionalJudgment)("textToSeal") && r.indexOf("exportAnnotations") > -1
}, {
title: {"zh-CN": "保存文档", "zh-TW": "保存文檔", "en-US": "Save the document"},
content: {"zh-CN": "保存文档", "zh-TW": "保存文檔", "en-US": "Save the document"},
key: "docSave",
condition: (0, i.functionalJudgment)("textToSeal") && r.indexOf("docSave") > -1
}, {
title: {"zh-CN": "另存为", "zh-TW": "另存為", "en-US": "Save document as"},
content: {"zh-CN": "另存为", "zh-TW": "另存為", "en-US": "Save document as"},
key: "docSaveAs",
condition: (0, i.functionalJudgment)("textToSeal") && r.indexOf("docSaveAs") > -1
}, {
title: {"zh-CN": "添加水印", "zh-TW": "添加水印", "en-US": "Add watermark"},
content: {"zh-CN": "添加水印", "zh-TW": "添加水印", "en-US": "Add watermark"},
key: "watermark",
condition: (0, i.functionalJudgment)("watermark") && r.indexOf("watermark") > -1
}, {
title: {"zh-CN": "打印文档", "zh-TW": "打印文檔", "en-US": "Print document"},
content: {"zh-CN": "打印文档", "zh-TW": "打印文檔", "en-US": "Print document"},
key: "print",
condition: (0, i.functionalJudgment)("print") && r.indexOf("print") > -1
}], s = [], l = 0; l < o.length; l++) {
var c = o[l];
r.indexOf(c.key) > -1 && c.condition && s.push(c)
}
var u = document.body.clientWidth;
s.length && (u <= 768 ? (s[0].arrow = "middleRight", s[0].right = "44px") : u > 768 && (2 === s.length && (s[0].arrow = "right", s[1].arrow = "right", u <= 960 ? (s[1].right = "100px", s[0].right = "150px") : (s[1].right = "140px", s[0].right = "240px")), 1 === s.length && (s[0].arrow = "right", s[0].right = u <= 960 ? "102px" : "142px")), 2 === s.length ? this.steps.splice(1, 0, s[0], s[1]) : this.steps.splice(1, 0, s[0])), this.show()
}
}
return r(e, [{
key: "next", value: function () {
this.step >= this.steps.length - 1 && (this.nextBtn.setAttribute("hidden", !0), this.closeBtn.classList.add("btn-primary")), this.title.innerHTML = this.steps[this.step].title[this.app.l10n._lang], this.content.innerHTML = this.steps[this.step].content[this.app.l10n._lang], this.container.classList.remove("left"), this.container.classList.remove("middle"), this.container.classList.remove("right"), this.steps[this.step].left && (this.container.style.left = this.steps[this.step].left, this.container.style.right = ""), this.steps[this.step].right && (this.container.style.right = this.steps[this.step].right, this.container.style.left = ""), this.container.classList.add(this.steps[this.step].arrow), this.step++
}
}, {
key: "show", value: function () {
this.container.removeAttribute("hidden"), this.next()
}
}, {
key: "close", value: function () {
this.step >= this.steps.length - 1 ? this.closeAndNeverShow() : this.container.setAttribute("hidden", !0)
}
}, {
key: "closeAndNeverShow", value: function () {
this.container.setAttribute("hidden", !0), (0, i.setCookieOrStorage)(a, !0, {expires: 365})
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_InsetPageNum = function () {
function e(t, n) {
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1e3;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.container = n.mainContainer, this.viwerPages = this.container.querySelector("#viewer").children, this.len = this.viwerPages.length, this.delay = r, this.flag = !1, this.init()
}
return r(e, [{
key: "init", value: function () {
this.createDom(), this.container.addEventListener("scroll", this.debounceScroll(this.delay), !0)
}
}, {
key: "debounceScroll", value: function (e) {
var t = void 0, n = this;
return function () {
n.show(), clearTimeout(t), t = setTimeout(function () {
n.hide()
}, e)
}
}
}, {
key: "createDom", value: function () {
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.app.pdfViewer.currentScaleValue;
this.delDom();
for (var e = 0; e < this.len; e++) {
var t = document.createElement("div");
t.innerHTML = e + 1, t.classList.add("kg_pageNum"), this.viwerPages[e].appendChild(t)
}
}
}, {
key: "delDom", value: function () {
for (var e = this.container.querySelectorAll(".kg_pageNum"), t = 0; t < e.length; t++) e[t].remove()
}
}, {
key: "show", value: function () {
if (!this.flag) {
for (var e = 0; e < this.len; e++) if (this.viwerPages[e] && this.viwerPages[e].childNodes) for (var t = 0; t < this.viwerPages[e].childNodes.length; t++) if ("kg_pageNum" == this.viwerPages[e].childNodes[t].className) {
this.viwerPages[e].childNodes[t].style.opacity = "1";
break
}
this.flag = !0
}
}
}, {
key: "hide", value: function () {
for (var e = 0; e < this.len; e++) if (this.viwerPages[e] && this.viwerPages[e].childNodes) for (var t = 0; t < this.viwerPages[e].childNodes.length; t++) if ("kg_pageNum" == this.viwerPages[e].childNodes[t].className) {
this.viwerPages[e].childNodes[t].style.opacity = "0";
break
}
this.flag = !1
}
}, {
key: "update", value: function (e) {
this.createDom(e), this.container.addEventListener("scroll", this.debounceScroll(this.delay), !0)
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_BlockChain = void 0;
var r, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(21), o = n(2), s = n(124), l = (r = s) && r.__esModule ? r : {default: r};
t.KG_BlockChain = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.overlayName = n.overlayName, this.container = n.container, this.blockChainData = null, this.cancelToken = null, this.createLifeCyclePromptDOM(), this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !1)
}
return i(e, [{
key: "getChainInfo", value: function (e, t, n) {
var r = this;
n.innerHTML = "";
var i = this.createLoadingDom(n);
this.cancelToken = a.axios.CancelToken.source();
var s = {
withCredentials: !0,
cancelToken: this.cancelToken.token,
headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}
}, l = {
action: "verifyBlockChain",
stampTime: e,
stampDatahHash: t,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
i.style.display = "block", a.axios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, o.transformData)(l), s).then(function (e) {
if (i.style.display = "none", e.data) {
if (!1 === e.data.status) return Promise.reject(e.data.message);
var t = e.data.data;
r.createVerifyDom(t.verify, n), t.blockChainId && r.createBlockChainIdDom(t.blockChainId, n), t.stampData && r.createStampDataDom(t.stampData, n), t.stampData && r.createLifeCycleDOM(JSON.parse(t.stampData).sealName, t.sealLifeCycleDatas, n)
}
}).catch(function (e) {
i.style.display = "none", r.cancelToken && (r.app.KGAlertPrompt.closeCallback = null, r.app.KGAlertPrompt.open(e))
})
}
}, {
key: "createLoadingDom", value: function (e) {
var t = document.createElement("div");
return t.classList.add("KG_Block_Loading"), t.classList.add("kg_icon"), t.innerHTML = "正在验证上链数据...", e.appendChild(t), t
}
}, {
key: "createVerifyDom", value: function (e, t) {
var n = document.createElement("div");
n.classList.add("KG_Block_Item"), n.classList.add("KG_Clearfix");
var r = document.createElement("label");
r.innerHTML = "核验结果:", n.appendChild(r);
var i = document.createElement("span");
i.classList.add("kg_copyright_status"), i.style.width = "auto", "3" === e ? (i.innerHTML = "异常", i.classList.remove("kg_copyright_status_warn"), i.classList.remove("kg_copyright_status_success"), i.classList.add("kg_copyright_status_error")) : "0" === e ? (i.innerHTML = "未上链", i.classList.add("kg_copyright_status_warn"), i.classList.remove("kg_copyright_status_success"), i.classList.remove("kg_copyright_status_error")) : ("1" === e && (i.innerHTML = "有效", i.classList.remove("kg_copyright_status_warn"), i.classList.add("kg_copyright_status_success"), i.classList.remove("kg_copyright_status_error")), "2" === e && (i.innerHTML = "无效", i.classList.remove("kg_copyright_status_warn"), i.classList.remove("kg_copyright_status_success"), i.classList.add("kg_copyright_status_error"))), n.appendChild(i), t.appendChild(n)
}
}, {
key: "createBlockChainIdDom", value: function (e, t) {
var n = document.createElement("div");
n.classList.add("KG_Block_Item"), n.classList.add("KG_Clearfix");
var r = document.createElement("label");
r.innerHTML = "存证凭据:", n.appendChild(r);
var i = document.createElement("span");
i.classList.add("KG_Tooltip_Wrapper"), n.appendChild(i);
var a = document.createElement("span");
a.innerHTML = e, a.classList.add("KG_Block_Data"), i.appendChild(a);
var o = document.createElement("span");
o.classList.add("KG_Tooltip"), o.innerHTML = e, i.appendChild(o);
var s = document.createElement("span");
s.classList.add("KG_Tooltip_Wrapper"), n.appendChild(s);
var c = document.createElement("span");
c.classList.add("KG_VerifySealPrompt_Tip_Copy"), c.innerHTML = "复制", s.appendChild(c);
var u = document.createElement("span");
u.classList.add("KG_Tooltip"), u.innerHTML = "已复制", u.style.left = "-56px", u.style.width = "42px", s.appendChild(u), new l.default(c, {
text: function () {
return s.classList.add("KG_Show_Tooltip"), setTimeout(function () {
s.classList.remove("KG_Show_Tooltip")
}, 750), e
}
}), i.onmouseenter = function () {
i.classList.add("KG_Show_Tooltip")
}, i.onmouseleave = function () {
i.classList.remove("KG_Show_Tooltip")
}, t.appendChild(n)
}
}, {
key: "createStampDataDom", value: function (e, t) {
var n = document.createElement("div");
n.classList.add("KG_Block_Item"), n.classList.add("KG_Clearfix");
var r = document.createElement("label");
r.innerHTML = "上链数据:", n.appendChild(r);
var i = document.createElement("span");
i.classList.add("KG_Tooltip_Wrapper"), n.appendChild(i);
var a = document.createElement("span");
a.classList.add("KG_Block_Data"), a.innerHTML = e, i.appendChild(a);
var o = document.createElement("span");
o.classList.add("KG_Tooltip_Wrapper"), n.appendChild(o);
var s = document.createElement("span");
s.classList.add("KG_VerifySealPrompt_Tip_Copy"), s.innerHTML = "复制", o.appendChild(s);
var c = document.createElement("span");
c.classList.add("KG_Tooltip"), c.innerHTML = "已复制", c.style.left = "-56px", c.style.width = "42px", o.appendChild(c), new l.default(s, {
text: function () {
return o.classList.add("KG_Show_Tooltip"), setTimeout(function () {
o.classList.remove("KG_Show_Tooltip")
}, 750), e
}
}), t.appendChild(n)
}
}, {
key: "createLifeCycleDOM", value: function (e, t, n) {
var r = this, i = document.createElement("div");
i.classList.add("KG_Block_Item"), i.classList.add("KG_Clearfix");
var a = document.createElement("label");
a.innerHTML = "印章数据:", i.appendChild(a);
var o = document.createElement("span");
o.classList.add("KG_Tooltip_Wrapper"), i.appendChild(o);
var s = document.createElement("span");
s.classList.add("KG_Block_Data"), s.innerHTML = e, o.appendChild(s);
var l = document.createElement("span");
l.classList.add("KG_Tooltip_Wrapper"), i.appendChild(l);
var c = document.createElement("span");
c.classList.add("KG_VerifySealPrompt_Tip_Copy"), c.innerHTML = "更多", l.appendChild(c), c.onclick = function () {
r.showLifeCycleData(t)
}, n.appendChild(i)
}
}, {
key: "cancelResquest", value: function () {
this.cancelToken && (this.cancelToken.cancel(), this.cancelToken = null)
}
}, {
key: "createLifeCyclePromptDOM", value: function () {
var e = this, t = document.createElement("div");
t.classList.add("kg_dialog_header"), this.container.appendChild(t);
var n = document.createElement("div");
n.classList.add("kg_dialog_title"), n.innerHTML = "印章数据", t.appendChild(n), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", t.appendChild(this.closeBtn), this.closeBtn.addEventListener("click", function () {
return e.close()
}), this.dialog = document.createElement("div"), this.dialog.classList.add("dialog"), this.container.appendChild(this.dialog)
}
}, {
key: "showLifeCycleData", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
e.forEach(function (e, n) {
var r = e.blockChainId, i = e.sealLifeCycleData, a = e.verify, o = e.sealLifeCycleType,
s = document.createElement("div");
s.classList.add("KG_Block_Item"), s.classList.add("KG_Block_Title_Container");
var c = document.createElement("span");
switch (c.classList.add("KG_Block_Title"), c.innerHTML = "电子印章", o) {
case"1":
c.innerHTML += "申请";
break;
case"2":
c.innerHTML += "审核";
break;
case"3":
c.innerHTML += "制作";
break;
case"4":
c.innerHTML += "续期";
break;
case"5":
c.innerHTML += "撤销";
break;
case"6":
c.innerHTML += "挂失";
break;
case"7":
c.innerHTML += "盖章";
break;
case"8":
c.innerHTML += "更新"
}
s.appendChild(c), t.dialog.appendChild(s);
var u = document.createElement("div");
u.classList.add("KG_Block_Item"), u.classList.add("KG_Clearfix");
var d = document.createElement("label");
d.innerHTML = "核验结果:", u.appendChild(d);
var h = document.createElement("span");
switch (h.classList.add("kg_copyright_status"), h.classList.add("KG_Block_Data"), h.style.width = "auto", a) {
case"0":
h.innerHTML = "未上链", h.classList.add("kg_copyright_status_warn"), h.classList.remove("kg_copyright_status_success"), h.classList.remove("kg_copyright_status_error");
break;
case"1":
h.innerHTML = "有效", h.classList.remove("kg_copyright_status_warn"), h.classList.add("kg_copyright_status_success"), h.classList.remove("kg_copyright_status_error");
break;
case"2":
h.innerHTML = "无效", h.classList.remove("kg_copyright_status_warn"), h.classList.remove("kg_copyright_status_success"), h.classList.add("kg_copyright_status_error");
break;
case"3":
h.innerHTML = "异常", h.classList.remove("kg_copyright_status_warn"), h.classList.remove("kg_copyright_status_success"), h.classList.add("kg_copyright_status_error")
}
if (u.appendChild(h), t.dialog.appendChild(u), r) {
var p = document.createElement("div");
p.classList.add("KG_Block_Item"), p.classList.add("KG_Clearfix");
var f = document.createElement("label");
f.innerHTML = "存证凭据:", p.appendChild(f);
var m = document.createElement("span");
m.classList.add("KG_Tooltip_Wrapper"), p.appendChild(m);
var v = document.createElement("span");
v.classList.add("KG_Block_Data"), v.innerHTML = r, m.appendChild(v);
var g = document.createElement("span");
g.classList.add("KG_Tooltip"), g.innerHTML = r, m.appendChild(g);
var y = document.createElement("span");
y.classList.add("KG_Tooltip_Wrapper"), p.appendChild(y);
var b = document.createElement("span");
b.classList.add("KG_VerifySealPrompt_Tip_Copy"), b.innerHTML = "复制", y.appendChild(b);
var w = document.createElement("span");
w.classList.add("KG_Tooltip"), w.innerHTML = "已复制", w.style.left = "-56px", w.style.width = "42px", y.appendChild(w), new l.default(b, {
text: function () {
return y.classList.add("KG_Show_Tooltip"), setTimeout(function () {
y.classList.remove("KG_Show_Tooltip")
}, 750), r
}
}), m.onmouseenter = function () {
m.classList.add("KG_Show_Tooltip")
}, m.onmouseleave = function () {
m.classList.remove("KG_Show_Tooltip")
}, t.dialog.appendChild(p)
}
if (i) {
var S = document.createElement("div");
S.classList.add("KG_Block_Item"), S.classList.add("KG_Clearfix"), S.style.marginBottom = "16px";
var _ = document.createElement("label");
_.innerHTML = "上链数据:", S.appendChild(_);
var k = document.createElement("span");
k.classList.add("KG_Tooltip_Wrapper"), S.appendChild(k);
var x = document.createElement("span");
x.classList.add("KG_Block_Data"), x.innerHTML = i, k.appendChild(x);
var P = document.createElement("span");
P.classList.add("KG_Tooltip_Wrapper"), S.appendChild(P);
var C = document.createElement("span");
C.classList.add("KG_VerifySealPrompt_Tip_Copy"), C.innerHTML = "复制", P.appendChild(C);
var A = document.createElement("span");
A.classList.add("KG_Tooltip"), A.innerHTML = "已复制", A.style.left = "-56px", A.style.width = "42px", P.appendChild(A), new l.default(C, {
text: function () {
return P.classList.add("KG_Show_Tooltip"), setTimeout(function () {
P.classList.remove("KG_Show_Tooltip")
}, 750), i
}
}), t.dialog.appendChild(S)
}
})
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.dialog.innerHTML = ""
})
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_BlockChain_V2 = void 0;
var r, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(21), o = n(2), s = n(124), l = (r = s) && r.__esModule ? r : {default: r};
t.KG_BlockChain_V2 = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.overlayName = n.overlayName, this.container = n.container, this.blockChainData = null, this.cancelToken = null, this.createLifeCyclePromptDOM(), this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !1)
}
return i(e, [{
key: "getChainInfo", value: function (e, t, n) {
var r = this;
n.innerHTML = "";
var i = this.createLoadingDom(n);
this.cancelToken = a.axios.CancelToken.source();
var s = {
withCredentials: !0,
cancelToken: this.cancelToken.token,
headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}
}, l = {
action: "verifyChain",
stampTime: e,
stampDatahHash: t,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin
};
i.style.display = "block", a.axios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, o.transformData)(l), s).then(function (e) {
if (i.style.display = "none", e.data) {
if (!1 === e.data.status) return Promise.reject(e.data.message);
var t = e.data.data, a = t.sealUpperChains, o = t.signUpperChain;
if (o) {
var s = o.content, l = o.result;
r.createStampDataDom(s, n, "签章"), r.createVerifyDom("success" == l, n)
}
a.map(function (e) {
var t = e.content, i = e.result, a = JSON.parse(JSON.parse(t)).data;
r.createStampDataDom(t, n, a.operateType), r.createVerifyDom("success" == i, n)
})
}
}).catch(function (e) {
i.style.display = "none", r.cancelToken && (r.app.KGAlertPrompt.closeCallback = null, r.app.KGAlertPrompt.open(e))
})
}
}, {
key: "createLoadingDom", value: function (e) {
var t = document.createElement("div");
return t.classList.add("KG_Block_Loading"), t.classList.add("kg_icon"), t.innerHTML = "正在验证上链数据...", e.appendChild(t), t
}
}, {
key: "createVerifyDom", value: function (e, t) {
var n = document.createElement("div");
n.classList.add("KG_Block_Item"), n.classList.add("KG_Clearfix");
var r = document.createElement("label");
r.innerHTML = "上链结果:", n.appendChild(r);
var i = document.createElement("span");
i.classList.add("kg_copyright_status"), i.style.width = "auto", e ? (i.innerHTML = "成功", i.classList.remove("kg_copyright_status_warn"), i.classList.add("kg_copyright_status_success"), i.classList.remove("kg_copyright_status_error")) : (i.innerHTML = "失败", i.classList.add("kg_copyright_status_warn"), i.classList.remove("kg_copyright_status_success"), i.classList.remove("kg_copyright_status_error")), n.appendChild(i), t.appendChild(n)
}
}, {
key: "createBlockChainIdDom", value: function (e, t) {
var n = document.createElement("div");
n.classList.add("KG_Block_Item"), n.classList.add("KG_Clearfix");
var r = document.createElement("label");
r.innerHTML = "存证凭据:", n.appendChild(r);
var i = document.createElement("span");
i.classList.add("KG_Tooltip_Wrapper"), n.appendChild(i);
var a = document.createElement("span");
a.innerHTML = e, a.classList.add("KG_Block_Data"), i.appendChild(a);
var o = document.createElement("span");
o.classList.add("KG_Tooltip"), o.innerHTML = e, i.appendChild(o);
var s = document.createElement("span");
s.classList.add("KG_Tooltip_Wrapper"), n.appendChild(s);
var c = document.createElement("span");
c.classList.add("KG_VerifySealPrompt_Tip_Copy"), c.innerHTML = "复制", s.appendChild(c);
var u = document.createElement("span");
u.classList.add("KG_Tooltip"), u.innerHTML = "已复制", u.style.left = "-56px", u.style.width = "42px", s.appendChild(u), new l.default(c, {
text: function () {
return s.classList.add("KG_Show_Tooltip"), setTimeout(function () {
s.classList.remove("KG_Show_Tooltip")
}, 750), e
}
}), i.onmouseenter = function () {
i.classList.add("KG_Show_Tooltip")
}, i.onmouseleave = function () {
i.classList.remove("KG_Show_Tooltip")
}, t.appendChild(n)
}
}, {
key: "createStampDataDom", value: function (e, t, n) {
var r = document.createElement("div");
r.classList.add("KG_Block_Item"), r.classList.add("KG_Clearfix");
var i = document.createElement("label");
i.innerHTML = n + "上链数据:", r.appendChild(i);
var a = document.createElement("span");
a.classList.add("KG_Tooltip_Wrapper"), r.appendChild(a);
var o = document.createElement("span");
o.classList.add("KG_Block_Data"), o.innerHTML = e, a.appendChild(o);
var s = document.createElement("span");
s.classList.add("KG_Tooltip_Wrapper"), r.appendChild(s);
var c = document.createElement("span");
c.classList.add("KG_VerifySealPrompt_Tip_Copy"), c.innerHTML = "复制", s.appendChild(c);
var u = document.createElement("span");
u.classList.add("KG_Tooltip"), u.innerHTML = "已复制", u.style.left = "-56px", u.style.width = "42px", s.appendChild(u), new l.default(c, {
text: function () {
return s.classList.add("KG_Show_Tooltip"), setTimeout(function () {
s.classList.remove("KG_Show_Tooltip")
}, 750), e
}
}), t.appendChild(r)
}
}, {
key: "createLifeCycleDOM", value: function (e, t, n) {
var r = this, i = document.createElement("div");
i.classList.add("KG_Block_Item"), i.classList.add("KG_Clearfix");
var a = document.createElement("label");
a.innerHTML = "印章数据:", i.appendChild(a);
var o = document.createElement("span");
o.classList.add("KG_Tooltip_Wrapper"), i.appendChild(o);
var s = document.createElement("span");
s.classList.add("KG_Block_Data"), s.innerHTML = e, o.appendChild(s);
var l = document.createElement("span");
l.classList.add("KG_Tooltip_Wrapper"), i.appendChild(l);
var c = document.createElement("span");
c.classList.add("KG_VerifySealPrompt_Tip_Copy"), c.innerHTML = "更多", l.appendChild(c), c.onclick = function () {
r.showLifeCycleData(t)
}, n.appendChild(i)
}
}, {
key: "cancelResquest", value: function () {
this.cancelToken && (this.cancelToken.cancel(), this.cancelToken = null)
}
}, {
key: "createLifeCyclePromptDOM", value: function () {
var e = this, t = document.createElement("div");
t.classList.add("kg_dialog_header"), this.container.appendChild(t);
var n = document.createElement("div");
n.classList.add("kg_dialog_title"), n.innerHTML = "印章数据", t.appendChild(n), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", t.appendChild(this.closeBtn), this.closeBtn.addEventListener("click", function () {
return e.close()
}), this.dialog = document.createElement("div"), this.dialog.classList.add("dialog"), this.container.appendChild(this.dialog)
}
}, {
key: "showLifeCycleData", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
e.forEach(function (e, n) {
var r = e.blockChainId, i = e.sealLifeCycleData, a = e.verify, o = e.sealLifeCycleType,
s = document.createElement("div");
s.classList.add("KG_Block_Item"), s.classList.add("KG_Block_Title_Container");
var c = document.createElement("span");
switch (c.classList.add("KG_Block_Title"), c.innerHTML = "电子印章", o) {
case"1":
c.innerHTML += "申请";
break;
case"2":
c.innerHTML += "审核";
break;
case"3":
c.innerHTML += "制作";
break;
case"4":
c.innerHTML += "续期";
break;
case"5":
c.innerHTML += "撤销";
break;
case"6":
c.innerHTML += "挂失";
break;
case"7":
c.innerHTML += "盖章";
break;
case"8":
c.innerHTML += "更新"
}
s.appendChild(c), t.dialog.appendChild(s);
var u = document.createElement("div");
u.classList.add("KG_Block_Item"), u.classList.add("KG_Clearfix");
var d = document.createElement("label");
d.innerHTML = "核验结果:", u.appendChild(d);
var h = document.createElement("span");
switch (h.classList.add("kg_copyright_status"), h.classList.add("KG_Block_Data"), h.style.width = "auto", a) {
case"0":
h.innerHTML = "未上链", h.classList.add("kg_copyright_status_warn"), h.classList.remove("kg_copyright_status_success"), h.classList.remove("kg_copyright_status_error");
break;
case"1":
h.innerHTML = "有效", h.classList.remove("kg_copyright_status_warn"), h.classList.add("kg_copyright_status_success"), h.classList.remove("kg_copyright_status_error");
break;
case"2":
h.innerHTML = "无效", h.classList.remove("kg_copyright_status_warn"), h.classList.remove("kg_copyright_status_success"), h.classList.add("kg_copyright_status_error");
break;
case"3":
h.innerHTML = "异常", h.classList.remove("kg_copyright_status_warn"), h.classList.remove("kg_copyright_status_success"), h.classList.add("kg_copyright_status_error")
}
if (u.appendChild(h), t.dialog.appendChild(u), r) {
var p = document.createElement("div");
p.classList.add("KG_Block_Item"), p.classList.add("KG_Clearfix");
var f = document.createElement("label");
f.innerHTML = "存证凭据:", p.appendChild(f);
var m = document.createElement("span");
m.classList.add("KG_Tooltip_Wrapper"), p.appendChild(m);
var v = document.createElement("span");
v.classList.add("KG_Block_Data"), v.innerHTML = r, m.appendChild(v);
var g = document.createElement("span");
g.classList.add("KG_Tooltip"), g.innerHTML = r, m.appendChild(g);
var y = document.createElement("span");
y.classList.add("KG_Tooltip_Wrapper"), p.appendChild(y);
var b = document.createElement("span");
b.classList.add("KG_VerifySealPrompt_Tip_Copy"), b.innerHTML = "复制", y.appendChild(b);
var w = document.createElement("span");
w.classList.add("KG_Tooltip"), w.innerHTML = "已复制", w.style.left = "-56px", w.style.width = "42px", y.appendChild(w), new l.default(b, {
text: function () {
return y.classList.add("KG_Show_Tooltip"), setTimeout(function () {
y.classList.remove("KG_Show_Tooltip")
}, 750), r
}
}), m.onmouseenter = function () {
m.classList.add("KG_Show_Tooltip")
}, m.onmouseleave = function () {
m.classList.remove("KG_Show_Tooltip")
}, t.dialog.appendChild(p)
}
if (i) {
var S = document.createElement("div");
S.classList.add("KG_Block_Item"), S.classList.add("KG_Clearfix"), S.style.marginBottom = "16px";
var _ = document.createElement("label");
_.innerHTML = "上链数据:", S.appendChild(_);
var k = document.createElement("span");
k.classList.add("KG_Tooltip_Wrapper"), S.appendChild(k);
var x = document.createElement("span");
x.classList.add("KG_Block_Data"), x.innerHTML = i, k.appendChild(x);
var P = document.createElement("span");
P.classList.add("KG_Tooltip_Wrapper"), S.appendChild(P);
var C = document.createElement("span");
C.classList.add("KG_VerifySealPrompt_Tip_Copy"), C.innerHTML = "复制", P.appendChild(C);
var A = document.createElement("span");
A.classList.add("KG_Tooltip"), A.innerHTML = "已复制", A.style.left = "-56px", A.style.width = "42px", P.appendChild(A), new l.default(C, {
text: function () {
return P.classList.add("KG_Show_Tooltip"), setTimeout(function () {
P.classList.remove("KG_Show_Tooltip")
}, 750), i
}
}), t.dialog.appendChild(S)
}
})
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.dialog.innerHTML = ""
})
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_ScanStamp = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = c(n(17)), a = c(n(34)), o = n(21), s = n(2), l = n(42);
function c(e) {
return e && e.__esModule ? e : {default: e}
}
var u = {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"};
function d(e) {
return (0, o.axios)({
url: window.KGPdfViewerWebApp.getDocTypeUrl(),
method: "POST",
data: (0, s.transformData)({action: "establishSession", authCode: e}),
headers: u
})
}
function h(e, t, n) {
return (0, o.axios)({
url: window.KGPdfViewerWebApp.getDocTypeUrl(),
method: "POST",
data: (0, s.transformData)({action: "getUserSeals", userToken: e, category: t, entityCode: n}),
headers: u
})
}
t.KG_ScanStamp = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.options = n, this.qrCodeOverlayName = this.options.qrCodeOverlayName, this.qrCodeContainer = this.options.qrCodeContainer, this.companySelectContainer = document.getElementById("kg_companySelectContainer"), this.companySelect = document.getElementById("kg_companySelect"), this.exitSessionContainer = document.getElementById("kg_exitSessionContainer"), this.exitSession = document.getElementById("kg_exitSession"), this.overlayManager = r, this.qrcodeId = "", this.scanId = "", this.qrCodeUserUid = "", this.sealData = [], this.companys = [], this.session = "1", this.type = null, this.sealType = 2, this.scanDlalogTitle = null, this.cancelQrCodeUserInfo = null, this.esid = null, this.storeType = "1", this.base64Img = "", this.certFromKey = window.KGPdfViewerWebApp.certFromKey, this.getExternalToken = window.KGPdfViewerWebApp.getExternalToken, this.userToken = null, this.entityCode = null, this.openQrCodeOverlay = this.openQrCodeOverlay.bind(this), this.closeQrCodeOverlay = this.closeQrCodeOverlay.bind(this), this.getCompanyInfo = this.getCompanyInfo.bind(this), this.getSeals = this.getSeals.bind(this), this.getUserToken = this.getUserToken.bind(this), this.getUserTokenByKey = this.getUserTokenByKey.bind(this), this.getQrCodeUserInfo = this.getQrCodeUserInfo.bind(this), this.handleSelectCompany = this.handleSelectCompany.bind(this), this.handleExitSession = this.handleExitSession.bind(this), this.onError = this.onError.bind(this), this.callback = null, this.tipPrompt = window.KGPdfViewerWebApp.getTipPrompt(), this.alertPrompt = this.app.KGAlertPrompt, this.selectSealPrompt = window.KGPdfViewerWebApp.getSelectSealPrompt(), this.handleScanClick = this.handleScanClick.bind(this), this.overlayManager.register(this.qrCodeOverlayName, this.qrCodeContainer, this.closeQrCodeOverlay);
var i = window.KGPdfViewerWebApp.customScanDialog;
i ? this.extentCreateDOM(i) : this.createDom(), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this, t = window.KGPdfViewerWebApp.btnPositionConfig, n = (t.toolbar, t.sidebar),
r = window.KGPdfViewerWebApp, i = r.paginSealConfig, a = r.continuityRange, o = r.singlePageSeal,
l = ["companySignBtn"];
this.certFromKey || l.push("personSignBtn"), o && l.push("companySinglePageSealSignBtn"), a && l.push("companyContinuitySignBtn"), i && l.push("companyPagingSealSignBtn");
this.options.companySignBtn.removeAttribute("hidden"), this.options.companySignBtn.addEventListener("click", function (t) {
e.disableOtherBtn(t, "companySignBtn"), e.collectParmas("companySignBtn"), e.app.pdfStamp.stamp("scan")
}), n.indexOf("scanStamp") > -1 && l.map(function (t) {
var n = "secondary" + (0, s.titleCase)(t);
e.options[n].removeAttribute("hidden"), e.options[n].addEventListener("click", function (t) {
e.disableOtherBtn(t, n), e.collectParmas(n), e.app.pdfStamp.stamp("scan")
})
}), "ofd" === window.KGPdfViewerWebApp.fileType.toLowerCase() && (window.KGPdfViewerWebApp.multipleStamp = !1), this.app.appConfig.toolbar.stamp.setAttribute("hidden", !0), this.app.appConfig.secondaryToolbar.secondaryStamp.setAttribute("hidden", !0), this.closeQrCodeBtn.addEventListener("click", this.closeQrCodeOverlay), this.qrCodeImgForeground.addEventListener("click", function () {
return e.getQrCodeImage(e.type, e.callback)
})
}
}, {
key: "disableOtherBtn", value: function (e, t) {
t.toLowerCase().indexOf("company") > -1 ? (this.options.secondaryPersonSignBtn.setAttribute("disabled", !0), this.options.personSignBtn.setAttribute("disabled", !0)) : (this.options.companySignBtn.setAttribute("disabled", !0), this.options.secondaryCompanySignBtn.setAttribute("disabled", !0), this.options.companySinglePageSealSignBtn.setAttribute("disabled", !0), this.options.secondaryCompanySinglePageSealSignBtn.setAttribute("disabled", !0), this.options.companyContinuitySignBtn.setAttribute("disabled", !0), this.options.secondaryCompanyContinuitySignBtn.setAttribute("disabled", !0), this.options.companyPagingSealSignBtn.setAttribute("disabled", !0), this.options.secondaryCompanyPagingSealSignBtn.setAttribute("disabled", !0)), e.target.removeAttribute("disabled")
}
}, {
key: "enableAllBtn", value: function () {
for (var e in this.options) {
var t = this.options[e];
t instanceof HTMLElement && t.removeAttribute("disabled")
}
}
}, {
key: "createDom", value: function () {
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.qrCodeContainer.appendChild(e);
var t = this.scanDlalogTitle = document.createElement("div");
t.classList.add("kg_dialog_title"), e.appendChild(t), this.closeQrCodeBtn = document.createElement("button"), this.closeQrCodeBtn.classList.add("kg_dialog_close"), this.closeQrCodeBtn.innerHTML = "×", e.appendChild(this.closeQrCodeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.qrCodeContainer.appendChild(n), this.qrCodeImgForeground = document.createElement("div"), this.qrCodeImgForeground.classList.add("qrCodeImgForeground"), this.qrCodeImgForeground.innerHTML = "二维码已失效,点击刷新", n.appendChild(this.qrCodeImgForeground), this.qrCodeImgEl = document.createElement("img"), n.appendChild(this.qrCodeImgEl), this.app.l10n.translate(this.qrCodeContainer)
}
}, {
key: "extentCreateDOM", value: function (e) {
var t = e.information, n = e.imageName, r = e.copyright, i = document.createElement("div");
i.classList.add("kg_dialog_header"), i.classList.add("kg_extent_width"), this.qrCodeContainer.appendChild(i);
var a = this.scanDlalogTitle = document.createElement("div");
a.classList.add("kg_dialog_title"), a.setAttribute("data-l10n-id", "qrCode_title"), i.appendChild(a), this.closeQrCodeBtn = document.createElement("button"), this.closeQrCodeBtn.classList.add("kg_dialog_close"), this.closeQrCodeBtn.innerHTML = "×", i.appendChild(this.closeQrCodeBtn);
var o = document.createElement("div");
o.classList.add("dialog"), o.classList.add("kg_extent_width");
var s = document.createElement("div");
s.classList.add("kg_dialog_left"), this.qrCodeContainer.appendChild(o), this.qrCodeImgForeground = document.createElement("div"), this.qrCodeImgForeground.classList.add("qrCodeImgForeground"), this.qrCodeImgForeground.innerHTML = "二维码已失效,点击刷新", this.qrCodeImgEl = document.createElement("img"), this.qrCodeImgEl.style["background-image"] = 'url("images/kg_extend_img_border.png")', s.appendChild(this.qrCodeImgForeground), s.appendChild(this.qrCodeImgEl);
var l = document.createElement("div");
if (t) {
var c = "";
t.map(function (e, t) {
c += "<p>" + (t + 1) + "." + e + "</p>"
}), l.innerHTML = c
}
s.appendChild(l);
var u = document.createElement("div");
u.classList.add("kg_dialog_right");
var d = new Image;
if (d.classList.add("kg_extend_img"), d.src = "images/" + encodeURIComponent(n), u.appendChild(d), o.appendChild(s), o.appendChild(u), r) {
var h = document.createElement("div");
h.classList.add("kg_copyright_scan"), h.innerHTML = r, o.appendChild(h)
}
this.app.l10n.translate(this.qrCodeContainer)
}
}, {
key: "getQrCodeImage", value: function (e, t) {
var n = this;
if (this.qrCodeImgForeground.style.display = "", this.type = e, this.setDialogTitle(e), this.callback = t, this.sealData.length > 0) this.callback({
status: !0,
seals: this.sealData
}); else if (this.certFromKey) {
this.session;
var r = window.KGPdfViewerWebApp.getPasswordPrompt();
r.open(), r.setUpdateCallback(function (e) {
n.getUserTokenByKey(e)
})
} else window.KGPdfViewerWebApp.getQrCodeImage(e, this.sealType, this.esid).then(function (e) {
if (1 != e.status) return Promise.reject({message: e.message});
if (e.session && (n.session = window.KGPdfViewerWebApp.mobile || window.KGPdfViewerWebApp.getExternalToken ? "2" : e.session), "1" === n.session && (n.base64Img = "data:image/png;base64," + e.image, n.qrCodeImgEl.src = n.base64Img, window.KGPdfViewerWebApp.getQrCodeBase64Image(n.base64Img), n.qrcodeId = e.qrcodeId, n.hideExitSessionClick(), n.openQrCodeOverlay()), "2" === n.session) if (n.userToken) n.getSealsBySealType(); else {
if (n.getExternalToken) return n._getExternalToken();
1 == window.KGPdfViewerWebApp.mobile ? n.getUserToken() : (n.base64Img = "data:image/png;base64," + e.image, n.qrCodeImgEl.src = n.base64Img, window.KGPdfViewerWebApp.getQrCodeBase64Image(n.base64Img), n.qrcodeId = e.qrcodeId, n.openQrCodeOverlay())
}
}).catch(this.onError)
}
}, {
key: "getRequestParameters", value: function (e) {
var t = this;
window.KGPdfViewerWebApp.getQrCodeToken(this.qrcodeId).then(function (n) {
var r = a.default.stringify(i.default.parse(n.stampSystemUrl, "=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"));
t.request = o.axios.create({baseURL: "" + r, timeout: 75e3}), e && e()
}).catch(this.onError)
}
}, {
key: "handleScanClick", value: function (e) {
this.app.secondaryToolbar.close(), this.hideCompanySelect(), this.tipPrompt.open("加载中..."), this.getQrCodeImage("stamp", e)
}
}, {
key: "getSealsBySealType", value: function () {
1 === this.sealType ? this.getSeals() : this.getCompanyInfo()
}
}, {
key: "getUserToken", value: function () {
var e = this;
new Promise(function (e, t) {
window.KGPdfViewerWebApp.getAuthCode(e, t)
}).then(d).then(function (t) {
var n = t.data, r = n.data, i = n.code, a = n.message;
if (0 != i) return Promise.reject({code: i, message: a});
e.userToken = r.token, e.getSealsBySealType()
}).catch(this.onError)
}
}, {
key: "getUserSealsByKey", value: function () {
var e = this;
h(this.userToken, 2).then(function (t) {
var n = t.data, r = n.data, i = n.code, a = n.message;
if (0 != i) return Promise.reject({code: i, message: a});
var o = r.userInfo, l = r.seals;
if (e.qrCodeUserUid = o.userId, e.qrCodeUserName = o.userName, "stamp" == e.type) {
e.sealData = [];
for (var c = 0; c < l.length; c++) {
var u = l[c];
u.imageData && (u.imgdata = "data:image/png;base64," + u.imageData, delete u.imageData, u.height = (0, s.mmCovertToPx)(u.height), u.width = (0, s.mmCovertToPx)(u.width), u.version = 4, e.sealData.push(u))
}
e.sealData.length > 0 ? e.callback ? e.callback({
status: !0,
seals: e.sealData
}) : window.KGPdfViewerWebApp.getSelectSealPrompt().updateSeals(e.sealData) : e.closeQrCodeOverlay().then(function () {
e.alertPrompt.open("该用户没有可用印章!")
})
}
"delete" == e.type && (e.clearSealData(), e.callback && e.callback()), e.callback = null
}).catch(this.onError)
}
}, {
key: "getUserTokenByKey", value: function (e) {
var t = this;
(0, o.axios)({
url: window.KGPdfViewerWebApp.getDocTypeUrl(),
method: "POST",
data: (0, s.transformData)({action: "getToken"}),
headers: u
}).then(function (n) {
var r = n.data, i = r.token, a = r.message;
if (!i) return Promise.reject({message: a});
new Promise(function (n) {
return (0, l.getCertByScanStamp)(e, i, n, t.onError)
}).then(function (e) {
return n = (t = e).cert, r = t.signData, i = t.token, (0, o.axios)({
url: window.KGPdfViewerWebApp.getDocTypeUrl(),
method: "POST",
data: (0, s.transformData)({action: "establishSessionByKey", cert: n, signData: r, token: i}),
headers: u
});
var t, n, r, i
}).then(function (e) {
var n = e.data.token;
return t.userToken = n, t.getUserSealsByKey()
})
}).catch(this.onError)
}
}, {
key: "getCompanyInfo", value: function () {
var e, t = this;
(e = this.userToken, (0, o.axios)({
url: window.KGPdfViewerWebApp.getDocTypeUrl(),
method: "POST",
data: (0, s.transformData)({action: "queryUserCompany", userToken: e}),
headers: u
})).then(function (e) {
var n = e.data, r = n.data, i = n.code, a = n.message;
if (0 == i) {
var o = r.companys;
t.companys = o, t.companys.push({
entityName: "授权印章",
entityCode: 1
}), t.showCompanySelect(), t.companySelect.innerHTML = "", t.companys.forEach(function (e, n) {
var r = document.createElement("option");
r.value = e.entityCode, r.innerText = e.entityName, 0 === n && (t.entityCode = e.entityCode, r.setAttribute("selected", "selected")), t.companySelect.appendChild(r)
}), t.getSeals(t.companys[0].entityCode)
} else {
if (6 !== i) return Promise.reject({code: i, message: a});
if (t.userToken = null, t.getExternalToken) return Promise.reject({message: "用户会话已失效"});
t.getQrCodeImage(t.type, t.callback)
}
}).catch(this.onError)
}
}, {
key: "getSeals", value: function (e) {
var t = this, n = {userToken: this.userToken};
if (1 == e) n.category = 3; else if (n.entityCode = e, n.category = this.sealType, 2 === this.sealType) {
this.companySelect.querySelector("option[selected=selected]").removeAttribute("selected");
for (var r = this.companySelect.getElementsByTagName("option"), i = 0; i < r.length; i++) {
if (r[i].value == e) {
r[i].setAttribute("selected", "selected");
break
}
}
}
h(n.userToken, n.category, n.entityCode).then(function (n) {
var r = n.data, i = r.data, a = r.code, o = r.message;
if (0 == a) {
var l = i.userInfo, c = i.seals;
if (t.qrCodeUserUid = l.userId, t.qrCodeUserName = l.userName, "stamp" == t.type) {
t.sealData = [];
for (var u = 0; u < c.length; u++) {
var d = c[u];
d.imageData && (d.imgdata = "data:image/png;base64," + d.imageData, delete d.imageData, d.height = (0, s.mmCovertToPx)(d.height), d.width = (0, s.mmCovertToPx)(d.width), d.version = 4, t.sealData.push(d))
}
t.sealData.length > 0 ? t.callback ? t.callback({
status: !0,
seals: t.sealData
}) : window.KGPdfViewerWebApp.getSelectSealPrompt().updateSeals(t.sealData) : (t.tipPrompt.close(), t.alertPrompt.closeCallback = function () {
t.companys.length > 1 && e != t.companys[0].entityCode && 1 != t.sealType ? t.getSeals(t.companys[0].entityCode) : (t.enableAllBtn(), t.closeQrCodeOverlay())
}, t.alertPrompt.open("没有可用印章!"))
}
"delete" == t.type && (t.clearSealData(), t.callback && t.callback()), t.callback = null
} else {
if (6 !== a) return Promise.reject({code: a, message: o});
if (t.userToken = null, t.getExternalToken) return Promise.reject({message: "用户会话已失效"});
t.getQrCodeImage(t.type, t.callback)
}
}).catch(this.onError)
}
}, {
key: "getQrCodeUserInfo", value: function () {
var e = this, t = o.axios.CancelToken;
return this.request({
method: "GET", cancelToken: new t(function (t) {
e.cancelQrCodeUserInfo = t
})
}).then(function (t) {
e.cancelQrCodeUserInfo = null;
var n = t.data, r = n.data, i = n.code, a = n.message;
if (0 == i) "1" === e.session && (e.scanId = r.scanId, e.qrCodeUserUid = r.userInfo ? r.userInfo.userId : void 0, e.qrCodeUserName = r.userInfo ? r.userInfo.userName : void 0, "stamp" == e.type && (r.seals && r.seals.length > 0 ? (e.sealData = r.seals.map(function (e) {
return delete e.isGmSeal, delete e.isPersonal, e.imgdata = "data:image/png;base64," + e.imageData, delete e.imageData, e.height = (0, s.mmCovertToPx)(e.height), e.width = (0, s.mmCovertToPx)(e.width), e.version = 4, e
}), e.closeQrCodeOverlay().then(function () {
e.callback({status: !0, seals: e.sealData})
})) : e.closeQrCodeOverlay().then(function () {
e.alertPrompt.open("该用户没有可用印章!")
})), "delete" == e.type && e.closeQrCodeOverlay().then(function () {
e.clearSealData(), e.callback()
})), "2" === e.session && (e.userToken = r.userToken, e.overlayManager.close(e.qrCodeOverlayName), e.tipPrompt.open("加载中..."), e.getSealsBySealType(), e.showExitSessionClick()); else if (801 == i) setTimeout(function () {
e.getRequestParameters(e.getQrCodeUserInfo)
}, 3e3); else if (802 == i) e.qrCodeImgForeground.style.display = "block", e.base64Img = ""; else {
if (803 != i) return Promise.resolve({code: i, message: a});
e.closeQrCodeOverlay()
}
}).catch(this.onError)
}
}, {
key: "showCompanySelect", value: function () {
this.companySelectContainer.style.display = "block", this.companySelect.addEventListener("change", this.handleSelectCompany)
}
}, {
key: "handleSelectCompany", value: function (e) {
var t = e.target.value;
this.getSeals(t)
}
}, {
key: "hideCompanySelect", value: function () {
this.companySelectContainer.style.display = "none", this.companySelect.removeEventListener("change", this.handleSelectCompany)
}
}, {
key: "showExitSessionClick", value: function () {
1 != window.KGPdfViewerWebApp.mobile && (this.exitSessionContainer.style.display = "flex", this.exitSession.addEventListener("click", this.handleExitSession))
}
}, {
key: "hideExitSessionClick", value: function () {
this.exitSessionContainer.style.display = "none", this.exitSession.removeEventListener("click", this.handleExitSession)
}
}, {
key: "handleExitSession", value: function () {
var e = this;
window.KGPdfViewerWebApp.exitSession(this.userToken).then(function (t) {
t.status && (e.userToken = null, e.sealData = [], e.hideExitSessionClick(), e.enableAllBtn(), window.KGPdfViewerWebApp.getSelectSealPrompt().cancelButton.click())
}).catch(this.onError)
}
}, {
key: "openQrCodeOverlay", value: function () {
var e = this;
this.tipPrompt.close(), this.overlayManager._active.indexOf(this.qrCodeOverlayName) > -1 ? this.getRequestParameters(this.getQrCodeUserInfo) : this.overlayManager.open(this.qrCodeOverlayName).then(function () {
e.getRequestParameters(e.getQrCodeUserInfo)
})
}
}, {
key: "_getExternalToken", value: function () {
var e = this;
this.tipPrompt.open("加载中..."), this.getExternalToken().then(function (t) {
e.tipPrompt.close(), e.getRequestParameters(function () {
e.userToken = t, e.getSealsBySealType(), e.showExitSessionClick()
})
}).catch(this.onError)
}
}, {
key: "closeQrCodeOverlay", value: function () {
return this.cancelQrCodeUserInfo && (this.enableAllBtn(), this.cancelQrCodeUserInfo()), this.esid = null, this.storeType = "1", this.session = "1", this.base64Img = "", this.overlayManager._active.indexOf(this.qrCodeOverlayName) > -1 ? this.overlayManager.close(this.qrCodeOverlayName) : Promise.resolve()
}
}, {
key: "clearSealData", value: function () {
this.sealData = [], this.enableAllBtn()
}
}, {
key: "collectParmas", value: function (e) {
var t = e.toLowerCase(), n = this.app.pdfStamp, r = function (e, t) {
return -1 != e.indexOf(t)
};
n.stampSealType = "default", r(t, "single") && (n.stampSealType = "singleSeal"), r(t, "continuity") && (n.stampSealType = "continuitySeal"), r(t, "paging") && (n.stampSealType = "pagingSeal"), r(t, "company") && (this.sealType = 2), r(t, "person") && (this.sealType = 1)
}
}, {
key: "setDialogTitle", value: function (e) {
"stamp" == e ? this.scanDlalogTitle.setAttribute("data-l10n-id", "qrCode_title") : this.scanDlalogTitle.setAttribute("data-l10n-id", "delSeal_title"), this.app.l10n.translate(this.scanDlalogTitle)
}
}, {
key: "onError", value: function (e) {
var t = this;
this.enableAllBtn(), this.tipPrompt.close(), this.cancelQrCodeUserInfo && this.cancelQrCodeUserInfo(), !e || e instanceof o.axios.Cancel || (this.alertPrompt.closeCallback = function () {
return t.closeQrCodeOverlay()
}, this.alertPrompt.open(e.message || e))
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_ScanStamp_V2 = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(21), a = n(2);
function o(e, t) {
var n = Object.assign({action: e}, t);
return (0, i.axios)({
headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"},
url: window.KGPdfViewerWebApp.getDocTypeUrl(),
method: "POST",
data: (0, a.transformData)(n)
}).then(function (e) {
var t = e.data, n = t.status, r = t.message, i = void 0 === r ? "程序异常,请联系管理员!" : r, a = t.data;
return n ? Promise.resolve(a) : Promise.reject({message: i})
})
}
var s = function (e) {
return o("seals", e)
}, l = function (e) {
return o("accessToken", e)
}, c = function (e) {
return o("authorizeCode", e)
}, u = function (e) {
return o("authorizeCodeState", e)
}, d = "KG_V2_TOKEN";
t.KG_ScanStamp_V2 = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.options = n, this.overlayManager = r, this.iframe = n.iframe, this.container = n.container, this.overlayName = n.overlayName, this.exitSession = document.getElementById("kg_exitSession"), this.dialogTitle = document.getElementById("KG_V2_Iframe_Title"), this.companySelect = document.getElementById("kg_companySelect"), this.exitSessionContainer = document.getElementById("kg_exitSessionContainer"), this.companySelectContainer = document.getElementById("kg_companySelectContainer");
var i = this.app.KGPdfViewerWebApp.mobile;
this.code = "", this.token = "", this.codeWay = 1, this.authType = "", this.polling = null, this.cacheOrgSeals = [], this.preAuthType = null, this.queryResolve = null, this.authorizeMode = null, this.clientType = i ? "MOBILE" : "PC", this.open = this.open.bind(this), this.close = this.close.bind(this), this.stamp = this.stamp.bind(this), this.onError = this.onError.bind(this), this.getSeals = this.getSeals.bind(this), this.isSession = this.isSession.bind(this), this.convertSeals = this.convertSeals.bind(this), this.enableAllBtn = this.enableAllBtn.bind(this), this.getAccessToken = this.getAccessToken.bind(this), this.queryCodeState = this.queryCodeState.bind(this), this.getAuthorizeCode = this.getAuthorizeCode.bind(this), this.handleExitSession = this.handleExitSession.bind(this), this.nonSessionProcess = this.nonSessionProcess.bind(this), this.hideCompanySelect = this.hideCompanySelect.bind(this), this.showCompanySelect = this.showCompanySelect.bind(this), this.handleSelectCompany = this.handleSelectCompany.bind(this), this.alertPrompt = this.app.KGAlertPrompt, this.tipPrompt = window.KGPdfViewerWebApp.getTipPrompt(), this.overlayManager.register(this.overlayName, this.container, this.close, !1), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this, t = this.options, n = t.organize, r = t.secondaryOrganize, i = t.person, a = t.secondaryPerson,
o = [];
o = this.app.KGPdfViewerWebApp.mobile ? [r, a] : [n, r, i, a], this.buttons = o, o.map(function (t) {
t.removeAttribute("hidden"), t.addEventListener("click", function (n) {
o.map(function (e) {
e.setAttribute("disabled", !0)
}), e.authType = t.dataset.type;
var r = void 0;
"organize" == e.authType ? (r = "法人签章", e.showCompanySelect()) : (r = "个人签章", e.hideCompanySelect()), e.dialogTitle.innerHTML = r;
e.app.pdfStamp.stamp("scan_v2")
})
}), this.container.querySelector(".kg_dialog_close").addEventListener("click", this.close), document.getElementById("secondaryKgSignature").setAttribute("hidden", !0)
}
}, {
key: "stamp", value: function (e) {
var t = this, n = void 0;
this.code = "", this.codeWay = 1, this.cacheOrgSeals = [], window.KGPdfViewerWebApp.PDFViewerApplication.secondaryToolbar.close();
var r = (0, a.getCookieOrStorage)("KG_PRE_AUTH_TYPE");
return r && r != this.authType && (this.token = "", (0, a.deleteCookieAndStorage)(d)), this.tipPrompt.open("加载中..."), this.isSession().then(function (e) {
return n = e, e ? Promise.resolve() : new Promise(function (e) {
t.queryResolve = e, t.nonSessionProcess()
})
}).then(function () {
return t.preAuthType = t.authType, (0, a.setCookieOrStorage)("KG_PRE_AUTH_TYPE", t.authType), n ? (t.showExitSessionClick(), t.sealData ? t.sealData : t.getSeals({token: t.token})) : ("SESSION" == t.authorizeMode ? t.getAccessToken() : Promise.resolve()).then(function () {
return t.getSeals({code: t.code, token: t.token})
})
}).catch(function (e) {
t.onError(e)
}).then(function (t) {
e(t)
}).finally(function () {
t.tipPrompt.close(), t.enableAllBtn()
})
}
}, {
key: "delete", value: function (e) {
var t = this, n = void 0;
return this.codeWay = 2, this.isSession().then(function (e) {
return n = e, e ? Promise.resolve() : new Promise(function (e) {
t.queryResolve = e, t.nonSessionProcess()
})
}).then(function () {
return "NON_SESSION" == t.authorizeMode ? Promise.resolve() : n ? Promise.resolve() : t.getAccessToken()
}).then(function () {
return e()
})
}
}, {
key: "isSession", value: function () {
var e = !1, t = (0, a.getCookieOrStorage)(d);
return (this.token || t) && (this.token = this.token || t, e = !0), Promise.resolve(e)
}
}, {
key: "nonSessionProcess", value: function () {
var e = this;
this.getAuthorizeCode().catch(this.onError).then(function (t) {
var n = t.code, r = t.loginUrl, i = t.authorizeMode;
e.code = n, e.loginUrl = r, e.authorizeMode = i, "NON_SESSION" == i ? (e.hideCompanySelect(), e.hideExitSessionClick()) : e.showExitSessionClick(), e.open().then(function () {
e.queryCodeState()
})
})
}
}, {
key: "getSeals", value: function (e) {
var t = this;
return s(e).then(function (e) {
var n = e.accountType, r = e.personSeals, i = e.orgSeals, a = void 0;
return "organize" == n ? (t.cacheOrgSeals = i, a = t.cacheOrgSeals.filter(function (e) {
return 1 == e.choose
}), t.companySelect.innerHTML = "", t.cacheOrgSeals.forEach(function (e) {
var n = document.createElement("option");
n.value = e.orgUscc, n.innerText = e.orgName, e.choose && n.setAttribute("selected", "selected"), t.companySelect.appendChild(n)
})) : a = [{seals: r}], t.convertSeals(a)
}).catch(function (e) {
return Promise.reject(e)
})
}
}, {
key: "convertSeals", value: function () {
var e = [];
return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []).map(function (t) {
t.seals.map(function (t) {
var n = t.sealName, r = t.sealPicBase64, i = t.sealCode, a = t.width, o = t.height, s = t.seSealDataB64;
e.push({
width: a / (96 / 72),
height: o / (96 / 72),
version: 4,
imgExt: "png",
sealTag: "GM",
esid: i,
signName: n,
sealData: s,
imgdata: "data:image/png;base64," + r
})
})
}), {status: !0, seals: e}
}
}, {
key: "queryCodeState", value: function () {
var e = this, t = this.code;
u({code: t}).then(function (t) {
0 == t.state ? e.polling = setTimeout(function () {
e.queryCodeState()
}, 3e3) : (e.close(), e.queryResolve())
})
}
}, {
key: "getAuthorizeCode", value: function () {
var e = this.authType, t = this.clientType, n = this.codeWay;
return c({codeWay: n, authType: e, clientType: t})
}
}, {
key: "getAccessToken", value: function () {
var e = this, t = this.code;
return l({code: t}).then(function (t) {
var n = t.token, r = t.expiresIn, i = (new Date).getTime(), o = new Date(i + 1e3 * r);
return (0, a.setCookieOrStorage)(d, n, {expires: o}), e.token = n, Promise.resolve()
})
}
}, {
key: "open", value: function () {
var e = this;
return this.overlayManager.open(this.overlayName).then(function () {
var t = e.loginUrl;
e.iframe.src = t
})
}
}, {
key: "close", value: function () {
var e = this;
return this.overlayManager.close(this.overlayName).then(function () {
e.tipPrompt.close(), clearTimeout(e.polling), e.enableAllBtn(), e.iframe.src = ""
})
}
}, {
key: "enableAllBtn", value: function () {
this.buttons.map(function (e) {
e.removeAttribute("disabled")
})
}
}, {
key: "showExitSessionClick", value: function () {
this.exitSessionContainer.style.display = "flex", this.exitSession.addEventListener("click", this.handleExitSession)
}
}, {
key: "hideExitSessionClick", value: function () {
this.exitSessionContainer.style.display = "none", this.exitSession.removeEventListener("click", this.handleExitSession)
}
}, {
key: "handleExitSession", value: function () {
this.token = "", this.hideExitSessionClick(), (0, a.deleteCookieAndStorage)(d), window.KGPdfViewerWebApp.getSelectSealPrompt().close()
}
}, {
key: "showCompanySelect", value: function () {
this.companySelectContainer.style.display = "block", this.companySelect.addEventListener("change", this.handleSelectCompany)
}
}, {
key: "hideCompanySelect", value: function () {
this.companySelectContainer.style.display = "none", this.companySelect.removeEventListener("change", this.handleSelectCompany)
}
}, {
key: "handleSelectCompany", value: function (e) {
var t = this.cacheOrgSeals.filter(function (t) {
return t.orgUscc == e.target.value
}), n = this.convertSeals(t).seals;
window.KGPdfViewerWebApp.getSelectSealPrompt().updateSeals(n)
}
}, {
key: "onError", value: function (e) {
var t = e.message;
this.enableAllBtn(), this.tipPrompt.close(), clearTimeout(this.polling), this.alertPrompt.open(t)
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_Annotation = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(2), a = n(43), o = c(n(185)), s = c(n(56)), l = n(55);
function c(e) {
return e && e.__esModule ? e : {default: e}
}
function u(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
t.KG_Annotation = function () {
function e(t, n, r) {
u(this, e), this.value = "", this.painting = new o.default({
canvasId: "kg-AnnotationSignature",
lineColor: "#1a1a1a"
}), this.app = t, this.container = n.container, this.overlayName = n.overlayName, this.canvas = document.getElementById("kg-AnnotationSignature"), this.times = 2, this.board = document.getElementById("kg-AnnotationBoard"), this.applyBtn = document.getElementById("annotation-apply"), this.cancelBtn = document.getElementById("annotation-cancel"), this.clearBtn = document.getElementById("annotation-clear");
var i = window.KGPdfViewerWebApp, a = i.annotationConfig, s = i.annotationDefaultConfig;
this.annotQueue = a.annotQueue, this.queueRendering = !1, this.defaultConfig = {
mode: a.mode || s.mode,
height: a.height || s.height,
width: a.width || s.width,
minHeight: a.minHeight || s.minHeight,
minWidth: a.minWidth || s.minWidth,
font: a.font || s.font,
size: a.size || s.size,
color: a.color || s.color,
line: a.line || s.line,
callback: a.callback || s.callback,
extend: a.extend || s.extend,
annotationSuccess: a.annotationSuccess || s.annotationSuccess,
annotationQueueSuccess: a.annotQueueSuccess || s.annotQueueSuccess,
wrapSize: a.wrapSize || s.wrapSize,
editable: a.editable || s.editable
}, this.annotQueue && (this.defaultConfig.minHeight = 0, this.defaultConfig.minWidth = 0), this.modeValue = this.defaultConfig.mode, this.isSign = !1, this.userInput = "", this.extendValue = {}, this.isAnnotation = !1, this.padding = 4, this.timeAnnotation = new d(this.addDate.bind(this)), this.createDOM(), this.overlayManager = r, this.pdfStamp = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp, this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.clearBtn.onclick = this.clear.bind(this), this.cancelBtn.onclick = this.close.bind(this), this.container.querySelector(".kg_dialog_close").onclick = this.close.bind(this), this.applyBtn.onclick = this.apply.bind(this), this.modeSelect.addEventListener("change", this.onModeSelect.bind(this)), this.colorSelect.addEventListener("change", this.onColorSelect.bind(this)), this.sizeSelect.value = this.defaultConfig.size, 0 === window.KGPdfViewerWebApp.mobile && this.fontSelect.addEventListener("change", this.onFontSelect.bind(this)), this.sizeSelect.addEventListener("change", this.onSizeSelect.bind(this)), this.lineSelect.addEventListener("change", this.onLineSelect.bind(this)), 1 === window.KGPdfViewerWebApp.mobile ? this.textArea.addEventListener("input", this.onTextarea.bind(this)) : this.textArea.addEventListener("keyup", this.onTextarea.bind(this)), this.cutBlankImage = this.cutBlankImage.bind(this), this.pdfStamp = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0), this.createCanvas = this.createCanvas.bind(this.painting), this.createCanvas(this.defaultConfig), this.ListenerApplyBtn = this.ListenerApplyBtn.bind(this), this.init = this.init.bind(this), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this, t = window.KGPdfViewerWebApp.btnPositionConfig, n = t.toolbar, r = t.sidebar;
n.indexOf("annotation") > -1 && (this.app.appConfig.toolbar.kgAnnotation.removeAttribute("hidden"), this.app.appConfig.toolbar.kgAnnotation.addEventListener("click", this.show)), r.indexOf("annotation") > -1 && (this.app.appConfig.secondaryToolbar.secondaryKgAnnotation.removeAttribute("hidden"), this.app.appConfig.secondaryToolbar.secondaryKgAnnotation.addEventListener("click", this.show)), this.canvas.addEventListener("mousedown", this.ListenerApplyBtn), this.canvas.addEventListener("touchmove", this.ListenerApplyBtn), window.addEventListener("resize", function () {
return e.createCanvas(e.defaultConfig)
}), this.applyBtn.classList.add("btn"), this.applyBtn.classList.add("btn-primary"), this.applyBtn.setAttribute("data-l10n-id", "password_ok"), this.cancelBtn.classList.add("btn"), this.cancelBtn.setAttribute("data-l10n-id", "password_cancel"), this.app.l10n.translate(this.container), this._zindexByMode(this.modeValue), this._widgetByMode(this.modeValue)
}
}, {
key: "createCanvas", value: function (e) {
var t = this.isMobilePhone(), n = Math.max(e.width, e.minWidth), r = Math.max(e.height, e.minHeight), i = n,
a = r, o = -n / 2, s = -(r / 2 - 22);
e.extend && (s += 16);
var l = "50%", c = "50%";
t && (a = r, o = -(i = document.body.clientWidth - 36) / 2, s = -(r / 2 - 38), l = "50%", c = "50%"), this.setCanvasStyle(i, a, l, c, o, s, t)
}
}, {
key: "ListenerApplyBtn", value: function () {
if (!this.isSign) {
this.isSign = !0;
var e = this.canvas.getContext("2d");
console.log(111)
e.fillStyle = "rgba(255,255,255,0)", e.fillRect(0, 0, this.canvas.width, this.canvas.height)
}
this.applyBtn.removeAttribute("disabled")
}
}, {
key: "createDOM", value: function () {
for (var e = this, t = Math.max(this.defaultConfig.width, this.defaultConfig.minWidth), n = Math.max(this.defaultConfig.height, this.defaultConfig.minHeight), r = [], i = 8, a = 0; a < 10; a++) i += 4, r.push({
label: i,
value: i,
_value: i
});
for (var o = [], s = 1; s < 9; s++) o.push({label: s, value: s, _value: s});
var l = [], c = [{
key: "模式",
value: [{label: "文字批注", value: "文字批注", _value: "text"}, {label: "手写批注", value: "手写批注", _value: "write"}],
type: "modeSelect"
}, {
key: "颜色",
value: [{label: "黑色", value: "黑色", _value: "black"}, {label: "红色", value: "红色", _value: "red"}, {
label: "蓝色",
value: "蓝色",
_value: "blue"
}, {label: "绿色", value: "绿色", _value: "green"}],
type: "colorSelect"
}, {key: "字号", value: r, type: "sizeSelect"}, {key: "线宽", value: o, type: "lineSelect"}];
1 === window.KGPdfViewerWebApp.mobile ? this.defaultConfig.fonts = "黑体" : c.splice(2, 0, {
key: "字体",
value: [{label: "sans-serif", value: "sans-serif", _value: "sans-serif"}, {
label: "宋体",
value: "宋体",
_value: "宋体"
}, {label: "仿宋", value: "仿宋", _value: "仿宋"}, {label: "黑体", value: "黑体", _value: "黑体"}, {
label: "楷体",
value: "楷体",
_value: "楷体"
}],
type: "fontSelect"
});
var u = document.createElement("div");
u.classList.add("kg-widget-container"), u.classList.add("clearfix"), c.map(function (t) {
var n = t.key, r = t.value, i = t.type, a = document.createElement("div");
a.classList.add("kg-widget-item");
var o = document.createElement("label");
o.classList.add("kg-widget-item-label"), o.innerHTML = n, e[i] = document.createElement("select"), e[i].classList.add("kg-widget-input");
for (var s = 0; s < r.length; s++) {
var c = document.createElement("option");
c.value = r[s]._value, c.label = r[s].label, c.innerHTML = r[s].value, e[i].appendChild(c)
}
a.appendChild(o), a.appendChild(e[i]), u.appendChild(a), l.push(e[i])
});
var d = document.createElement("div");
d.classList.add("kg-widget-item"), d.appendChild(this.timeAnnotation.DOM), u.appendChild(d);
var h = document.createElement("div");
h.classList.add("kg-textArea"), this.textArea = document.createElement("textArea"), this.hideText = document.createElement("div"), this.hideText.classList.add("kg-hideText"), h.appendChild(this.textArea), h.appendChild(this.hideText), this.board.appendChild(u), this.defaultConfig.extend && this.createExtendModuleDOM(this.defaultConfig.extend), this.board.appendChild(h), this.modeSelect.value = this.defaultConfig.mode, this.sizeSelect.value = this.defaultConfig.size, 0 === window.KGPdfViewerWebApp.mobile && (this.fontSelect.value = this.defaultConfig.font), this.colorSelect.value = this.defaultConfig.color, this.lineSelect.value = this.defaultConfig.line, this.painting.setLineSize(this.defaultConfig.line), this.painting.setLineColor(this.defaultConfig.color), this.textArea.style["font-size"] = this.sizeSelect.value + "px", this.textArea.style.color = this.colorSelect.value, this.sizeSelect.value = this.defaultConfig.size, 0 === window.KGPdfViewerWebApp.mobile && (this.textArea.style["font-family"] = this.fontSelect.value), this.hideText.style["font-size"] = this.sizeSelect.value + "px", this.hideText.style.color = this.colorSelect.value, this.sizeSelect.value = this.defaultConfig.size, 0 === window.KGPdfViewerWebApp.mobile && (this.hideText.style["font-family"] = this.fontSelect.value), h.style.width = t + "px", h.style.height = n + "px";
var p = this.defaultConfig.wrapSize;
if (p) {
var f = Math.min(this.sizeSelect.value * (Number(p) + 0), t);
f !== t && (f += this.padding), this.resizeTextarea(f, n)
} else this.resizeTextarea(t, n);
this.defaultConfig.editable || l.map(function (e) {
e.setAttribute("disabled", "disabled"), e.style.cursor = "not-allowed"
}), this.hideText.style.top = -(n + 4) + "px", this.container.querySelector(".kg_dialog_header").style.width = t + 48 + "px", this.container.querySelector("#kg-AnnotationBoard").style.width = t + 48 + "px", this.container.querySelector(".kg_dialog_footer").style.width = t + 48 + "px", this.container.querySelector(".kg_dialog_title").style.width = t + "px", this.container.querySelector(".kg-widget-container").style.width = t + "px"
}
}, {
key: "createExtendModuleDOM", value: function (e) {
switch (this.ExtendContainer = document.createElement("div"), this.ExtendContainer.setAttribute("id", "KG_ExtendContainer"), this.ExtendContainer.classList.add("kg-widget-container"), this.ExtendContainer.classList.add("clearfix"), e.type) {
case"radio":
case"checkbox":
this._createCheckboxOrRadioDOM(e, this.ExtendContainer);
break;
case"select":
this._createSelectDOM(e, this.ExtendContainer)
}
this.board.appendChild(this.ExtendContainer)
}
}, {
key: "_createCheckboxOrRadioDOM", value: function (e, t) {
var n = e.title, r = e.type, i = e.options, a = this, o = document.createElement("div");
o.classList.add("kg-extend-item");
var s = document.createElement("label");
s.innerHTML = n, s.classList.add("kg-extend-label");
for (var l = function (e) {
var n = document.createElement("div"), l = document.createElement("input"),
c = document.createElement("label"), u = "kg-extend-item-id-" + i[e].value, d = i[e].checked;
n.classList.add("kg-extend-" + r + "-item"), n.classList.add("kg_" + r + "_wrapper"), n.setAttribute("data-kg-id", u), l.setAttribute("name", "kg-extend-options"), l.setAttribute("data-kg-id", u), l.type = r, l.value = i[e].value, l.setAttribute("id", u), c.innerHTML = i[e].text, c.setAttribute("for", u), c.setAttribute("data-kg-id", u), n.addEventListener("click", function () {
"radio" === r ? (Array.prototype.slice.call(o.childNodes).map(function (e) {
e.classList.remove("kg_" + r + "_wrapper-checked")
}), l.id === this.getAttribute("data-kg-id") ? (this.classList.add("kg_" + r + "_wrapper-checked"), a._setValueByRadioOrSelect(l.value)) : this.classList.remove("kg_" + r + "_wrapper-checked")) : (this.classList.toggle("kg_" + r + "_wrapper-checked"), a._setValueByCheckbox())
}), n.appendChild(l), n.appendChild(c), o.appendChild(n), t.appendChild(s), t.appendChild(o), d && (n.classList.add("kg_" + r + "_wrapper-checked"), "radio" === r ? (l.setAttribute("checked", "checked"), a._setValueByRadioOrSelect(l.value)) : a._setValueByCheckbox())
}, c = 0; c < i.length; c++) l(c)
}
}, {
key: "resizeTextarea", value: function (e, t) {
this.textArea.style.width = e + "px", this.textArea.style.height = t + "px", this.hideText.style.width = e + "px", this.hideText.style.height = t + "px"
}
}, {
key: "_createSelectDOM", value: function (e, t) {
var n = this, r = e.title, i = e.type, a = e.options, o = void 0, s = document.createElement("div");
s.classList.add("kg-extend-item");
var l = document.createElement("label");
l.classList.add("kg-extend-label"), l.innerHTML = r;
var c = document.createElement(i);
c.classList.add("kg-widget-input");
for (var u = 0; u < a.length; u++) {
var d = document.createElement("option");
d.value = a[u].value, d.id = "kg-extend-item-id-" + a[u].value, d.label = a[u].text, d.innerHTML = a[u].text, c.appendChild(d), a[u].checked && (o = d.value)
}
o || (o = a[0].value), c.value = o, this._setValueByRadioOrSelect(o), c.addEventListener("change", function () {
n._setValueByRadioOrSelect(c.value)
}), s.appendChild(l), s.appendChild(c), t.appendChild(s)
}
}, {
key: "_setValueByRadioOrSelect", value: function (e) {
this.extendValue.result = e
}
}, {
key: "_setValueByCheckbox", value: function () {
var e = this.ExtendContainer.querySelectorAll(".kg_checkbox_wrapper-checked"), t = e.length, n = [];
if (t) for (var r = 0; r < t; r++) {
var i = e[r].getAttribute("data-kg-id"), a = this.ExtendContainer.querySelector("#" + i).value;
n.push(a)
}
this.extendValue.result = n
}
}, {
key: "onModeSelect", value: function (e) {
this.switchMode(e.target.value)
}
}, {
key: "onFontSelect", value: function (e) {
this._editTextarea({key: "font-family", val: e.target.value})
}
}, {
key: "onColorSelect", value: function (e) {
this._editTextarea({key: "color", val: e.target.value}), this.painting.setLineColor(e.target.value)
}
}, {
key: "onSizeSelect", value: function (e) {
var t = Number(e.target.value), n = this.defaultConfig.wrapSize;
if (this._editTextarea({key: "font-size", val: t + "px"}), n) {
var r = Math.max(this.defaultConfig.width, this.defaultConfig.minWidth),
i = Math.max(this.defaultConfig.height, this.defaultConfig.minHeight), a = Math.min(n * t, r);
a !== r && (a += this.padding), this.resizeTextarea(a, i)
}
}
}, {
key: "_editTextarea", value: function (e) {
var t = e.key, n = e.val;
this.textArea.style[t] = n, this.hideText.style[t] = n
}
}, {
key: "addDate", value: function (e) {
this.value = this.textArea.value = this.textArea.value + e, this.hideText.innerHTML = this.convertText(this.value), this.applyIsDisabled()
}
}, {
key: "switchMode", value: function (e) {
e !== this.modeValue && (this.modeValue = e, this._zindexByMode(e), this._widgetByMode(e), this.clear())
}
}, {
key: "_zindexByMode", value: function (e) {
"text" === e ? (this.textArea.style["z-index"] = 8, this.canvas.style["z-index"] = -1) : (this.textArea.style["z-index"] = -1, this.canvas.style["z-index"] = 8)
}
}, {
key: "_widgetByMode", value: function (e) {
var t = [this.sizeSelect, this.lineSelect];
this.sizeSelect.value = this.defaultConfig.size, 0 === window.KGPdfViewerWebApp.mobile && (t = [this.fontSelect, this.sizeSelect, this.lineSelect]), t.forEach(function (e) {
e.parentNode.style.display = "none"
}), "text" === e ? (this.sizeSelect.value = this.defaultConfig.size, 0 === window.KGPdfViewerWebApp.mobile && (this.fontSelect.parentNode.style.display = "block"), this.sizeSelect.parentNode.style.display = "block") : this.lineSelect.parentNode.style.display = "block"
}
}, {
key: "onTextarea", value: function (e) {
this.value = e.target.value, this.hideText.innerHTML = this.convertText(this.value), this.applyIsDisabled()
}
}, {
key: "applyIsDisabled", value: function () {
this.value.trim() ? this.applyBtn.removeAttribute("disabled") : this.applyBtn.setAttribute("disabled", !0)
}
}, {
key: "show", value: function () {
window.KGPdfViewerWebApp.PDFViewerApplication.secondaryToolbar.close(), this.pdfStamp = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp, this.pdfStamp && (this.pdfStamp.isStamp || this.pdfStamp.tempSeals.length) && this.keySN ? this.open() : this.verifyPassword()
}
}, {
key: "verifyPassword", value: function () {
var e = this, t = window.KGPdfViewerWebApp.sealOrigin,
n = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt;
if ("1" === t.toString()) {
var r = new l.iWebAssist({clientType: "0"});
Promise.all([r.promise]).then(function () {
return r.getKeyInfo()
}).then(function (t) {
var r = l.iWebAssistError.getKeyInfo;
if (t.result) window.KGPdfViewerWebApp.userId = t.keysn, window.KGPdfViewerWebApp.userCode = t.usercode, e._getUserByKeysn(); else {
var i = t.errmsg || r[t.errcode] || r[t.errmsg] || "未知异常";
n.open(i)
}
})
} else this._getUserByKeysn()
}
}, {
key: "_getUserByKeysn", value: function () {
var e = this, t = window.KGPdfViewerWebApp.getPasswordPrompt();
this.pdfStamp = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp, t.open(), t.setUpdateCallback(function (n) {
window.KGPdfViewerWebApp.getUserBeforeSign(n).then(function (r) {
return (0, i.closeOverlay)().then(function () {
r.data.status ? (t.remember(), e.pdfStamp.pdfStampSeal.keyPwd = n, e.keySN = r.data.keySN, e.unitName = r.data.unitName, e.userName = r.data.userName, e.signSN = r.data.signSN, window.KGPdfViewerWebApp.userCode = r.data.userCode, e.open()) : window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(r.data.message)
})
})
})
}
}, {
key: "apply", value: function (e, t, n) {
var r = this;
if (!this.applyBtn.hasAttribute("disabled") || t) {
this.isAnnotation = !0, this.userInput = this.textArea.value;
var i = this.handleEdittable(this.hideText);
return this.setWebHandWrite(i, {
fontStyle: "normal",
fontSize: t ? Number(this.defaultConfig.size) : this.hideText.style["font-size"],
fontFamily: t ? this.defaultConfig.font : this.hideText.style["font-family"],
fontColor: t ? this.defaultConfig.color : this.hideText.style.color
}), e && (e.preventDefault(), e.stopPropagation()), new Promise(function (e) {
r.cutBlankImage(r.canvas, r.painting, e)
}).then(function (e) {
r.clear(), r.close();
var i = "text" === r.modeValue ? "文字批注" : "手写批注";
if (t && (i = "文字批注"), e.keySN = r.keySN, e.userCode = window.KGPdfViewerWebApp.userCode, e.signName = i, e.signSN = r.signSN, e.userName = r.userName, e.unitName = r.unitName, e.height = e.height * r.times, e.width = e.width * r.times, e.sealType = "signature", e.sealtag = window.KGPdfViewerWebApp.sealType, t) switch (t.mode) {
case 0:
case 1:
break;
default:
t.mode = 0
}
if (t && 0 === t.mode) return e.left = t.left || 0, e.top = t.top || 0, e.page = t.page, e.isStampOfXY = !0, n.push(e), e;
if (t && 1 === t.mode) return e.isStampOfText = !0, e.page = t.page, e.text = t.text, e.offsetX = t.offsetX || 0, e.offsetY = t.offsetY || 0, n.push(e), e;
var o = window.KGPdfViewerWebApp.annotationConfig.callback;
if (o) o(e); else {
var s = (0, a.createCapability)();
r.pdfStamp.setSealData({seal: e, capability: s})
}
})
}
}
}, {
key: "resetAnnotationExtendValue", value: function () {
this.userInput = "", this.isAnnotation = !1
}
}, {
key: "onLineSelect", value: function (e) {
this.painting.setLineSize(e.target.value)
}
}, {
key: "clear", value: function (e) {
e && (e.preventDefault(), e.stopPropagation()), this.isSign = !1, this.applyBtn.setAttribute("disabled", !0), this.painting.clearCanvas(), this.value = "", this.textArea.value = "", this.hideText.innerHTML = ""
}
}, {
key: "cutBlankImage", value: function (e, t, n) {
for (var r = e.getContext("2d").getImageData(0, 0, e.width, e.height), i = r.data, a = r.width, o = 0, s = r.height, l = 0, c = 0; c < e.width; c++) for (var u = 0; u < r.height; u++) {
var d = 4 * (c + r.width * u);
(i[d] > 0 || i[d + 1] > 0 || i[d + 2] || i[d + 3] > 0) && (l = Math.max(u, l), o = Math.max(c, o), s = Math.min(u, s), a = Math.min(c, a))
}
a++, o++, s++, l++;
var h = t.saveImage(), p = new Image;
p.src = h, p.onload = function () {
var e = document.createElement("canvas");
e.width = o - a, e.height = l - s, e.getContext("2d").drawImage(p, a, s, e.width, e.height, 0, 0, e.width, e.height);
var t = {};
t.imgdata = e.toDataURL(), t.imgExt = "png", t.width = e.width / 5, t.height = e.height / 5, n(t)
}
}
}, {
key: "setWebHandWrite", value: function (e, t) {
var n = this.canvas.getContext("2d");
console.log(n)
n.textAlign = "left", n.textBaseline = "bottom", n.shadowBlur = 0, n.font = t.fontStyle + " " + parseFloat(t.fontSize) * this.times + "px " + t.fontFamily, n.fillStyle = t.fontColor;
for (var r = 0; e && r < e.length; r++) {
var i = e[r];
n.fillText(i.txt, i.left * this.times, i.top * this.times)
}
}
}, {
key: "handleEdittable", value: function (e) {
for (var t = navigator.userAgent.indexOf("Trident") >= 0, n = [], r = 0, i = 0, a = e.children, o = 0; o < a.length; o++) {
var s = a[o].innerHTML || a[o].innerText, l = {};
"<br>" === s && (r = 0, i += t ? a[o].offsetHeight / 2 : a[o].offsetHeight, s = ""), 0 === i && (i = a[o].offsetHeight + 2), r >= e.offsetWidth - a[o].offsetWidth && (r = 0, i += a[o].offsetHeight, i += 4), l.txt = s, l.left = r, l.top = i, n.push(l), "" !== s && (r += a[o].offsetWidth)
}
return n
}
}, {
key: "convertText", value: function (e) {
for (var t = "", n = 0; n < e.length; n++) t += e[n].replace(/(\S)/gi, "<span>$1</span>").replace(/\n|\r/gi, "<span><br></span>").replace(/\s/gi, "<span> </span>");
return t
}
}, {
key: "createTextAnnotSealObj", value: function (e, t) {
var n = this;
return this.overlayManager.open(this.overlayName).then(function (r) {
n.hideText.innerHTML = "", n.clear(), n.hideText.innerHTML = n.convertText(e.content);
var i = (0, s.default)(), a = null;
switch (e.timeStampType) {
case 0:
a = n.convertText(i.format("YYYY-MM-DD"));
break;
case 1:
a = n.convertText(i.format("YYYY-MM-DD HH:mm:ss"));
break;
case 2:
a = n.convertText(i.format("YYYY年MM月DD日"));
break;
case 3:
a = n.convertText(i.format("YYYY年MM月DD日 HH:mm:ss"))
}
return n.hideText.innerHTML += a, n.apply(null, e, t)
})
}
}, {
key: "createAnnotPromise", value: function (e) {
var t = this;
return new Promise(function (n, r) {
var i = [];
t.createTextAnnotSealObj(e, i).then(function (t) {
var n = [];
switch (e.mode) {
case 0:
return n.push(new Promise(function (e) {
window.KGPdfViewerWebApp.stampOfXY("", null, null, i, e)
})), Promise.all(n);
case 1:
return n.push(new Promise(function (e) {
window.KGPdfViewerWebApp.stampOfText("", null, i, e)
})), Promise.all(n)
}
}).then(function (e) {
n(e)
})
})
}
}, {
key: "hideAndWriteAnnotQueue", value: function () {
var e = this;
this.container.style.opacity = "0", this.queueRendering = !0, (0, i.limitQueueFn)(this.annotQueue, 1, this.createAnnotPromise.bind(this)).then(function () {
e.container.style.opacity = "1", e.queueRendering = !1, e.defaultConfig.annotationQueueSuccess && (e.defaultConfig.annotationQueueSuccess(), e.resetAnnotationExtendValue())
})
}
}, {
key: "open", value: function () {
return this.annotQueue ? this.hideAndWriteAnnotQueue() : this.overlayManager.open(this.overlayName)
}
}, {
key: "close", value: function () {
var e = this;
this.annotQueue || this.overlayManager.close(this.overlayName).then(function () {
e.closeCallback && e.closeCallback(), e.clear()
})
}
}, {
key: "hide", value: function () {
this.container.classList.add("hidden")
}
}]), e
}();
var d = function () {
function e(t) {
u(this, e), this.value = "", this.TimeSignaturePanel = null, this.okBtn = null, this.cancelBtn = null, this.openBtn = null, this.DOM = null, this.createDOM(), this.callBack = t, this.cancelBtn.addEventListener("click", this.onCancel.bind(this)), this.okBtn.addEventListener("click", this.onOk.bind(this)), this.openBtn.addEventListener("click", this.open.bind(this))
}
return r(e, [{
key: "createDOM", value: function () {
var e = this, t = document.createElement("div");
t.setAttribute("id", "TimeAnnotationContainer"), this.openBtn = document.createElement("div"), this.openBtn.setAttribute("id", "TimeSignatureSelectBtn"), this.openBtn.classList.add("kg-button"), this.openBtn.innerHTML = "时间签批", t.appendChild(this.openBtn), this.TimeSignaturePanel = document.createElement("div"), this.TimeSignaturePanel.setAttribute("id", "KG_TimeSignaturePanel"), this.TimeSignaturePanel.setAttribute("hidden", !0);
for (var n = (0, s.default)(), r = [{
value: n.format("YYYY-MM-DD"),
id: "YYYY-MM-DD"
}, {
value: n.format("YYYY-MM-DD HH:mm:ss"),
id: "YYYY-MM-DD HH:mm:ss",
checked: "checked"
}, {value: n.format("YYYY年MM月DD日"), id: "YYYY年MM月DD日"}, {
value: n.format("YYYY年MM月DD日 HH:mm:ss"),
id: "YYYY年MM月DD日 HH:mm:ss"
}], i = function (t) {
var n = document.createElement("div"), i = document.createElement("input"),
a = document.createElement("label");
n.classList.add("kg-time-item"), i.setAttribute("name", "TimeSignatureOption"), i.type = "radio", i.value = r[t].value, i.setAttribute("id", r[t].id), a.innerHTML = r[t].value, a.setAttribute("for", r[t].id), i.addEventListener("click", function () {
return e._setValue(i.value)
}), a.addEventListener("click", function () {
return e._setValue(i.value)
}), r[t].checked && (i.setAttribute("checked", "checked"), e._setValue(i.value)), n.appendChild(i), n.appendChild(a), e.TimeSignaturePanel.appendChild(n)
}, a = 0; a < r.length; a++) i(a);
var o = document.createElement("div");
o.classList.add("btnContainer"), this.okBtn = document.createElement("div"), this.okBtn.classList.add("kg-button"), this.okBtn.classList.add("kg-button-primary"), this.okBtn.setAttribute("id", "TimeSignatureOkBtn"), this.okBtn.innerHTML = "确定", this.cancelBtn = document.createElement("div"), this.cancelBtn.classList.add("kg-button"), this.cancelBtn.setAttribute("id", "TimeSignatureCancelBtn"), this.cancelBtn.innerHTML = "取消", o.appendChild(this.cancelBtn), o.appendChild(this.okBtn), this.TimeSignaturePanel.appendChild(o), t.appendChild(this.TimeSignaturePanel), this.DOM = t
}
}, {
key: "onOk", value: function () {
this.callBack && this.callBack(this.value), this._showAndHide()
}
}, {
key: "onCancel", value: function () {
this._showAndHide()
}
}, {
key: "open", value: function () {
this._showAndHide()
}
}, {
key: "close", value: function () {
this._showAndHide()
}
}, {
key: "_showAndHide", value: function () {
this.TimeSignaturePanel.hasAttribute("hidden") ? (this.TimeSignaturePanel.removeAttribute("hidden", !1), this.TimeSignaturePanel.style.height = this.TimeSignaturePanel.offsetHeight, this.TimeSignaturePanel.style.opacity = "1", this.TimeSignaturePanel.parentNode.parentNode.style["z-index"] = 10) : (this.TimeSignaturePanel.setAttribute("hidden", !0), this.TimeSignaturePanel.style.opacity = "0", this.TimeSignaturePanel.parentNode.parentNode.style["z-index"] = 0)
}
}, {
key: "_setValue", value: function (e) {
this.value = e
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_NoServer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(2), a = n(62);
var o = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.stamp = !1, this.verify = !1, this.verifyOnload = !1, this.unit = window.KGPdfViewerWebApp.externalUnit || "px"
}
return r(e, [{
key: "renderExternalSeals", value: function (e, t) {
for (var n = [], r = 0; r < e.length; r++) {
var a = e[r], o = t.getPageView(a.page - 1), s = o.viewport.scale, l = o.viewport.viewBox[2],
c = o.viewport.viewBox[3];
switch (a.sizeUnit) {
case"mm":
a.width && (a.width = (0, i.mmCovertToPx)(a.width)), a.height && (a.height = (0, i.mmCovertToPx)(a.height));
break;
case"cm":
a.width && (a.width = (0, i.mmCovertToPx)(10 * a.width)), a.height && (a.height = (0, i.mmCovertToPx)(10 * a.height))
}
switch (a.positionUnit) {
case"mm":
a.top && (a.top = (0, i.mmCovertToPx)(a.top)), a.right && (a.right = (0, i.mmCovertToPx)(a.right)), a.bottom && (a.bottom = (0, i.mmCovertToPx)(a.bottom)), a.left && (a.left = (0, i.mmCovertToPx)(a.left));
break;
case"cm":
a.top && (a.top = (0, i.mmCovertToPx)(10 * a.top)), a.right && (a.right = (0, i.mmCovertToPx)(10 * a.right)), a.bottom && (a.bottom = (0, i.mmCovertToPx)(10 * a.bottom)), a.left && (a.left = (0, i.mmCovertToPx)(10 * a.left));
break;
case"percent":
a.top = (1 - a.bottom) * c - a.height / 2, a.bottom = a.bottom * c - a.height / 2, a.left = a.left * l - a.width / 2
}
var u = (new Date).getTime(), d = this.app.pdfStamp._createSection(a, u, u, "", a.left, a.top, s);
o.pdfPage.newStamps[u] = d, this.app.pdfStamp.updatePageView(o, d), n.push({
top: a.top,
left: a.left,
width: a.width,
height: a.height,
page: a.page,
section: d,
annotId: u
})
}
window.KGPdfViewerWebApp.renderExternalSealsComplete && window.KGPdfViewerWebApp.renderExternalSealsComplete(n)
}
}, {
key: "stampSeal", value: function () {
}
}, {
key: "getSeals", value: function () {
}
}, {
key: "verifySeal", value: function () {
}
}, {
key: "deleteSeal", value: function (e, t) {
var n = this.app, r = n.pdfViewer.getPageView(e - 1), i = r.pdfPage, o = document.getElementById(t);
(0, a.deleteOneSeal)(r, n, i, o)
}
}]), e
}();
t.KG_NoServer = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_SignaturePad = void 0;
var r, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(43), o = n(2), s = n(69), l = n(185), c = (r = l) && r.__esModule ? r : {default: r}, u = n(42);
t.KG_SignaturePad = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.metas = [{node: "meta", name: "x5-orientation", content: "portrait"}, {
node: "meta",
name: "screen-orientation",
content: "portrait"
}, {node: "meta", name: "browsermode", content: "application"}, {
node: "meta",
name: "x5-page-mode",
content: "app"
}, {node: "meta", name: "msapplication-tap-highlight", content: "no"}, {
node: "meta",
name: "format-detection",
content: "telephone=no"
}], this.painting = new c.default({
canvasId: "kgSignatureCanvas",
lineColor: "#1a1a1a"
}), this.canvas = document.getElementById("kgSignatureCanvas"), this.app = t, this.container = n.container, this.overlayName = n.overlayName, this.isSign = !1, this.canvas = document.getElementById("kgSignatureCanvas"), this.board = document.getElementById("kgSignatureBoard"), this.applyBtn = document.getElementById("sign-msg-apply"), this.cancelBtn = document.getElementById("sign-msg-cancel"), this.clearBtn = document.getElementById("sign-msg-clear"), this.blackBtn = document.getElementById("sign-msg-black"), this.blueBtn = document.getElementById("sign-msg-blue"), this.redBtn = document.getElementById("sign-msg-red"), this.thick = document.getElementById("sign-msg-thick"), this.thickTip = document.getElementById("sign-msg-thick-tip"), this.thickSlide = document.getElementById("sign-msg-thick-slide"), this.thickDrop = document.getElementById("sign-msg-thick-drop"), this.lastPageY = 0, this.lastThickDropLeft = 0, this.maxLineSize = 8, this.isSign = !1, this.overlayManager = r, this.pdfStamp = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp, this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.isIframe = window != top, this.clearBtn.onclick = this.clear.bind(this), this.cancelBtn.onclick = this.close.bind(this), this.container.querySelector(".kg_dialog_close").onclick = this.close.bind(this), this.applyBtn.onclick = this.apply.bind(this), this.blackBtn.onclick = this.setColor.bind(this), this.blueBtn.onclick = this.setColor.bind(this), this.redBtn.onclick = this.setColor.bind(this), this.thick.onclick = this.toggleThickTip.bind(this), this.thickDrop.ontouchstart = this.thickDropTouchStart.bind(this), this.thickDrop.ontouchmove = this.thickDropTouchMove.bind(this), this.thickDrop.ontouchend = this.thickDropTouchEnd.bind(this), this.thickDrop.onmousedown = this.thickDropMouseStart.bind(this), this.thickDrop.onmouseup = this.thickDropMouseEnd.bind(this), this.thickDrop.onmouseout = this.thickDropMouseEnd.bind(this), this.cutBlankImage = this.cutBlankImage.bind(this), this.setMeta = this.setMeta.bind(this), this.lineSize = 5, this.setSize(this.lineSize), this.ListenerApplyBtn = this.ListenerApplyBtn.bind(this), this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0), this.createCanvas = this.createCanvas.bind(this.painting), document.body.clientWidth < 720 ? this.isRotate = !0 : this.isRotate = !1, this.createCanvas(), this.init = this.init.bind(this), this.init()
}
return i(e, [{
key: "ListenerApplyBtn", value: function (e) {
console.log(e)
if (!this.isSign) {
this.isSign = !0;
var e = this.canvas.getContext("2d");
console.log(e)
e.fillStyle = "rgba(255,255,255,0)", e.fillRect(0, 0, this.canvas.width, this.canvas.height)
}
this.applyBtn.removeAttribute("disabled"), this.hideThickTip()
}
}, {
key: "init", value: function () {
console.log(11111111)
var e = window.KGPdfViewerWebApp.btnPositionConfig, t = e.toolbar, n = e.sidebar;
t.indexOf("signature") > -1 && (this.app.appConfig.toolbar.kgSignature.removeAttribute("hidden"), this.app.appConfig.toolbar.kgSignature.addEventListener("click", this.show)), n.indexOf("signature") > -1 && (this.app.appConfig.secondaryToolbar.secondaryKgSignature.removeAttribute("hidden"), this.app.appConfig.secondaryToolbar.secondaryKgSignature.addEventListener("click", this.show)), this.canvas.addEventListener("mousedown", this.ListenerApplyBtn), this.canvas.addEventListener("touchmove", this.ListenerApplyBtn), window.addEventListener("resize", this.createCanvas), this.isRotate || (this.applyBtn.classList.add("btn"), this.applyBtn.classList.add("btn-primary"), this.applyBtn.setAttribute("data-l10n-id", "password_ok"), this.cancelBtn.classList.add("btn"), this.cancelBtn.setAttribute("data-l10n-id", "password_cancel"), this.app.l10n.translate(this.container))
}
}, {
key: "createCanvas", value: function () {
if (this.isRotate) {
var e = document.body.clientWidth, t = document.body.clientHeight;
console.log(e)
console.log(t)
this.setCanvasStyle(e, t, 0, 0, 0, 0, !0)
} else {
this.setCanvasStyle(720, 360, "50%", "50%", -360, -180, !1)
}
}
}, {
key: "hideThickTip", value: function () {
console.log(11111111)
this.thickTip.style.display = "none"
}
}, {
key: "toggleThickTip", value: function (e) {
console.log(123123)
if (e.preventDefault(), e.stopPropagation(), "none" === this.thickTip.style.display) {
this.thickTip.style.display = "block";
var t = this.thickSlide.offsetWidth * (this.lineSize - 1) / this.maxLineSize;
this.thickDrop.style.left = t + "px"
} else this.hideThickTip()
}
}, {
key: "hideThickTip", value: function () {
this.thickTip.style.display = "none"
}
}, {
key: "thickDropTouchStart", value: function (e) {
console.log(123123)
e.preventDefault(), e.stopPropagation(), this.lastPageX = void 0 !== e.touches ? e.touches[0].pageX : this.lastPageX = e.pageX, this.lastPageY = void 0 !== e.touches ? e.touches[0].pageY : this.lastPageY = e.pageY, this.lastThickDropLeft = Number(this.thickDrop.style.left.slice(0, -2))
}
}, {
key: "thickDropMouseStart", value: function (e) {
console.log(123123)
e.preventDefault(), e.stopPropagation(), this.lastPageX = e.pageX, this.lastThickDropLeft = Number(this.thickDrop.style.left.slice(0, -2));
var t = this;
document.onmousemove = function (e) {
console.log(123123123124)
e.preventDefault(), e.stopPropagation();
var n = e.pageX, r = t.lastThickDropLeft + (n - t.lastPageX);
r < 0 ? r = 0 : r > t.thickSlide.offsetWidth - t.thickDrop.offsetWidth && (r = t.thickSlide.offsetWidth - t.thickDrop.offsetWidth);
var i = t.thickSlide.offsetWidth / t.maxLineSize;
t.thickDrop.style.left = r + "px", t.lineSize = Math.round(r / i) + 1, t.setSize(t.lineSize)
}
}
}, {
key: "thickDropTouchMove", value: function (e) {
console.log(123123)
e.preventDefault(), e.stopPropagation();
var t = void 0, n = void 0, r = void 0;
document.body.clientWidth;
this.isRotate ? (n = e.touches[0].pageY, r = this.lastThickDropLeft + (n - this.lastPageY)) : (t = e.touches[0].pageX, r = this.lastThickDropLeft + (t - this.lastPageX)), r < 0 ? r = 0 : r > this.thickSlide.offsetWidth - this.thickDrop.offsetWidth && (r = this.thickSlide.offsetWidth - this.thickDrop.offsetWidth);
var i = this.thickSlide.offsetWidth / this.maxLineSize;
this.thickDrop.style.left = r + "px", this.lineSize = Math.round(r / i) + 1, this.setSize(this.lineSize)
}
}, {
key: "thickDropTouchEnd", value: function (e) {
console.log(123123)
e.preventDefault(), e.stopPropagation()
}
}, {
key: "thickDropMouseEnd", value: function (e) {
console.log(123123)
e.preventDefault(), e.stopPropagation(), document.onmousemove = null
}
}, {
key: "setSize", value: function (e) {
console.log(123123)
this.painting.setLineSize(e)
}
}, {
key: "setColor", value: function (e) {
console.log(123123)
e.preventDefault(), e.stopPropagation(), this.hideThickTip();
var t = e.target, n = t.getAttribute("data-color");
t.parentNode.querySelector('div[data-color][class="selected"]').removeAttribute("class"), t.setAttribute("class", "selected"), this.painting.setLineColor(n)
}
}, {
key: "show", value: function () {
console.log(123123)
window.KGPdfViewerWebApp.PDFViewerApplication.secondaryToolbar.close(), this.pdfStamp = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp, this.pdfStamp && (this.pdfStamp.isStamp || this.pdfStamp.tempSeals.length) && this.keySN ? this.open() : this.verifyPassword()
}
}, {
key: "verifyPassword", value: function () {
console.log(123123)
var e = this, t = window.KGPdfViewerWebApp.getPasswordPrompt();
t.open(), t.setUpdateCallback(function (n) {
console.log(123123)
if (1 === window.KGPdfViewerWebApp.sealOrigin) {
var r = new u.KG_OFD, i = void 0;
r.promise.then(function () {
return r.WebGetKeyCount()
}).then(function () {
return r.WebOpenKey(0)
}).then(function (e) {
return i = e, r.WebKeyIsNotAdmin(i)
}).then(function () {
return r.WebVerifyPin(i, n)
}).then(function () {
return r.WebSetAlgoFlag()
}).then(function () {
return r.WebGetCertData(i)
}).then(function (e) {
return window.KGPdfViewerWebApp.cert = e, r.WebGetKeySerialNumber(i)
}).then(function (t) {
return window.KGPdfViewerWebApp.keySN = t, e.keySN = t, r.WebGetKeyUnit(i)
}).then(function (r) {
e.unitName = r, t.remember(), t.pwd = n, e.open()
}).catch(function (t) {
var n = t.message;
return (0, o.closeOverlay)().then(function () {
e.app.KGAlertPrompt.open(n)
}), Promise.resolve()
}).then(function () {
if (null != i) return r.WebCloseKey(i)
})
} else window.KGPdfViewerWebApp.getUserBeforeSign(n).then(function (n) {
return (0, o.closeOverlay)().then(function () {
n.data.status ? (t.remember(), e.keySN = n.data.keySN, e.unitName = n.data.unitName, e.userName = n.data.userName, e.signSN = n.data.signSN, e.open()) : (window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(n.data.message), t.clearRememberedPwd())
})
})
})
}
}, {
key: "setMeta", value: function () {
console.log(123123)
this.metas.forEach(function (e) {
var t = document.createElement(e.node);
t.name = e.name, t.content = e.content, document.head.appendChild(t)
})
}
}, {
key: "remoteMeta", value: function () {
console.log(123123)
this.metas.forEach(function (e) {
var t = document.head.querySelector(e.node + '[name="' + e.name + '"]');
document.head.removeChild(t)
})
}
}, {
key: "apply", value: function (e) {
console.log(123123)
var t = this;
if (!this.applyBtn.hasAttribute("disabled")) {
this.painting.isMobilePhone();
return e && (e.preventDefault(), e.stopPropagation()), this.hideThickTip(), new Promise(function (e) {
t.cutBlankImage(t.canvas, t.painting, e)
}).then(function (e) {
console.log(123123)
t.close();
var n = (0, a.createCapability)();
e.keySN = t.keySN, e.signName = "个人签名", e.signSN = t.signSN, e.userName = t.userName, e.unitName = t.unitName, e.sealType = "signature";
var r = e.imgdata, i = e.height;
document.body.clientWidth;
t.isRotate ? (0, s.rotateBase64Img)(r, 270, function (r) {
e.imgdata = r, e.height = e.width, e.width = i, t.pdfStamp.setSealData({seal: e, capability: n})
}) : (0, s.rotateBase64Img)(r, 0, function (r) {
e.imgdata = r, e.height = i, e.width = e.width, t.pdfStamp.setSealData({seal: e, capability: n})
})
})
}
}
}, {
key: "clear", value: function (e) {
console.log(123123)
e && (e.preventDefault(), e.stopPropagation()), this.isSign = !1, this.hideThickTip(), this.applyBtn.setAttribute("disabled", !0), this.painting.clearCanvas()
}
}, {
key: "cutBlankImage", value: function (e, t, n) {
console.log(123123)
for (var r = e.getContext("2d").getImageData(0, 0, e.width, e.height), i = r.data, a = r.width, o = 0, s = r.height, l = 0, c = 0; c < e.width; c++) for (var u = 0; u < r.height; u++) {
var d = 4 * (c + r.width * u);
(i[d] > 0 || i[d + 1] > 0 || i[d + 2] || i[d + 3] > 0) && (l = Math.max(u, l), o = Math.max(c, o), s = Math.min(u, s), a = Math.min(c, a))
}
a++, o++, s++, l++;
var h = t.saveImage(), p = new Image;
p.src = h, p.onload = function () {
console.log(123123)
var e = document.createElement("canvas");
e.width = o - a, e.height = l - s, e.getContext("2d").drawImage(p, a, s, e.width, e.height, 0, 0, e.width, e.height);
var t = {};
t.imgdata = e.toDataURL(), t.imgExt = "png", t.width = e.width / 5, t.height = e.height / 5, n(t)
}
}
}, {
key: "open", value: function () {
var e = this;
return this.overlayManager.open(this.overlayName).then(function () {
console.log(123123)
e.setMeta()
})
}
}, {
key: "close", value: function () {
var e = this;
return new Promise(function (t) {
console.log(123123)
e.overlayManager._active.indexOf(e.overlayName) > -1 ? t(e.overlayManager.close(e.overlayName)) : t()
}).then(function () {
e.closeCallback && e.closeCallback(), e.clear(), e.remoteMeta(), e.hideThickTip()
})
}
}, {
key: "hide", value: function () {
this.container.classList.add("hidden")
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_IWebAuth = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(416), a = n(21), o = c(n(17)), s = c(n(34)), l = n(2);
function c(e) {
return e && e.__esModule ? e : {default: e}
}
var u = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.options = n, this.providerName = null, this.iWebAssist = null, this.alertPrompt = this.app.KGAlertPrompt, this.tipPrompt = window.KGPdfViewerWebApp.getTipPrompt(), this.iWebAuthInstance = null, this.iWebAuthConfig = window.KGPdfViewerWebApp.iWebAuth, this.sealData = [], this.CAType = null, this.algorithmType = null, this.handleToggle = this.handleToggle.bind(this), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this, t = void 0, n = [], r = this.iWebAuthConfig, i = r.scan, a = r.uKey;
i && (this.options.scanButton.removeAttribute("hidden"), this.options.scanButton.addEventListener("click", function () {
t = 1, e.stamp(t), n.push("iWebAuthScan")
})), a && (this.options.ukeyButton.removeAttribute("hidden"), this.options.ukeyButton.addEventListener("click", function () {
t = 0, e.stamp(t), n.push("iWebAuthUkey")
})), window.KGPdfViewerWebApp.btnPositionConfig = {
toolbar: n,
sidebar: []
}, document.querySelector("#toolbarViewerMiddle").style.left = "230px", this.providerContainer = document.querySelector("#toolbarIWebAuth"), this.providerNode = document.querySelector("#iWebAuth_Provider"), this.toggleNode = document.querySelector("#iWebAuth_Toggle"), this.toggleNode.addEventListener("click", this.handleToggle);
var o = (0, l.getCookieOrStorage)("KG_Provider_Name");
o && (this.CAType = 1, this.updateProviderName(o))
}
}, {
key: "stamp", value: function (e) {
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
this.tipPrompt.open("加载中..."), this.CAType = e, this.iWebAuthInstance || (this.iWebAuthInstance = new i.iWebAuth);
var r = this.iWebAuthInstance;
r.promise.then(function () {
n && r.clearField()
}).then(function () {
return r.setFieldByName("CAType", t.CAType)
}).then(function () {
return r.getAuth()
}).then(function (e) {
var n = e.providerName;
if (t.updateProviderName(n), 0 == t.CAType) return new Promise(function (e) {
t.getPIN(e)
});
Promise.resolve()
}).then(function (e) {
if (0 == t.CAType && e) {
var n = window.KGPdfViewerWebApp.getPasswordPrompt();
return r.verifyPin(e).then(function () {
n.remember(), Promise.resolve()
}).catch(function () {
return n.clearRememberedPwd(), Promise.reject()
})
}
Promise.resolve()
}).then(function () {
return r.getFieldByName("SealList")
}).then(function (e) {
if (0 !== e.errorCode) return Promise.reject();
t.handleClientSeal(e.sealList).then(function (e) {
return t.setSelas(e)
}).catch(function (e) {
return t.onError(e)
})
}).catch(function () {
r.getLastErrorMsg().then(function (e) {
t.onError(e)
})
})
}
}, {
key: "handleClientSeal", value: function (e) {
var t = {action: "handleCilentSeal", isWebAuth: !0, stampType: window.KGPdfViewerWebApp.stampType, seals: e};
return a.myaxios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), t).then(function (e) {
var t = e.data, n = t.status, r = t.seals, i = t.message;
return n ? r : Promise.reject(i)
})
}
}, {
key: "setSelas", value: function (e) {
this.tipPrompt.close(), this.clearSealData();
for (var t = 0; t < e.length; t++) {
var n = e[t];
n.providerName = this.providerName, n.CAType = this.CAType, this.sealData.push(n)
}
if (!this.sealData.length) return this.alertPrompt.open("该用户没有可用印章!");
this.handleClick()
}
}, {
key: "handleClick", value: function () {
var e = this, t = this.iWebAuthInstance, n = window.KGPdfViewerWebApp.getSelectSealPrompt(),
r = window.KGPdfViewerWebApp.PDFViewerApplication.pdfStamp;
n.setSeals(this.sealData), n.open(), n.setUpdateCallback(function (n) {
var i = n.seal;
e._sealID = i.signSN, i.signSN = o.default.stringify(s.default.parse(i.signSN));
var a = {
isContinuityStampCheck: n.isContinuityStampCheck,
continuityRange: n.continuityRange,
isStampOfQfz: n.isStampOfQfz
}, l = {capability: r.pdfStampSeal.createAddSealPromise()};
for (var c in a.seal = i, r.setSealData(a), a) l[c] = a[c];
t.getFieldByName(i.certSN).then(function (t) {
e.algorithmType = "1.2.156.10197.1.501" == t ? "SM2" : "RSA", ("SM2" == e.algorithmType ? e.getCert(i.certSN) : Promise.resolve(null)).then(function (t) {
e.cert = t, r.getSealObjectCallback(l)
})
})
})
}
}, {
key: "sign", value: function (e) {
var t = this, n = this.iWebAuthInstance, r = function () {
var e = void 0, t = decodeURIComponent(window.location.href), n = new URL(t).searchParams.get("savePath");
n = n.replace(/\\/g, "/");
var r = new RegExp("//", "g"), i = (n = n.replace(r, "/")).split("/");
return (e = i[i.length - 1]) || (e = (i = new URL(t).searchParams.get("savePath").split("\\"))[i.length - 1]), e
}();
return new Promise(function (i) {
n.setFieldByName("fileName", r).then(function () {
return n.setFieldByName("sealId", t._sealID)
}).then(function () {
return n.kgSign(e)
}).then(function () {
return n.getFieldByName("KGSignMessage")
}).then(function (e) {
i({sigData: e, cert: t.cert})
}).catch(function () {
t.app.pdfStamp.clearTempSeals(!0), n.getLastErrorMsg().then(function (e) {
t.onError(e)
})
})
})
}
}, {
key: "removeSignature", value: function (e) {
var t = this, n = this.iWebAuthInstance;
return n.deleteSigantureBySubjectName(e).catch(function () {
n.getLastErrorMsg().then(function (e) {
t.onError(e)
})
})
}
}, {
key: "getPIN", value: function (e) {
var t = window.KGPdfViewerWebApp.getPasswordPrompt();
t.open(), t.setUpdateCallback(function (t) {
e(t)
})
}
}, {
key: "getCert", value: function (e) {
var t = this, n = "certBase64" + e, r = this.iWebAuthInstance;
return new Promise(function (e) {
r.getFieldByName(n).then(function (t) {
return e(t)
}).catch(function () {
r.getLastErrorMsg().then(function (e) {
t.onError(e)
})
})
})
}
}, {
key: "clearSealData", value: function () {
this.sealData = []
}
}, {
key: "updateProviderName", value: function (e) {
this.iWebAuthConfig.scan && (this.providerName = e, this.providerNode.innerHTML = e, e.length > 12 ? this.providerNode.style.width = "220px" : this.providerNode.style.width = "auto", 0 == this.CAType ? (this.providerContainer.setAttribute("hidden", !0), (0, l.deleteCookieAndStorage)("KG_Provider_Name")) : (this.providerContainer.removeAttribute("hidden"), (0, l.setCookieOrStorage)("KG_Provider_Name", e, {expires: 7})))
}
}, {
key: "handleToggle", value: function () {
this.stamp(1, !0)
}
}, {
key: "onError", value: function (e) {
this.tipPrompt.close(), this.alertPrompt.open(e.message || e)
}
}]), e
}();
t.KG_IWebAuth = u
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.iWebAuth = void 0;
var r = n(43), i = function (e) {
this.kg = new r.KG("Kinggrid.iWebAuth", "0E0D0490-7085-4FA8-86A6-649F0CF1DA41"), this.promise = this.kg.init()
};
i.prototype = {
setFieldByName: function (e, t) {
return this.kg.invoke("SetFieldByName", e, t)
}, getFieldByName: function (e) {
return this.kg.invoke("GetFieldByName", e)
}, getAuth: function () {
return this.kg.invoke("GetAuth").then(function (e) {
return "" === e ? Promise.reject() : e
})
}, kgSign: function (e) {
return this.kg.invoke("KGSign", e).then(function (e) {
return 0 != e ? Promise.reject() : e
})
}, kgSignMessage: function () {
return this.kg.invoke("KGSignMessage").then(function (e) {
return "none" === e ? Promise.reject() : e
})
}, deleteSiganture: function (e) {
return this.kg.invoke("DeleteSigantureBySubjectName", e).then(function (e) {
return 0 != e ? Promise.reject() : e
})
}, clearField: function () {
return this.kg.invoke("ClearField")
}, verifyPin: function (e) {
return this.kg.invoke("VerifyPin", e).then(function (e) {
return "false" == e ? Promise.reject() : e
})
}, getLastErrorMsg: function () {
return this.kg.invoke("GetLastErrorMsg")
}
}, t.iWebAuth = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_UkeyStamp = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(21), a = n(186), o = n(42), s = n(2);
var l = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.options = n, this.alertPrompt = this.app.KGAlertPrompt, this.tipPrompt = window.KGPdfViewerWebApp.getTipPrompt(), this.passwordPrompt = window.KGPdfViewerWebApp.getPasswordPrompt(), this.TGCertMsgCtrl = new a.TGCertMsgCtrl({
onError: function (e) {
return Promise.reject(e)
}, userCode: window.KGPdfViewerWebApp.userCode
}), this.esidList = [], this.esid = null, this.stamp = this.stamp.bind(this), this.delete = this.delete.bind(this), this.onError = this.onError.bind(this), this.willCertified = this.willCertified.bind(this), this.password = "", this.seals = null, this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this, t = this.options.KG_UkeyStamp, n = t.button, r = t.secondaryButton;
n.removeAttribute("hidden"), n.addEventListener("click", function () {
return e.stamp()
}), r.removeAttribute("hidden"), r.addEventListener("click", function () {
return e.stamp()
}), window.KGPdfViewerWebApp.btnPositionConfig.toolbar = ["Ukey"]
}
}, {
key: "willCertified", value: function () {
var e = this;
return this.tipPrompt.open("加载中..."), this.TGCertMsgCtrl.keySNSign().then(function (e) {
return n = {
action: "keyWillResult",
signData: (t = e).signData,
keySn: t.keySn,
keyOwner: t.keyOwner,
stampSystemOrigin: window.KGPdfViewerWebApp.stampSystemOrigin || 1
}, r = window.KGPdfViewerWebApp.getDocTypeUrl(), i.myaxios.post(r, n);
var t, n, r
}).then(function (t) {
e.tipPrompt.close();
var n = t.data, r = n.status, i = n.message, a = n.data;
return r ? (e.esidList = a, Promise.resolve(a)) : Promise.reject(i)
})
}
}, {
key: "stamp", value: function () {
var e = this;
this.passwordPrompt.open(!0, "add"), this.passwordPrompt.setUpdateCallback(function (t) {
e.password = t, e.ukeyHasSeals().then(function (t) {
var n = t.status, r = t.seals;
return n ? (r.length && (e.seals = r), Promise.resolve()) : (e.seals = null, window.KGPdfViewerWebApp.isUkey && (window.KGPdfViewerWebApp.certOrigin = 0), e.willCertified())
}).then(function () {
return e.app.pdfStamp.stamp("ukey")
}).catch(e.onError)
})
}
}, {
key: "delete", value: function (e) {
var t = this;
this.willCertified().then(function (n) {
if (!n.includes(t.esid)) return Promise.reject("您没有权限删除该印章!");
e && e()
}).catch(this.onError)
}
}, {
key: "ukeyHasSeals", value: function () {
var e = this;
return new Promise(function (t) {
(0, o.getOfdSealsByTG)(e.password, function (e) {
return i.myaxios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), e)
}, function (e, n, r) {
return (0, s.closeOverlay)().then(function () {
window.KGPdfViewerWebApp.isUkey && (window.KGPdfViewerWebApp.certOrigin = 1), window.KGPdfViewerWebApp.keySN = r, window.KGPdfViewerWebApp.cert = n, t(e)
})
}, function (n) {
var r = n.message, i = n.status, a = void 0 === i || i;
return (0, s.closeOverlay)().then(function () {
a ? e.onError({message: r}) : t({status: a})
})
})
})
}
}, {
key: "onError", value: function (e) {
var t = void 0, n = void 0;
try {
try {
t = JSON.parse(e.message).errorCode.toString(), n = JSON.parse(e.message).errorMsg
} catch (r) {
t = JSON.parse(e).errorCode.toString(), n = JSON.parse(e).errorMsg
}
switch (t) {
case"25003":
n = "未检测到Ukey,请插入Ukey";
break;
case"25136":
n = "PIN码错误,请重新输入";
break;
case"120008":
n = "证书已过期,请联系管理员续期"
}
} catch (t) {
n = e.message || e
}
this.alertPrompt.open(n)
}
}]), e
}();
t.KG_UkeyStamp = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_Finger_Print = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(2), a = n(43);
t.KG_Finger_Print = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t;
var i = n.button, a = n.secondaryButton;
this.button = i, this.secondaryButton = a, this.stamp = this.stamp.bind(this), this.createImage = this.createImage.bind(this), this.createPromise = this.createImage(), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this;
[this.button, this.secondaryButton].map(function (t) {
t.removeAttribute("hidden"), t.addEventListener("click", function () {
e.app.pdfStamp.stamp("fingerPrint"), e.app.secondaryToolbar.close()
})
})
}
}, {
key: "createImage", value: function () {
var e = window.KGPdfViewerWebApp.fingerPrint, t = e.imgData, n = e.fixHeight, r = void 0 === n ? 100 : n,
i = new Image, o = (0, a.createCapability)();
return i.onload = function () {
var e = r / i.height, n = {width: i.width * e, height: r, imgExt: t.split(";")[0].split("/")[1], imgdata: t};
o.resolve(n)
}, i.onerror = function () {
o.reject("指纹图片加载失败")
}, i.src = t, o.promise
}
}, {
key: "stamp", value: function (e) {
var t = this, n = window.KGPdfViewerWebApp, r = n.password, a = n.sealType;
window.KGPdfViewerWebApp.getUserBeforeSign(r).then(function (n) {
var r = n.data;
return (0, i.closeOverlay)().then(function () {
var n = r.status, i = r.message, o = r.keySN, s = r.unitName, l = r.userName, c = r.signSN;
if (!n) return t.app.KGAlertPrompt.open(i);
t.createPromise.then(function (t) {
var n = t.imgdata, r = t.width, i = t.height, u = t.imgExt;
e({
status: !0,
seals: [{
keySN: o,
width: r,
height: i,
imgExt: u,
signSN: c,
imgdata: n,
userName: l,
unitName: s,
sealtag: a,
signName: "指纹签名",
sealType: "signature"
}]
})
}).catch(function (e) {
t.app.KGAlertPrompt.open(e)
})
})
})
}
}]), e
}()
}, function (e, t, n) {
"use strict";
function r(e) {
this.element = e.element, this.document = e.element.ownerDocument, "function" == typeof e.ignoreTarget && (this.ignoreTarget = e.ignoreTarget), this.onActiveChanged = e.onActiveChanged, this.activate = this.activate.bind(this), this.deactivate = this.deactivate.bind(this), this.toggle = this.toggle.bind(this), this._onmousedown = this._onmousedown.bind(this), this._onmousemove = this._onmousemove.bind(this), this._endPan = this._endPan.bind(this), (this.overlay = document.createElement("div")).className = "grab-to-pan-grabbing"
}
var i;
Object.defineProperty(t, "__esModule", {value: !0}), r.prototype = {
CSS_CLASS_GRAB: "grab-to-pan-grab", activate: function () {
this.active || (this.active = !0, this.element.addEventListener("mousedown", this._onmousedown, !0), this.element.classList.add(this.CSS_CLASS_GRAB), this.onActiveChanged && this.onActiveChanged(!0))
}, deactivate: function () {
this.active && (this.active = !1, this.element.removeEventListener("mousedown", this._onmousedown, !0), this._endPan(), this.element.classList.remove(this.CSS_CLASS_GRAB), this.onActiveChanged && this.onActiveChanged(!1))
}, toggle: function () {
this.active ? this.deactivate() : this.activate()
}, ignoreTarget: function (e) {
return e[i]("a[href], a[href] *, input, textarea, button, button *, select, option")
}, _onmousedown: function (e) {
console.log(234353)
if (0 === e.button && !this.ignoreTarget(e.target)) {
if (e.originalTarget) try {
e.originalTarget.tagName
} catch (e) {
return
}
this.scrollLeftStart = this.element.scrollLeft, this.scrollTopStart = this.element.scrollTop, this.clientXStart = e.clientX, this.clientYStart = e.clientY, this.document.addEventListener("mousemove", this._onmousemove, !0), this.document.addEventListener("mouseup", this._endPan, !0), this.element.addEventListener("scroll", this._endPan, !0), e.preventDefault(), e.stopPropagation();
var t = document.activeElement;
t && !t.contains(e.target) && t.blur()
}
}, _onmousemove: function (e) {
console.log(123124124)
if (this.element.removeEventListener("scroll", this._endPan, !0), function (e) {
if ("buttons" in e && a) return !(1 & e.buttons);
if (s || l) return 0 === e.which
}(e)) this._endPan(); else {
var t = e.clientX - this.clientXStart, n = e.clientY - this.clientYStart, r = this.scrollTopStart - n,
i = this.scrollLeftStart - t;
this.element.scrollTo ? this.element.scrollTo({
top: r,
left: i,
behavior: "instant"
}) : (this.element.scrollTop = r, this.element.scrollLeft = i), this.overlay.parentNode || document.body.appendChild(this.overlay)
}
}, _endPan: function () {
this.element.removeEventListener("scroll", this._endPan, !0), this.document.removeEventListener("mousemove", this._onmousemove, !0), this.document.removeEventListener("mouseup", this._endPan, !0), this.overlay.remove()
}
}, ["webkitM", "mozM", "msM", "oM", "m"].some(function (e) {
var t = e + "atches";
return t in document.documentElement && (i = t), (t += "Selector") in document.documentElement && (i = t), i
});
var a = !document.documentMode || document.documentMode > 9, o = window.chrome, s = o && (o.webstore || o.app),
l = /Apple/.test(navigator.vendor) && /Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);
t.GrabToPan = r
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFSidebar = t.SidebarView = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9), a = n(16);
var o = {NONE: 0, THUMBS: 1, OUTLINE: 2, ATTACHMENTS: 3, KGANNOTATIONS: 4}, s = function () {
function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : i.NullL10n;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.isOpen = !1, this.active = o.THUMBS, this.isInitialViewSet = !1, this.onToggled = null, this.pdfViewer = t.pdfViewer, this.pdfThumbnailViewer = t.pdfThumbnailViewer, this.pdfOutlineViewer = t.pdfOutlineViewer, this.mainContainer = t.mainContainer, this.outerContainer = t.outerContainer, this.sidebarContainer = this.outerContainer.querySelector("#sidebarContainer"), this.eventBus = t.eventBus, this.toggleButton = t.toggleButton, this.thumbnailButton = t.thumbnailButton, this.outlineButton = t.outlineButton, this.attachmentsButton = t.attachmentsButton, this.kgAnnotationsButton = t.kgAnnotationsButton, this.thumbnailView = t.thumbnailView, this.outlineView = t.outlineView, this.attachmentsView = t.attachmentsView, this.kgAnnotationsView = t.kgAnnotationsView, this.disableNotification = t.disableNotification || !1, this.l10n = n, this._addEventListeners()
}
return r(e, [{
key: "reset", value: function () {
this.isInitialViewSet = !1, this._hideUINotification(null), this.switchView(o.THUMBS), this.outlineButton.disabled = !1, this.attachmentsButton.disabled = !1, this.kgAnnotationsButton.disabled = !1
}
}, {
key: "setInitialView", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : o.NONE;
if (!this.isInitialViewSet) if (this.isInitialViewSet = !0, this.isOpen && e === o.NONE) this._dispatchEvent(); else {
var t = e === this.visibleView;
this.switchView(e, !0), t && this._dispatchEvent()
}
}
}, {
key: "switchView", value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
if (e !== o.NONE) {
var n = e !== this.active, r = !1;
switch (e) {
case o.THUMBS:
this.thumbnailButton.classList.add("toggled"), this.outlineButton.classList.remove("toggled"), this.attachmentsButton.classList.remove("toggled"), this.kgAnnotationsButton.classList.remove("toggled"), this.thumbnailView.classList.remove("hidden"), this.outlineView.classList.add("hidden"), this.attachmentsView.classList.add("hidden"), this.kgAnnotationsView.classList.add("hidden"), this.isOpen && n && (this._updateThumbnailViewer(), r = !0);
break;
case o.OUTLINE:
if (this.outlineButton.disabled) return;
this.thumbnailButton.classList.remove("toggled"), this.outlineButton.classList.add("toggled"), this.attachmentsButton.classList.remove("toggled"), this.kgAnnotationsButton.classList.remove("toggled"), this.thumbnailView.classList.add("hidden"), this.outlineView.classList.remove("hidden"), this.attachmentsView.classList.add("hidden"), this.kgAnnotationsView.classList.add("hidden");
break;
case o.ATTACHMENTS:
if (this.attachmentsButton.disabled) return;
this.thumbnailButton.classList.remove("toggled"), this.outlineButton.classList.remove("toggled"), this.attachmentsButton.classList.add("toggled"), this.kgAnnotationsButton.classList.remove("toggled"), this.thumbnailView.classList.add("hidden"), this.outlineView.classList.add("hidden"), this.attachmentsView.classList.remove("hidden"), this.kgAnnotationsView.classList.add("hidden");
break;
case o.KGANNOTATIONS:
if (this.kgAnnotationsButton.disabled) return;
this.thumbnailButton.classList.remove("toggled"), this.outlineButton.classList.remove("toggled"), this.attachmentsButton.classList.remove("toggled"), this.kgAnnotationsButton.classList.add("toggled"), this.thumbnailView.classList.add("hidden"), this.outlineView.classList.add("hidden"), this.attachmentsView.classList.add("hidden"), this.kgAnnotationsView.classList.remove("hidden");
break;
default:
return void console.error('PDFSidebar_switchView: "' + e + '" is an unsupported value.')
}
this.active = 0 | e, !t || this.isOpen ? (r && this._forceRendering(), n && this._dispatchEvent(), this._hideUINotification(this.active)) : this.open()
} else this.close()
}
}, {
key: "open", value: function () {
this.isOpen || (this.isOpen = !0, this.toggleButton.classList.add("toggled"), this.sidebarContainer.classList.remove("hidden"), this.active === o.THUMBS && this._updateThumbnailViewer(), this._forceRendering(), this._dispatchEvent(), this._hideUINotification(this.active))
}
}, {
key: "close", value: function () {
this.isOpen && (this.isOpen = !1, this.toggleButton.classList.remove("toggled"), this.sidebarContainer.classList.add("hidden"), this._forceRendering(), this._dispatchEvent())
}
}, {
key: "toggle", value: function () {
this.isOpen ? this.close() : this.open()
}
}, {
key: "_dispatchEvent", value: function () {
this.eventBus.dispatch("sidebarviewchanged", {source: this, view: this.visibleView})
}
}, {
key: "_forceRendering", value: function () {
this.onToggled ? this.onToggled() : (this.pdfViewer.forceRendering(), this.pdfThumbnailViewer.forceRendering())
}
}, {
key: "_updateThumbnailViewer", value: function () {
for (var e = this.pdfViewer, t = this.pdfThumbnailViewer, n = e.pagesCount, r = 0; r < n; r++) {
var i = e.getPageView(r);
if (i && i.renderingState === a.RenderingStates.FINISHED) t.getThumbnail(r).setImage(i)
}
t.scrollThumbnailIntoView(e.currentPageNumber)
}
}, {
key: "_showUINotification", value: function (e) {
var t = this;
if (!this.disableNotification) {
if (this.l10n.get("toggle_sidebar_notification.title", null, "Toggle Sidebar (document contains outline/attachments)").then(function (e) {
t.toggleButton.title = e
}), this.isOpen) {
if (e === this.active) return
} else this.toggleButton.classList.add("pdfSidebarNotification");
switch (e) {
case o.OUTLINE:
this.outlineButton.classList.add("pdfSidebarNotification");
break;
case o.ATTACHMENTS:
this.attachmentsButton.classList.add("pdfSidebarNotification");
break;
case o.KGANNOTATIONS:
this.kgAnnotationsButton.classList.add("pdfSidebarNotification")
}
}
}
}, {
key: "_hideUINotification", value: function (e) {
var t = this;
if (!this.disableNotification) {
var n = function (e) {
switch (e) {
case o.OUTLINE:
t.outlineButton.classList.remove("pdfSidebarNotification");
break;
case o.ATTACHMENTS:
t.attachmentsButton.classList.remove("pdfSidebarNotification");
break;
case o.KGANNOTATIONS:
t.kgAnnotationsButton.classList.remove("pdfSidebarNotification")
}
};
if (this.isOpen || null === e) if (this.toggleButton.classList.remove("pdfSidebarNotification"), null === e) {
for (e in o) n(o[e]);
this.l10n.get("toggle_sidebar.title", null, "Toggle Sidebar").then(function (e) {
t.toggleButton.title = e
})
} else n(e)
}
}
}, {
key: "_addEventListeners", value: function () {
var e = this;
this.mainContainer.addEventListener("transitionend", function (t) {
t.target === e.mainContainer && e.outerContainer.classList.remove("sidebarMoving")
}), this.thumbnailButton.addEventListener("click", function () {
e.switchView(o.THUMBS)
}), this.outlineButton.addEventListener("click", function () {
e.switchView(o.OUTLINE)
}), this.outlineButton.addEventListener("dblclick", function () {
e.pdfOutlineViewer.toggleOutlineTree()
}), this.attachmentsButton.addEventListener("click", function () {
e.switchView(o.ATTACHMENTS)
}), this.kgAnnotationsButton.addEventListener("click", function () {
e.switchView(o.KGANNOTATIONS)
}), this.eventBus.on("outlineloaded", function (t) {
var n = t.outlineCount;
e.outlineButton.disabled = !n, n ? e._showUINotification(o.OUTLINE) : e.active === o.OUTLINE && e.switchView(o.THUMBS)
}), this.eventBus.on("attachmentsloaded", function (t) {
if (t.attachmentsCount) return e.attachmentsButton.disabled = !1, void e._showUINotification(o.ATTACHMENTS);
Promise.resolve().then(function () {
e.attachmentsView.hasChildNodes() || (e.attachmentsButton.disabled = !0, e.active === o.ATTACHMENTS && e.switchView(o.THUMBS))
})
}), this.eventBus.on("presentationmodechanged", function (t) {
t.active || t.switchInProgress || !e.isThumbnailViewVisible || e._updateThumbnailViewer()
})
}
}, {
key: "visibleView", get: function () {
return this.isOpen ? this.active : o.NONE
}
}, {
key: "isThumbnailViewVisible", get: function () {
return this.isOpen && this.active === o.THUMBS
}
}, {
key: "isOutlineViewVisible", get: function () {
return this.isOpen && this.active === o.OUTLINE
}
}, {
key: "isAttachmentsViewVisible", get: function () {
return this.isOpen && this.active === o.ATTACHMENTS
}
}, {
key: "isKgAnnotationsViewVisible", get: function () {
return this.isOpen && this.active === o.KGANNOTATIONS
}
}]), e
}();
t.SidebarView = o, t.PDFSidebar = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this._overlays = {}, this._active = [], this._keyDownBound = this._keyDown.bind(this)
}
return r(e, [{
key: "register", value: function (e, t) {
var n = this, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null,
i = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
return new Promise(function (a) {
var o = void 0;
if (!(e && t && (o = t.parentNode))) throw new Error("Not enough parameters.");
if (n._overlays[e]) throw new Error("The overlay is already registered.");
n._overlays[e] = {element: t, container: o, callerCloseMethod: r, canForceClose: i}, a()
})
}
}, {
key: "unregister", value: function (e) {
var t = this;
return new Promise(function (n) {
if (!t._overlays[e]) throw new Error("The overlay does not exist.");
if (t._active.indexOf(e) > -1) throw new Error("The overlay cannot be removed while it is active.");
delete t._overlays[e], n()
})
}
}, {
key: "open", value: function (e) {
var t = this;
return new Promise(function (n) {
if (!t._overlays[e]) throw new Error("The overlay does not exist.");
if (t._active.length) if (t._overlays[e].canForceClose) t._closeThroughCaller(); else if (t._active.indexOf(e) > -1) throw new Error("The overlay is already active.");
t._active.push(e);
var r = t._active[t._active.length - 1];
t._overlays[r].element.classList.remove("hidden"), t._overlays[r].container.classList.remove("hidden"), window.addEventListener("keydown", t._keyDownBound), n()
})
}
}, {
key: "close", value: function (e) {
var t = this;
return new Promise(function (n) {
if (!t._overlays[e]) throw new Error("The overlay does not exist.");
if (-1 === t._active.indexOf(e)) throw new Error("The overlay is currently not active.");
t._overlays[t._active[t._active.indexOf(e)]].container.classList.add("hidden"), t._overlays[t._active[t._active.indexOf(e)]].element.classList.add("hidden"), t._active.splice(t._active.indexOf(e), 1), t._active.length || window.removeEventListener("keydown", t._keyDownBound), n()
})
}
}, {
key: "_keyDown", value: function (e) {
this._active.length && 27 === e.keyCode && (this._closeThroughCaller(), e.preventDefault())
}
}, {
key: "_closeThroughCaller", value: function () {
this._overlays[this._active[0]].callerCloseMethod && this._overlays[this._active[0]].callerCloseMethod(), this._active[0] && this.close(this._active[0])
}
}, {
key: "active", get: function () {
return this._active
}
}]), e
}();
t.OverlayManager = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PasswordPrompt = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9), a = n(14);
var o = function () {
function e(t, n) {
var r = this, a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : i.NullL10n;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = t.overlayName, this.container = t.container, this.label = t.label, this.input = t.input, this.submitButton = t.submitButton, this.cancelButton = t.cancelButton, this.overlayManager = n, this.l10n = a, this.updateCallback = null, this.reason = null, this.submitButton.addEventListener("click", this.verify.bind(this)), this.cancelButton.addEventListener("click", this.close.bind(this)), this.input.addEventListener("keydown", function (e) {
13 === e.keyCode && r.verify()
}), this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !0)
}
return r(e, [{
key: "open", value: function () {
var e = this;
this.overlayManager.open(this.overlayName).then(function () {
e.input.focus();
(e.reason === a.PasswordResponses.INCORRECT_PASSWORD ? e.l10n.get("password_invalid", null, "Invalid password. Please try again.") : e.l10n.get("password_label", null, "Enter the password to open this PDF file.")).then(function (t) {
e.label.textContent = t
})
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.input.value = ""
})
}
}, {
key: "verify", value: function () {
var e = this.input.value;
if (e && e.length > 0) return this.close(), this.updateCallback(e)
}
}, {
key: "setUpdateCallback", value: function (e, t) {
this.updateCallback = e, this.reason = t
}
}]), e
}();
t.PasswordPrompt = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFAttachmentViewer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(14);
var a = function () {
function e(t) {
var n = t.container, r = t.eventBus, i = t.downloadManager;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.container = n, this.eventBus = r, this.downloadManager = i, this.reset(), this.eventBus.on("fileattachmentannotation", this._appendAttachment.bind(this))
}
return r(e, [{
key: "reset", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
this.attachments = null, this.container.textContent = "", e || (this._renderedCapability = (0, i.createPromiseCapability)())
}
}, {
key: "_dispatchEvent", value: function (e) {
this._renderedCapability.resolve(), this.eventBus.dispatch("attachmentsloaded", {
source: this,
attachmentsCount: e
})
}
}, {
key: "_bindPdfLink", value: function (e, t, n) {
if (i.PDFJS.disableCreateObjectURL) throw new Error('bindPdfLink: Unsupported "PDFJS.disableCreateObjectURL" value.');
var r = void 0;
e.onclick = function () {
r || (r = (0, i.createObjectURL)(t, "application/pdf"));
var e;
return e = "?file=" + encodeURIComponent(r + "#" + n), window.open(e), !1
}
}
}, {
key: "_bindLink", value: function (e, t, n) {
var r = this;
e.onclick = function () {
return r.downloadManager.downloadData(t, n, ""), !1
}
}
}, {
key: "render", value: function (e) {
var t = e.attachments, n = e.keepRenderedCapability, r = void 0 !== n && n, a = 0;
if (this.attachments && this.reset(!0 === r), this.attachments = t || null, t) {
var o = Object.keys(t).sort(function (e, t) {
return e.toLowerCase().localeCompare(t.toLowerCase())
});
a = o.length;
for (var s = 0; s < a; s++) {
var l = t[o[s]], c = (0, i.removeNullCharacters)((0, i.getFilenameFromUrl)(l.filename)),
u = document.createElement("div");
u.className = "attachmentsItem";
var d = document.createElement("button");
d.textContent = c, this._bindLink(d, l.content, c), u.appendChild(d), this.container.appendChild(u)
}
this._dispatchEvent(a)
} else this._dispatchEvent(a)
}
}, {
key: "_appendAttachment", value: function (e) {
var t = this, n = e.id, r = e.filename, i = e.content;
this._renderedCapability.promise.then(function () {
var e = t.attachments;
if (e) {
for (var a in e) if (n === a) return
} else e = Object.create(null);
e[n] = {filename: r, content: i}, t.render({attachments: e, keepRenderedCapability: !0})
})
}
}]), e
}();
t.PDFAttachmentViewer = a
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFDocumentProperties = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(9), o = n(14);
var s = function () {
function e(t, n) {
var r = t.overlayName, i = t.fields, o = t.container, s = t.closeButton,
l = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : a.NullL10n;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.overlayName = r, this.fields = i, this.container = o, this.overlayManager = n, this.l10n = l, this._reset(), s && s.addEventListener("click", this.close.bind(this)), this.overlayManager.register(this.overlayName, this.container, this.close.bind(this))
}
return i(e, [{
key: "open", value: function () {
var e = this, t = function (t) {
Object.defineProperty(e, "fieldData", {
value: Object.freeze(t),
writable: !1,
enumerable: !0,
configurable: !0
})
};
Promise.all([this.overlayManager.open(this.overlayName), this._dataAvailableCapability.promise]).then(function () {
e.fieldData ? e._updateUI() : e.pdfDocument.getMetadata().then(function (t) {
var n = t.info, r = t.metadata;
return Promise.all([n, r, e._parseFileSize(e.maybeFileSize), e._parseDate(n.CreationDate), e._parseDate(n.ModDate)])
}).then(function (n) {
var i = r(n, 5), o = i[0], s = (i[1], i[2]), l = i[3], c = i[4];
return t({
fileName: (0, a.getPDFFileNameFromURL)(e.url),
fileSize: s,
fileType: window.KGPdfViewerWebApp.fileType.toUpperCase(),
title: o.Title,
author: o.Author,
subject: o.Subject,
keywords: o.Keywords,
creationDate: l,
modificationDate: c,
creator: o.Creator,
producer: o.Producer,
version: o.PDFFormatVersion,
pageCount: e.pdfDocument.numPages
}), e._updateUI(), e.pdfDocument.getDownloadInfo()
}).then(function (t) {
var n = t.length;
return e._parseFileSize(n)
}).then(function (n) {
var r = (0, a.cloneObj)(e.fieldData);
r.fileSize = n, t(r), e._updateUI()
})
})
}
}, {
key: "close", value: function () {
this.overlayManager.close(this.overlayName)
}
}, {
key: "setDocument", value: function (e, t) {
this.pdfDocument && (this._reset(), this._updateUI(!0)), e && (this.pdfDocument = e, this.url = t, this._dataAvailableCapability.resolve())
}
}, {
key: "setFileSize", value: function (e) {
"number" == typeof e && e > 0 && (this.maybeFileSize = e)
}
}, {
key: "_reset", value: function () {
this.pdfDocument = null, this.url = null, this.maybeFileSize = 0, delete this.fieldData, this._dataAvailableCapability = (0, o.createPromiseCapability)()
}
}, {
key: "_updateUI", value: function () {
if (!(arguments.length > 0 && void 0 !== arguments[0] && arguments[0]) && this.fieldData) {
if (-1 !== this.overlayManager.active.indexOf(this.overlayName)) for (var e in this.fields) {
var t = this.fieldData[e];
this.fields[e].textContent = t || 0 === t ? t : "-"
}
} else for (var n in this.fields) this.fields[n].textContent = "-"
}
}, {
key: "_parseFileSize", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, t = e / 1024;
return t ? t < 1024 ? this.l10n.get("document_properties_kb", {
size_kb: (+t.toPrecision(3)).toLocaleString(),
size_b: e.toLocaleString()
}, "{{size_kb}} KB ({{size_b}} bytes)") : this.l10n.get("document_properties_mb", {
size_mb: (+(t / 1024).toPrecision(3)).toLocaleString(),
size_b: e.toLocaleString()
}, "{{size_mb}} MB ({{size_b}} bytes)") : Promise.resolve(void 0)
}
}, {
key: "_parseDate", value: function (e) {
if (e) {
var t = e;
"D:" === t.substring(0, 2) && (t = t.substring(2));
var n = parseInt(t.substring(0, 4), 10), r = parseInt(t.substring(4, 6), 10) - 1,
i = parseInt(t.substring(6, 8), 10), a = parseInt(t.substring(8, 10), 10),
o = parseInt(t.substring(10, 12), 10), s = parseInt(t.substring(12, 14), 10), l = t.substring(14, 15),
c = parseInt(t.substring(15, 17), 10), u = parseInt(t.substring(18, 20), 10);
"-" === l ? (a += c, o += u) : "+" === l && (a -= c, o -= u);
var d = new Date(Date.UTC(n, r, i, a, o, s)), h = d.toLocaleDateString(), p = d.toLocaleTimeString();
return this.l10n.get("document_properties_date_string", {date: h, time: p}, "{{date}}, {{time}}")
}
}
}]), e
}();
t.PDFDocumentProperties = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFFindBar = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(188), a = n(9);
var o = function () {
function e(t) {
var n = this, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : a.NullL10n;
if (function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.opened = !1, this.bar = t.bar || null, this.toggleButton = t.toggleButton || null, this.findField = t.findField || null, this.highlightAllWrapper = document.body.querySelectorAll("#findbarOptionsContainer .kg_checkbox_wrapper")[0], this.highlightAll = t.highlightAllCheckbox || null, this.caseSensitiveWrapper = document.body.querySelectorAll("#findbarOptionsContainer .kg_checkbox_wrapper")[1], this.caseSensitive = t.caseSensitiveCheckbox || null, this.findMsg = t.findMsg || null, this.findResultsCount = t.findResultsCount || null, this.findStatusIcon = t.findStatusIcon || null, this.findPreviousButton = t.findPreviousButton || null, this.findNextButton = t.findNextButton || null, this.findController = t.findController || null, this.eventBus = t.eventBus, this.l10n = r, null === this.findController) throw new Error("PDFFindBar cannot be used without a PDFFindController instance.");
this.toggleButton.addEventListener("click", function () {
n.toggle()
}), this.findField.addEventListener("input", function () {
n.dispatchEvent("")
}), this.bar.addEventListener("keydown", function (e) {
switch (e.keyCode) {
case 13:
e.target === n.findField && n.dispatchEvent("again", e.shiftKey);
break;
case 27:
n.close()
}
}), this.findPreviousButton.addEventListener("click", function () {
n.dispatchEvent("again", !0)
}), this.findNextButton.addEventListener("click", function () {
n.dispatchEvent("again", !1)
}), this.highlightAllWrapper.addEventListener("click", function (e) {
e.preventDefault(), n.highlightAll.checked = !n.highlightAll.checked, n.dispatchEvent("highlightallchange"), n.highlightAll.checked ? n.highlightAllWrapper.classList.add("kg_checkbox_wrapper-checked") : n.highlightAllWrapper.classList.remove("kg_checkbox_wrapper-checked")
}), this.caseSensitiveWrapper.addEventListener("click", function (e) {
e.preventDefault(), n.caseSensitive.checked = !n.caseSensitive.checked, n.dispatchEvent("casesensitivitychange"), n.caseSensitive.checked ? n.caseSensitiveWrapper.classList.add("kg_checkbox_wrapper-checked") : n.caseSensitiveWrapper.classList.remove("kg_checkbox_wrapper-checked")
}), this.eventBus.on("resize", this._adjustWidth.bind(this))
}
return r(e, [{
key: "reset", value: function () {
this.updateUIState()
}
}, {
key: "dispatchEvent", value: function (e, t) {
this.eventBus.dispatch("find", {
source: this,
type: e,
query: this.findField.value,
caseSensitive: this.caseSensitive.checked,
phraseSearch: !0,
highlightAll: this.highlightAll.checked,
findPrevious: t
})
}
}, {
key: "updateUIState", value: function (e, t, n) {
var r = this, a = !1, o = "";
switch (e) {
case i.FindState.FOUND:
case i.FindState.PENDING:
break;
case i.FindState.NOT_FOUND:
o = this.l10n.get("find_not_found", null, "Phrase not found"), a = !0;
break;
case i.FindState.WRAPPED:
o = t ? this.l10n.get("find_reached_top", null, "Reached top of document, continued from bottom") : this.l10n.get("find_reached_bottom", null, "Reached end of document, continued from top")
}
a ? this.findField.classList.add("notFound") : this.findField.classList.remove("notFound"), Promise.resolve(o).then(function (e) {
r.findMsg.textContent = e, r._adjustWidth()
}), this.updateResultsCount(n)
}
}, {
key: "updateResultsCount", value: function (e) {
this.findResultsCount && (e ? (this.findResultsCount.textContent = Math.floor(e.toLocaleString()) + "", this.findResultsCount.classList.remove("hidden")) : (this.findResultsCount.classList.add("hidden"), this.findResultsCount.textContent = ""), this._adjustWidth())
}
}, {
key: "open", value: function () {
this.opened || (this.opened = !0, this.toggleButton.classList.add("toggled"), this.bar.classList.remove("hidden")), this.findField.select(), this.findField.focus(), this.eventBus.dispatch("findbarOpen"), this._adjustWidth()
}
}, {
key: "close", value: function () {
this.opened && (this.opened = !1, this.toggleButton.classList.remove("toggled"), this.bar.classList.add("hidden"), this.findController.active = !1)
}
}, {
key: "toggle", value: function () {
this.opened ? this.close() : this.open()
}
}, {
key: "_adjustWidth", value: function () {
this.opened && (this.bar.classList.remove("wrapContainers"), this.bar.clientHeight > this.bar.firstElementChild.clientHeight && this.bar.classList.add("wrapContainers"))
}
}]), e
}();
t.PDFFindBar = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.isDestArraysEqual = t.isDestHashesEqual = t.PDFHistory = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(9), o = n(63);
function s() {
return document.location.hash
}
function l(e) {
var t = unescape(s()).substring(1), n = 0 | (0, a.parseQueryString)(t).page;
return Number.isInteger(n) && n > 0 && n <= e.pagesCount || (n = null), {hash: t, page: n, rotation: e.rotation}
}
var c = function () {
function e(t) {
var n = this, r = t.linkService, i = t.eventBus;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.linkService = r, this.eventBus = i || (0, o.getGlobalEventBus)(), this.initialized = !1, this.initialBookmark = null, this.initialRotation = null, this._boundEvents = Object.create(null), this._isViewerInPresentationMode = !1, this._isPagesLoaded = !1, this.eventBus.on("presentationmodechanged", function (e) {
n._isViewerInPresentationMode = e.active || e.switchInProgress
}), this.eventBus.on("pagesloaded", function (e) {
n._isPagesLoaded = !!e.pagesCount
})
}
return i(e, [{
key: "initialize", value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
if (e && "string" == typeof e) {
var n = this.initialized && this.fingerprint !== e;
this.fingerprint = e, this.initialized || this._bindEvents();
var r = window.history.state;
if (this.initialized = !0, this.initialBookmark = null, this.initialRotation = null, this._popStateInProgress = !1, this._blockHashChange = 0, this._currentHash = s(), this._numPositionUpdates = 0, this._uid = this._maxUid = 0, this._destination = null, this._position = null, !this._isValidState(r) || t) {
var i = l(this.linkService), a = i.hash, o = i.page, c = i.rotation;
return !a || n || t ? void this._pushOrReplaceState(null, !0) : void this._pushOrReplaceState({
hash: a,
page: o,
rotation: c
}, !0)
}
var u = r.destination;
this._updateInternalState(u, r.uid, !0), void 0 !== u.rotation && (this.initialRotation = u.rotation), u.dest ? (this.initialBookmark = JSON.stringify(u.dest), this._destination.page = null) : u.hash ? this.initialBookmark = u.hash : u.page && (this.initialBookmark = "page=" + u.page)
} else console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.')
}
}, {
key: "push", value: function (e) {
var t = this, n = e.namedDest, r = e.explicitDest, i = e.pageNumber;
if (this.initialized) if ((!n || "string" == typeof n) && r instanceof Array && Number.isInteger(i) && i > 0 && i <= this.linkService.pagesCount) {
var a = n || JSON.stringify(r);
if (a) {
var o = !1;
if (this._destination && (u(this._destination.hash, a) || d(this._destination.dest, r))) {
if (this._destination.page) return;
o = !0
}
this._popStateInProgress && !o || (this._pushOrReplaceState({
dest: r,
hash: a,
page: i,
rotation: this.linkService.rotation
}, o), this._popStateInProgress || (this._popStateInProgress = !0, Promise.resolve().then(function () {
t._popStateInProgress = !1
})))
}
} else console.error("PDFHistory.push: Invalid parameters.")
}
}, {
key: "pushCurrentPosition", value: function () {
this.initialized && !this._popStateInProgress && this._tryPushCurrentPosition()
}
}, {
key: "back", value: function () {
if (this.initialized && !this._popStateInProgress) {
var e = window.history.state;
this._isValidState(e) && e.uid > 0 && window.history.back()
}
}
}, {
key: "forward", value: function () {
if (this.initialized && !this._popStateInProgress) {
var e = window.history.state;
this._isValidState(e) && e.uid < this._maxUid && window.history.forward()
}
}
}, {
key: "_pushOrReplaceState", value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1] || !this._destination,
n = {fingerprint: this.fingerprint, uid: t ? this._uid : this._uid + 1, destination: e};
this._updateInternalState(e, n.uid), t ? window.history.replaceState(n, "", document.URL) : (this._maxUid = this._uid, window.history.pushState(n, "", document.URL))
}
}, {
key: "_tryPushCurrentPosition", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (this._position) {
var t = this._position;
if (e && ((t = (0, a.cloneObj)(this._position)).temporary = !0), this._destination) {
if (this._destination.temporary) this._pushOrReplaceState(t, !0); else if (this._destination.hash !== t.hash && (this._destination.page || !(this._numPositionUpdates <= 50))) {
var n = !1;
if (this._destination.page === t.first || this._destination.page === t.page) {
if (this._destination.dest || !this._destination.first) return;
n = !0
}
this._pushOrReplaceState(t, n)
}
} else this._pushOrReplaceState(t)
}
}
}, {
key: "_isValidState", value: function (e) {
return !!e && (e.fingerprint === this.fingerprint && (!(!Number.isInteger(e.uid) || e.uid < 0) && (null !== e.destination && "object" === r(e.destination))))
}
}, {
key: "_updateInternalState", value: function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
this._updateViewareaTimeout && (clearTimeout(this._updateViewareaTimeout), this._updateViewareaTimeout = null), n && e && e.temporary && delete e.temporary, this._destination = e, this._uid = t, this._numPositionUpdates = 0
}
}, {
key: "_updateViewarea", value: function (e) {
var t = this, n = e.location;
this._updateViewareaTimeout && (clearTimeout(this._updateViewareaTimeout), this._updateViewareaTimeout = null), this._position = {
hash: this._isViewerInPresentationMode ? "page=" + n.pageNumber : n.pdfOpenParams.substring(1),
page: this.linkService.page,
first: n.pageNumber,
rotation: this.initialRotation
}, this._popStateInProgress || (this._isPagesLoaded && this._destination && !this._destination.page && this._numPositionUpdates++, this._updateViewareaTimeout = setTimeout(function () {
t._popStateInProgress || t._tryPushCurrentPosition(!0), t._updateViewareaTimeout = null
}, 1e3))
}
}, {
key: "_popState", value: function (e) {
var t = this, n = e.state, r = s(), i = this._currentHash !== r;
if (this._currentHash = r, n) {
if (this._isValidState(n)) {
this._popStateInProgress = !0, i && (this._blockHashChange++, (0, a.waitOnEventOrTimeout)({
target: window,
name: "hashchange",
delay: 1e3
}).then(function () {
t._blockHashChange--
}));
var o = n.destination;
this._updateInternalState(o, n.uid, !0), (0, a.isValidRotation)(o.rotation) && (this.linkService.rotation = o.rotation), o.dest ? this.linkService.navigateTo(o.dest) : o.hash ? this.linkService.setHash(o.hash) : o.page && (this.linkService.page = o.page), Promise.resolve().then(function () {
t._popStateInProgress = !1
})
}
} else {
this._uid++;
var c = l(this.linkService), u = c.hash, d = c.page, h = c.rotation;
this._pushOrReplaceState({hash: u, page: d, rotation: h}, !0)
}
}
}, {
key: "_bindEvents", value: function () {
var e = this, t = this._boundEvents, n = this.eventBus;
t.updateViewarea = this._updateViewarea.bind(this), t.popState = this._popState.bind(this), t.pageHide = function (t) {
e._destination || e._tryPushCurrentPosition()
}, n.on("updateviewarea", t.updateViewarea), window.addEventListener("popstate", t.popState), window.addEventListener("pagehide", t.pageHide)
}
}, {
key: "popStateInProgress", get: function () {
return this.initialized && (this._popStateInProgress || this._blockHashChange > 0)
}
}]), e
}();
function u(e, t) {
return "string" == typeof e && "string" == typeof t && (e === t || (0, a.parseQueryString)(e).nameddest === t)
}
function d(e, t) {
function n(e, t) {
if ((void 0 === e ? "undefined" : r(e)) !== (void 0 === t ? "undefined" : r(t))) return !1;
if (e instanceof Array || t instanceof Array) return !1;
if (null !== e && "object" === (void 0 === e ? "undefined" : r(e)) && null !== t) {
if (Object.keys(e).length !== Object.keys(t).length) return !1;
for (var i in e) if (!n(e[i], t[i])) return !1;
return !0
}
return e === t || Number.isNaN(e) && Number.isNaN(t)
}
if (!(e instanceof Array && t instanceof Array)) return !1;
if (e.length !== t.length) return !1;
for (var i = 0, a = e.length; i < a; i++) if (!n(e[i], t[i])) return !1;
return !0
}
t.PDFHistory = c, t.isDestHashesEqual = u, t.isDestArraysEqual = d
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFOutlineViewer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(14);
var a = function () {
function e(t) {
var n = t.container, r = t.linkService, i = t.eventBus;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.container = n, this.linkService = r, this.eventBus = i, this.reset()
}
return r(e, [{
key: "reset", value: function () {
this.outline = null, this.lastToggleIsShow = !0, this.container.textContent = "", this.container.classList.remove("outlineWithDeepNesting")
}
}, {
key: "_dispatchEvent", value: function (e) {
this.eventBus.dispatch("outlineloaded", {source: this, outlineCount: e})
}
}, {
key: "_bindLink", value: function (e, t) {
var n = this;
if (t.url) (0, i.addLinkAttributes)(e, {
url: t.url,
target: t.newWindow ? i.PDFJS.LinkTarget.BLANK : void 0
}); else {
var r = t.dest;
e.href = this.linkService.getDestinationHash(r), e.onclick = function () {
return r && n.linkService.navigateTo(r), !1
}
}
}
}, {
key: "_setStyles", value: function (e, t) {
var n = "";
t.bold && (n += "font-weight: bold;"), t.italic && (n += "font-style: italic;"), n && e.setAttribute("style", n)
}
}, {
key: "_addToggleButton", value: function (e) {
var t = this, n = document.createElement("div");
n.className = "outlineItemToggler", n.onclick = function (r) {
if (r.stopPropagation(), n.classList.toggle("outlineItemsHidden"), r.shiftKey) {
var i = !n.classList.contains("outlineItemsHidden");
t._toggleOutlineItem(e, i)
}
}, e.insertBefore(n, e.firstChild)
}
}, {
key: "_toggleOutlineItem", value: function (e, t) {
this.lastToggleIsShow = t;
for (var n = e.querySelectorAll(".outlineItemToggler"), r = 0, i = n.length; r < i; ++r) n[r].classList[t ? "remove" : "add"]("outlineItemsHidden")
}
}, {
key: "toggleOutlineTree", value: function () {
this.outline && this._toggleOutlineItem(this.container, !this.lastToggleIsShow)
}
}, {
key: "render", value: function (e) {
var t = e.outline, n = 0;
if (this.outline && this.reset(), this.outline = t || null, t) {
for (var r = document.createDocumentFragment(), a = [{
parent: r,
items: this.outline
}], o = !1; a.length > 0;) for (var s = a.shift(), l = 0, c = s.items.length; l < c; l++) {
var u = s.items[l], d = document.createElement("div");
d.className = "outlineItem";
var h = document.createElement("a");
if (this._bindLink(h, u), this._setStyles(h, u), h.textContent = (0, i.removeNullCharacters)(u.title) || "", d.appendChild(h), u.items.length > 0) {
o = !0, this._addToggleButton(d);
var p = document.createElement("div");
p.className = "outlineItems", d.appendChild(p), a.push({parent: p, items: u.items})
}
s.parent.appendChild(d), n++
}
o && this.container.classList.add("outlineWithDeepNesting"), this.container.appendChild(r), this._dispatchEvent(n)
} else this._dispatchEvent(n)
}
}]), e
}();
t.PDFOutlineViewer = a
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFPresentationMode = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9);
var a = Math.PI / 6, o = function () {
function e(t) {
var n = this, r = t.container, i = t.viewer, a = void 0 === i ? null : i, o = t.pdfViewer, s = t.eventBus,
l = t.contextMenuItems, c = void 0 === l ? null : l;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.container = r, this.viewer = a || r.firstElementChild, this.pdfViewer = o, this.eventBus = s, this.active = !1, this.args = null, this.contextMenuOpen = !1, this.mouseScrollTimeStamp = 0, this.mouseScrollDelta = 0, this.touchSwipeState = null, c && (c.contextFirstPage.addEventListener("click", function () {
n.contextMenuOpen = !1, n.eventBus.dispatch("firstpage")
}), c.contextLastPage.addEventListener("click", function () {
n.contextMenuOpen = !1, n.eventBus.dispatch("lastpage")
}), c.contextPageRotateCw.addEventListener("click", function () {
n.contextMenuOpen = !1, n.eventBus.dispatch("rotatecw")
}), c.contextPageRotateCcw.addEventListener("click", function () {
n.contextMenuOpen = !1, n.eventBus.dispatch("rotateccw")
}))
}
return r(e, [{
key: "request", value: function () {
if (this.switchInProgress || this.active || !this.viewer.hasChildNodes()) return !1;
if (this._addFullscreenChangeListeners(), this._setSwitchInProgress(), this._notifyStateChange(), this.container.requestFullscreen) this.container.requestFullscreen(); else if (this.container.mozRequestFullScreen) this.container.mozRequestFullScreen(); else if (this.container.webkitRequestFullscreen) this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); else {
if (!this.container.msRequestFullscreen) return !1;
this.container.msRequestFullscreen()
}
return this.args = {page: this.pdfViewer.currentPageNumber, previousScale: this.pdfViewer.currentScaleValue}, !0
}
}, {
key: "_mouseWheel", value: function (e) {
if (this.active) {
e.preventDefault();
var t = (0, i.normalizeWheelEventDelta)(e), n = (new Date).getTime(), r = this.mouseScrollTimeStamp;
if (!(n > r && n - r < 50) && ((this.mouseScrollDelta > 0 && t < 0 || this.mouseScrollDelta < 0 && t > 0) && this._resetMouseScrollState(), this.mouseScrollDelta += t, Math.abs(this.mouseScrollDelta) >= .1)) {
var a = this.mouseScrollDelta;
this._resetMouseScrollState(), (a > 0 ? this._goToPreviousPage() : this._goToNextPage()) && (this.mouseScrollTimeStamp = n)
}
}
}
}, {
key: "_goToPreviousPage", value: function () {
var e = this.pdfViewer.currentPageNumber;
return !(e <= 1) && (this.pdfViewer.currentPageNumber = e - 1, !0)
}
}, {
key: "_goToNextPage", value: function () {
var e = this.pdfViewer.currentPageNumber;
return !(e >= this.pdfViewer.pagesCount) && (this.pdfViewer.currentPageNumber = e + 1, !0)
}
}, {
key: "_notifyStateChange", value: function () {
this.eventBus.dispatch("presentationmodechanged", {
source: this,
active: this.active,
switchInProgress: !!this.switchInProgress
})
}
}, {
key: "_setSwitchInProgress", value: function () {
var e = this;
this.switchInProgress && clearTimeout(this.switchInProgress), this.switchInProgress = setTimeout(function () {
e._removeFullscreenChangeListeners(), delete e.switchInProgress, e._notifyStateChange()
}, 1500)
}
}, {
key: "_resetSwitchInProgress", value: function () {
this.switchInProgress && (clearTimeout(this.switchInProgress), delete this.switchInProgress)
}
}, {
key: "_enter", value: function () {
var e = this;
this.active = !0, this._resetSwitchInProgress(), this._notifyStateChange(), this.container.classList.add("pdfPresentationMode"), setTimeout(function () {
e.pdfViewer.currentPageNumber = e.args.page, e.pdfViewer.currentScaleValue = "page-fit"
}, 0), this._addWindowListeners(), this._showControls(), this.contextMenuOpen = !1, this.container.setAttribute("contextmenu", "viewerContextMenu"), window.getSelection().removeAllRanges()
}
}, {
key: "_exit", value: function () {
var e = this, t = this.pdfViewer.currentPageNumber;
this.container.classList.remove("pdfPresentationMode"), setTimeout(function () {
e.active = !1, e._removeFullscreenChangeListeners(), e._notifyStateChange(), e.pdfViewer.currentScaleValue = e.args.previousScale, e.pdfViewer.currentPageNumber = t, e.args = null
}, 0), this._removeWindowListeners(), this._hideControls(), this._resetMouseScrollState(), this.container.removeAttribute("contextmenu"), this.contextMenuOpen = !1
}
}, {
key: "_mouseDown", value: function (e) {
if (this.contextMenuOpen) return this.contextMenuOpen = !1, void e.preventDefault();
0 === e.button && (e.target.href && e.target.classList.contains("internalLink") || (e.preventDefault(), e.shiftKey ? this._goToPreviousPage() : this._goToNextPage()))
}
}, {
key: "_contextMenu", value: function () {
this.contextMenuOpen = !0
}
}, {
key: "_showControls", value: function () {
var e = this;
this.controlsTimeout ? clearTimeout(this.controlsTimeout) : this.container.classList.add("pdfPresentationModeControls"), this.controlsTimeout = setTimeout(function () {
e.container.classList.remove("pdfPresentationModeControls"), delete e.controlsTimeout
}, 3e3)
}
}, {
key: "_hideControls", value: function () {
this.controlsTimeout && (clearTimeout(this.controlsTimeout), this.container.classList.remove("pdfPresentationModeControls"), delete this.controlsTimeout)
}
}, {
key: "_resetMouseScrollState", value: function () {
this.mouseScrollTimeStamp = 0, this.mouseScrollDelta = 0
}
}, {
key: "_touchSwipe", value: function (e) {
if (this.active) if (e.touches.length > 1) this.touchSwipeState = null; else switch (e.type) {
case"touchstart":
this.touchSwipeState = {
startX: e.touches[0].pageX,
startY: e.touches[0].pageY,
endX: e.touches[0].pageX,
endY: e.touches[0].pageY
};
break;
case"touchmove":
if (null === this.touchSwipeState) return;
this.touchSwipeState.endX = e.touches[0].pageX, this.touchSwipeState.endY = e.touches[0].pageY, e.preventDefault();
break;
case"touchend":
if (null === this.touchSwipeState) return;
var t = 0, n = this.touchSwipeState.endX - this.touchSwipeState.startX,
r = this.touchSwipeState.endY - this.touchSwipeState.startY, i = Math.abs(Math.atan2(r, n));
Math.abs(n) > 50 && (i <= a || i >= Math.PI - a) ? t = n : Math.abs(r) > 50 && Math.abs(i - Math.PI / 2) <= a && (t = r), t > 0 ? this._goToPreviousPage() : t < 0 && this._goToNextPage()
}
}
}, {
key: "_addWindowListeners", value: function () {
this.showControlsBind = this._showControls.bind(this), this.mouseDownBind = this._mouseDown.bind(this), this.mouseWheelBind = this._mouseWheel.bind(this), this.resetMouseScrollStateBind = this._resetMouseScrollState.bind(this), this.contextMenuBind = this._contextMenu.bind(this), this.touchSwipeBind = this._touchSwipe.bind(this), window.addEventListener("mousemove", this.showControlsBind), window.addEventListener("mousedown", this.mouseDownBind), window.addEventListener("wheel", this.mouseWheelBind), window.addEventListener("keydown", this.resetMouseScrollStateBind), window.addEventListener("contextmenu", this.contextMenuBind), window.addEventListener("touchstart", this.touchSwipeBind), window.addEventListener("touchmove", this.touchSwipeBind), window.addEventListener("touchend", this.touchSwipeBind)
}
}, {
key: "_removeWindowListeners", value: function () {
window.removeEventListener("mousemove", this.showControlsBind), window.removeEventListener("mousedown", this.mouseDownBind), window.removeEventListener("wheel", this.mouseWheelBind), window.removeEventListener("keydown", this.resetMouseScrollStateBind), window.removeEventListener("contextmenu", this.contextMenuBind), window.removeEventListener("touchstart", this.touchSwipeBind), window.removeEventListener("touchmove", this.touchSwipeBind), window.removeEventListener("touchend", this.touchSwipeBind), delete this.showControlsBind, delete this.mouseDownBind, delete this.mouseWheelBind, delete this.resetMouseScrollStateBind, delete this.contextMenuBind, delete this.touchSwipeBind
}
}, {
key: "_fullscreenChange", value: function () {
this.isFullscreen ? this._enter() : this._exit()
}
}, {
key: "_addFullscreenChangeListeners", value: function () {
this.fullscreenChangeBind = this._fullscreenChange.bind(this), window.addEventListener("fullscreenchange", this.fullscreenChangeBind), window.addEventListener("mozfullscreenchange", this.fullscreenChangeBind), window.addEventListener("webkitfullscreenchange", this.fullscreenChangeBind), window.addEventListener("MSFullscreenChange", this.fullscreenChangeBind)
}
}, {
key: "_removeFullscreenChangeListeners", value: function () {
window.removeEventListener("fullscreenchange", this.fullscreenChangeBind), window.removeEventListener("mozfullscreenchange", this.fullscreenChangeBind), window.removeEventListener("webkitfullscreenchange", this.fullscreenChangeBind), window.removeEventListener("MSFullscreenChange", this.fullscreenChangeBind), delete this.fullscreenChangeBind
}
}, {
key: "isFullscreen", get: function () {
return !!(document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement)
}
}]), e
}();
t.PDFPresentationMode = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFThumbnailViewer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9), a = n(430);
var o = function () {
function e(t) {
var n = t.container, r = t.linkService, a = t.renderingQueue, o = t.l10n, s = void 0 === o ? i.NullL10n : o;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.container = n, this.linkService = r, this.renderingQueue = a, this.l10n = s, this.scroll = (0, i.watchScroll)(this.container, this._scrollUpdated.bind(this)), this._resetView()
}
return r(e, [{
key: "_scrollUpdated", value: function () {
this.renderingQueue.renderHighestPriority()
}
}, {
key: "getThumbnail", value: function (e) {
return this._thumbnails[e]
}
}, {
key: "_getVisibleThumbs", value: function () {
return (0, i.getVisibleElements)(this.container, this._thumbnails)
}
}, {
key: "scrollThumbnailIntoView", value: function (e) {
var t = document.querySelector(".thumbnail.selected");
t && t.classList.remove("selected");
var n = document.querySelector('div.thumbnail[data-page-number="' + e + '"]');
n && n.classList.add("selected");
var r = this._getVisibleThumbs(), a = r.views.length;
if (a > 0) {
var o = r.first.id, s = a > 1 ? r.last.id : o;
(e <= o || e >= s) && (0, i.scrollIntoView)(n, {top: -19})
}
}
}, {
key: "cleanup", value: function () {
a.PDFThumbnailView.cleanup()
}
}, {
key: "_resetView", value: function () {
this._thumbnails = [], this._pageLabels = null, this._pagesRotation = 0, this._pagesRequests = [], this.container.textContent = ""
}
}, {
key: "setDocument", value: function (e) {
var t = this;
this.pdfDocument && (this._cancelRendering(), this._resetView()), this.pdfDocument = e, e && e.getPage(1).then(function (n) {
for (var r = e.numPages, i = n.getViewport(1), o = 1; o <= r; ++o) {
var s = new a.PDFThumbnailView({
container: t.container,
id: o,
defaultViewport: i.clone(),
linkService: t.linkService,
renderingQueue: t.renderingQueue,
disableCanvasToImageConversion: !1,
l10n: t.l10n
});
t._thumbnails.push(s)
}
}).catch(function (e) {
console.error("Unable to initialize thumbnail viewer", e)
})
}
}, {
key: "_cancelRendering", value: function () {
for (var e = 0, t = this._thumbnails.length; e < t; e++) this._thumbnails[e] && this._thumbnails[e].cancelRendering()
}
}, {
key: "setPageLabels", value: function (e) {
if (this.pdfDocument) {
e ? e instanceof Array && this.pdfDocument.numPages === e.length ? this._pageLabels = e : (this._pageLabels = null, console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")) : this._pageLabels = null;
for (var t = 0, n = this._thumbnails.length; t < n; t++) {
var r = this._pageLabels && this._pageLabels[t];
this._thumbnails[t].setPageLabel(r)
}
}
}
}, {
key: "_ensurePdfPageLoaded", value: function (e) {
var t = this;
if (e.pdfPage) return Promise.resolve(e.pdfPage);
var n = e.id;
if (this._pagesRequests[n]) return this._pagesRequests[n];
var r = this.pdfDocument.getPage(n).then(function (r) {
return e.setPdfPage(r), t._pagesRequests[n] = null, r
}).catch(function (e) {
console.error("Unable to get page for thumb view", e), t._pagesRequests[n] = null
});
return this._pagesRequests[n] = r, r
}
}, {
key: "forceRendering", value: function () {
var e = this, t = this._getVisibleThumbs(),
n = this.renderingQueue.getHighestPriority(t, this._thumbnails, this.scroll.down);
return !!n && (this._ensurePdfPageLoaded(n).then(function () {
n.pdfPage.disableTextAnnotation = window.KGPdfViewerWebApp.disableTextAnnotation;
var t = window.KGPdfViewerWebApp.globalAnnotation && window.KGPdfViewerWebApp.globalAnnotation.hideList || [];
n.pdfPage.disableDocSignAnnotation = t, e.renderingQueue.renderView(n)
}), !0)
}
}, {
key: "pagesRotation", get: function () {
return this._pagesRotation
}, set: function (e) {
if (!(0, i.isValidRotation)(e)) throw new Error("Invalid thumbnails rotation angle.");
if (this.pdfDocument && this._pagesRotation !== e) {
this._pagesRotation = e;
for (var t = 0, n = this._thumbnails.length; t < n; t++) this._thumbnails[t].update(e)
}
}
}]), e
}();
t.PDFThumbnailViewer = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFThumbnailView = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(14), a = n(9), o = n(16);
var s, l = 1, c = 160, u = (s = null, {
getCanvas: function (e, t) {
var n = s;
n || (n = document.createElement("canvas"), s = n), n.width = e, n.height = t, n.mozOpaque = !0;
var r = n.getContext("2d", {alpha: !1});
return r.save(), r.fillStyle = "rgb(255, 255, 255)", r.fillRect(0, 0, e, t), r.restore(), n
}, destroyCanvas: function () {
var e = s;
e && (e.width = 0, e.height = 0), s = null
}
}), d = function () {
function e(t) {
var n = t.container, r = t.id, i = t.defaultViewport, s = t.linkService, u = t.renderingQueue,
d = t.disableCanvasToImageConversion, h = void 0 !== d && d, p = t.l10n, f = void 0 === p ? a.NullL10n : p;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.id = r, this.renderingId = "thumbnail" + r, this.pageLabel = null, this.pdfPage = null, this.rotation = 0, this.viewport = i, this.pdfPageRotate = i.rotation, this.linkService = s, this.renderingQueue = u, this.renderTask = null, this.renderingState = o.RenderingStates.INITIAL, this.resume = null, this.disableCanvasToImageConversion = h, this.pageWidth = this.viewport.width, this.pageHeight = this.viewport.height, this.pageRatio = this.pageWidth / this.pageHeight, this.canvasWidth = c, this.canvasHeight = this.canvasWidth / this.pageRatio | 0, this.scale = this.canvasWidth / this.pageWidth, this.l10n = f;
var m = document.createElement("a");
m.href = s.getAnchorUrl("#page=" + r), this.l10n.get("thumb_page_title", {page: r}, "Page {{page}}").then(function (e) {
m.title = e
}), m.onclick = function () {
return s.page = r, !1
}, this.anchor = m;
var v = document.createElement("div");
v.className = "thumbnail", v.setAttribute("data-page-number", this.id), this.div = v, 1 === r && v.classList.add("selected");
var g = document.createElement("div");
g.className = "thumbnailSelectionRing";
var y = 2 * l;
g.style.width = this.canvasWidth + y + "px", g.style.height = this.canvasHeight + y + "px", this.ring = g, v.appendChild(g), m.appendChild(v), n.appendChild(m)
}
return r(e, [{
key: "setPdfPage", value: function (e) {
this.pdfPage = e, this.pdfPageRotate = e.rotate;
var t = (this.rotation + this.pdfPageRotate) % 360;
this.viewport = e.getViewport(1, t), this.reset()
}
}, {
key: "reset", value: function () {
this.cancelRendering(), this.pageWidth = this.viewport.width, this.pageHeight = this.viewport.height, this.pageRatio = this.pageWidth / this.pageHeight, this.canvasHeight = this.canvasWidth / this.pageRatio | 0, this.scale = this.canvasWidth / this.pageWidth, this.div.removeAttribute("data-loaded");
for (var e = this.ring, t = e.childNodes, n = t.length - 1; n >= 0; n--) e.removeChild(t[n]);
var r = 2 * l;
e.style.width = this.canvasWidth + r + "px", e.style.height = this.canvasHeight + r + "px", this.canvas && (this.canvas.width = 0, this.canvas.height = 0, delete this.canvas), this.image && (this.image.removeAttribute("src"), delete this.image)
}
}, {
key: "update", value: function (e) {
void 0 !== e && (this.rotation = e);
var t = (this.rotation + this.pdfPageRotate) % 360;
this.viewport = this.viewport.clone({scale: 1, rotation: t}), this.reset()
}
}, {
key: "cancelRendering", value: function () {
this.renderTask && (this.renderTask.cancel(), this.renderTask = null), this.renderingState = o.RenderingStates.INITIAL, this.resume = null
}
}, {
key: "_getPageDrawContext", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = document.createElement("canvas");
this.canvas = t, t.mozOpaque = !0;
var n = t.getContext("2d", {alpha: !1}), r = (0, a.getOutputScale)(n);
return t.width = this.canvasWidth * r.sx | 0, t.height = this.canvasHeight * r.sy | 0, t.style.width = this.canvasWidth + "px", t.style.height = this.canvasHeight + "px", !e && r.scaled && n.scale(r.sx, r.sy), n
}
}, {
key: "_convertCanvasToImage", value: function () {
var e = this;
if (this.canvas && this.renderingState === o.RenderingStates.FINISHED) {
var t = this.renderingId;
if (this.disableCanvasToImageConversion) return this.canvas.id = t, this.canvas.className = "thumbnailImage", this.l10n.get("thumb_page_canvas", {page: this.pageId}, "Thumbnail of Page {{page}}").then(function (t) {
e.canvas.setAttribute("aria-label", t)
}), this.div.setAttribute("data-loaded", !0), void this.ring.appendChild(this.canvas);
var n = this.ring.querySelector("img");
n ? n.src = this.canvas.toDataURL() : ((n = document.createElement("img")).id = t, n.className = "thumbnailImage", this.l10n.get("thumb_page_canvas", {page: this.pageId}, "Thumbnail of Page {{page}}").then(function (e) {
n.setAttribute("aria-label", e)
}), n.style.width = this.canvasWidth + "px", n.style.height = this.canvasHeight + "px", n.src = this.canvas.toDataURL(), this.image = n, this.div.setAttribute("data-loaded", !0), this.ring.appendChild(n), this.canvas.width = 0, this.canvas.height = 0, delete this.canvas)
}
}
}, {
key: "draw", value: function () {
console.log("draw")
var e = this;
if (this.renderingState !== o.RenderingStates.INITIAL) return console.error("Must be in new state before drawing"), Promise.resolve(void 0);
this.renderingState = o.RenderingStates.RUNNING;
var t = (0, i.createPromiseCapability)(), n = function (n) {
a === e.renderTask && (e.renderTask = null), "cancelled" === n || n instanceof i.RenderingCancelledException ? t.resolve(void 0) : (e.renderingState = o.RenderingStates.FINISHED, e._convertCanvasToImage(), n ? t.reject(n) : t.resolve(void 0))
}, r = {canvasContext: this._getPageDrawContext(), viewport: this.viewport.clone({scale: this.scale})},
a = this.renderTask = this.pdfPage.render(r);
return a.onContinue = function (t) {
if (!e.renderingQueue.isHighestPriority(e)) return e.renderingState = o.RenderingStates.PAUSED, void (e.resume = function () {
e.renderingState = o.RenderingStates.RUNNING, t()
});
t()
}, a.promise.then(function () {
n(null)
}, function (e) {
n(e)
}), t.promise
}
}, {
key: "setImage", value: function (e) {
if (this.renderingState === o.RenderingStates.INITIAL) {
var t = e.canvas;
if (t) {
this.pdfPage || this.setPdfPage(e.pdfPage), this.renderingState = o.RenderingStates.FINISHED;
var n = this._getPageDrawContext(!0), r = n.canvas;
if (t.width <= 2 * r.width) return n.drawImage(t, 0, 0, t.width, t.height, 0, 0, r.width, r.height), void this._convertCanvasToImage();
for (var i = r.width << 3, a = r.height << 3, s = u.getCanvas(i, a), l = s.getContext("2d"); i > t.width || a > t.height;) i >>= 1, a >>= 1;
for (l.drawImage(t, 0, 0, t.width, t.height, 0, 0, i, a); i > 2 * r.width;) l.drawImage(s, 0, 0, i, a, 0, 0, i >> 1, a >> 1), i >>= 1, a >>= 1;
n.drawImage(s, 0, 0, i, a, 0, 0, r.width, r.height), this._convertCanvasToImage()
}
}
}
}, {
key: "setPageLabel", value: function (e) {
var t = this;
this.pageLabel = "string" == typeof e ? e : null, this.l10n.get("thumb_page_title", {page: this.pageId}, "Page {{page}}").then(function (e) {
t.anchor.title = e
}), this.renderingState === o.RenderingStates.FINISHED && this.l10n.get("thumb_page_canvas", {page: this.pageId}, "Thumbnail of Page {{page}}").then(function (e) {
t.image ? t.image.setAttribute("aria-label", e) : t.disableCanvasToImageConversion && t.canvas && t.canvas.setAttribute("aria-label", e)
})
}
}, {
key: "pageId", get: function () {
return null !== this.pageLabel ? this.pageLabel : this.id
}
}], [{
key: "cleanup", value: function () {
u.destroyCanvas()
}
}]), e
}();
t.PDFThumbnailView = d
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFViewer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9), a = n(432), o = n(14);
var s = function (e) {
function t() {
return function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), function (e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, a.BaseViewer), r(t, [{
key: "_scrollIntoView", value: function (e) {
var t = e.pageDiv, n = e.pageSpot, r = void 0 === n ? null : n;
(0, i.scrollIntoView)(t, r)
}
}, {
key: "_getVisiblePages", value: function () {
if (!this.isInPresentationMode) return (0, i.getVisibleElements)(this.container, this._pages, !0);
var e = this._pages[this._currentPageNumber - 1];
return {first: e, last: e, views: [{id: e.id, view: e}]}
}
}, {
key: "update", value: function () {
var e = this._getVisiblePages(), t = e.views, n = t.length;
if (0 !== n) {
this._resizeBuffer(n), this.renderingQueue.renderHighestPriority(e);
for (var r = this._currentPageNumber, i = !1, a = 0; a < n; ++a) {
var o = t[a];
if (o.percent < 100) break;
if (o.id === r) {
i = !0;
break
}
}
i || (r = t[0].id), this.isInPresentationMode || this._setCurrentPageNumber(r), this._updateLocation(e.first), this.eventBus.dispatch("updateviewarea", {
source: this,
location: this._location
}), this.app.KGStampConfirm && this.app.KGStampConfirm.setContainerWidth()
}
}
}, {
key: "_setDocumentViewerElement", get: function () {
return (0, o.shadow)(this, "_setDocumentViewerElement", this.viewer)
}
}]), t
}();
t.PDFViewer = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.BaseViewer = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(14), a = n(9), o = n(16), s = n(433), l = n(63), c = n(434), u = n(125), d = n(435);
var h = function () {
function e(t) {
if (function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.constructor === e) throw new Error("Cannot initialize BaseViewer.");
this._name = this.constructor.name, this.container = t.container, this.viewer = t.viewer || t.container.firstElementChild, this.eventBus = t.eventBus || (0, l.getGlobalEventBus)(), this.linkService = t.linkService || new u.SimpleLinkService, this.downloadManager = t.downloadManager || null, this.removePageBorders = t.removePageBorders || !1, this.enhanceTextSelection = t.enhanceTextSelection || !1, this.renderInteractiveForms = t.renderInteractiveForms || !1, this.enablePrintAutoRotate = t.enablePrintAutoRotate || !1, this.renderer = t.renderer || a.RendererType.CANVAS, this.l10n = t.l10n || a.NullL10n, this.defaultRenderingQueue = !t.renderingQueue, this.defaultRenderingQueue ? (this.renderingQueue = new o.PDFRenderingQueue, this.renderingQueue.setViewer(this)) : this.renderingQueue = t.renderingQueue, this.scroll = (0, a.watchScroll)(this.container, this._scrollUpdate.bind(this)), this.presentationModeState = a.PresentationModeState.UNKNOWN, this._resetView(), this.removePageBorders && this.viewer.classList.add("removePageBorders")
}
return r(e, [{
key: "getPageView", value: function (e) {
return this._pages[e]
}
}, {
key: "_setCurrentPageNumber", value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
if (this._currentPageNumber !== e) if (0 < e && e <= this.pagesCount) {
var n = {source: this, pageNumber: e, pageLabel: this._pageLabels && this._pageLabels[e - 1]};
this._currentPageNumber = e, this.eventBus.dispatch("pagechanging", n), this.eventBus.dispatch("pagechange", n), t && this._resetCurrentPageView()
} else console.error(this._name + '._setCurrentPageNumber: "' + e + '" is out of bounds.'); else t && this._resetCurrentPageView()
}
}, {
key: "setDocument", value: function (e) {
var t = this;
if (this.pdfDocument && (this._cancelRendering(), this._resetView()), this.pdfDocument = e, e) {
var n = e.numPages, r = (0, i.createPromiseCapability)();
this.pagesPromise = r.promise, r.promise.then(function () {
t._pageViewsReady = !0, window.KGPdfViewerWebApp.enableButtons(), t.eventBus.dispatch("pagesloaded", {
source: t,
pagesCount: n
})
});
var o = !1, s = (0, i.createPromiseCapability)();
this.onePageRendered = s.promise;
var l = function (e) {
e.onBeforeDraw = function () {
t._buffer.push(e)
}, e.onAfterDraw = function () {
o || (o = !0, s.resolve())
}
}, u = e.getPage(1);
this.firstPagePromise = u, u.then(function (o) {
for (var u = t.currentScale, d = o.getViewport(u * a.CSS_UNITS), h = 1; h <= n; ++h) {
var p = null;
i.PDFJS.disableTextLayer || (p = t);
var f = new c.PDFPageView({
container: t._setDocumentViewerElement,
eventBus: t.eventBus,
id: h,
scale: u,
defaultViewport: d.clone(),
renderingQueue: t.renderingQueue,
textLayerFactory: p,
annotationLayerFactory: t,
enhanceTextSelection: t.enhanceTextSelection,
renderInteractiveForms: t.renderInteractiveForms,
renderer: t.renderer,
l10n: t.l10n
});
f.pdfViewer = t, l(f), t._pages.push(f)
}
s.promise.then(function () {
if (i.PDFJS.disableAutoFetch) r.resolve(); else for (var a = n, o = function (n) {
e.getPage(n).then(function (e) {
var i = t._pages[n - 1];
i.pdfPage || i.setPdfPage(e), t.linkService.cachePageRef(n, e.ref), 0 == --a && r.resolve()
}, function (e) {
console.error("Unable to get page " + n + " to initialize viewer", e), 0 == --a && r.resolve()
})
}, s = 1; s <= n; ++s) o(s)
}), t.eventBus.dispatch("pagesinit", {source: t}), t.defaultRenderingQueue && t.update(), t.findController && t.findController.resolveFirstPage()
}).catch(function (e) {
console.error("Unable to initialize viewer", e)
})
}
}
}, {
key: "setPageLabels", value: function (e) {
if (this.pdfDocument) {
e ? e instanceof Array && this.pdfDocument.numPages === e.length ? this._pageLabels = e : (this._pageLabels = null, console.error(this._name + ".setPageLabels: Invalid page labels.")) : this._pageLabels = null;
for (var t = 0, n = this._pages.length; t < n; t++) {
var r = this._pages[t], i = this._pageLabels && this._pageLabels[t];
r.setPageLabel(i)
}
}
}
}, {
key: "_resetView", value: function () {
this._pages = [], this._currentPageNumber = 1, this._currentScale = a.UNKNOWN_SCALE, this._currentScaleValue = null, this._pageLabels = null, this._buffer = new function (e) {
var t = [];
this.push = function (n) {
var r = t.indexOf(n);
r >= 0 && t.splice(r, 1), t.push(n), t.length > e && t.shift().destroy()
}, this.resize = function (n) {
for (e = n; t.length > e;) t.shift().destroy()
}
}(10), this._location = null, this._pagesRotation = 0, this._pagesRequests = [], this._pageViewsReady = !1, this.viewer.textContent = ""
}
}, {
key: "_scrollUpdate", value: function () {
0 !== this.pagesCount && this.update()
}
}, {
key: "_scrollIntoView", value: function (e) {
e.pageDiv, e.pageSpot, e.pageNumber;
throw new Error("Not implemented: _scrollIntoView")
}
}, {
key: "_setScaleDispatchEvent", value: function (e, t) {
var n = {
source: this,
scale: e,
presetValue: arguments.length > 2 && void 0 !== arguments[2] && arguments[2] ? t : void 0
};
this.eventBus.dispatch("scalechanging", n), this.eventBus.dispatch("scalechange", n)
}
}, {
key: "_setScaleUpdatePages", value: function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
if (this._currentScaleValue = t.toString(), function (e, t) {
return t === e || Math.abs(t - e) < 1e-15
}(this._currentScale, e)) r && this._setScaleDispatchEvent(e, t, !0); else {
for (var a = 0, o = this._pages.length; a < o; a++) this._pages[a].update(e);
if (this._currentScale = e, !n) {
var s = this._currentPageNumber, l = void 0;
!this._location || i.PDFJS.ignoreCurrentPositionOnZoom || this.isInPresentationMode || this.isChangingPresentationMode || (s = this._location.pageNumber, l = [null, {name: "XYZ"}, this._location.left, this._location.top, null]), this.scrollPageIntoView({
pageNumber: s,
destArray: l,
allowNegativeOffset: !0
})
}
this._setScaleDispatchEvent(e, t, r), this.defaultRenderingQueue && this.update()
}
}
}, {
key: "_setScale", value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = parseFloat(e);
if (n > 0) this._setScaleUpdatePages(n, e, t, !1); else {
var r = this._pages[this._currentPageNumber - 1];
if (!r) return;
var i = this.isInPresentationMode || this.removePageBorders ? 0 : a.SCROLLBAR_PADDING,
o = this.isInPresentationMode || this.removePageBorders ? 0 : a.VERTICAL_PADDING,
s = (this.container.clientWidth - i) / r.width * r.scale,
l = (this.container.clientHeight - o) / r.height * r.scale;
switch (e) {
case"page-actual":
n = 1;
break;
case"page-width":
n = s;
break;
case"page-height":
n = l;
break;
case"page-fit":
n = Math.min(s, l);
break;
case"auto":
var c = r.width > r.height ? Math.min(l, s) : s;
n = Math.min(a.MAX_AUTO_SCALE, c);
break;
default:
return void console.error(this._name + '._setScale: "' + e + '" is an unknown zoom value.')
}
this._setScaleUpdatePages(n, e, t, !0)
}
}
}, {
key: "_resetCurrentPageView", value: function () {
this.isInPresentationMode && this._setScale(this._currentScaleValue, !0);
var e = this._pages[this._currentPageNumber - 1];
this._scrollIntoView({pageDiv: e.div})
}
}, {
key: "scrollPageIntoView", value: function (e) {
if (arguments.length > 1 || "number" == typeof e) console.error("Call of scrollPageIntoView() with obsolete signature."); else if (this.pdfDocument) {
var t = e.pageNumber || 0, n = e.destArray || null, r = e.allowNegativeOffset || !1;
if (!this.isInPresentationMode && n) {
var i = this._pages[t - 1];
if (i) {
var o = 0, s = 0, l = 0, c = 0, u = void 0, d = void 0, h = i.rotation % 180 != 0,
p = (h ? i.height : i.width) / i.scale / a.CSS_UNITS,
f = (h ? i.width : i.height) / i.scale / a.CSS_UNITS, m = 0;
switch (n[1].name) {
case"XYZ":
o = n[2], s = n[3], m = n[4], o = null !== o ? o : 0, s = null !== s ? s : f;
break;
case"Fit":
case"FitB":
m = "page-fit";
break;
case"FitH":
case"FitBH":
m = "page-width", null === (s = n[2]) && this._location && (o = this._location.left, s = this._location.top);
break;
case"FitV":
case"FitBV":
o = n[2], l = p, c = f, m = "page-height";
break;
case"FitR":
o = n[2], s = n[3], l = n[4] - o, c = n[5] - s;
var v = this.removePageBorders ? 0 : a.SCROLLBAR_PADDING,
g = this.removePageBorders ? 0 : a.VERTICAL_PADDING;
u = (this.container.clientWidth - v) / l / a.CSS_UNITS, d = (this.container.clientHeight - g) / c / a.CSS_UNITS, m = Math.min(Math.abs(u), Math.abs(d));
break;
default:
return void console.error(this._name + '.scrollPageIntoView: "' + n[1].name + '" is not a valid destination type.')
}
if (m && m !== this._currentScale ? this.currentScaleValue = m : this._currentScale === a.UNKNOWN_SCALE && (this.currentScaleValue = a.DEFAULT_SCALE_VALUE), "page-fit" !== m || n[4]) {
var y = [i.viewport.convertToViewportPoint(o, s), i.viewport.convertToViewportPoint(o + l, s + c)],
b = Math.min(y[0][0], y[1][0]), w = Math.min(y[0][1], y[1][1]);
r || (b = Math.max(b, 0), w = Math.max(w, 0)), this._scrollIntoView({
pageDiv: i.div,
pageSpot: {left: b, top: w},
pageNumber: t
})
} else this._scrollIntoView({pageDiv: i.div, pageNumber: t})
} else console.error(this._name + '.scrollPageIntoView: Invalid "pageNumber" parameter.')
} else this._setCurrentPageNumber(t, !0)
}
}
}, {
key: "_resizeBuffer", value: function (e) {
var t = Math.max(10, 2 * e + 1);
this._buffer.resize(t)
}
}, {
key: "_updateLocation", value: function (e) {
var t = this._currentScale, n = this._currentScaleValue,
r = parseFloat(n) === t ? Math.round(1e4 * t) / 100 : n, i = e.id, a = "#page=" + i;
a += "&zoom=" + r;
var o = this._pages[i - 1], s = this.container, l = o.getPagePoint(s.scrollLeft - e.x, s.scrollTop - e.y),
c = Math.round(l[0]), u = Math.round(l[1]);
a += "," + c + "," + u, this._location = {
pageNumber: i,
scale: r,
top: u,
left: c,
rotation: this._pagesRotation,
pdfOpenParams: a
}
}
}, {
key: "update", value: function () {
throw new Error("Not implemented: update")
}
}, {
key: "containsElement", value: function (e) {
return this.container.contains(e)
}
}, {
key: "focus", value: function () {
this.container.focus()
}
}, {
key: "_getVisiblePages", value: function () {
throw new Error("Not implemented: _getVisiblePages")
}
}, {
key: "cleanup", value: function () {
for (var e = 0, t = this._pages.length; e < t; e++) this._pages[e] && this._pages[e].renderingState !== o.RenderingStates.FINISHED && this._pages[e].reset()
}
}, {
key: "_cancelRendering", value: function () {
for (var e = 0, t = this._pages.length; e < t; e++) this._pages[e] && this._pages[e].cancelRendering()
}
}, {
key: "_ensurePdfPageLoaded", value: function (e) {
var t = this;
if (e.pdfPage) return Promise.resolve(e.pdfPage);
var n = e.id;
if (this._pagesRequests[n]) return this._pagesRequests[n];
var r = this.pdfDocument.getPage(n).then(function (r) {
return e.pdfPage || e.setPdfPage(r), t._pagesRequests[n] = null, r
}).catch(function (e) {
console.error("Unable to get page for page view", e), t._pagesRequests[n] = null
});
return this._pagesRequests[n] = r, r
}
}, {
key: "forceRendering", value: function (e) {
var t = this, n = e || this._getVisiblePages(),
r = this.renderingQueue.getHighestPriority(n, this._pages, this.scroll.down);
return !!r && (this._ensurePdfPageLoaded(r).then(function () {
r.pdfPage.disableTextAnnotation = window.KGPdfViewerWebApp.disableTextAnnotation;
var e = window.KGPdfViewerWebApp.globalAnnotation && window.KGPdfViewerWebApp.globalAnnotation.hideList || [];
r.pdfPage.disableDocSignAnnotation = e, t.renderingQueue.renderView(r)
}), !0)
}
}, {
key: "getPageTextContent", value: function (e) {
return this.pdfDocument.getPage(e + 1).then(function (e) {
return e.getTextContent({normalizeWhitespace: !0})
})
}
}, {
key: "createTextLayerBuilder", value: function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
return new d.TextLayerBuilder({
textLayerDiv: e,
eventBus: this.eventBus,
pageIndex: t,
viewport: n,
findController: this.isInPresentationMode ? null : this.findController,
enhanceTextSelection: !this.isInPresentationMode && r
})
}
}, {
key: "createAnnotationLayerBuilder", value: function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : a.NullL10n;
return new s.AnnotationLayerBuilder({
pageDiv: e,
pdfPage: t,
renderInteractiveForms: n,
linkService: this.linkService,
downloadManager: this.downloadManager,
l10n: r
})
}
}, {
key: "setFindController", value: function (e) {
this.findController = e
}
}, {
key: "getPagesOverview", value: function () {
var e = function (e) {
return e.width <= e.height
}, t = this._pages.map(function (t) {
var n = t.pdfPage.getViewport(1);
return e(n) ? {width: n.width, height: n.height, rotation: n.rotation} : {
width: n.height,
height: n.width,
rotation: (n.rotation - 90) % 360
}
});
if (!this.enablePrintAutoRotate) return t;
var n = e(t[0]);
return t.map(function (t) {
return n === e(t) ? t : {width: t.height, height: t.width, rotation: (t.rotation + 90) % 360}
})
}
}, {
key: "pagesCount", get: function () {
return this._pages.length
}
}, {
key: "pageViewsReady", get: function () {
return this._pageViewsReady
}
}, {
key: "currentPageNumber", get: function () {
return this._currentPageNumber
}, set: function (e) {
if (!Number.isInteger(e)) throw new Error("Invalid page number.");
this.pdfDocument && this._setCurrentPageNumber(e, !0)
}
}, {
key: "currentPageLabel", get: function () {
return this._pageLabels && this._pageLabels[this._currentPageNumber - 1]
}, set: function (e) {
var t = 0 | e;
if (this._pageLabels) {
var n = this._pageLabels.indexOf(e);
n >= 0 && (t = n + 1)
}
this.currentPageNumber = t
}
}, {
key: "currentScale", get: function () {
return this._currentScale !== a.UNKNOWN_SCALE ? this._currentScale : a.DEFAULT_SCALE
}, set: function (e) {
if (isNaN(e)) throw new Error("Invalid numeric scale");
this.pdfDocument && this._setScale(e, !1)
}
}, {
key: "currentScaleValue", get: function () {
return this._currentScaleValue
}, set: function (e) {
this.pdfDocument && (window.hightMap.removeAll(), this._setScale(e, !1))
}
}, {
key: "pagesRotation", get: function () {
return this._pagesRotation
}, set: function (e) {
if (!(0, a.isValidRotation)(e)) throw new Error("Invalid pages rotation angle.");
if (this.pdfDocument && this._pagesRotation !== e) {
this._pagesRotation = e;
for (var t = this._currentPageNumber, n = 0, r = this._pages.length; n < r; n++) {
var i = this._pages[n];
i.update(i.scale, e)
}
this._currentScaleValue && this._setScale(this._currentScaleValue, !0), this.eventBus.dispatch("rotationchanging", {
source: this,
pagesRotation: e,
pageNumber: t
}), this.defaultRenderingQueue && this.update()
}
}
}, {
key: "_setDocumentViewerElement", get: function () {
throw new Error("Not implemented: _setDocumentViewerElement")
}
}, {
key: "isInPresentationMode", get: function () {
return this.presentationModeState === a.PresentationModeState.FULLSCREEN
}
}, {
key: "isChangingPresentationMode", get: function () {
return this.presentationModeState === a.PresentationModeState.CHANGING
}
}, {
key: "isHorizontalScrollbarEnabled", get: function () {
return !this.isInPresentationMode && this.container.scrollWidth > this.container.clientWidth
}
}, {
key: "hasEqualPageSizes", get: function () {
for (var e = this._pages[0], t = 1, n = this._pages.length; t < n; ++t) {
var r = this._pages[t];
if (r.width !== e.width || r.height !== e.height) return !1
}
return !0
}
}]), e
}();
t.BaseViewer = h
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.DefaultAnnotationLayerFactory = t.AnnotationLayerBuilder = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(14), a = n(9), o = n(125);
function s(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var l = function () {
function e(t) {
var n = t.pageDiv, r = t.pdfPage, i = t.linkService, o = t.downloadManager, l = t.renderInteractiveForms,
c = void 0 !== l && l, u = t.l10n, d = void 0 === u ? a.NullL10n : u;
s(this, e), this.pageDiv = n, this.pdfPage = r, this.linkService = i, this.downloadManager = o, this.renderInteractiveForms = c, this.l10n = d, this.div = null, this._cancelled = !1
}
return r(e, [{
key: "render", value: function (e) {
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "display", r = arguments[2];
this.pdfPage.getAnnotations({intent: n}).then(function (n) {
if (!t._cancelled) {
var a = {
pdfPageView: r,
viewport: e.clone({dontFlip: !0}),
div: t.div,
annotations: n,
page: t.pdfPage,
renderInteractiveForms: t.renderInteractiveForms,
linkService: t.linkService,
downloadManager: t.downloadManager
};
t.div ? i.AnnotationLayer.update(a) : (t.div = document.createElement("div"), t.div.className = "annotationLayer", t.pageDiv.appendChild(t.div), a.div = t.div, i.AnnotationLayer.render(a), t.l10n.translate(t.div)), r.newAnnotRenderingCapability && r.newAnnotRenderingCapability.resolve()
}
})
}
}, {
key: "cancel", value: function () {
this._cancelled = !0
}
}, {
key: "hide", value: function () {
this.div && this.div.setAttribute("hidden", "true")
}
}]), e
}(), c = function () {
function e() {
s(this, e)
}
return r(e, [{
key: "createAnnotationLayerBuilder", value: function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : a.NullL10n;
return new l({pageDiv: e, pdfPage: t, renderInteractiveForms: n, linkService: new o.SimpleLinkService, l10n: r})
}
}]), e
}();
t.AnnotationLayerBuilder = l, t.DefaultAnnotationLayerFactory = c
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFPageView = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9), a = n(14), o = n(63), s = n(16), l = n(62);
n(2);
var c = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e);
var n = t.container, r = t.defaultViewport;
this.id = t.id, this.renderingId = "page" + this.id, this.pdfPage = null, this.pageLabel = null, this.rotation = 0, this.scale = t.scale || i.DEFAULT_SCALE, this.viewport = r, this.pdfPageRotate = r.rotation, this.hasRestrictedScaling = !1, this.enhanceTextSelection = t.enhanceTextSelection || !1, this.renderInteractiveForms = t.renderInteractiveForms || !1, this.eventBus = t.eventBus || (0, o.getGlobalEventBus)(), this.renderingQueue = t.renderingQueue, this.textLayerFactory = t.textLayerFactory, this.annotationLayerFactory = t.annotationLayerFactory, this.renderer = t.renderer || i.RendererType.CANVAS, this.l10n = t.l10n || i.NullL10n, this.paintTask = null, this.paintedViewportMap = new WeakMap, this.renderingState = s.RenderingStates.INITIAL, this.resume = null, this.error = null, this.onBeforeDraw = null, this.onAfterDraw = null, this.annotationLayer = null, this.textLayer = null, this.zoomLayer = null;
var a = document.createElement("div");
a.id = "pageContainer" + this.id, a.className = "page", a.style.width = Math.floor(this.viewport.width) + "px", a.style.height = Math.floor(this.viewport.height) + "px", a.setAttribute("data-page-number", this.id), this.div = a, n.appendChild(a)
}
return r(e, [{
key: "setPdfPage", value: function (e) {
this.pdfPage = e, this.pdfPageRotate = e.rotate;
var t = (this.rotation + this.pdfPageRotate) % 360;
this.viewport = e.getViewport(this.scale * i.CSS_UNITS, t), this.stats = e.stats, this.reset()
}
}, {
key: "destroy", value: function () {
this.reset(), this.pdfPage && this.pdfPage.cleanup()
}
}, {
key: "_resetZoomLayer", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (this.zoomLayer) {
var t = this.zoomLayer.firstChild;
this.paintedViewportMap.delete(t), t.width = 0, t.height = 0, e && this.zoomLayer.remove(), this.zoomLayer = null
}
}
}, {
key: "reset", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],
t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
this.cancelRendering(t);
var n = this.div;
n.style.width = Math.floor(this.viewport.width) + "px", n.style.height = Math.floor(this.viewport.height) + "px";
for (var r = n.childNodes, i = e && this.zoomLayer || null, a = t && this.annotationLayer && this.annotationLayer.div || null, o = r.length - 1; o >= 0; o--) {
var s = r[o];
i !== s && a !== s && n.removeChild(s)
}
n.removeAttribute("data-loaded"), a ? this.annotationLayer.hide() : this.annotationLayer && (this.annotationLayer.cancel(), this.annotationLayer = null), i || (this.canvas && (this.paintedViewportMap.delete(this.canvas), this.canvas.width = 0, this.canvas.height = 0, delete this.canvas), this._resetZoomLayer()), this.svg && (this.paintedViewportMap.delete(this.svg), delete this.svg), this.loadingIconDiv = document.createElement("div"), this.loadingIconDiv.className = "loadingIcon", n.appendChild(this.loadingIconDiv)
}
}, {
key: "update", value: function (e, t) {
this.scale = e || this.scale, void 0 !== t && (this.rotation = t);
var n = (this.rotation + this.pdfPageRotate) % 360;
if (this.viewport = this.viewport.clone({
scale: this.scale * i.CSS_UNITS,
rotation: n
}), this.svg) return this.cssTransform(this.svg, !0), void this.eventBus.dispatch("pagerendered", {
source: this,
pageNumber: this.id,
cssTransform: !0
});
var r = !1;
if (this.canvas && a.PDFJS.maxCanvasPixels > 0) {
var o = this.outputScale;
(Math.floor(this.viewport.width) * o.sx | 0) * (Math.floor(this.viewport.height) * o.sy | 0) > a.PDFJS.maxCanvasPixels && (r = !0)
}
if (this.canvas) {
if (a.PDFJS.useOnlyCssZoom || this.hasRestrictedScaling && r) return this.cssTransform(this.canvas, !0), void this.eventBus.dispatch("pagerendered", {
source: this,
pageNumber: this.id,
cssTransform: !0
});
this.zoomLayer || this.canvas.hasAttribute("hidden") || (this.zoomLayer = this.canvas.parentNode, this.zoomLayer.style.position = "absolute")
}
this.zoomLayer && this.cssTransform(this.zoomLayer.firstChild), this.reset(!0, !0)
}
}, {
key: "cancelRendering", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
this.paintTask && (this.paintTask.cancel(), this.paintTask = null), this.renderingState = s.RenderingStates.INITIAL, this.resume = null, this.textLayer && (this.textLayer.cancel(), this.textLayer = null), !e && this.annotationLayer && (this.annotationLayer.cancel(), this.annotationLayer = null)
}
}, {
key: "cssTransform", value: function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = this.viewport.width,
r = this.viewport.height, i = this.div;
e.style.width = e.parentNode.style.width = i.style.width = Math.floor(n) + "px", e.style.height = e.parentNode.style.height = i.style.height = Math.floor(r) + "px";
var o = this.viewport.rotation - this.paintedViewportMap.get(e).rotation, s = Math.abs(o), l = 1, c = 1;
90 !== s && 270 !== s || (l = r / n, c = n / r);
var u = "rotate(" + o + "deg) scale(" + l + "," + c + ")";
if (a.CustomStyle.setProp("transform", e, u), this.textLayer) {
var d = this.textLayer.viewport, h = this.viewport.rotation - d.rotation, p = Math.abs(h), f = n / d.width;
90 !== p && 270 !== p || (f = n / d.height);
var m = this.textLayer.textLayerDiv, v = void 0, g = void 0;
switch (p) {
case 0:
v = g = 0;
break;
case 90:
v = 0, g = "-" + m.style.height;
break;
case 180:
v = "-" + m.style.width, g = "-" + m.style.height;
break;
case 270:
v = "-" + m.style.width, g = 0;
break;
default:
console.error("Bad rotation value.")
}
a.CustomStyle.setProp("transform", m, "rotate(" + p + "deg) scale(" + f + ", " + f + ") translate(" + v + ", " + g + ")"), a.CustomStyle.setProp("transformOrigin", m, "0% 0%")
}
t && this.annotationLayer && this.annotationLayer.render(this.viewport, "display", this)
}
}, {
key: "getPagePoint", value: function (e, t) {
return this.viewport.convertToPdfPoint(e, t)
}
}, {
key: "draw", value: function () {
var e = this;
if (this.renderingState !== s.RenderingStates.INITIAL && (console.error("Must be in new state before drawing"), this.reset()), !this.pdfPage) return this.renderingState = s.RenderingStates.FINISHED, Promise.reject(new Error("Page is not loaded"));
this.renderingState = s.RenderingStates.RUNNING;
var t = this.pdfPage, n = this.div, r = document.createElement("div");
r.style.width = n.style.width, r.style.height = n.style.height, r.classList.add("canvasWrapper"), this.annotationLayer && this.annotationLayer.div, n.appendChild(r), this.updateSVGCanvas();
var o = null;
if (this.textLayerFactory) {
var c = document.createElement("div");
c.className = "textLayer", c.style.width = r.style.width, c.style.height = r.style.height, this.annotationLayer && this.annotationLayer.div ? n.insertBefore(c, this.annotationLayer.div) : n.appendChild(c), o = this.textLayerFactory.createTextLayerBuilder(c, this.id - 1, this.viewport, this.enhanceTextSelection)
}
this.textLayer = o;
var u = null;
this.renderingQueue && (u = function (t) {
if (!e.renderingQueue.isHighestPriority(e)) return e.renderingState = s.RenderingStates.PAUSED, void (e.resume = function () {
e.renderingState = s.RenderingStates.RUNNING, t()
});
t()
});
var d = function (r) {
return h === e.paintTask && (e.paintTask = null), "cancelled" === r || r instanceof a.RenderingCancelledException ? (e.error = null, Promise.resolve(void 0)) : (e.renderingState = s.RenderingStates.FINISHED, e.loadingIconDiv && (n.removeChild(e.loadingIconDiv), delete e.loadingIconDiv), e._resetZoomLayer(!0), e.error = r, e.stats = t.stats, e.onAfterDraw && e.onAfterDraw(), e.eventBus.dispatch("pagerendered", {
source: e,
pageNumber: e.id,
cssTransform: !1
}), r ? Promise.reject(r) : Promise.resolve(void 0))
}, h = this.renderer === i.RendererType.SVG ? this.paintOnSvg(r) : this.paintOnCanvas(r);
h.onRenderContinue = u, this.paintTask = h;
var p = h.promise.then(function () {
return d(null).then(function () {
if (o) {
var e = t.streamTextContent({normalizeWhitespace: !0});
o.setTextContentStream(e), o.render()
}
})
}, function (e) {
return d(e)
});
if (this.annotationLayerFactory || Object.keys(t.newStamps).length > 0 || Object.keys(t.tempStamps).length > 0 || t.textToSeals.length > 0 || Object.keys(t.prepareStamps).length > 0 || Object.keys(t.newDocSigns).length > 0) {
var f = !0;
this.annotationLayer || (this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(n, t, this.renderInteractiveForms, this.l10n), f = !1), this.newAnnotRenderingCapability = (0, a.createPromiseCapability)(), this.annotationLayer.render(this.viewport, "display", this);
Promise.all([p, this.newAnnotRenderingCapability.promise]).then(function () {
var n = t.newStamps, r = t.tempStamps, i = t.textToSeals, o = t.prepareStamps, s = t.newDocSigns,
c = e.viewport.scale, u = "matrix(" + c + ", 0, 0, " + c + ", 0, 0)";
for (var d in n) {
var h = n[d];
if (h.children.length < 2) {
f = !1;
var p = h.style.width, m = h.style.height;
h.querySelector("img").style.display = "none";
var v = (0, l.createSealNode)(e.pdfPage, e, h, p, m);
h.appendChild(v), a.CustomStyle.setProp("transform", h, u)
} else a.CustomStyle.setProp("transform", h, u);
!f && null != e.annotationLayer && e.annotationLayer.div && e.annotationLayer.div.appendChild(h)
}
for (var g in r) if (r.hasOwnProperty(g)) {
var y = r[g];
a.CustomStyle.setProp("transform", y, u), f || null == e.annotationLayer || e.annotationLayer.div.appendChild(y)
}
for (var b in i.forEach(function (t) {
var n = t.section;
a.CustomStyle.setProp("transform", n, u), f || null == e.annotationLayer || e.annotationLayer.div.appendChild(n)
}), o) if (o.hasOwnProperty(b)) {
var w = o[b].section;
a.CustomStyle.setProp("transform", w, u), f || null == e.annotationLayer || e.annotationLayer.div.appendChild(w)
}
for (var S in s) if (s.hasOwnProperty(S)) {
var _ = s[S];
a.CustomStyle.setProp("transform", _, u), f || null == e.annotationLayer || e.annotationLayer.div.appendChild(_)
}
var k = document.getElementsByClassName("stamp");
k.length > 0 && a.CustomStyle.setProp("transform", k[0], u)
})
}
return n.setAttribute("data-loaded", !0), this.onBeforeDraw && this.onBeforeDraw(), p
}
}, {
key: "updateSVGCanvas", value: function () {
var e = document.getElementById("svgCanvas"), t = document.getElementById("viewer"),
n = t.querySelector(".page"), r = t.offsetHeight, i = window.KGPdfViewerWebApp.PDFViewerApplication.pdfViewer,
a = i._currentPageNumber - 1, o = i.getPageView(a).viewport, s = o.viewBox, l = o.scale, c = o.width;
e.setAttribute("width", s[2]), e.setAttribute("height", Math.round(r / l)), e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), e.setAttribute("xmlns:se", "http://svg-edit.googlecode.com"), e.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
var u = !!window.KGPdfViewerWebApp.mobile ? n.offsetLeft : -(c - s[2]) / 2;
e.style.transform = "matrix( " + l + ", 0, 0, " + l + ", " + u + ", 0)", e.style.transformOrigin = "0 0"
}
}, {
key: "paintOnCanvas", value: function (e) {
var t = (0, a.createPromiseCapability)(), n = {
promise: t.promise, onRenderContinue: function (e) {
e()
}, cancel: function () {
g.cancel()
}
}, r = this.viewport, o = document.createElement("canvas");
o.id = this.renderingId, o.setAttribute("hidden", "hidden");
var s = !0, l = function () {
s && (o.removeAttribute("hidden"), s = !1)
};
e.appendChild(o), this.canvas = o, o.mozOpaque = !0;
var c = o.getContext("2d", {alpha: !1}), u = (0, i.getOutputScale)(c);
if (this.outputScale = u, a.PDFJS.useOnlyCssZoom) {
var d = r.clone({scale: i.CSS_UNITS});
u.sx *= d.width / r.width, u.sy *= d.height / r.height, u.scaled = !0
}
if (a.PDFJS.maxCanvasPixels > 0) {
var h = r.width * r.height, p = Math.sqrt(a.PDFJS.maxCanvasPixels / h);
u.sx > p || u.sy > p ? (u.sx = p, u.sy = p, u.scaled = !0, this.hasRestrictedScaling = !0) : this.hasRestrictedScaling = !1
}
var f = (0, i.approximateFraction)(u.sx), m = (0, i.approximateFraction)(u.sy);
o.width = (0, i.roundToDivide)(r.width * u.sx, f[0]), o.height = (0, i.roundToDivide)(r.height * u.sy, m[0]), o.style.width = (0, i.roundToDivide)(r.width, f[1]) + "px", o.style.height = (0, i.roundToDivide)(r.height, m[1]) + "px", this.paintedViewportMap.set(o, r);
var v = {
canvasContext: c,
transform: u.scaled ? [u.sx, 0, 0, u.sy, 0, 0] : null,
viewport: this.viewport,
renderInteractiveForms: this.renderInteractiveForms
}, g = this.pdfPage.render(v);
return g.onContinue = function (e) {
l(), n.onRenderContinue ? n.onRenderContinue(e) : e()
}, g.promise.then(function () {
l(), t.resolve(void 0)
}, function (e) {
l(), t.reject(e)
}), n
}
}, {
key: "paintOnSvg", value: function (e) {
var t = this, n = !1, r = function () {
if (n) throw a.PDFJS.pdfjsNext ? new a.RenderingCancelledException("Rendering cancelled, page " + t.id, "svg") : "cancelled"
}, o = this.pdfPage, l = this.viewport.clone({scale: i.CSS_UNITS});
return {
promise: o.getOperatorList().then(function (n) {
return r(), new a.SVGGraphics(o.commonObjs, o.objs).getSVG(n, l).then(function (n) {
r(), t.svg = n, t.paintedViewportMap.set(n, l), n.style.width = e.style.width, n.style.height = e.style.height, t.renderingState = s.RenderingStates.FINISHED, e.appendChild(n)
})
}), onRenderContinue: function (e) {
e()
}, cancel: function () {
n = !0
}
}
}
}, {
key: "setPageLabel", value: function (e) {
this.pageLabel = "string" == typeof e ? e : null, null !== this.pageLabel ? this.div.setAttribute("data-page-label", this.pageLabel) : this.div.removeAttribute("data-page-label")
}
}, {
key: "width", get: function () {
return this.viewport.width
}
}, {
key: "height", get: function () {
return this.viewport.height
}
}]), e
}();
t.PDFPageView = c
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.DefaultTextLayerFactory = t.TextLayerBuilder = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(63), a = n(14);
function o(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var s = function () {
function e(t) {
var n = t.textLayerDiv, r = t.eventBus, a = t.pageIndex, s = t.viewport, l = t.findController,
c = void 0 === l ? null : l, u = t.enhanceTextSelection, d = void 0 !== u && u;
o(this, e), this.textLayerDiv = n, this.eventBus = r || (0, i.getGlobalEventBus)(), this.textContent = null, this.textContentItemsStr = [], this.textContentStream = null, this.renderingDone = !1, this.pageIdx = a, this.pageNumber = this.pageIdx + 1, this.matches = [], this.viewport = s, this.textDivs = [], this.findController = c, this.textLayerRenderTask = null, this.enhanceTextSelection = d, this._bindMouse()
}
return r(e, [{
key: "_finishRendering", value: function () {
if (this.renderingDone = !0, !this.enhanceTextSelection) {
var e = document.createElement("div");
e.className = "endOfContent", this.textLayerDiv.appendChild(e)
}
this.eventBus.dispatch("textlayerrendered", {
source: this,
pageNumber: this.pageNumber,
numTextDivs: this.textDivs.length
})
}
}, {
key: "render", value: function () {
var e = this, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
if ((this.textContent || this.textContentStream) && !this.renderingDone) {
this.cancel(), this.textDivs = [];
var n = document.createDocumentFragment();
this.textLayerRenderTask = (0, a.renderTextLayer)({
textContent: this.textContent,
textContentStream: this.textContentStream,
container: n,
viewport: this.viewport,
textDivs: this.textDivs,
textContentItemsStr: this.textContentItemsStr,
timeout: t,
enhanceTextSelection: this.enhanceTextSelection
}), this.textLayerRenderTask.promise.then(function () {
e.textLayerDiv.appendChild(n), e._finishRendering(), e.updateMatches()
}, function (e) {
})
}
}
}, {
key: "cancel", value: function () {
this.textLayerRenderTask && (this.textLayerRenderTask.cancel(), this.textLayerRenderTask = null)
}
}, {
key: "setTextContentStream", value: function (e) {
this.cancel(), this.textContentStream = e
}
}, {
key: "setTextContent", value: function (e) {
this.cancel(), this.textContent = e
}
}, {
key: "convertMatches", value: function (e, t) {
var n = 0, r = 0, i = this.textContentItemsStr, a = i.length - 1,
o = null === this.findController ? 0 : this.findController.state.query.length, s = [];
if (!e) return s;
for (var l = 0, c = e.length; l < c; l++) {
for (var u = e[l]; n !== a && u >= r + i[n].length;) r += i[n].length, n++;
n === i.length && console.error("Could not find a matching mapping");
var d = {begin: {divIdx: n, offset: u - r}};
for (u += t ? t[l] : o; n !== a && u > r + i[n].length;) r += i[n].length, n++;
d.end = {divIdx: n, offset: u - r}, s.push(d)
}
return s
}
}, {
key: "renderMatches", value: function (e) {
if (0 !== e.length) {
var t = this.textContentItemsStr, n = this.textDivs, r = null, i = this.pageIdx,
a = null !== this.findController && i === this.findController.selected.pageIdx,
o = null === this.findController ? -1 : this.findController.selected.matchIdx,
s = {divIdx: -1, offset: void 0}, l = o, c = l + 1;
if (null !== this.findController && this.findController.state.highlightAll) l = 0, c = e.length; else if (!a) return;
for (var u = l; u < c; u++) {
var d = e[u], h = d.begin, p = d.end, f = a && u === o ? " selected" : "";
if (this.findController && this.findController.updateMatchPosition(i, u, n, h.divIdx), r && h.divIdx === r.divIdx ? y(r.divIdx, r.offset, h.offset) : (null !== r && y(r.divIdx, r.offset, s.offset), g(h)), h.divIdx === p.divIdx) y(h.divIdx, h.offset, p.offset, "highlight" + f); else {
y(h.divIdx, h.offset, s.offset, "highlight begin" + f);
for (var m = h.divIdx + 1, v = p.divIdx; m < v; m++) n[m].className = "highlight middle" + f;
g(p, "highlight end" + f)
}
r = p
}
r && y(r.divIdx, r.offset, s.offset)
}
function g(e, t) {
var r = e.divIdx;
n[r].textContent = "", y(r, 0, e.offset, t)
}
function y(e, r, i, a) {
var o = n[e], s = t[e].substring(r, i), l = document.createTextNode(s);
if (a) {
var c = document.createElement("span");
return c.className = a, c.appendChild(l), void o.appendChild(c)
}
o.appendChild(l)
}
}
}, {
key: "updateMatches", value: function () {
if (this.renderingDone) {
for (var e = this.matches, t = this.textDivs, n = this.textContentItemsStr, r = -1, i = 0, a = e.length; i < a; i++) {
for (var o = e[i], s = Math.max(r, o.begin.divIdx), l = o.end.divIdx; s <= l; s++) {
var c = t[s];
c.textContent = n[s], c.className = ""
}
r = o.end.divIdx + 1
}
if (null !== this.findController && this.findController.active) {
var u = void 0, d = void 0;
null !== this.findController && (u = this.findController.pageMatches[this.pageIdx] || null, d = this.findController.pageMatchesLength && this.findController.pageMatchesLength[this.pageIdx] || null), this.matches = this.convertMatches(u, d), this.renderMatches(this.matches)
}
}
}
}, {
key: "_bindMouse", value: function () {
var e = this, t = this.textLayerDiv, n = null;
t.addEventListener("mousedown", function (r) {
if (e.enhanceTextSelection && e.textLayerRenderTask) return e.textLayerRenderTask.expandTextDivs(!0), void (n && (clearTimeout(n), n = null));
var i = t.querySelector(".endOfContent");
if (i) {
var a = r.target !== t;
if (a = a && "none" !== window.getComputedStyle(i).getPropertyValue("-moz-user-select")) {
var o = t.getBoundingClientRect(), s = Math.max(0, (r.pageY - o.top) / o.height);
i.style.top = (100 * s).toFixed(2) + "%"
}
i.classList.add("active")
}
}), t.addEventListener("mouseup", function () {
if (e.enhanceTextSelection && e.textLayerRenderTask) n = setTimeout(function () {
e.textLayerRenderTask && e.textLayerRenderTask.expandTextDivs(!1), n = null
}, 300); else {
var r = t.querySelector(".endOfContent");
r && (r.style.top = "", r.classList.remove("active"))
}
})
}
}]), e
}(), l = function () {
function e() {
o(this, e)
}
return r(e, [{
key: "createTextLayerBuilder", value: function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
return new s({textLayerDiv: e, pageIndex: t, viewport: n, enhanceTextSelection: r})
}
}]), e
}();
t.TextLayerBuilder = s, t.DefaultTextLayerFactory = l
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.SecondaryToolbar = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(187), a = n(9);
var o = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.toolbar = t.toolbar, this.toggleButton = t.toggleButton, this.toolbarButtonContainer = t.toolbarButtonContainer, this.buttons = [{
element: t.printButton,
eventName: "print",
close: !0
}, {element: t.firstPageButton, eventName: "firstpage", close: !0}, {
element: t.lastPageButton,
eventName: "lastpage",
close: !0
}, {element: t.pageRotateCwButton, eventName: "rotatecw", close: !1}, {
element: t.pageRotateCcwButton,
eventName: "rotateccw",
close: !1
}, {
element: t.cursorSelectToolButton,
eventName: "switchcursortool",
eventDetails: {tool: i.CursorTool.SELECT},
close: !0
}, {
element: t.cursorHandToolButton,
eventName: "switchcursortool",
eventDetails: {tool: i.CursorTool.HAND},
close: !0
}, {
element: t.documentPropertiesButton,
eventName: "documentproperties",
close: !0
}], this.items = {
firstPage: t.firstPageButton,
lastPage: t.lastPageButton,
pageRotateCw: t.pageRotateCwButton,
pageRotateCcw: t.pageRotateCcwButton
}, this.mainContainer = n, this.eventBus = r, this.opened = !1, this.containerHeight = null, this.previousContainerHeight = null, this.reset(), this._bindClickListeners(), this._bindCursorToolsListener(t), this.eventBus.on("resize", this._setMaxHeight.bind(this))
}
return r(e, [{
key: "setPageNumber", value: function (e) {
this.pageNumber = e, this._updateUIState()
}
}, {
key: "setPagesCount", value: function (e) {
this.pagesCount = e, this._updateUIState()
}
}, {
key: "reset", value: function () {
this.pageNumber = 0, this.pagesCount = 0, this._updateUIState()
}
}, {
key: "_updateUIState", value: function () {
this.items.firstPage.disabled = this.pageNumber <= 1, this.items.lastPage.disabled = this.pageNumber >= this.pagesCount, this.items.pageRotateCw.disabled = 0 === this.pagesCount, this.items.pageRotateCcw.disabled = 0 === this.pagesCount
}
}, {
key: "_bindClickListeners", value: function () {
var e = this;
this.toggleButton.addEventListener("click", this.toggle.bind(this));
for (var t = function (t) {
var n = e.buttons[t], r = n.element, i = n.eventName, a = n.close, o = n.eventDetails;
r.addEventListener("click", function (t) {
if (null !== i) {
var n = {source: e};
for (var r in o) n[r] = o[r];
e.eventBus.dispatch(i, n)
}
a && e.close()
})
}, n = 0; n < this.buttons.length; n++) t(n)
}
}, {
key: "_bindCursorToolsListener", value: function (e) {
this.eventBus.on("cursortoolchanged", function (t) {
switch (e.cursorSelectToolButton.classList.remove("toggled"), e.cursorHandToolButton.classList.remove("toggled"), t.tool) {
case i.CursorTool.SELECT:
e.cursorSelectToolButton.classList.add("toggled");
break;
case i.CursorTool.HAND:
e.cursorHandToolButton.classList.add("toggled")
}
})
}
}, {
key: "open", value: function () {
this.opened || (this.opened = !0, this._setMaxHeight(), this.toggleButton.classList.add("toggled"), this.toolbar.classList.remove("hidden"), this.eventBus.dispatch("secondaryToolbarOpen"))
}
}, {
key: "close", value: function () {
this.opened && (this.opened = !1, this.toolbar.classList.add("hidden"), this.toggleButton.classList.remove("toggled"))
}
}, {
key: "toggle", value: function () {
this.opened ? this.close() : this.open()
}
}, {
key: "_setMaxHeight", value: function () {
this.opened && (this.containerHeight = this.mainContainer.clientHeight, this.containerHeight !== this.previousContainerHeight && (this.toolbarButtonContainer.setAttribute("style", "max-height: " + (this.containerHeight - a.SCROLLBAR_PADDING) + "px;"), this.previousContainerHeight = this.containerHeight))
}
}, {
key: "isOpen", get: function () {
return this.opened
}
}]), e
}();
t.SecondaryToolbar = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.Toolbar = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9);
var a = function () {
function e(t, n, r) {
var a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : i.NullL10n;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.toolbar = t.container, this.mainContainer = n, this.eventBus = r, this.l10n = a, this.items = t, this._wasLocalized = !1, this.reset(), this._bindListeners()
}
return r(e, [{
key: "setPageNumber", value: function (e, t) {
this.pageNumber = e, this.pageLabel = t, this._updateUIState(!1)
}
}, {
key: "setPagesCount", value: function (e, t) {
this.pagesCount = e, this.hasPageLabels = t, this._updateUIState(!0)
}
}, {
key: "setPageScale", value: function (e, t) {
this.pageScaleValue = e, this.pageScale = t, this._updateUIState(!1)
}
}, {
key: "reset", value: function () {
this.pageNumber = 0, this.pageLabel = null, this.hasPageLabels = !1, this.pagesCount = 0, this.pageScaleValue = i.DEFAULT_SCALE_VALUE, this.pageScale = i.DEFAULT_SCALE, this._updateUIState(!0)
}
}, {
key: "_bindListeners", value: function () {
var e = this, t = this.eventBus, n = this.items, r = this;
n.previous.addEventListener("click", function () {
t.dispatch("previouspage")
}), n.next.addEventListener("click", function () {
t.dispatch("nextpage")
}), n.zoomIn.addEventListener("click", function () {
t.dispatch("zoomin")
}), n.zoomOut.addEventListener("click", function () {
t.dispatch("zoomout")
}), n.pageNumber.addEventListener("click", function () {
this.select()
}), n.pageNumber.addEventListener("change", function () {
t.dispatch("pagenumberchanged", {source: r, value: this.value})
}), n.scaleSelect.addEventListener("change", function () {
"custom" !== this.value && t.dispatch("scalechanged", {source: r, value: this.value})
}), n.print.addEventListener("click", function () {
t.dispatch("print")
}), n.scaleSelect.oncontextmenu = i.noContextMenuHandler, t.on("localized", function () {
e._localized()
})
}
}, {
key: "_localized", value: function () {
this._wasLocalized = !0, this._adjustScaleWidth(), this._updateUIState(!0)
}
}, {
key: "_updateUIState", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (this._wasLocalized) {
var t = this.pageNumber, n = this.pagesCount, r = this.items,
a = (this.pageScaleValue || this.pageScale).toString(), o = this.pageScale;
e && (this.hasPageLabels ? r.pageNumber.type = "text" : (r.pageNumber.type = "number", this.l10n.get("of_pages", {pagesCount: n}, "of {{pagesCount}}").then(function (e) {
r.numPages.textContent = e
})), r.pageNumber.max = n), this.hasPageLabels ? (r.pageNumber.value = this.pageLabel, this.l10n.get("page_of_pages", {
pageNumber: t,
pagesCount: n
}, "({{pageNumber}} of {{pagesCount}})").then(function (e) {
r.numPages.textContent = e
})) : r.pageNumber.value = t, r.previous.disabled = t <= 1, r.next.disabled = t >= n, r.zoomOut.disabled = o <= i.MIN_SCALE, r.zoomIn.disabled = o >= i.MAX_SCALE;
var s = Math.round(1e4 * o) / 100;
this.l10n.get("page_scale_percent", {scale: s}, "{{scale}}%").then(function (e) {
for (var t = r.scaleSelect.options, n = !1, i = 0, o = t.length; i < o; i++) {
var s = t[i];
s.value === a ? (s.selected = !0, n = !0) : s.selected = !1
}
n || (r.customScaleOption.textContent = e, r.customScaleOption.selected = !0)
})
}
}
}, {
key: "updateLoadingIndicatorState", value: function () {
arguments.length > 0 && void 0 !== arguments[0] && arguments[0]
}
}, {
key: "_adjustScaleWidth", value: function () {
}
}]), e
}();
t.Toolbar = a
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = 20, a = function () {
function e(t) {
var n = this, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : i;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.fingerprint = t, this.cacheSize = r, this._initializedPromise = this._readFromStorage().then(function (e) {
var t = JSON.parse(e || "{}");
"files" in t || (t.files = []), t.files.length >= n.cacheSize && t.files.shift();
for (var r = void 0, i = 0, a = t.files.length; i < a; i++) {
if (t.files[i].fingerprint === n.fingerprint) {
r = i;
break
}
}
"number" != typeof r && (r = t.files.push({fingerprint: n.fingerprint}) - 1), n.file = t.files[r], n.database = t
})
}
return r(e, [{
key: "_writeToStorage", value: function () {
var e = this;
return new Promise(function (t) {
var n = JSON.stringify(e.database);
localStorage.setItem("pdfjs.history", n), t()
})
}
}, {
key: "_readFromStorage", value: function () {
return new Promise(function (e) {
e(localStorage.getItem("pdfjs.history"))
})
}
}, {
key: "set", value: function (e, t) {
var n = this;
return this._initializedPromise.then(function () {
return n.file[e] = t, n._writeToStorage()
})
}
}, {
key: "setMultiple", value: function (e) {
var t = this;
return this._initializedPromise.then(function () {
for (var n in e) t.file[n] = e[n];
return t._writeToStorage()
})
}
}, {
key: "get", value: function (e, t) {
var n = this;
return this._initializedPromise.then(function () {
var r = n.file[e];
return void 0 !== r ? r : t
})
}
}, {
key: "getMultiple", value: function (e) {
var t = this;
return this._initializedPromise.then(function () {
var n = Object.create(null);
for (var r in e) {
var i = t.file[r];
n[r] = void 0 !== i ? i : e[r]
}
return n
})
}
}]), e
}();
t.ViewHistory = a
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_FJRS = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(123), a = n(21), o = u(n(440)), s = n(2), l = u(n(17)), c = u(n(34));
function u(e) {
return e && e.__esModule ? e : {default: e}
}
var d = function () {
function e(t, n, r, i) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.options = n, this.config = r, this.iWebAssist = null, this.data = null, this.delKeySN = null, this.tipPrompt = window.KGPdfViewerWebApp.getTipPrompt(), this.selectSealPrompt = window.KGPdfViewerWebApp.getSelectSealPrompt(), this.handleScanClick = this.handleScanClick.bind(this), this.overlayManager = i, this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this;
this.isServer = window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isServer, this.FJRS_API = window.KGPdfViewerWebApp.fjrs.FJRS_API, this.RS_WS = window.KGPdfViewerWebApp.fjrs.RS_WS, this.scanDlalogTitle = null, this.qrcodeTimer = null, this.pollingTimer = null, this.signResultPollingTimer = null, this.token = "", this.operateType = "add", this.openQrCodeOverlay = this.openQrCodeOverlay.bind(this), this.closeQrCodeOverlay = this.closeQrCodeOverlay.bind(this), this.clickQrcodeImgForeground = this.clickQrcodeImgForeground.bind(this), this.qrCodeOverlayName = this.options.qrCodeOverlayName, this.qrCodeContainer = this.options.qrCodeContainer, this.overlayManager && this.overlayManager._overlays && !this.overlayManager._overlays[this.qrCodeOverlayName] && this.overlayManager.register(this.qrCodeOverlayName, this.qrCodeContainer, this.closeQrCodeOverlay), this.createDom(), this.ws = new this.RS_WS(this.socketResult), this.ws.initialization(), this.alertPrompt = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, this.tipPrompt = window.KGPdfViewerWebApp.getTipPrompt();
var t = window.KGPdfViewerWebApp.btnPositionConfig, n = (t.toolbar, t.sidebar);
if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isScanStamp) {
window.KGPdfViewerWebApp.btnPositionConfig = {toolbar: [], sidebar: n};
var r = document.getElementById("kgScanFjrs");
r.setAttribute("data-l10n-id", "fjrsCompanySeal"), r.querySelector("span").setAttribute("data-l10n-id", "fjrsCompanySeal_label");
var i = document.getElementById("secondaryKgScanFjrs");
i.setAttribute("data-l10n-id", "fjrsCompanySeal"), i.querySelector("span").setAttribute("data-l10n-id", "fjrsCompanySeal_label"), this.options.button.removeAttribute("hidden"), this.options.button.addEventListener("click", function () {
return e.app.pdfStamp.stamp(!0)
}), this.options.secondaryButton.removeAttribute("hidden"), this.options.secondaryButton.addEventListener("click", function () {
return e.app.pdfStamp.stamp(!0)
}), this.app.appConfig.toolbar.stamp.setAttribute("hidden", !0), this.app.appConfig.secondaryToolbar.secondaryStamp.setAttribute("hidden", !0)
} else {
var a = document.getElementById("kgScanFjrs");
a.setAttribute("data-l10n-id", "stamp"), a.querySelector("span").setAttribute("data-l10n-id", "stamp_label");
var o = document.getElementById("secondaryKgScanFjrs");
o.setAttribute("data-l10n-id", "stamp"), o.querySelector("span").setAttribute("data-l10n-id", "stamp_label");
var s = document.getElementById("secondaryStamp");
s.removeAttribute("hidden"), s.addEventListener("click", function () {
e.app.pdfStamp.stamp(!0)
})
}
document.getElementById("secondaryKG_PersonSign").style.display = "none", this.closeQrCodeBtn.addEventListener("click", this.closeQrCodeOverlay), this.qrCodeImgForeground.addEventListener("click", this.clickQrcodeImgForeground), this.isServer && (this.exitSessionContainer = document.getElementById("kg_exitSessionContainer"), this.exitSession = document.getElementById("kg_exitSession"), this.exitSessionContainer && this.exitSession && (this.exitSessionContainer.style.textAlign = "center", this.exitSessionContainer.style.display = "block", this.exitSession.addEventListener("click", this.logoutToken.bind(this))))
}
}, {
key: "createDom", value: function () {
if (document.getElementById("FJRS_qrcode_box")) for (var e = this.qrCodeContainer.childNodes, t = e.length - 1; t >= 0; t--) this.qrCodeContainer.removeChild(e[t]);
var n = document.createElement("div");
n.classList.add("kg_dialog_header"), n.classList.add("kg_extent_width"), this.qrCodeContainer.appendChild(n);
var r = this.scanDlalogTitle = document.createElement("div");
r.classList.add("kg_dialog_title"), n.appendChild(r), this.closeQrCodeBtn = document.createElement("button"), this.closeQrCodeBtn.classList.add("kg_dialog_close"), this.closeQrCodeBtn.innerHTML = "×", n.appendChild(this.closeQrCodeBtn);
var i = document.createElement("div");
i.classList.add("dialog"), i.classList.add("kg_extent_width"), this.qrCodeContainer.appendChild(i), this.tips = document.createElement("div"), this.tips.innerText = "请使用手机APP扫码盖章过程请勿关闭APP或息屏", this.tips.classList.add("tips"), i.appendChild(this.tips), this.qrCodeImgForeground = document.createElement("div"), this.qrCodeImgForeground.classList.add("qrCodeImgForeground"), this.qrCodeImgForeground.innerHTML = "二维码已失效,点击刷新", i.appendChild(this.qrCodeImgForeground), this.qrCodeImgElBox = document.createElement("div"), this.qrCodeImgElBox.setAttribute("id", "FJRS_qrcode_box"), i.appendChild(this.qrCodeImgElBox), this.app.l10n.translate(this.qrCodeContainer)
}
}, {
key: "socketResult", value: function (e) {
if ("registerMqttService" === e.data) ; else JSON.parse(e.data)
}
}, {
key: "logoutToken", value: function () {
var e = this, t = (0, s.getSessionItem)("token_info", !0);
t && (t = JSON.parse(t), this.FJRS_API.RS_CloudLogoutAuth(t.token).then(function (t) {
t.result ? ((0, s.deleteSessionItem)("token_info"), window.KGPdfViewerWebApp.getSelectSealPrompt().cancelButton.click()) : e.alertPrompt.open("注销授权失败")
}))
}
}, {
key: "needToScanQRcode", value: function () {
this.tipPrompt.open("加载中..."), this.getQrcode()
}
}, {
key: "handleScanClick", value: function (e, t) {
var n = this;
if (this.isServer) {
this.operateType = "add";
var r = (0, s.getSessionItem)("token_info", !0);
this.getSealsFromServer = t, this.scanClickResolve = e, r && (r = JSON.parse(r)).token && (new Date).getTime() - r.time < 864e5 ? (this.token = r.token, this.cloudGetSealList()) : this.needToScanQRcode("add")
} else null == this.data ? (this.tipPrompt.open("正在获取印章数据..."), this.iWebAssist = new i.iWebAssist, this.iWebAssist.promise.then(function () {
return n.iWebAssist.setParamByName("FJRSISPHONE", "1")
}).then(function () {
return n.iWebAssist.setParamByName("APPCODE", window.KGPdfViewerWebApp.appCode)
}).then(function () {
return n.iWebAssist.getKeyInfo()
}).then(function (t) {
if (t.result) {
n.token = t.fjrs_token;
var r = {
action: "handleCilentSeal",
keySN: t.keysn,
unitName: t.orgname,
stampType: window.KGPdfViewerWebApp.stampType,
seals: t.seals
};
return a.myaxios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), r).then(function (t) {
return n.config.isScanStamp && t.data.seals.forEach(function (e) {
return e.bSignByCalibrary = "1"
}), e(t.data)
})
}
return Promise.reject(t.errmsg)
}).catch(function (e) {
n.app.KGAlertPrompt.open(e || "获取印章数据失败")
}).finally(function () {
n.tipPrompt.close()
})) : e(this.data)
}
}, {
key: "getQrcode", value: function () {
var e = this;
this.qrCodeImgForeground.style.display = "none";
var t = this.FJRS_API.RS_GetTransid(1e3).data.transid, n = "add" === this.operateType ? 0 : 1;
return this.FJRS_API.RS_CloudSealAuth(t, n, "delete" === this.operateType ? this.delKeySN : "").then(function (n) {
if (n.isError) e.alertPrompt.open(n.msg); else {
"add" === e.operateType ? (e.setDialogTitle("stamp"), e.tips.innerText = "请使用手机APP扫码盖章过程请勿关闭APP或息屏") : "delete" === e.operateType && (e.setDialogTitle("delete"), e.tips.innerText = "请使用手机APP扫码撤章过程请勿关闭APP或息屏"), e.qrCodeImgElBox.childNodes.length && (e.qrCodeImgElBox.innerHTML = "");
var r = new o.default(e.qrCodeImgElBox, {width: 300, height: 300}),
i = '{"action":"' + n.data.action + '","authIdent":"' + n.data.authIdent + '"}';
r.makeCode(i), e.qrCodeImgElBox.setAttribute("title", ""), e.openQrCodeOverlay(), e.getScanResult(t), e.qrcodeTimer = setTimeout(function () {
e.qrCodeImgForeground.style.display = "block", clearInterval(e.pollingTimer)
}, 24e4)
}
}).finally(function () {
e.tipPrompt.close()
})
}
}, {
key: "clickQrcodeImgForeground", value: function () {
this.getQrcode()
}
}, {
key: "getScanResult", value: function (e) {
var t = this;
this.pollingTimer = setInterval(function () {
var n = "add" === t.operateType ? 0 : 1, r = t.FJRS_API.RS_CloudGetAuth(e, n);
if ("0" === r.data.authResult) ; else if ("1" === r.data.authResult) if (clearInterval(t.pollingTimer), t.closeQrCodeOverlay(), "add" === t.operateType) {
t.token = r.data.token;
var i = {token: t.token, time: (new Date).getTime()};
(0, s.setSessionItem)("token_info", JSON.stringify(i), !0), t.cloudGetSealList()
} else "delete" === t.operateType && r.data.keySn === t.delKeySN && t.delCallback && t.delCallback(); else "2" === r.data.authResult ? (t.qrCodeImgForeground.style.display = "block", clearInterval(t.pollingTimer)) : (t.alertPrompt.open(r.data.authMsg), clearInterval(t.pollingTimer))
}, 3e3)
}
}, {
key: "cloudGetSealList", value: function () {
var e = this;
this.FJRS_API.RS_CloudGetSealList(this.token).then(function (t) {
if (!t.isError && t.data) {
e.sealListInfo = t.data;
var n = [];
e.sealListInfo.forEach(function (e) {
n.push(e.signSn)
}), window.KGPdfViewerWebApp.userId = e.sealListInfo[0].keySn, window.KGPdfViewerWebApp.filterSealNames = n, e.getSealsFromServer(e.scanClickResolve)
} else e.alertPrompt.open(t.msg)
})
}
}, {
key: "p7Sign", value: function (e) {
var t = this, n = this.FJRS_API.RS_GetTransid(1e3).data.transid;
this.FJRS_API.RS_CloudSignByP7(e[0].needSigMessage, this.sealListInfo[0].keySn, n, this.token).then(function (r) {
r.isError ? t.alertPrompt.open(r.msg) : t.getSignResult(n, e)
})
}
}, {
key: "getSignResult", value: function (e, t) {
var n = this;
this.signResultPollingTimer = setInterval(function () {
n.FJRS_API.RS_CloudGetSignResult(e).then(function (e) {
if ("0" === e.data.signResult) ; else if ("1" === e.data.signResult) {
var r = [];
t.forEach(function (t) {
r.push({
cert: e.data.certBase64,
sigKeepData: t.sigKeepData,
certSignMsg: l.default.stringify(c.default.parse(e.data.signdMsg))
})
}), clearInterval(n.signResultPollingTimer), window.KGPdfViewerWebApp.reWriteSigData(r, r[0].cert).then(function () {
window.KGPdfViewerWebApp.stampSuccess && window.KGPdfViewerWebApp.stampSuccess()
})
} else n.alertPrompt.open(e.data.authMsg), clearInterval(n.signResultPollingTimer)
})
}, 1500)
}
}, {
key: "verifySignByP7", value: function (e, t, n) {
return this.FJRS_API.RS_VerifySignByP7WithServer(e, t, n)
}
}, {
key: "deleteScanStamp", value: function (e) {
"1" === this.bSignByCalibrary && (this.operateType = "delete", this.delCallback = e, this.delKeySN = window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN, this.needToScanQRcode())
}
}, {
key: "openQrCodeOverlay", value: function () {
this.overlayManager._active.indexOf(this.qrCodeOverlayName) > -1 || this.overlayManager.open(this.qrCodeOverlayName).then(function () {
})
}
}, {
key: "closeQrCodeOverlay", value: function () {
return this.overlayManager._active.indexOf(this.qrCodeOverlayName) > -1 ? (this.pollingTimer && clearInterval(this.pollingTimer), this.signResultPollingTimer && clearInterval(this.signResultPollingTimer), this.qrcodeTimer && clearTimeout(this.qrcodeTimer), this.overlayManager.close(this.qrCodeOverlayName)) : Promise.resolve()
}
}, {
key: "setDialogTitle", value: function (e) {
"stamp" == e ? this.scanDlalogTitle.setAttribute("data-l10n-id", "qrCode_title") : this.scanDlalogTitle.setAttribute("data-l10n-id", "delSeal_title"), this.app.l10n.translate(this.scanDlalogTitle)
}
}]), e
}();
t.KG_FJRS = d
}, function (e, t, n) {
"use strict";
var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
o = function () {
var e;
function t(e) {
this.mode = r.MODE_8BIT_BYTE, this.data = e, this.parsedData = [];
for (var t = 0, n = this.data.length; t < n; t++) {
var i = [], a = this.data.charCodeAt(t);
a > 65536 ? (i[0] = 240 | (1835008 & a) >>> 18, i[1] = 128 | (258048 & a) >>> 12, i[2] = 128 | (4032 & a) >>> 6, i[3] = 128 | 63 & a) : a > 2048 ? (i[0] = 224 | (61440 & a) >>> 12, i[1] = 128 | (4032 & a) >>> 6, i[2] = 128 | 63 & a) : a > 128 ? (i[0] = 192 | (1984 & a) >>> 6, i[1] = 128 | 63 & a) : i[0] = a, this.parsedData.push(i)
}
this.parsedData = Array.prototype.concat.apply([], this.parsedData), this.parsedData.length != this.data.length && (this.parsedData.unshift(191), this.parsedData.unshift(187), this.parsedData.unshift(239))
}
function n(e, t) {
this.typeNumber = e, this.errorCorrectLevel = t, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = []
}
t.prototype = {
getLength: function (e) {
return this.parsedData.length
}, write: function (e) {
for (var t = 0, n = this.parsedData.length; t < n; t++) e.put(this.parsedData[t], 8)
}
}, n.prototype = {
addData: function (e) {
var n = new t(e);
this.dataList.push(n), this.dataCache = null
}, isDark: function (e, t) {
if (e < 0 || this.moduleCount <= e || t < 0 || this.moduleCount <= t) throw new Error(e + "," + t);
return this.modules[e][t]
}, getModuleCount: function () {
return this.moduleCount
}, make: function () {
this.makeImpl(!1, this.getBestMaskPattern())
}, makeImpl: function (e, t) {
this.moduleCount = 4 * this.typeNumber + 17, this.modules = new Array(this.moduleCount);
for (var r = 0; r < this.moduleCount; r++) {
this.modules[r] = new Array(this.moduleCount);
for (var i = 0; i < this.moduleCount; i++) this.modules[r][i] = null
}
this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(e, t), this.typeNumber >= 7 && this.setupTypeNumber(e), null == this.dataCache && (this.dataCache = n.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, t)
}, setupPositionProbePattern: function (e, t) {
for (var n = -1; n <= 7; n++) if (!(e + n <= -1 || this.moduleCount <= e + n)) for (var r = -1; r <= 7; r++) t + r <= -1 || this.moduleCount <= t + r || (this.modules[e + n][t + r] = 0 <= n && n <= 6 && (0 == r || 6 == r) || 0 <= r && r <= 6 && (0 == n || 6 == n) || 2 <= n && n <= 4 && 2 <= r && r <= 4)
}, getBestMaskPattern: function () {
for (var e = 0, t = 0, n = 0; n < 8; n++) {
this.makeImpl(!0, n);
var r = p.getLostPoint(this);
(0 == n || e > r) && (e = r, t = n)
}
return t
}, createMovieClip: function (e, t, n) {
console.log(12312412)
var r = e.createEmptyMovieClip(t, n);
this.make();
for (var i = 0; i < this.modules.length; i++) for (var a = 1 * i, o = 0; o < this.modules[i].length; o++) {
var s = 1 * o;
this.modules[i][o] && (r.beginFill(0, 100), r.moveTo(s, a), r.lineTo(s + 1, a), r.lineTo(s + 1, a + 1), r.lineTo(s, a + 1), r.endFill())
}
return r
}, setupTimingPattern: function () {
for (var e = 8; e < this.moduleCount - 8; e++) null == this.modules[e][6] && (this.modules[e][6] = e % 2 == 0);
for (var t = 8; t < this.moduleCount - 8; t++) null == this.modules[6][t] && (this.modules[6][t] = t % 2 == 0)
}, setupPositionAdjustPattern: function () {
for (var e = p.getPatternPosition(this.typeNumber), t = 0; t < e.length; t++) for (var n = 0; n < e.length; n++) {
var r = e[t], i = e[n];
if (null == this.modules[r][i]) for (var a = -2; a <= 2; a++) for (var o = -2; o <= 2; o++) this.modules[r + a][i + o] = -2 == a || 2 == a || -2 == o || 2 == o || 0 == a && 0 == o
}
}, setupTypeNumber: function (e) {
for (var t = p.getBCHTypeNumber(this.typeNumber), n = 0; n < 18; n++) {
var r = !e && 1 == (t >> n & 1);
this.modules[Math.floor(n / 3)][n % 3 + this.moduleCount - 8 - 3] = r
}
for (n = 0; n < 18; n++) {
r = !e && 1 == (t >> n & 1);
this.modules[n % 3 + this.moduleCount - 8 - 3][Math.floor(n / 3)] = r
}
}, setupTypeInfo: function (e, t) {
for (var n = this.errorCorrectLevel << 3 | t, r = p.getBCHTypeInfo(n), i = 0; i < 15; i++) {
var a = !e && 1 == (r >> i & 1);
i < 6 ? this.modules[i][8] = a : i < 8 ? this.modules[i + 1][8] = a : this.modules[this.moduleCount - 15 + i][8] = a
}
for (i = 0; i < 15; i++) {
a = !e && 1 == (r >> i & 1);
i < 8 ? this.modules[8][this.moduleCount - i - 1] = a : i < 9 ? this.modules[8][15 - i - 1 + 1] = a : this.modules[8][15 - i - 1] = a
}
this.modules[this.moduleCount - 8][8] = !e
}, mapData: function (e, t) {
for (var n = -1, r = this.moduleCount - 1, i = 7, a = 0, o = this.moduleCount - 1; o > 0; o -= 2) for (6 == o && o--; ;) {
for (var s = 0; s < 2; s++) if (null == this.modules[r][o - s]) {
var l = !1;
a < e.length && (l = 1 == (e[a] >>> i & 1)), p.getMask(t, r, o - s) && (l = !l), this.modules[r][o - s] = l, -1 == --i && (a++, i = 7)
}
if ((r += n) < 0 || this.moduleCount <= r) {
r -= n, n = -n;
break
}
}
}
}, n.PAD0 = 236, n.PAD1 = 17, n.createData = function (e, t, r) {
for (var i = g.getRSBlocks(e, t), a = new y, o = 0; o < r.length; o++) {
var s = r[o];
a.put(s.mode, 4), a.put(s.getLength(), p.getLengthInBits(s.mode, e)), s.write(a)
}
var l = 0;
for (o = 0; o < i.length; o++) l += i[o].dataCount;
if (a.getLengthInBits() > 8 * l) throw new Error("code length overflow. (" + a.getLengthInBits() + ">" + 8 * l + ")");
for (a.getLengthInBits() + 4 <= 8 * l && a.put(0, 4); a.getLengthInBits() % 8 != 0;) a.putBit(!1);
for (; !(a.getLengthInBits() >= 8 * l || (a.put(n.PAD0, 8), a.getLengthInBits() >= 8 * l));) a.put(n.PAD1, 8);
return n.createBytes(a, i)
}, n.createBytes = function (e, t) {
for (var n = 0, r = 0, i = 0, a = new Array(t.length), o = new Array(t.length), s = 0; s < t.length; s++) {
var l = t[s].dataCount, c = t[s].totalCount - l;
r = Math.max(r, l), i = Math.max(i, c), a[s] = new Array(l);
for (var u = 0; u < a[s].length; u++) a[s][u] = 255 & e.buffer[u + n];
n += l;
var d = p.getErrorCorrectPolynomial(c), h = new v(a[s], d.getLength() - 1).mod(d);
o[s] = new Array(d.getLength() - 1);
for (u = 0; u < o[s].length; u++) {
var f = u + h.getLength() - o[s].length;
o[s][u] = f >= 0 ? h.get(f) : 0
}
}
var m = 0;
for (u = 0; u < t.length; u++) m += t[u].totalCount;
var g = new Array(m), y = 0;
for (u = 0; u < r; u++) for (s = 0; s < t.length; s++) u < a[s].length && (g[y++] = a[s][u]);
for (u = 0; u < i; u++) for (s = 0; s < t.length; s++) u < o[s].length && (g[y++] = o[s][u]);
return g
};
for (var r = {MODE_NUMBER: 1, MODE_ALPHA_NUM: 2, MODE_8BIT_BYTE: 4, MODE_KANJI: 8}, i = {
L: 1,
M: 0,
Q: 3,
H: 2
}, a = 0, o = 1, s = 2, l = 3, c = 4, u = 5, d = 6, h = 7, p = {
PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]],
G15: 1335,
G18: 7973,
G15_MASK: 21522,
getBCHTypeInfo: function (e) {
for (var t = e << 10; p.getBCHDigit(t) - p.getBCHDigit(p.G15) >= 0;) t ^= p.G15 << p.getBCHDigit(t) - p.getBCHDigit(p.G15);
return (e << 10 | t) ^ p.G15_MASK
},
getBCHTypeNumber: function (e) {
for (var t = e << 12; p.getBCHDigit(t) - p.getBCHDigit(p.G18) >= 0;) t ^= p.G18 << p.getBCHDigit(t) - p.getBCHDigit(p.G18);
return e << 12 | t
},
getBCHDigit: function (e) {
for (var t = 0; 0 != e;) t++, e >>>= 1;
return t
},
getPatternPosition: function (e) {
return p.PATTERN_POSITION_TABLE[e - 1]
},
getMask: function (e, t, n) {
switch (e) {
case a:
return (t + n) % 2 == 0;
case o:
return t % 2 == 0;
case s:
return n % 3 == 0;
case l:
return (t + n) % 3 == 0;
case c:
return (Math.floor(t / 2) + Math.floor(n / 3)) % 2 == 0;
case u:
return t * n % 2 + t * n % 3 == 0;
case d:
return (t * n % 2 + t * n % 3) % 2 == 0;
case h:
return (t * n % 3 + (t + n) % 2) % 2 == 0;
default:
throw new Error("bad maskPattern:" + e)
}
},
getErrorCorrectPolynomial: function (e) {
for (var t = new v([1], 0), n = 0; n < e; n++) t = t.multiply(new v([1, f.gexp(n)], 0));
return t
},
getLengthInBits: function (e, t) {
if (1 <= t && t < 10) switch (e) {
case r.MODE_NUMBER:
return 10;
case r.MODE_ALPHA_NUM:
return 9;
case r.MODE_8BIT_BYTE:
case r.MODE_KANJI:
return 8;
default:
throw new Error("mode:" + e)
} else if (t < 27) switch (e) {
case r.MODE_NUMBER:
return 12;
case r.MODE_ALPHA_NUM:
return 11;
case r.MODE_8BIT_BYTE:
return 16;
case r.MODE_KANJI:
return 10;
default:
throw new Error("mode:" + e)
} else {
if (!(t < 41)) throw new Error("type:" + t);
switch (e) {
case r.MODE_NUMBER:
return 14;
case r.MODE_ALPHA_NUM:
return 13;
case r.MODE_8BIT_BYTE:
return 16;
case r.MODE_KANJI:
return 12;
default:
throw new Error("mode:" + e)
}
}
},
getLostPoint: function (e) {
for (var t = e.getModuleCount(), n = 0, r = 0; r < t; r++) for (var i = 0; i < t; i++) {
for (var a = 0, o = e.isDark(r, i), s = -1; s <= 1; s++) if (!(r + s < 0 || t <= r + s)) for (var l = -1; l <= 1; l++) i + l < 0 || t <= i + l || 0 == s && 0 == l || o == e.isDark(r + s, i + l) && a++;
a > 5 && (n += 3 + a - 5)
}
for (r = 0; r < t - 1; r++) for (i = 0; i < t - 1; i++) {
var c = 0;
e.isDark(r, i) && c++, e.isDark(r + 1, i) && c++, e.isDark(r, i + 1) && c++, e.isDark(r + 1, i + 1) && c++, 0 != c && 4 != c || (n += 3)
}
for (r = 0; r < t; r++) for (i = 0; i < t - 6; i++) e.isDark(r, i) && !e.isDark(r, i + 1) && e.isDark(r, i + 2) && e.isDark(r, i + 3) && e.isDark(r, i + 4) && !e.isDark(r, i + 5) && e.isDark(r, i + 6) && (n += 40);
for (i = 0; i < t; i++) for (r = 0; r < t - 6; r++) e.isDark(r, i) && !e.isDark(r + 1, i) && e.isDark(r + 2, i) && e.isDark(r + 3, i) && e.isDark(r + 4, i) && !e.isDark(r + 5, i) && e.isDark(r + 6, i) && (n += 40);
var u = 0;
for (i = 0; i < t; i++) for (r = 0; r < t; r++) e.isDark(r, i) && u++;
return n += 10 * (Math.abs(100 * u / t / t - 50) / 5)
}
}, f = {
glog: function (e) {
if (e < 1) throw new Error("glog(" + e + ")");
return f.LOG_TABLE[e]
}, gexp: function (e) {
for (; e < 0;) e += 255;
for (; e >= 256;) e -= 255;
return f.EXP_TABLE[e]
}, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256)
}, m = 0; m < 8; m++) f.EXP_TABLE[m] = 1 << m;
for (m = 8; m < 256; m++) f.EXP_TABLE[m] = f.EXP_TABLE[m - 4] ^ f.EXP_TABLE[m - 5] ^ f.EXP_TABLE[m - 6] ^ f.EXP_TABLE[m - 8];
for (m = 0; m < 255; m++) f.LOG_TABLE[f.EXP_TABLE[m]] = m;
function v(e, t) {
if (void 0 == e.length) throw new Error(e.length + "/" + t);
for (var n = 0; n < e.length && 0 == e[n];) n++;
this.num = new Array(e.length - n + t);
for (var r = 0; r < e.length - n; r++) this.num[r] = e[r + n]
}
function g(e, t) {
this.totalCount = e, this.dataCount = t
}
function y() {
this.buffer = [], this.length = 0
}
v.prototype = {
get: function (e) {
return this.num[e]
}, getLength: function () {
return this.num.length
}, multiply: function (e) {
for (var t = new Array(this.getLength() + e.getLength() - 1), n = 0; n < this.getLength(); n++) for (var r = 0; r < e.getLength(); r++) t[n + r] ^= f.gexp(f.glog(this.get(n)) + f.glog(e.get(r)));
return new v(t, 0)
}, mod: function (e) {
if (this.getLength() - e.getLength() < 0) return this;
for (var t = f.glog(this.get(0)) - f.glog(e.get(0)), n = new Array(this.getLength()), r = 0; r < this.getLength(); r++) n[r] = this.get(r);
for (r = 0; r < e.getLength(); r++) n[r] ^= f.gexp(f.glog(e.get(r)) + t);
return new v(n, 0).mod(e)
}
}, g.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]], g.getRSBlocks = function (e, t) {
var n = g.getRsBlockTable(e, t);
if (void 0 == n) throw new Error("bad rs block @ typeNumber:" + e + "/errorCorrectLevel:" + t);
for (var r = n.length / 3, i = [], a = 0; a < r; a++) for (var o = n[3 * a + 0], s = n[3 * a + 1], l = n[3 * a + 2], c = 0; c < o; c++) i.push(new g(s, l));
return i
}, g.getRsBlockTable = function (e, t) {
switch (t) {
case i.L:
return g.RS_BLOCK_TABLE[4 * (e - 1) + 0];
case i.M:
return g.RS_BLOCK_TABLE[4 * (e - 1) + 1];
case i.Q:
return g.RS_BLOCK_TABLE[4 * (e - 1) + 2];
case i.H:
return g.RS_BLOCK_TABLE[4 * (e - 1) + 3];
default:
return
}
}, y.prototype = {
get: function (e) {
var t = Math.floor(e / 8);
return 1 == (this.buffer[t] >>> 7 - e % 8 & 1)
}, put: function (e, t) {
for (var n = 0; n < t; n++) this.putBit(1 == (e >>> t - n - 1 & 1))
}, getLengthInBits: function () {
return this.length
}, putBit: function (e) {
var t = Math.floor(this.length / 8);
this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++
}
};
var b = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];
function w() {
var e = !1, t = navigator.userAgent;
if (/android/i.test(t)) {
e = !0;
var n = t.toString().match(/android ([0-9]\.[0-9])/i);
n && n[1] && (e = parseFloat(n[1]))
}
return e
}
var S = function () {
var e = function (e, t) {
this._el = e, this._htOption = t
};
return e.prototype.draw = function (e) {
var t = this._htOption, n = this._el, r = e.getModuleCount();
Math.floor(t.width / r), Math.floor(t.height / r);
function i(e, t) {
var n = document.createElementNS("http://www.w3.org/2000/svg", e);
for (var r in t) t.hasOwnProperty(r) && n.setAttribute(r, t[r]);
return n
}
this.clear();
var a = i("svg", {
viewBox: "0 0 " + String(r) + " " + String(r),
width: "100%",
height: "100%",
fill: t.colorLight
});
a.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"), n.appendChild(a), a.appendChild(i("rect", {
fill: t.colorLight,
width: "100%",
height: "100%"
})), a.appendChild(i("rect", {fill: t.colorDark, width: "1", height: "1", id: "template"}));
for (var o = 0; o < r; o++) for (var s = 0; s < r; s++) if (e.isDark(o, s)) {
var l = i("use", {x: String(s), y: String(o)});
l.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template"), a.appendChild(l)
}
}, e.prototype.clear = function () {
for (; this._el.hasChildNodes();) this._el.removeChild(this._el.lastChild)
}, e
}(),
_ = "svg" === document.documentElement.tagName.toLowerCase() ? S : "undefined" == typeof CanvasRenderingContext2D ? function () {
var e = function (e, t) {
this._el = e, this._htOption = t
};
return e.prototype.draw = function (e) {
for (var t = this._htOption, n = this._el, r = e.getModuleCount(), i = Math.floor(t.width / r), a = Math.floor(t.height / r), o = ['<table style="border:0;border-collapse:collapse;">'], s = 0; s < r; s++) {
o.push("<tr>");
for (var l = 0; l < r; l++) o.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + i + "px;height:" + a + "px;background-color:" + (e.isDark(s, l) ? t.colorDark : t.colorLight) + ';"></td>');
o.push("</tr>")
}
o.push("</table>"), n.innerHTML = o.join("");
var c = n.childNodes[0], u = (t.width - c.offsetWidth) / 2, d = (t.height - c.offsetHeight) / 2;
u > 0 && d > 0 && (c.style.margin = d + "px " + u + "px")
}, e.prototype.clear = function () {
this._el.innerHTML = ""
}, e
}() : function () {
function e() {
this._elImage.src = this._elCanvas.toDataURL("image/png"), this._elImage.style.display = "block", this._elCanvas.style.display = "none"
}
if (this && this._android && this._android <= 2.1) {
var t = 1 / window.devicePixelRatio, n = CanvasRenderingContext2D.prototype.drawImage;
CanvasRenderingContext2D.prototype.drawImage = function (e, r, i, a, o, s, l, c, u) {
if ("nodeName" in e && /img/i.test(e.nodeName)) for (var d = arguments.length - 1; d >= 1; d--) arguments[d] = arguments[d] * t; else void 0 === c && (arguments[1] *= t, arguments[2] *= t, arguments[3] *= t, arguments[4] *= t);
n.apply(this, arguments)
}
}
var r = function (e, t) {
this._bIsPainted = !1, this._android = w(), this._htOption = t, this._elCanvas = document.createElement("canvas"), this._elCanvas.width = t.width, this._elCanvas.height = t.height, e.appendChild(this._elCanvas), this._el = e, this._oContext = this._elCanvas.getContext("2d"), this._bIsPainted = !1, this._elImage = document.createElement("img"), this._elImage.alt = "Scan me!", this._elImage.style.display = "none", this._el.appendChild(this._elImage), this._bSupportDataURI = null
};
return r.prototype.draw = function (e) {
var t = this._elImage, n = this._oContext, r = this._htOption, i = e.getModuleCount(), a = r.width / i,
o = r.height / i, s = Math.round(a), l = Math.round(o);
t.style.display = "none", this.clear();
for (var c = 0; c < i; c++) for (var u = 0; u < i; u++) {
var d = e.isDark(c, u), h = u * a, p = c * o;
n.strokeStyle = d ? r.colorDark : r.colorLight, n.lineWidth = 1, n.fillStyle = d ? r.colorDark : r.colorLight, n.fillRect(h, p, a, o), n.strokeRect(Math.floor(h) + .5, Math.floor(p) + .5, s, l), n.strokeRect(Math.ceil(h) - .5, Math.ceil(p) - .5, s, l)
}
this._bIsPainted = !0
}, r.prototype.makeImage = function () {
this._bIsPainted && function (e, t) {
var n = this;
if (n._fFail = t, n._fSuccess = e, null === n._bSupportDataURI) {
var r = document.createElement("img"), i = function () {
n._bSupportDataURI = !1, n._fFail && n._fFail.call(n)
};
return r.onabort = i, r.onerror = i, r.onload = function () {
n._bSupportDataURI = !0, n._fSuccess && n._fSuccess.call(n)
}, void (r.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")
}
!0 === n._bSupportDataURI && n._fSuccess ? n._fSuccess.call(n) : !1 === n._bSupportDataURI && n._fFail && n._fFail.call(n)
}.call(this, e)
}, r.prototype.isPainted = function () {
return this._bIsPainted
}, r.prototype.clear = function () {
this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height), this._bIsPainted = !1
}, r.prototype.round = function (e) {
return e ? Math.floor(1e3 * e) / 1e3 : e
}, r
}();
function k(e, t) {
for (var n = 1, r = function (e) {
var t = encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g, "a");
return t.length + (t.length != e ? 3 : 0)
}(e), a = 0, o = b.length; a <= o; a++) {
var s = 0;
switch (t) {
case i.L:
s = b[a][0];
break;
case i.M:
s = b[a][1];
break;
case i.Q:
s = b[a][2];
break;
case i.H:
s = b[a][3]
}
if (r <= s) break;
n++
}
if (n > b.length) throw new Error("Too long data");
return n
}
return (e = function (e, t) {
if (this._htOption = {
width: 256,
height: 256,
typeNumber: 4,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: i.H
}, "string" == typeof t && (t = {text: t}), t) for (var n in t) this._htOption[n] = t[n];
"string" == typeof e && (e = document.getElementById(e)), this._htOption.useSVG && (_ = S), this._android = w(), this._el = e, this._oQRCode = null, this._oDrawing = new _(this._el, this._htOption), this._htOption.text && this.makeCode(this._htOption.text)
}).prototype.makeCode = function (e) {
this._oQRCode = new n(k(e, this._htOption.correctLevel), this._htOption.correctLevel), this._oQRCode.addData(e), this._oQRCode.make(), this._el.title = e, this._oDrawing.draw(this._oQRCode), this.makeImage()
}, e.prototype.makeImage = function () {
"function" == typeof this._oDrawing.makeImage && (!this._android || this._android >= 3) && this._oDrawing.makeImage()
}, e.prototype.clear = function () {
this._oDrawing.clear()
}, e.CorrectLevel = i, e
}, "object" === s(t) ? e.exports = t = o() : (i = [], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_DocSign = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(442), o = n(2), s = n(2), l = n(16), c = d(n(17)), u = d(n(34));
function d(e) {
return e && e.__esModule ? e : {default: e}
}
function h(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function p(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var f = function () {
var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null);
function n() {
}
return n.getProp = function (n, r) {
if (1 === arguments.length && "string" == typeof t[n]) return t[n];
var i, a = (r = r || document.documentElement).style, o = void 0;
if ("string" == typeof a[n]) return t[n] = n;
i = n.charAt(0).toUpperCase() + n.slice(1);
for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof a[o = e[s] + i]) return t[n] = o;
return t[n] = "undefined"
}, n.setProp = function (e, t, n) {
var r = this.getProp(e);
"undefined" !== r && (t.style[r] = n)
}, n
}(), m = "http://www.w3.org/2000/svg", v = "http://www.w3.org/1999/xlink", g = "http://svg-edit.googlecode.com",
y = (t.KG_DocSign = function () {
function e(t, n, r) {
var i = this;
p(this, e), this.init = this.init.bind(this), this.open = this.open.bind(this), this.onClose = this.onClose.bind(this), this.setColor = this.setColor.bind(this), this.createDOM = this.createDOM.bind(this), this.setCurentMode = this.setCurentMode.bind(this), this.setStrokeWidth = this.setStrokeWidth.bind(this), this.app = t, this.container = n.container, this.overlayName = n.overlayName, this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.onClose, !0), this.isMobile = (0, o.isMobile)() || !!window.KGPdfViewerWebApp.mobile, this.isHDScreen = /iphone|eben/.test(navigator.userAgent.toLowerCase()), this.viewerContainer = document.getElementById("viewerContainer"), this.pageViewer = document.getElementById("viewer"), window.KGPdfViewerWebApp.globalAnnotation ? this.defaultConfig = window.KGPdfViewerWebApp.globalAnnotation : this.defaultConfig = {
lineColor: "#000",
lineWidth: 4,
author: "kg-author",
subject: "",
hideList: []
}, this.banList = [document.getElementById("toolbarViewerMiddle"), document.getElementById("toolbarViewerRight")], this.editing = !1, this.editData = null, this.cur_shape = {
fill: "transparent",
fill_opacity: 0,
stroke: this.defaultConfig.lineColor,
stroke_RGB: "0,0,0",
stroke_width: this.defaultConfig.lineWidth,
opacity: 1
}, this.current_mode = "line", this.selectorGrips = {
nw: null,
n: null,
ne: null,
e: null,
se: null,
s: null,
sw: null,
w: null
}, this.data = [], this.idprefix = "kg_svg_", this.svgCanvas = document.getElementById("svgCanvas"), this.svgDoc = this.svgCanvas.ownerDocument, this.current_zoom = 1, this.current_drawing = new y(this.svgCanvas, this.idprefix), this.init(), this.svgList = document.getElementById("kg_svg_list"), this.mouseEventBindDOM = this.mouseEventBindDOM.bind(this), this.mouseEventBindDOM(this.svgCanvas), this.colorHandler.addEventListener("change", this.setColor), this.lineWidthHandler.addEventListener("change", this.setStrokeWidth), this.selectedElement = null, this.toolsElements = this.container.querySelector(".KG_tool_button_left"), this.toolsElements.addEventListener("click", function (e) {
return i.setCurentMode(e.target.getAttribute("data-mode"))
})
}
return i(e, [{
key: "setCurentMode", value: function (e) {
this.current_mode = e, this.updateTools(e)
}
}, {
key: "updateTools", value: function (e) {
var t = [this.lineHandler, this.rectHandler, this.ellipseHandler];
function n(e, t) {
"path" !== e.tagName && "ellipse" !== e.tagName || ("line" == e.getAttribute("data-mode") ? e.setAttribute("fill", t) : e.setAttribute("stroke", t))
}
if ("select" == e) return t.map(function (e) {
(0, a.walkTree)(e, function (e) {
n(e, "#919191")
})
}), !1;
t.map(function (e) {
(0, a.walkTree)(e, function (e) {
n(e, "#919191")
})
});
var r = this[e + "Handler"];
return (0, a.walkTree)(r, function (e) {
n(e, "#1890ff")
}), !0
}
}, {
key: "setColor", value: function () {
var e = this.colorHandler.value;
/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test("#" + e) && (this.colorHandler.jscolor.fromString(e), this.cur_shape.stroke = "#" + e, this.cur_shape.stroke_RGB = this.colorHandler.jscolor.rgb.map(Math.round), this.colorHandler.jscolor.hide())
}
}, {
key: "setStrokeWidth", value: function (e) {
this.cur_shape.stroke_width = e.target.value
}
}, {
key: "createSVGFromJson", value: function (e) {
var t = this.svgCanvas.getElementById(e.attr.id), n = this.current_drawing.getCurrentLayer();
return t && e.element != t.tagName && (n.removeChild(t), t = null), t || (t = this.svgDoc.createElementNS(m, e.element), n && n.appendChild(t)), e.curStyles && (0, a.assignAttributes)(t, {
fill: this.cur_shape.fill,
stroke: this.cur_shape.stroke,
"stroke-width": this.cur_shape.stroke_width,
"data-stroke_RGB": this.cur_shape.stroke_RGB,
style: "pointer-events:inherit"
}, 100), (0, a.assignAttributes)(t, e.attr, 100), (0, a.cleanupElement)(t), t
}
}, {
key: "initSelectGroup", value: function () {
for (var e in this.selectorParentGroup && this.selectorParentGroup.parentNode && this.selectorParentGroup.parentNode.removeChild(this.selectorParentGroup), this.selectorParentGroup = this.createSVGFromJson({
element: "g",
attr: {id: "selectorParentGroup"}
}), this.svgCanvas.appendChild(this.selectorParentGroup), this.selectorGripsGroup = this.createSVGFromJson({
element: "g",
attr: {display: "none"}
}), this.selectorRect = this.createSVGFromJson({
element: "path",
attr: {
id: "selectedBox",
fill: "none",
stroke: "#bfbfbf",
"stroke-width": "2",
"shape-rendering": "crispEdges",
style: "pointer-events:none"
}
}), this.selectorParentGroup.appendChild(this.selectorRect), this.selectorParentGroup.appendChild(this.selectorGripsGroup), this.selectorGrips) {
var t = void 0, n = void 0;
if ("ne" == e) {
var r, i = this.isMobile ? 32 : 16, a = this.createSVGFromJson({
element: "svg",
attr: (r = {
id: "selectorGrip_resize_" + e,
xmlns: m,
"xmlns:se": g,
"xmlns:xlink": v,
viewBox: "0 0 1024 1024",
width: i,
height: i
}, h(r, "viewBox", "0 0 1024 1024"), h(r, "pointer-events", "all"), r)
}), o = this.createSVGFromJson({
element: "g",
attr: {id: "selectorGrip_resize_" + e, "pointer-events": "all", style: "cursor:pointer"}
});
n = "delete", t = a;
var s = this.createSVGFromJson({
element: "path",
attr: {
id: "selectorGrip_resize_" + e,
"data-type": n,
fill: "#707070",
d: "M512 512m-448 0a448 448 0 1 0 896 0 448 448 0 1 0-896 0Z",
"pointer-events": "all",
style: "cursor:pointer"
}
}), l = this.createSVGFromJson({
element: "path",
attr: {
id: "selectorGrip_resize_" + e,
"data-type": n,
fill: "white",
d: "M352.9 671.1c-9.7-9.7-9.7-25.6 0-35.4l282.8-282.8c9.7-9.7 25.6-9.7 35.4 0 9.7 9.7 9.7 25.6 0 35.4L388.3 671.1c-9.8 9.7-25.7 9.7-35.4 0z",
"pointer-events": "all",
style: "cursor:pointer"
}
}), c = this.createSVGFromJson({
element: "path",
attr: {
id: "selectorGrip_resize_" + e,
"data-type": n,
fill: "white",
d: "M352.9 352.9c9.7-9.7 25.6-9.7 35.4 0l282.8 282.8c9.7 9.7 9.7 25.6 0 35.4-9.7 9.7-25.6 9.7-35.4 0L352.9 388.3c-9.7-9.8-9.7-25.7 0-35.4z",
"pointer-events": "all",
style: "cursor:pointer"
}
});
o.appendChild(s), o.appendChild(l), o.appendChild(c), o.setAttribute("data-type", n), a.appendChild(o)
} else {
n = "resize";
var u = this.isMobile ? 24 : 8;
t = this.createSVGFromJson({
element: "rect",
attr: {
id: "selectorGrip_resize_" + e,
width: u,
height: u,
fill: "#4F80FF",
stroke: "rgba(0,0,0,0)",
"stroke-width": 1,
style: "cursor:" + e + "-" + n,
"pointer-events": "all"
}
}), this.isMobile && t.setAttribute("fill-opacity", .5)
}
t.setAttribute("data-dir", e), t.setAttribute("data-type", n), this.selectorGrips[e] = this.selectorGripsGroup.appendChild(t)
}
}
}, {
key: "showGrips", value: function (e) {
var t = e ? "inline" : "none";
this.selectorGripsGroup.setAttribute("display", t), this.selectorRect.setAttribute("display", t)
}
}, {
key: "resizeSelector", value: function () {
if (this.selectedElement) {
var e = 10, t = this.selectorRect, n = this.selectorGrips, r = this.selectedElement,
i = this.cur_shape.stroke_width;
"none" === r.getAttribute("stroke") || isNaN(i) || (e += i / 2);
var o = (0, a.getTransformList)(r), s = (0, a.transformListToTransform)(o).matrix, l = r.getBBox();
l = {x: l.x, y: l.y, width: l.width, height: l.height};
var c = (0, a.transformBox)(l.x, l.y, l.width, l.height, s).aabox, u = c.x - e, d = c.y - e,
h = c.width + 2 * e, p = c.height + 2 * e,
f = "M" + u + "," + d + " L" + (u + h) + "," + d + " " + (u + h) + "," + (d + p) + " " + u + "," + (d + p) + "z";
for (var m in t.setAttribute("d", f), this.isMobile ? (u -= 12, d -= 12) : (u -= 4, d -= 4), this.gripCoords = {
nw: [u, d].map(Math.round),
ne: [u + h, d].map(Math.round),
sw: [u, d + p].map(Math.round),
se: [u + h, d + p].map(Math.round),
n: [u + h / 2, d].map(Math.round),
w: [u, d + p / 2].map(Math.round),
e: [u + h, d + p / 2].map(Math.round),
s: [u + h / 2, d + p].map(Math.round)
}, this.gripCoords) {
var v = void 0, g = void 0, y = this.gripCoords[m];
if ("ne" == m) {
var b = (this.isMobile, 4);
v = y[0] - b, g = y[1] - b
} else v = y[0], g = y[1];
n[m].setAttribute("x", v), n[m].setAttribute("y", g)
}
this.showGrips(!0)
}
}
}, {
key: "updateSelectedElement", value: function (e) {
this.selectedElement = e
}
}, {
key: "deleteSelectedElement", value: function () {
var e = this.selectedElement;
e && (e.parentNode.removeChild(e), this.selectedElement = null, this.showGrips(!1))
}
}, {
key: "init", value: function () {
window.KGPdfViewerWebApp.globalAnnotation && (this.app.appConfig.secondaryToolbar.secondaryKgDocSign.removeAttribute("hidden"), this.app.appConfig.secondaryToolbar.secondaryKgDocSign.addEventListener("click", this.open), this.updateTools(this.curentMode)), this.createDOM(), this.lineHandler = this.container.querySelector("#kg_tool_line"), this.rectHandler = this.container.querySelector("#kg_tool_rect"), this.ellipseHandler = this.container.querySelector("#kg_tool_ellipse"), this.lineWidthHandler = this.container.querySelector("#kg_tool_lineWidth"), this.colorHandler = this.container.querySelector("#kg_tool_color"), this.colorHandler.jscolor = new jscolor(this.colorHandler), this.colorHandler.jscolor.fromString("#000");
var e = this.defaultConfig, t = e.lineWidth, n = e.lineColor;
this.lineWidthHandler.value = t, this.colorHandler.jscolor.fromString(n), this.cur_shape.stroke_RGB = this.colorHandler.jscolor.rgb.map(Math.round), this.initSelectGroup(), this.current_drawing.createLayer()
}
}, {
key: "createDOM", value: function () {
this.container.innerHTML = '<div class="KG_tool_button_left">\n <div class="KG_tool_button" id="kg_tool_line" data-mode="line" title="直线工具">\n <svg viewBox="0 0 27 27" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M 3 1 L 26 24 L 24 26 L 1 3 L 3 1 Z" fill="#919191" data-mode="line"></path>\n </svg>\n </div>\n\n <div class="KG_tool_button" id="kg_tool_rect" data-mode="rect" title="矩形工具">\n <svg viewBox="0 0 27 27" xmlns="http://www.w3.org/2000/svg" width="32" height="24">\n <path d="M 0 6 L 0 24 L 24 24 L 24 6 L 0 6 Z" fill="none" stroke="#919191" stroke-width="3px"\n data-mode="rect"></path>\n </svg>\n </div>\n\n <div class="KG_tool_button" id="kg_tool_ellipse" data-mode="ellipse" title="椭圆工具">\n <svg viewBox="0 0 27 27" xmlns="http://www.w3.org/2000/svg" width="32" height="24">\n <ellipse cx="14" cy="14" rx="13" ry="9" fill="none" stroke="#919191" stroke-width="3px"\n data-mode="ellipse"></ellipse>\n </svg>\n </div>\n </div>\n\n <div class="KG_tool_button_right">\n <div class="KG_DocSign_Item">\n <label class="KG_DocSign_Label">线粗</label>\n <select class="kgInput KG_DocSign_Input" id=\'kg_tool_lineWidth\'>\n <option value="2" label="二号">二号</option>\n <option value="4" label="四号">四号</option>\n <option value="6" label="六号">六号</option>\n </select>\n </div>\n\n <div class="KG_DocSign_Item">\n <label class="KG_DocSign_Label">颜色</label>\n <input class="kgInput KG_DocSign_Input" id=\'kg_tool_color\' autocomplete="off" data-jscolor="{}"\n style="background-image: none; background-color: rgb(0, 0, 0); color: transparent;">\n </div>\n </div>\n '
}
}, {
key: "onOk", value: function () {
for (var e = this, t = {}, n = void 0, r = (0, a.getChildElementNodes)(this.svgList), i = void 0, o = 0; o < r.length; o++) {
var s = r[o], l = s.id, c = s.tagName, u = parseInt(s.getAttribute("data-page")),
d = s.getBoundingClientRect(), h = d.width, p = d.height, f = d.left, v = d.top,
g = document.getElementById("pageContainer" + u).getBoundingClientRect();
v -= g.top, f -= g.left;
var y = s.getAttribute("data-stroke_RGB").split(",").map(Number),
b = parseInt(s.getAttribute("stroke-width")), w = document.createElementNS(m, "svg");
w.setAttribute("xmlns", m), w.appendChild(s);
var S = void 0, _ = w.cloneNode(!0), k = (new Date).getTime() + "-" + o,
x = document.getElementById("pageContainer" + u), P = this.app.pdfViewer.getPageView(u - 1),
C = P.viewport.scale, A = P.annotationLayer;
switch (v = v / C - b / 2, f = f / C - b / 2, c) {
case"line":
case"svg:line":
var T = parseInt(s.getAttribute("x1")), E = parseInt(s.getAttribute("y1")),
D = parseInt(s.getAttribute("x2")), I = parseInt(s.getAttribute("y2")), L = !1;
T > D ? (T = h + b, D = 0) : (T = 0, D = h + b), E == I ? (E = 0, I = 0, L = !0) : E > I ? (E = p + b, I = b / 2) : (E = b / 2, I = p + b), h = Math.round((h + b) / C), p = Math.round((p + b) / C), S = _.firstChild, L && (S.setAttribute("stroke-width", 2 * b), p = b);
var O = L ? 50 : 32;
h += 16, p += O, _.setAttribute("width", h), _.setAttribute("height", p), f -= 8, v -= O / 2, S.setAttribute("x1", Math.round(T / C) + 8), S.setAttribute("y1", Math.round(E / C) + O / 2), S.setAttribute("x2", Math.round(D / C) + 8), S.setAttribute("y2", Math.round(I / C) + O / 2), n = "lineAnnotation", t = {
shape: c = "line",
page: u,
color: y,
width: h,
height: p,
x1: T = T / C + f + 8,
y1: E = E / C + v + O / 2,
x2: D = D / C + f + 8,
y2: I = I / C + v + O / 2,
left: f,
top: v
};
break;
case"rect":
case"svg:rect":
h = Math.round(h / C), p = Math.round(p / C), (S = _.firstChild).setAttribute("x", b / 2), S.setAttribute("y", b / 2), S.setAttribute("height", h), S.setAttribute("height", p), h += b, p += b, _.setAttribute("width", h), _.setAttribute("height", p), n = "squareAnnotation", t = {
shape: c = "rect",
page: u,
color: y,
width: h,
height: p,
left: f,
top: v
};
break;
case"ellipse":
case"svg:ellipse":
S = _.firstChild;
var M = parseInt(s.getAttribute("rx")) + b / 2, N = parseInt(s.getAttribute("ry")) + b / 2;
h = 2 * M + b, p = 2 * N + b, S.setAttribute("cx", h / 2), S.setAttribute("cy", p / 2), S.setAttribute("rx", M), S.setAttribute("ry", N), _.setAttribute("width", h), _.setAttribute("height", p), n = "circleAnnotation", t = {
shape: c = "ellipse",
page: u,
color: y,
width: h,
height: p,
left: f,
top: v
}
}
S.removeAttribute("transform"), !!S.getAttribute("data-resize"), S.removeAttribute("data-resize"), t._imgsrc = this.svgToImgSrc(_), t.authorName = this.defaultConfig.author, t.subject = this.defaultConfig.subject, t.border = b, A.div || (A.div = document.createElement("div"), A.div.className = "annotationLayer", x.appendChild(A.div)), i = this._createSection({
data: t,
svg: _,
id: x.id + "_" + l + "_docSign",
annotId: k,
className: n,
strokeWidth: b,
scale: C
}), A.div.appendChild(i), t.type = "vectorAnnot", t._id = l, this.data.push(t)
}
if (this.editing) {
var R = this.editData, W = R.section, V = R.pageNumber, F = R.pdfPageView;
this.deleteDocSign(W, V, F, !this.data.length).then(function () {
e.addDocSign(), e.setCanvasOpacity(1), e.editing = !1
})
} else this.addDocSign();
this.showGrips(!1)
}
}, {
key: "_createSection", value: function (e) {
var t = e.data, n = e.svg, i = e.annotId, a = e.className, o = e.scale, s = t.width, l = t.height, c = t.left,
u = t.top, d = document.createElement("section");
d.setAttribute("data-annotation-id", i), d.className = a, d.style.width = s + "px", d.style.height = l + "px", d.style.opacity = .5;
var h = r(t.color, 3), p = h[0], m = h[1], v = h[2];
d.setAttribute("data-rgb", "rgb(" + p + "," + m + "," + v + ")"), t.authorName && d.setAttribute("data-author", t.authorName), d.appendChild(n);
var g = document.createElement("img");
return g.src = t._imgsrc, g.style.width = "100%", g.style.height = "100%", g.style.display = "none", d.appendChild(g), d.style.transform = "matrix(" + o + ", 0, 0, " + o + ", 0, 0)", d.style.left = c + "px", d.style.top = u + "px", f.setProp("transform", d, "matrix(" + o + ", 0, 0, " + o + ", 0, 0)"), f.setProp("transformOrigin", d, -1 * c + "px " + -1 * u + "px"), d
}
}, {
key: "deleteDocSign", value: function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
i = parseInt(e.style.left) + parseInt(e.style.width) / 2,
a = parseInt(e.style.top) + parseInt(e.style.height) / 2;
if (r) {
var o = window.KGPdfViewerWebApp.getTipPrompt();
switch (window.KGPdfViewerWebApp.PDFViewerApplication.l10n._lang) {
case"zh-TW":
o.open("正在删除全文簽批...");
break;
case"en-US":
o.open("Delete and Annoting...");
break;
default:
o.open("正在删除全文签批...")
}
}
return window.KGPdfViewerWebApp.deleteDocSign(t, i, a, e, n)
}
}, {
key: "addDocSign", value: function () {
var e = this;
if (!this.data.length) return this.onClose();
this._data = this.data.map(function (e) {
var t = (0, o._deepClone)(e);
return delete t._id, delete t._imgsrc, t
});
var t = window.KGPdfViewerWebApp.getTipPrompt();
switch (window.KGPdfViewerWebApp.PDFViewerApplication.l10n._lang) {
case"zh-TW":
t.open("正在進行全文簽批...");
break;
case"en-US":
t.open("Signing and Annoting...");
break;
default:
t.open("正在进行全文签批...")
}
window.KGPdfViewerWebApp.addDocSign(this._data).then(function (t) {
var n = t.data;
e.data.map(function (t) {
var r = t._imgsrc, i = t.page - 1, a = e.app.pdfViewer.getPageView(i), s = document.getElementById(t._id),
l = (0, o.closest)(s, "section"), c = l.querySelector("img");
n.status ? e.renderSign(a, l, s, i, r, c) : (e.app.KGAlertPrompt.open(n.message), l.parentNode.removeChild(l))
}), e.onClose(), e.data = []
})
}
}, {
key: "renderSign", value: function (e, t, n, r, i, a) {
var o = document.createElement("img"), s = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth),
c = t.offsetTop * s, u = t.offsetLeft * s, d = t.offsetWidth * s, h = t.offsetHeight * s,
p = t.getAttribute("data-annotation-id");
if (void 0 !== e.canvas) {
var f = e.canvas.getContext("2d");
f.globalCompositeOperation = "multiply", "multiply" !== f.globalCompositeOperation && (f.globalAlpha = .85), e.pdfPage.newDocSigns[p] = t, o.onload = function () {
f.drawImage(o, u, c, d, h), n.setAttribute("stroke", "transparent"), t.style.opacity = 1;
var i = window.KGPdfViewerWebApp.PDFViewerApplication.pdfThumbnailViewer.getThumbnail(r);
i.renderingState = l.RenderingStates.INITIAL, i.setImage(e)
}, o.src = i
}
}
}, {
key: "svgToImgSrc", value: function (e) {
var t = "data:image/svg+xml;base64,", n = document.createElement("div");
n.appendChild(e);
var r = n.innerHTML;
return t += c.default.stringify(u.default.parse(unescape(encodeURIComponent(r))))
}
}, {
key: "mouseEventBindDOM", value: function (e) {
var t = this, n = void 0, i = void 0, s = void 0, l = void 0, c = {}, u = null, d = null, h = null, p = null,
f = null, m = null, v = null, g = function (e) {
for (var n = (0, a.getChildElementNodes)(t.pageViewer), r = 0; r < n.length; r++) {
var i = n[r], o = i.getBoundingClientRect(), s = o.top, l = o.bottom;
if (e > s && e < l) return i.getAttribute("data-page-number")
}
return -1
}, y = function (e) {
t.isMobile ? (s = e.touches[0].pageX, l = e.touches[0].pageY) : (s = e.pageX, l = e.pageY), m = t.svgCanvas.querySelector("g").getScreenCTM().inverse();
var r = (0, a.transformPoint)(s, l, m), y = r.x * t.current_zoom, b = r.y * t.current_zoom;
if (-1 != (i = g(l))) {
var w = y / t.current_zoom, S = b / t.current_zoom, _ = function (e) {
if (null == e || null == e.target) return null;
var n = e.target, r = t.current_drawing.getCurrentLayer();
if ([t.svgCanvas, r].indexOf(n) >= 0) return t.svgCanvas;
if ((0, o.closest)(n, "#selectorParentGroup")) return t.selectorParentGroup;
for (; n.parentNode && n.parentNode !== r;) n = n.parentNode;
return n
}(e);
e.preventDefault(), e.stopPropagation(), t.isHDScreen && (w /= t.current_zoom, S /= t.current_zoom);
h = u = w, p = d = S;
if (_ == t.selectorParentGroup && null != t.selectedElement) {
var k = e.target, x = k.getAttribute("data-type");
if ("resize" == x) t.current_mode = "resize", v = k.getAttribute("data-dir"); else if ("delete" == x) return t.deleteSelectedElement();
_ = t.selectedElement
}
_.getAttribute("transform");
var P = (0, a.getTransformList)(_), C = t.cur_shape;
switch (t.current_mode) {
case"select":
if (f = !0, v = "none", _ != t.svgCanvas) {
t.updateSelectedElement(_), t.resizeSelector();
var A = (0, a.getTransformList)(t.selectedElement);
A.numberOfItems ? A.insertItemBefore(t.svgCanvas.createSVGTransform(), 0) : A.appendItem(t.svgCanvas.createSVGTransform())
} else {
if (t.editing && t.isMobile) break;
t.updateSelectedElement(null), t.showGrips(!1)
}
break;
case"resize":
f = !0, u = w, d = S, c = (0, a.getBBox)(t.selectorRect);
var T = {};
for (var E in c) {
var D = c[E];
T[E] = D / t.current_zoom
}
(0, a.hasMatrixTransform)(P) ? (P.insertItemBefore(t.svgCanvas.createSVGTransform(), 0), P.insertItemBefore(t.svgCanvas.createSVGTransform(), 0), P.insertItemBefore(t.svgCanvas.createSVGTransform(), 0)) : (P.appendItem(t.svgCanvas.createSVGTransform()), P.appendItem(t.svgCanvas.createSVGTransform()), P.appendItem(t.svgCanvas.createSVGTransform()));
break;
case"line":
f = !0;
var I = 0 == C.stroke_width ? 1 : C.stroke_width;
n = t.createSVGFromJson({
element: "line",
curStyles: !0,
attr: {
x1: w,
y1: S,
x2: w,
y2: S,
id: t.current_drawing.getNextId(),
stroke: C.stroke,
"stroke-width": I,
opacity: C.opacity / 2,
style: "pointer-events:none",
"data-page": i
}
});
break;
case"rect":
f = !0, u = w, d = S, n = t.createSVGFromJson({
element: "rect",
curStyles: !0,
attr: {
x: w,
y: S,
width: 0,
height: 0,
id: t.current_drawing.getNextId(),
opacity: C.opacity / 2,
"data-page": i,
fill: "transparent"
}
});
break;
case"ellipse":
f = !0, n = t.createSVGFromJson({
element: "ellipse",
curStyles: !0,
attr: {
cx: w,
cy: S,
rx: 0,
ry: 0,
id: t.current_drawing.getNextId(),
opacity: C.opacity / 2,
"data-page": i,
fill: "transparent"
}
})
}
}
}, b = function (e) {
if (f && 1 !== e.button) {
e.preventDefault(), t.isMobile ? (s = e.touches[0].pageX, l = e.touches[0].pageY) : (s = e.pageX, l = e.pageY);
var r = t.selectedElement, i = (0, a.transformPoint)(s, l, m), o = i.x * t.current_zoom,
h = i.y * t.current_zoom, p = o / t.current_zoom, g = h / t.current_zoom;
switch (t.isHDScreen && (p /= t.current_zoom, g /= t.current_zoom), t.current_mode) {
case"select":
if (null !== r) {
var y = p - u, b = g - d;
if (0 != y || 0 != b) {
if (null == r) break;
t.editing && r.setAttribute("data-resize", !0);
var w = t.svgCanvas.createSVGTransform(), S = (0, a.getTransformList)(r);
w.setTranslate(y, b), S.numberOfItems ? S.replaceItem(w, 0) : S.appendItem(w), t.resizeSelector()
}
}
break;
case"resize":
var _ = (0, a.getTransformList)(r), k = (0, a.hasMatrixTransform)(_), x = k ? c : (0, a.getBBox)(r),
P = x.x, C = x.y, A = x.width, T = x.height, E = p - u, D = g - d;
-1 == v.indexOf("n") && -1 == v.indexOf("s") && (D = 0), -1 == v.indexOf("e") && -1 == v.indexOf("w") && (E = 0);
var I = 0, L = 0, O = T ? (T + D) / T : 1, M = A ? (A + E) / A : 1;
v.indexOf("n") >= 0 && (O = T ? (T - D) / T : 1, L = T), v.indexOf("w") >= 0 && (M = A ? (A - E) / A : 1, I = A);
var N = t.svgCanvas.createSVGTransform(), R = t.svgCanvas.createSVGTransform(),
W = t.svgCanvas.createSVGTransform();
if (N.setTranslate(-(P + I), -(C + L)), e.shiftKey && (1 == M ? M = O : O = M), R.setScale(M, O), W.setTranslate(P + I, C + L), k) {
var V = angle ? 1 : 0;
_.replaceItem(N, 2 + V), _.replaceItem(R, 1 + V), _.replaceItem(W, 0 + V)
} else {
var F = _.numberOfItems;
_.replaceItem(W, F - 3), _.replaceItem(R, F - 2), _.replaceItem(N, F - 1)
}
t.editing && r.setAttribute("data-resize", !0), t.resizeSelector();
break;
case"line":
var G = p, B = g;
e.shiftKey && (B = d), n.setAttribute("x2", G), n.setAttribute("y2", B);
break;
case"rect":
var K = e.shiftKey, j = Math.abs(p - u), z = Math.abs(g - d), U = void 0, q = void 0;
K ? (j = z = Math.max(j, z), U = u < p ? u : u - j, q = d < g ? d : d - z) : (U = Math.min(u, p), q = Math.min(d, g)), e.altKey && (U = u - (j *= 2) / 2, q = d - (z *= 2) / 2), (0, a.assignAttributes)(n, {
width: j,
height: z,
x: U,
y: q
}, 1e3);
break;
case"ellipse":
var H = Math.abs(u + (p - u) / 2), Y = Math.abs(d + (g - d) / 2), X = Math.abs(u - H),
J = Math.abs(d - Y);
e.shiftKey && (J = X, Y = g > d ? d + X : d - X), e.altKey && (H = u, Y = d, X = Math.abs(p - H), J = e.shiftKey ? X : Math.abs(g - Y)), n.setAttribute("rx", X), n.setAttribute("ry", J), n.setAttribute("cx", H), n.setAttribute("cy", Y)
}
}
}, w = function (e) {
if (f) {
var n = (0, a.transformPoint)(s, l, m), o = n.x * t.current_zoom, c = n.y * t.current_zoom,
u = o / t.current_zoom, d = c / t.current_zoom, y = t.current_drawing.getId(),
b = document.getElementById(y), w = t.selectedElement, S = !1;
t.isHDScreen && (u /= t.current_zoom, d /= t.current_zoom);
var _ = void 0, k = u, x = d;
f = !1;
var P = t.cur_shape;
switch (t.current_mode) {
case"resize":
var C = w.getBBox();
C = {x: C.x, y: C.y, width: C.width, height: C.height};
var A = (0, a.getTransformList)(w), T = (0, a.transformListToTransform)(A).matrix,
E = (0, a.transformBox)(C.x, C.y, C.width, C.height, T), D = E.aabox, I = E.bl, L = E.br, O = E.tl,
M = E.tr, N = D.width, R = D.height, W = D.x, V = D.y;
switch (w.tagName) {
case"rect":
case"svg:rect":
w.setAttribute("width", N), w.setAttribute("height", R), w.setAttribute("x", W), w.setAttribute("y", V);
break;
case"line":
case"svg:line":
var F = Math.round(w.getAttribute("x1")), G = Math.round(w.getAttribute("y1")),
B = Math.round(w.getAttribute("x2")), K = Math.round(w.getAttribute("y2")), j = void 0,
z = void 0, U = void 0, q = void 0;
F < B ? G > K ? (j = I.x, U = I.y, z = M.x, q = M.y) : (j = O.x, U = O.y, z = L.x, q = L.y) : G < K ? (j = I.x, U = I.y, z = M.x, q = M.y) : (j = O.x, U = O.y, z = L.x, q = Math.abs(L.y)), w.setAttribute("x1", j), w.setAttribute("x2", z), w.setAttribute("y1", U), w.setAttribute("y2", q);
break;
case"ellipse":
case"svg:ellipse":
var H = Math.round(w.getAttribute("rx")), Y = Math.round(w.getAttribute("ry")), X = N / 2,
J = R / 2, Q = Math.round(w.getAttribute("cx")), $ = Math.round(w.getAttribute("cy")),
Z = void 0, ee = void 0;
switch (v) {
case"e":
case"s":
case"se":
Z = X - H, ee = J - Y;
break;
case"sw":
Z = -(X - H), ee = J - Y;
break;
default:
Z = H - X, ee = Y - J
}
var te = Q + Z, ne = $ + ee;
w.setAttribute("cx", te), w.setAttribute("cy", ne), w.setAttribute("rx", X), w.setAttribute("ry", J)
}
w.removeAttribute("transform"), t.current_mode = "select";
case"select":
if (null != t.selectedElement) {
var re = t.selectedElement, ie = /\(([^)]*)\)/;
switch (re.tagName) {
case"g":
break;
default:
P.fill = re.getAttribute("fill"), P.fill_opacity = re.getAttribute("fill-opacity"), P.stroke = re.getAttribute("stroke"), P.stroke_width = re.getAttribute("stroke-width")
}
t.showGrips(!0), h = h, p = p;
var ae = Math.abs(k - h), oe = Math.abs(x - p), se = 0, le = 0, ce = re.getAttribute("transform");
if (ce) {
var ue = ce.match(/translate\(([^)]*)\)/g);
if (ue && ue.length) for (var de = 0; de < ue.length; de++) {
var he = ue[de].match(ie)[1].split(" ").map(parseFloat), pe = r(he, 2);
se += pe[0], le += pe[1]
}
}
switch (re.tagName) {
case"line":
var fe = Math.round(re.getAttribute("x1")) + se, me = Math.round(re.getAttribute("y1")) + le,
ve = Math.round(re.getAttribute("x2")) + se, ge = Math.round(re.getAttribute("y2")) + le;
re.setAttribute("x1", fe), re.setAttribute("y1", me), re.setAttribute("x2", ve), re.setAttribute("y2", ge);
break;
case"rect":
var ye = Math.round(re.getAttribute("x")) + se, be = Math.round(re.getAttribute("y")) + le;
re.setAttribute("x", ye), re.setAttribute("y", be);
break;
case"ellipse":
var we = Math.round(re.getAttribute("cx")) + se, Se = Math.round(re.getAttribute("cy")) + le;
re.setAttribute("cx", we), re.setAttribute("cy", Se)
}
if (re.removeAttribute("transform"), oe > 1 || ae > 1) {
if (null == t.selectedElement) break;
t.resizeSelector()
}
var _e = re.getBoundingClientRect(), ke = _e.top, xe = _e.bottom;
-1 == (i = g(ke)) && (i = g(xe)), re.setAttribute("data-page", i)
}
return;
case"line":
S = (_ = {
x1: b.getAttribute("x1"),
x2: b.getAttribute("x2"),
y1: b.getAttribute("y1"),
y2: b.getAttribute("y2")
}).x1 != _.x2 || _.y1 != _.y2;
break;
case"rect":
S = 0 != (_ = {
width: b.getAttribute("width"),
height: b.getAttribute("height")
}).width || 0 != _.height;
break;
case"ellipse":
S = !(null == (_ = {
rx: b.getAttribute("rx"),
ry: b.getAttribute("ry")
}).rx && null == _.ry || 0 == _.rx && 0 == _.ry)
}
S || (b.parentNode.removeChild(b), b = null, t.showGrips(!1), t.setCurentMode("select")), b && (b.setAttribute("opacity", P.opacity || 1), b.setAttribute("style", "pointer-events:inherit"), (0, a.cleanupElement)(b), t.updateSelectedElement(b), t.resizeSelector(), t.showGrips(!0))
}
};
e.addEventListener("mousedown", y), e.addEventListener("mousemove", b), e.addEventListener("mouseup", w), e.addEventListener("touchstart", y), e.addEventListener("touchmove", b), e.addEventListener("touchend", w)
}
}, {
key: "showSvgCanvas", value: function (e) {
e ? (this.svgCanvas.style["z-index"] = "200", this.svgCanvas.style.display = "block") : (this.svgCanvas.style["z-index"] = "-1", this.svgCanvas.style.display = "none")
}
}, {
key: "updateZoom", value: function () {
var e = this.app.pdfViewer._currentPageNumber, t = this.app.pdfViewer.getPageView(e - 1);
this.current_zoom = t.viewport.scale
}
}, {
key: "editDocSign", value: function (e) {
var t = e.editData, n = e.left, r = e.top;
this.editing = !0, this.current_mode = "select", this.editData = t, this.selectedElement = t.element.cloneNode(!0);
var i = t.shape, a = t.strokeWidth, o = t.section.getAttribute("data-rgb"), s = o.match(/\(([^)]*)\)/)[1];
switch (this.selectedElement.setAttribute("data-stroke_RGB", s), this.selectedElement.setAttribute("data-page", t.pageNumber), this.selectedElement.getAttribute("id") || this.selectedElement.setAttribute("id", (new Date).getTime() + "-editAnnot"), i) {
case"line":
case"svg:line":
var l = Number(this.selectedElement.getAttribute("x1")),
c = Number(this.selectedElement.getAttribute("x2")),
u = Number(this.selectedElement.getAttribute("y1")),
d = Number(this.selectedElement.getAttribute("y2"));
this.selectedElement.setAttribute("x1", n + l), this.selectedElement.setAttribute("y1", r + u), this.selectedElement.setAttribute("x2", n + c), this.selectedElement.setAttribute("y2", r + d);
break;
case"rect":
case"svg:rect":
this.selectedElement.setAttribute("x", n + a), this.selectedElement.setAttribute("y", r + a / 2);
break;
case"ellipse":
case"svg:ellipse":
var h = Number(this.selectedElement.getAttribute("rx")),
p = Number(this.selectedElement.getAttribute("ry"));
this.selectedElement.setAttribute("cx", n + h + a / 2), this.selectedElement.setAttribute("cy", r + p + a / 2)
}
this.selectedElement.setAttribute("stroke", o), this.svgList.appendChild(this.selectedElement), this.banList.map(function (e) {
e.style.pointerEvents = "none"
}), this.setCanvasOpacity(.5), this.showGrips(!0), this.showSvgCanvas(!0), this.resizeSelector(), this.app.KG_DocSignConfirm.show()
}
}, {
key: "setCanvasOpacity", value: function (e) {
Array.prototype.slice.call(document.querySelectorAll(".canvasWrapper")).map(function (t) {
t.children[0].style.opacity = e
})
}
}, {
key: "restoreDocSign", value: function () {
var e = this.editData, t = e.scale, n = e.section, r = e.pdfPageView, i = e.pageNumber, a = e.strokeWidth,
o = n.cloneNode(!0), s = parseInt(o.style.top), l = parseInt(o.style.left), c = parseInt(o.style.width),
u = parseInt(o.style.height), d = void 0, h = document.createElementNS(m, "svg"),
p = o.getAttribute("data-rgb");
switch (r.annotationLayer.div.appendChild(o), this.editData.shape) {
case"line":
case"svg:line":
d = document.createElementNS(m, "line");
var f = n.querySelector("line"), y = Number(f.getAttribute("x1")), b = Number(f.getAttribute("x2")),
w = Number(f.getAttribute("y1")), S = Number(f.getAttribute("y2"));
d.setAttribute("x1", y), d.setAttribute("y1", w), d.setAttribute("x2", b), d.setAttribute("y2", S);
break;
case"rect":
case"svg:rect":
(d = document.createElementNS(m, "rect")).setAttribute("x", a / 2), d.setAttribute("y", a / 2), d.setAttribute("width", c - a), d.setAttribute("height", u - a);
break;
case"ellipse":
case"svg:ellipse":
(d = document.createElementNS(m, "ellipse")).setAttribute("cx", c / 2), d.setAttribute("cy", u / 2), d.setAttribute("rx", (c - a) / 2), d.setAttribute("ry", (u - a) / 2)
}
d.setAttribute("stroke", p), d.setAttribute("stroke-width", a), d.setAttribute("fill", "transparent"), h.setAttribute("xmlns", m), h.setAttribute("xmlns:se", g), h.setAttribute("xmlns:xlink", v), h.setAttribute("width", parseInt(o.style.width)), h.setAttribute("height", parseInt(o.style.height)), h.appendChild(d);
var _ = this.svgToImgSrc(h), k = o.querySelector("img");
k && k.parentNode.removeChild(k);
var x = new Image;
x.style.display = "none";
var P = r.canvas.getContext("2d");
P.globalCompositeOperation = "multiply", "multiply" !== P.globalCompositeOperation && (P.globalAlpha = .85), o.appendChild(x);
var C = r.div;
r.deleteStampCallback = function () {
var e = C.querySelector(".canvasWrapper"), t = C.querySelector(".textLayer");
e && C.removeChild(e), t && C.removeChild(t);
var n = window.KGPdfViewerWebApp.PDFViewerApplication.pdfThumbnailViewer.getThumbnail(i - 1);
n.renderingState = 0, n.setImage(r)
}, o.style.opacity = 0, x.onload = function () {
var e = n.getAttribute("data-annotation-id"), i = r.pdfPage, a = l * t, d = s * t, h = c * t, p = u * t;
i.delAnnotions && i.delAnnotions[e] ? (delete i.delAnnotions[e], i.needRestore = !0, i.reloadOperatorList = !0) : (i.newDocSigns[e] = o, P.drawImage(x, a, d, h, p)), r.renderingState = 0, r.renderingQueue.renderView(r)
}, x.src = _
}
}, {
key: "open", value: function () {
var e = this;
window.KGPdfViewerWebApp.PDFViewerApplication.secondaryToolbar.close(), this.app.KG_DocSignConfirm.show(), this.overlayManager.open(this.overlayName).then(function () {
e.updateZoom(), e.showSvgCanvas(!0), e.showGrips(!1), e.setCurentMode("line"), e.banList.map(function (e) {
e.style.pointerEvents = "none"
})
})
}
}, {
key: "onClose", value: function () {
var e = this;
(0, s.closeOverlay)().then(function () {
for (e.app.KG_DocSignConfirm.hide(), e.showSvgCanvas(!1), e.showGrips(!1), e.banList.map(function (e) {
e.style.pointerEvents = "all"
}); e.svgList.firstChild;) e.svgList.removeChild(e.svgList.firstChild), e.showGrips(!1);
e.editing && (e.restoreDocSign(), e.editing = !1, e.setCanvasOpacity(1))
})
}
}]), e
}(), function () {
function e(t, n) {
p(this, e), this.svgElem = t, this.obj_num = 0, this.idPrefix = n || "kg_svg_", this.current_layer = null
}
return i(e, [{
key: "getElem_", value: function (e) {
return this.svgElem.querySelector("#" + e)
}
}, {
key: "getId", value: function () {
return this.idPrefix + this.obj_num
}
}, {
key: "getNextId", value: function () {
this.obj_num++;
for (var e = this.getId(); this.getElem_(e);) this.obj_num++, e = this.getId();
return e
}
}, {
key: "getCurrentLayer", value: function () {
return this.current_layer
}
}, {
key: "createLayer", value: function () {
var e = null;
(e = this.svgElem.ownerDocument.createElementNS(m, "g")).id = "kg_svg_list", this.svgElem.insertBefore(e, this.svgElem.firstChild), (0, a.walkTree)(e, function (e) {
e.setAttribute("style", "pointer-events:inherit")
}), this.current_layer = e, this.current_layer.setAttribute("style", "pointer-events:all")
}
}]), e
}())
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.isIdentity = o, t.hasMatrixTransform = function (e) {
if (!e) return !1;
var t = e.numberOfItems;
for (; t--;) {
var n = e.getItem(t);
if (1 === n.type && !o(n.matrix)) return !0
}
return !1
}, t.bboxToObj = s, t.walkTree = l, t.walkTreePost = function (e, t) {
if (e && 1 == e.nodeType) {
for (var n = e.childNodes.length; n--;) l(e.childNodes.item(n), t);
t(e)
}
}, t.getPathBBox = function (e) {
for (var t = e.pathSegList, n = t.numberOfItems, r = [[], []], i = t.getItem(0), a = [i.x, i.y], o = 0; o < n; o++) {
var s = t.getItem(o);
if (void 0 !== s.x) if (r[0].push(a[0]), r[1].push(a[1]), s.x1) {
for (var l = [s.x1, s.y1], c = [s.x2, s.y2], u = [s.x, s.y], d = 0; d < 2; d++) {
var h = function (e) {
return Math.pow(1 - e, 3) * a[d] + 3 * Math.pow(1 - e, 2) * e * l[d] + 3 * (1 - e) * Math.pow(e, 2) * c[d] + Math.pow(e, 3) * u[d]
}, p = 6 * a[d] - 12 * l[d] + 6 * c[d], f = -3 * a[d] + 9 * l[d] - 9 * c[d] + 3 * u[d],
m = 3 * l[d] - 3 * a[d];
if (0 != f) {
var v = Math.pow(p, 2) - 4 * m * f;
if (!(v < 0)) {
var g = (-p + Math.sqrt(v)) / (2 * f);
0 < g && g < 1 && r[d].push(h(g));
var y = (-p - Math.sqrt(v)) / (2 * f);
0 < y && y < 1 && r[d].push(h(y))
}
} else {
if (0 == p) continue;
var b = -m / p;
0 < b && b < 1 && r[d].push(h(b))
}
}
a = u
} else r[0].push(s.x), r[1].push(s.y)
}
var w = Math.min.apply(null, r[0]), S = Math.max.apply(null, r[0]) - w, _ = Math.min.apply(null, r[1]),
k = Math.max.apply(null, r[1]) - _;
return {x: w, y: _, width: S, height: k}
}, t.groupBBFix = c, t.getBBox = function (e) {
var t = e || editorContext_.getSelectedElements()[0];
"textPath" === t.nodeName && (t = e.parentNode);
if (1 != e.nodeType) return null;
var n = null, r = t.nodeName;
switch (r) {
case"text":
if ("" === t.textContent) t.textContent = "a", n = t.getBBox(), t.textContent = ""; else try {
n = t.getBBox()
} catch (e) {
}
break;
case"path":
try {
n = t.getBBox()
} catch (e) {
}
break;
case"g":
case"a":
n = c(t);
break;
default:
if ("use" === r && (n = c(t)), "use" === r) n || (n = t.getBBox()); else if (~a.indexOf(r)) try {
n = t.getBBox()
} catch (e) {
var i = $(t).closest("foreignObject");
if (i.length) try {
n = i[0].getBBox()
} catch (e) {
n = null
} else n = null
}
}
n && (n = s(n));
return n
}, t.matrixMultiply = u, t.assignAttributes = function (e, t, n, r) {
for (var i in t) if (NaN !== t[i] && null !== t[i]) {
var a = "xml:" === i.substr(0, 4) ? XMLNS : "xlink:" === i.substr(0, 6) ? XLINKNS : null;
a ? e.setAttributeNS(a, i, t[i]) : r ? svgedit.units.setUnitAttr(e, i, t[i]) : e.setAttribute(i, t[i])
}
}, t.cleanupElement = function (e) {
var t = {
"fill-opacity": 1,
"stop-opacity": 1,
opacity: 1,
stroke: "none",
"stroke-dasharray": "none",
"stroke-linejoin": "miter",
"stroke-linecap": "butt",
"stroke-opacity": 1,
"stroke-width": 1,
rx: 0,
ry: 0
};
for (var n in t) {
var r = t[n];
e.getAttribute(n) == r && e.removeAttribute(n)
}
}, t.transformPoint = d, t.getTransformList = function (e) {
if (e.transform) return e.transform.baseVal;
if (e.gradientTransform) return e.gradientTransform.baseVal;
if (e.patternTransform) return e.patternTransform.baseVal;
return null
}, t.transformListToTransform = function (e, t, n) {
if (null === e) return r.createSVGTransformFromMatrix(r.createSVGMatrix());
var t = void 0 === t ? 0 : t, n = void 0 === n ? e.numberOfItems - 1 : n;
if (t = parseInt(t), n = parseInt(n), t > n) {
var i = n;
n = t, t = i
}
for (var a = r.createSVGMatrix(), o = t; o <= n; ++o) {
var s = o >= 0 && o < e.numberOfItems ? e.getItem(o).matrix : r.createSVGMatrix();
a = u(a, s)
}
return r.createSVGTransformFromMatrix(a)
}, t.transformBox = function (e, t, n, r, i) {
var a = {x: e, y: t}, o = {x: e + n, y: t}, s = {x: e + n, y: t + r}, l = {x: e, y: t + r},
c = (a = d(a.x, a.y, i)).x, u = a.x, h = a.y, p = a.y;
return o = d(o.x, o.y, i), c = Math.min(c, o.x), u = Math.max(u, o.x), h = Math.min(h, o.y), p = Math.max(p, o.y), l = d(l.x, l.y, i), c = Math.min(c, l.x), u = Math.max(u, l.x), h = Math.min(h, l.y), p = Math.max(p, l.y), s = d(s.x, s.y, i), c = Math.min(c, s.x), u = Math.max(u, s.x), h = Math.min(h, s.y), p = Math.max(p, s.y), {
tl: a,
tr: o,
bl: l,
br: s,
aabox: {x: c, y: h, width: u - c, height: p - h}
}
}, t.getChildElementNodes = function (e) {
return e.children ? Array.prototype.slice.call(e.children) : function () {
for (var t = [], n = 0, r = e.childNodes; n < r.length; n++) switch (Object.prototype.toString.call(r[n])) {
case"[object SVGlineElement]":
case"[object SVGRectElement]":
case"[object SVGEllipseElement]":
t.push(r[n])
}
return t
}()
};
var r = document.createElementNS("http://www.w3.org/2000/svg", "svg"), i = 1e-14,
a = "a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use,svg:rect,svg:line,svg:ellipse".split(",");
function o(e) {
return 1 === e.a && 0 === e.b && 0 === e.c && 1 === e.d && 0 === e.e && 0 === e.f
}
function s(e) {
return {x: e.x, y: e.y, width: e.width, height: e.height}
}
function l(e, t) {
if (e && 1 == e.nodeType) {
t(e);
for (var n = e.childNodes.length; n--;) l(e.childNodes.item(n), t)
}
}
function c(e) {
if (svgedit.browser.supportsHVLineContainerBBox()) try {
return e.getBBox()
} catch (e) {
}
var t = $.data(e, "ref"), n = null;
if (t) {
var r = $(t).children().clone().attr("visibility", "hidden");
$(svgroot_).append(r), n = r.filter("line, path")
} else n = $(e).find("line, path");
var i = !1;
if (n.length) if (n.each(function () {
var e = this.getBBox();
e.width && e.height || (i = !0)
}), i) {
var a = t ? r : $(e).children();
ret = getStrokedBBox(a)
} else ret = e.getBBox(); else ret = e.getBBox();
return t && r.remove(), ret
}
function u() {
for (var e = arguments, t = e.length, n = e[t - 1]; t-- > 1;) {
n = e[t - 1].multiply(n)
}
return Math.abs(n.a) < i && (n.a = 0), Math.abs(n.b) < i && (n.b = 0), Math.abs(n.c) < i && (n.c = 0), Math.abs(n.d) < i && (n.d = 0), Math.abs(n.e) < i && (n.e = 0), Math.abs(n.f) < i && (n.f = 0), n
}
function d(e, t, n) {
return {x: n.a * e + n.c * t + n.e, y: n.b * e + n.d * t + n.f}
}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_VerifySealPrompt = void 0;
var r, i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, a = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), o = n(124), s = (r = o) && r.__esModule ? r : {default: r}, l = n(2);
t.KG_VerifySealPrompt = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.overlayName = n.overlayName, this.container = n.container;
var i = window.KGPdfViewerWebApp.customVerifyOption,
a = "defaultVerifyOptionBy" + window.KGPdfViewerWebApp.fileType;
this.verifyOption = i ? (0, l.mergerConfig)(window.KGPdfViewerWebApp[a], i) : window.KGPdfViewerWebApp[a];
var o = this.app, s = o.KG_BlockChain_V2, c = o.KG_BlockChain;
this.BlockChain = window.KGPdfViewerWebApp.unifySealPlatformV2 ? s : c, 2 == window.KGPdfViewerWebApp.stampSystemOrigin && (delete this.verifyOption._map.tsa, delete this.verifyOption._map.chain), window.KGPdfViewerWebApp.unifySealPlatformV2 && delete this.verifyOption._map.tsa, this.createDOM(), this.init(), this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), !1), this.removeActiveClass = this.removeActiveClass.bind(this)
}
return a(e, [{
key: "createDOM", value: function () {
var e = this.verifyOption, t = e._map, n = "", r = "", i = "";
for (var a in t) {
var o = (0, l.titleCase)(a);
if (i = "", n += '<div hidden class="KG_VerifySealPrompt_Tab" data-tab="' + a + '">\n ' + t[a].title + "\n </div>", e[a]._map && e[a]._show) {
var s = e[a], c = [], u = {};
for (var d in s) "_map" == d ? u = (0, l.mergerConfig)(u, s[d]) : "_show" == d ? c = s[d].concat(c) : Object.prototype.hasOwnProperty.call(s[d], "_map") && Object.prototype.hasOwnProperty.call(s[d], "_show") && (c = c.concat(s[d]._show), u = (0, l.mergerConfig)(u, s[d]._map));
for (var h = 0, p = c.length; h < p; h++) {
var f = c[h];
i += '<div class="KG_VerifySealPrompt_Item KG_VerifySealPrompt_' + (0, l.titleCase)(f) + ' KG_Clearfix">\n <label>' + u[f].title + "</label>\n <span></span>\n </div>"
}
}
r += '<div class="KG_VerifySealPrompt_' + o + 'Data" style="display: none">' + i + "</div>"
}
this.container.innerHTML = '\n <div class="kg_dialog_header">\n <div class="kg_dialog_title KG_VerifySealPrompt_Title"></div>\n <button class="kg_dialog_close KG_VerifySealPrompt_Close">×</button>\n </div>\n <div class="dialog">\n <div class="KG_VerifySealPrompt_ResultIcon KG_VerifySealPrompt_ResultIcon_Success kg_icon"></div>\n <div class="KG_VerifySealPrompt_Result"></div>\n <div class="KG_VerifySealPrompt_Tabs">\n ' + n + "\n </div>\n " + r + '\n \x3c!--公司名称--\x3e\n <div class="KG_VerifySealPrompt_CompanyName"></div>\n\n <div class="KG_VerifySealPrompt_Tip doorHanger" hidden>\n <span class="KG_VerifySealPrompt_Tip_Text"></span>\n <span class="KG_VerifySealPrompt_Tip_Copy" data-l10n-id="verifySeal_copy">复制</span>\n </div>\n </div>'
}
}, {
key: "init", value: function () {
var e = this.verifyOption;
for (var t in this.title = this.container.querySelector(".KG_VerifySealPrompt_Title"), this.closeIcon = this.container.querySelector(".KG_VerifySealPrompt_Close"), this.closeIcon.onclick = this.close.bind(this), this.resultIcon = this.container.querySelector(".KG_VerifySealPrompt_ResultIcon"), this.resultText = this.container.querySelector(".KG_VerifySealPrompt_Result"), this.tabs = this.container.querySelector(".KG_VerifySealPrompt_Tabs"), this.tabs.onclick = this.switchTab.bind(this), e._map) {
var n = (0, l.titleCase)(t);
this[t + "DataTab"] = this.tabs.querySelector(".KG_VerifySealPrompt_Tab[data-tab=" + t + "]"), this[t + "Data"] = this.container.querySelector(".KG_VerifySealPrompt_" + n + "Data");
var r = e[t];
for (var i in r) if ("_map" != i) {
var a = [];
"_show" == i && (a = r[i].concat(a)), Object.prototype.hasOwnProperty.call(r[i], "_show") && (a = a.concat(r[i]._show));
for (var o = 0, s = a.length; o < s; o++) {
var c = a[o], u = (0, l.titleCase)(c);
this[t + "Data" + u] = this[t + "Data"].querySelector(".KG_VerifySealPrompt_" + u)
}
}
}
var d = Object.keys(this);
"PDF" == window.KGPdfViewerWebApp.fileType ? this.copyNodeName = "SignSN" : this.copyNodeName = "SealID";
for (var h = 0, p = d.length; h < p; h++) {
var f = d[h];
-1 != f.indexOf(this.copyNodeName) && (this[f].addEventListener("click", this.handleSignSnClick.bind(this)), this.handleNodeToCopy = this[f])
}
this.company = this.container.querySelector(".KG_VerifySealPrompt_CompanyName"), this.tipContainer = this.container.querySelector(".KG_VerifySealPrompt_Tip"), this.tipText = this.container.querySelector(".KG_VerifySealPrompt_Tip_Text"), this.tipCopy = this.container.querySelector(".KG_VerifySealPrompt_Tip_Copy")
}
}, {
key: "handleSignSnClick", value: function (e) {
var t = this;
this.tipContainer.removeAttribute("hidden"), this.tipText.innerHTML = this.handleNodeToCopy.querySelector("span").innerHTML, this.clipboard = new s.default(".KG_VerifySealPrompt_Tip_Copy", {
text: function () {
switch (t.app.l10n._lang) {
case"zh-TW":
t.tipCopy.innerHTML = "已復制";
break;
case"en-US":
t.tipCopy.innerHTML = "copied";
break;
default:
t.tipCopy.innerHTML = "已复制"
}
return t.tipText.innerHTML
}
}), this.tipContainer.style.left = this.handleNodeToCopy.offsetLeft + 12 + "px", this.tipContainer.style.top = this.handleNodeToCopy.offsetTop - this.tipContainer.clientHeight - 12 + "px", this.container.addEventListener("click", this.removeActiveClass)
}
}, {
key: "removeActiveClass", value: function (e) {
e.target.classList.contains("KG_VerifySealPrompt_" + this.copyNodeName) || e.target.parentNode.classList.contains("KG_VerifySealPrompt_" + this.copyNodeName) || e.target.classList.contains("KG_VerifySealPrompt_Tip_Copy") || (this.tipContainer.setAttribute("hidden", !0), this.container.removeEventListener("click", this.removeActiveClass), this.clipboard.destroy(), this.app.l10n.translate(this.tipCopy))
}
}, {
key: "switchTab", value: function (e) {
var t = e.target ? e.target.dataset.tab : e;
if (t) for (var n = (0, l.titleCase)(t), r = 0; r < this.tabs.children.length; r++) {
var i = this.tabs.children[r];
i.dataset.tab === t ? i.classList.contains("active") || (this.BlockChain && this.BlockChain.cancelResquest(), i.classList.add("active"), this[i.dataset.tab + "Data"].style.display = "block", this[i.dataset.tab + "Data"].style.marginBottom = 22, this["show" + n]()) : (i.classList.remove("active"), this[i.dataset.tab + "Data"].style.display = "none")
}
}
}, {
key: "verifySealResult", value: function () {
if (this.verifySealData.cert) if (this.verifySealData.seal.effectiveness && this.verifySealData.cert.sigEffectiveness) switch (this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Fail"), this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "檢測結果:文檔完整,數字簽名有效!";
break;
case"en-US":
this.resultText.innerHTML = "Validation result: The document is complete and the digital signature is valid!";
break;
default:
this.resultText.innerHTML = "检测结果:文档完整,数字签名有效!"
} else if (this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Fail"), this.verifySealData.seal.effectiveness && !this.verifySealData.cert.sigEffectiveness) switch (this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "檢測結果:文檔完整,數字簽名無效!";
break;
case"en-US":
this.resultText.innerHTML = "Validation result: the document is complete and the digital signature is invalid!";
break;
default:
this.resultText.innerHTML = "检测结果:文档完整,数字签名无效!"
} else switch (this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "檢測結果:文檔已被篡改,數字簽名無效!";
break;
case"en-US":
this.resultText.innerHTML = "Validation result: the document has been tampered with and the digital signature is invalid!";
break;
default:
this.resultText.innerHTML = "检测结果:文档已被篡改,数字签名无效!"
} else if (this.verifySealData.seal.effectiveness) switch (this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Fail"), this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "檢測結果:文檔完整!";
break;
case"en-US":
this.resultText.innerHTML = "Validation result: complete documentation!";
break;
default:
this.resultText.innerHTML = "检测结果:文档完整!"
} else switch (this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Fail"), this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "檢測結果:文檔已被篡改!";
break;
case"en-US":
this.resultText.innerHTML = "Validation result: the document has been tampered with!";
break;
default:
this.resultText.innerHTML = "检测结果:文档已被篡改!"
}
}
}, {
key: "verifySealResultByDomain", value: function () {
if (this.verifySealData.cert.effectiveness) if (this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Fail"), this.verifySealData.cert.appendContent) switch (this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "簽名有效,此修訂版本後文檔已追加內容!";
break;
case"en-US":
this.resultText.innerHTML = "The signature is valid, and the document has been added after this revision!";
break;
default:
this.resultText.innerHTML = "签名有效,此修订版本后文档已追加内容!"
} else switch (this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "簽名有效,此修訂版本後文檔未被修改!";
break;
case"en-US":
this.resultText.innerHTML = "The signature is valid and the document has not been modified after this revision!";
break;
default:
this.resultText.innerHTML = "签名有效,此修订版本后文档未被修改!"
} else if (this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Fail"), this.verifySealData.cert.failReason && "2" == this.verifySealData.seal.stampType) this.resultText.innerHTML = "签章无效," + this.verifySealData.cert.failReason; else switch (this.app.l10n._lang) {
case"zh-TW":
this.resultText.innerHTML = "簽名無效,此修訂版本後文檔已被修改!";
break;
case"en-US":
this.resultText.innerHTML = "The signature is invalid, the document has been modified since this revision!";
break;
default:
this.resultText.innerHTML = "签名无效,此修订版本后文档已被修改!"
}
}
}, {
key: "showSeal", value: function () {
var e = this;
"0" === this.verifySealData.seal.stampType ? this.verifySealResult() : this.verifySealResultByDomain();
var t = this.verifyOption.seal;
this._eachData(t, function (t) {
var n = (0, l.titleCase)(t), r = "";
switch (t) {
case"signDateTime":
r = e.verifySealData.seal.signDateTime || e.verifySealData.seal.createTime;
break;
case"userName":
r = e.verifySealData.seal.userName || e.verifySealData.seal.scanUserName;
break;
default:
r = e.verifySealData.seal[t]
}
"2" === e.verifySealData.seal.stampType && "signName" === t && (e["sealData" + n].querySelector("label").innerHTML = "印章名称:"), r ? e["sealData" + n].querySelector("span").innerHTML = r : e["sealData" + n].style.display = "none", "GB" === window.KGPdfViewerWebApp.sealType && (e.sealDataUserName && (e.sealDataUserName.style.display = "none"), e.sealDataSignSN && (e.sealDataSignSN.style.display = "none")), e.verifySealData.seal.scanStamp && (e.sealDataUnitName && (e.sealDataUnitName.style.display = "none"), e.sealDataKeySN && (e.sealDataKeySN.style.display = "none"))
})
}
}, {
key: "showCert", value: function () {
var e = this;
"1" === this.verifySealData.seal.stampType || "2" === this.verifySealData.seal.stampType ? this.verifySealResultByDomain() : this.verifySealResult();
var t = this.verifyOption.cert;
this._eachData(t, function (t) {
var n = (0, l.titleCase)(t), r = e.verifySealData.cert[t];
r ? e["certData" + n].querySelector("span").innerHTML = r : e["certData" + n].style.display = "none"
})
}
}, {
key: "showTsa", value: function () {
var e = this;
this.verifySealData.tsa.tsaEffectiveness ? (this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Fail")) : (this.resultIcon.classList.remove("KG_VerifySealPrompt_ResultIcon_Success"), this.resultIcon.classList.add("KG_VerifySealPrompt_ResultIcon_Fail"));
var t = this.verifyOption.tsa;
this._eachData(t, function (t) {
var n = (0, l.titleCase)(t), r = e.verifySealData.tsa.tsaCert[t] || e.verifySealData.tsa[t];
r ? e["tsaData" + n].querySelector("span").innerHTML = r : e["tsaData" + n].style.display = "none"
})
}
}, {
key: "showChain", value: function () {
this.BlockChain.getChainInfo(this.verifySealData.seal.stampTime, this.verifySealData.seal.stampDatahHash, this.chainData)
}
}, {
key: "showStamp", value: function () {
var e = this;
"0" === this.verifySealData.seal.stampType ? this.verifySealResult() : this.verifySealResultByDomain();
var t = this.verifyOption.stamp;
this._eachData(t, function (t) {
var n = (0, l.titleCase)(t), r = e.verifySealData.stamp[t];
r ? e["stampData" + n].querySelector("span").innerHTML = r : e["stampData" + n].style.display = "none"
})
}
}, {
key: "open", value: function (e) {
var t = this;
return this.overlayManager.open(this.overlayName).then(function () {
t.verifySealData = t.convertData(e.seal), t.company.innerHTML = e.companyName;
var n = t.verifySealData;
if (!n._map) {
return window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open("请配置正确的映射数据"), void t.close()
}
for (var r = Object.keys(n._map), i = [], a = 0, o = r.length; a < o; a++) {
var s = r[a];
n[s] ? (t[s + "DataTab"].removeAttribute("hidden"), i.push(s)) : t[s + "DataTab"].setAttribute("hidden", !0)
}
if (t.switchTab(i[0]), null != window.KGPdfViewerWebApp.externalVerifySeal) switch (t.app.l10n._lang) {
case"zh-TW":
t.title.innerHTML = "簽章驗證";
break;
case"en-US":
t.title.innerHTML = "Signature Verification";
break;
default:
t.title.innerHTML = "签章验证"
} else {
if ("0" === t.verifySealData.seal.stampType) switch (t.app.l10n._lang) {
case"zh-TW":
t.title.innerHTML = "電子簽章驗證";
break;
case"en-US":
t.title.innerHTML = "Electronic Signature Verification";
break;
default:
t.title.innerHTML = "电子签章验证"
}
if ("1" === t.verifySealData.seal.stampType || "2" === t.verifySealData.seal.stampType) switch (t.app.l10n._lang) {
case"zh-TW":
t.title.innerHTML = "PDF簽名驗證";
break;
case"en-US":
t.title.innerHTML = "PDF Sign Verification";
break;
default:
t.title.innerHTML = "PDF签名验证"
}
!0 === window.KGPdfViewerWebApp.verifyChainInfo && t.verifySealData.seal.stampDatahHash && t.chainDataTab.removeAttribute("hidden"), window.KGPdfViewerWebApp.unifySealPlatformV2 && t.chainDataTab.removeAttribute("hidden")
}
})
}
}, {
key: "close", value: function () {
var e = this;
this.overlayManager.close(this.overlayName).then(function () {
e.BlockChain && e.BlockChain.cancelResquest();
for (var t = 0; t < e.tabs.children.length; t++) {
e.tabs.children[t].classList.remove("active")
}
for (var n = e.container.querySelectorAll(".KG_VerifySealPrompt_Item"), r = 0; r < n.length; r++) {
var i = n[r];
e.resultIcon.src = "", e.resultText.innerHTML = "", i.style.display = "block", i.querySelector("span").innerHTML = ""
}
})
}
}, {
key: "_eachData", value: function (e, t) {
if (e) {
var n = [];
for (var r in e) "_show" == r && (n = e[r].concat(n)), Object.prototype.hasOwnProperty.call(e[r], "_show") && (n = n.concat(e[r]._show));
if (n.length) for (var i = 0, a = n.length; i < a; i++) {
var o = n[i];
t && t(o)
}
}
}
}, {
key: "convertData", value: function (e) {
var t = void 0, n = (0, l.deepCopy)(e);
return t = this._convertDataToStandard(e), t = this._convertDataByBindMap(t, this.verifyOption, n), t = this._deletExternalData(t)
}
}, {
key: "_convertDataByBindMap", value: function (e, t, n) {
return function e(t, r) {
for (var a in r) {
if ("object" == i(r[a]) && "_map" == a) {
var o = r[a];
for (var s in o) {
var l = o[s].value;
t[s] = t[l] || n[l], t._map = o
}
}
Array.isArray(r[a]) && "_show" == a && (t[a] = r[a])
}
for (var c in r) "object" == i(r[c]) && r[c].hasOwnProperty("_map") && t[c] && t[c] && e(t[c], r[c])
}(e, t), e
}
}, {
key: "_convertDataToStandard", value: function (e) {
e = {seal: e};
var t = {}, n = (0, l.flatten)(e);
for (var r in n) {
var i = r.split(".");
if (1 == i.length) t[r] = n[r]; else if (i.length >= 2 && i.length < 4) {
var a = i[i.length - 2], o = i[i.length - 1];
t[a] || (t[a] = {}), t[a][o] = n[r]
} else {
var s = i[i.length - 3], c = i[i.length - 2], u = i[i.length - 1];
t[s] || (t[s] = {}), t[s][c] || (t[s][c] = {}), t[s][c][u] = n[r]
}
}
return t
}
}, {
key: "_deletExternalData", value: function (e) {
var t = e._map;
for (var n in t) n != t[n].value && delete e[t[n].value];
return e
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
t.KG_TextWidget = function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.data = null
}
return r(e, [{
key: "setTextWidgetValue", value: function (e, t) {
null == this.data && (this.data = {}), this.data[e] = t
}
}, {
key: "getTextWidgetValue", value: function () {
return this.data
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.overlayManager = r, this.l10n = t.l10n, this.overlayName = n.overlayName, this.container = n.container, this.button = n.button, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this)), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this;
this.button.addEventListener("click", function () {
e.open(), e.app.secondaryToolbar.close()
}), this.closeBtn = this.container.querySelector(".kg_dialog_close"), this.closeBtn.addEventListener("click", this.close.bind(this))
}
}, {
key: "open", value: function () {
this.overlayManager.open(this.overlayName), this._repairIE()
}
}, {
key: "_repairIE", value: function () {
var e = document.querySelector(".kg_productInfo_warning").querySelector("p");
e.style.width = e.offsetWidth - 1 + "px"
}
}, {
key: "close", value: function () {
this.overlayManager.close(this.overlayName)
}
}]), e
}();
t.KG_ProductInfo = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_PrepareStamp = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(37), a = n(21), o = n(70), s = h(n(56)), l = n(69), c = h(l), u = n(2), d = n(9);
function h(e) {
return e && e.__esModule ? e : {default: e}
}
var p = "KG_PrepareStamp_activeSeal";
function f(e) {
var t = {action: "addAnnot", documentId: window.KGPdfViewerWebApp.documentId, annots: e};
return a.myaxios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), t)
}
function m(e, t, n) {
var r = {
action: "deleteAnnot",
documentId: window.KGPdfViewerWebApp.documentId,
page: e,
x: t,
y: n,
type: "prepareStamp"
};
return a.myaxios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), r)
}
function v() {
var e = document.getElementById("rightMenu");
e && e.parentNode.removeChild(e), document.body.removeEventListener("click", v)
}
t.KG_PrepareStamp = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = n, this.selectSealPrompt = window.KGPdfViewerWebApp.getSelectSealPrompt(), this.seals = [], this.seal = null, this.activeSeal = null, this.sealDate = null, this.movingData = {}, this.tempSeals = [], this.timer = null, this.getSeal = this.getSeal.bind(this), this.selectSeal = this.selectSeal.bind(this), this.onMouseMove = this.onMouseMove.bind(this), this.onDocumentContextmenu = this.onDocumentContextmenu.bind(this), this.onDocumentClick = this.onDocumentClick.bind(this), this.createRightMenu = this.createRightMenu.bind(this), this.bindDragEvent = this.bindDragEvent.bind(this), this.unbindDragEvent = this.unbindDragEvent.bind(this), this.onMoveStart = this.onMoveStart.bind(this), this.onMoving = this.onMoving.bind(this), this.onMoveEnd = this.onMoveEnd.bind(this), this.pressStart = this.pressStart.bind(this), this.pressEnd = this.pressEnd.bind(this), this.removeUnsubmittedSeals = this.removeUnsubmittedSeals.bind(this);
var r = window.KGPdfViewerWebApp.btnPositionConfig, i = r.toolbar, a = void 0 === i ? [] : i, o = r.sidebar,
s = void 0 === o ? [] : o;
a.indexOf("prepareStamp") > -1 && (t.button.removeAttribute("hidden"), t.button.addEventListener("click", this.getSeal)), s.indexOf("prepareStamp") > -1 && (t.secondaryButton.removeAttribute("hidden"), t.secondaryButton.addEventListener("click", this.getSeal))
}
return r(e, [{
key: "getSeal", value: function () {
var e = this;
if (this.app.KGPrepareStampConfirm.hide(), this.app.secondaryToolbar.close(), this.selectSealPrompt.seals && this.selectSealPrompt.seals.length) this.selectSealPrompt.open(); else {
var t = window.KGPdfViewerWebApp.getTipPrompt();
switch (this.app.l10n._lang) {
case"zh-TW":
t.open("正在獲取印章...");
break;
case"en-US":
t.open("Getting seal...");
break;
default:
t.open("正在获取印章...")
}
var n = {action: "getPrepareSeal", sealNames: window.KGPdfViewerWebApp.prepareStamp.sealNames.join(";")};
a.myaxios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), n).then(function (n) {
t.close().then(function () {
n.data.status ? e.selectSeal(n.data.seals) : e.app.KGAlertPrompt.open(n.data.message)
})
}).catch(function () {
t.close()
})
}
}
}, {
key: "selectSeal", value: function (e) {
var t = this;
e.length ? (this.selectSealPrompt.setSeals(e), this.selectSealPrompt.open(), this.selectSealPrompt.setUpdateCallback(function (e) {
t.activeSeal = e.seal, t.bindDocumentEvent(), window.KGPdfViewerWebApp.mobile && (t.app.KGPrepareStampConfirm.show(), t.app.KGPrepareStampConfirm.showMsg())
})) : this.app.KGAlertPrompt.open("没有获取到印章")
}
}, {
key: "bindDocumentEvent", value: function () {
document.body.addEventListener("mousemove", this.onMouseMove), window.KGPdfViewerWebApp.mobile || document.body.addEventListener("contextmenu", this.onDocumentContextmenu), document.body.addEventListener("mousedown", this.onDocumentClick), this.unbindDragEvent()
}
}, {
key: "unbindEvent", value: function () {
document.body.removeEventListener("mousemove", this.onMouseMove), window.KGPdfViewerWebApp.mobile || document.body.removeEventListener("contextmenu", this.onDocumentContextmenu), document.body.removeEventListener("mousedown", this.onDocumentClick)
}
}, {
key: "onMouseMove", value: function (e) {
var t = (0, i.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (t) {
var n = t.node, r = t.pageNumber, a = t.pageX, s = t.pageY, c = (0, o.sealSectionId)(r);
n.style.overflow = "hidden";
var u = this.app.pdfViewer.getPageView(r - 1), d = u.annotationLayer, h = u.viewport.scale;
if (d.div || (d.div = document.createElement("div"), d.div.className = "annotationLayer", n.appendChild(d.div)), a > 0 && s > 0) {
this.activeSeal.section = document.getElementById(c);
var f = a / h - this.activeSeal.width / 2, m = s / h - this.activeSeal.height / 2;
if (this.activeSeal.section) (0, l.setSectionStyle)(this.activeSeal.section, h, f, m); else {
(0, o.removeSealSection)(p);
var v = (new Date).getTime();
this.activeSeal.section = (0, o.createSealSection)(this.activeSeal, c, v, p, f, m, h), d.div.appendChild(this.activeSeal.section)
}
} else (0, o.removeSealSection)(p)
} else (0, o.removeSealSection)(p)
}
}, {
key: "onDocumentContextmenu", value: function (e) {
e.preventDefault(), (0, o.removeSealSection)(p), this.activeSeal = null, this.unbindEvent(), window.KGPdfViewerWebApp.multipleStamp && 2 === e.button && this.removeUnsubmittedSeals()
}
}, {
key: "removeUnsubmittedSeals", value: function () {
for (var e = 0; e < this.seals.length; e++) if (this.seals[e].sealData || this.seals[e].stampDone) {
if (this.seals[e].sealData && !this.seals[e].sealData.stampDone) {
for (var t = 0; t < this.seals[e].sealData.qfzSeal.length; t++) {
var n = this.seals[e].sealData.qfzSeal[t], r = this.seals[e].section.id + "-" + n.page,
i = this.app.pdfViewer.getPageView(n.page - 1), a = i.annotationLayer, o = i.pdfPage.tempStamps,
s = document.getElementById(r);
o.hasOwnProperty(r) && delete o[r], s && a && a.div && a.div.removeChild(s)
}
this.seals.splice(e, 1), e--
}
} else {
var l = this.seals[e].section;
l.parentNode && l.parentNode.removeChild(l), delete this.app.pdfViewer.getPageView(this.seals[e].page - 1).pdfPage.prepareStamps[this.seals[e].section.id], this.seals.splice(e, 1), e--
}
}
}, {
key: "onDocumentClick", value: function (e) {
var t = this;
window.KGPdfViewerWebApp.getSelectSealPrompt();
if (e && 0 === e.button) {
var n = (0, i.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (n) {
var r = n.pageNumber, a = n.pageX, l = n.pageY, h = (n.node, this.app.pdfViewer.getPageView(r - 1)),
m = h.pdfPage, v = h.viewport, g = m.prepareStamps, y = v.scale;
if (a < 0 || a > h.width || l < 0 || l > h.height) return;
this.activeSeal.section.classList.add("stampAnnotation"), this.activeSeal.section.classList.remove(p), this.activeSeal.left = (0, i.getNumbOfPx)(this.activeSeal.section.style.left), this.activeSeal.top = (0, i.getNumbOfPx)(this.activeSeal.section.style.top), this.activeSeal.width = (0, i.getNumbOfPx)(this.activeSeal.section.style.width), this.activeSeal.height = (0, i.getNumbOfPx)(this.activeSeal.section.style.height), this.activeSeal.page = r, this.activeSeal.createTime = (0, s.default)().format("YYYY-MM-DD HH:mm:ss");
var b = this.activeSeal.section;
if (window.KGPdfViewerWebApp.multipleStamp) {
window.KGPdfViewerWebApp.mobile ? this.app.KGPrepareStampConfirm.hideMsg() : this.app.KGPrepareStampConfirm.show(), this.app.KGPrepareStampConfirm.okCallback = function () {
for (var e = [], n = 0; n < t.seals.length; n++) if (t.seals[n].sealData) {
if (!t.seals[n].sealData.stampDone) {
var r = (0, u.leftTopTransformToLeftBottom)({x: t.seals[n].left, y: t.seals[n].top}, h.height / y);
e.push({
page: t.seals[n].sealData.page,
x: r.x,
y: r.y - t.seals[n].height,
width: t.seals[n].sealData.width,
height: t.seals[n].sealData.height,
sealName: t.seals[n].sealData.sealName,
imgdata: t.seals[n].sealData.imgdata.split("data:image/png;base64,")[1],
keysn: t.seals[n].sealData.keysn,
type: "prepareStamp",
isStampOfQfz: t.seals[n].sealData.isStampOfQfz,
pageAttr: t.seals[n].sealData.pageAttr,
bottom: t.seals[n].sealData.bottom
})
}
} else if (!t.seals[n].stampDone) {
var i = (0, u.leftTopTransformToLeftBottom)({x: t.seals[n].left, y: t.seals[n].top}, h.height / y);
e.push({
page: t.seals[n].page,
x: i.x,
y: i.y - t.seals[n].height,
width: t.seals[n].width,
height: t.seals[n].height,
sealName: t.seals[n].sealName,
imgdata: t.seals[n].imgdata.split("data:image/png;base64,")[1],
keysn: t.seals[n].keysn,
type: "prepareStamp",
isStampOfQfz: t.seals[n].isStampOfQfz
})
}
f(e).then(function (e) {
if (e.data.status) for (var n = 0; n < t.seals.length; n++) t.seals[n].sealData ? t.seals[n].sealData.stampDone || (t.seals[n].sealData.stampDone = !0) : t.seals[n].stampDone || (t.seals[n].stampDone = !0, t.app.pdfViewer.getPageView(t.seals[n].page - 1).pdfPage.prepareStamps[t.seals[n].section.id].stampDone = !0, t.seals[n].section.querySelector("img").style.opacity = "1"); else t.app.KGAlertPrompt.open(e.data.message);
t.app.KGPrepareStampConfirm.hide(), t.unbindDragEvent()
}).catch(function () {
t.app.KGPrepareStampConfirm.hide(), t.unbindDragEvent()
})
}, this.app.KGPrepareStampConfirm.closeCallback = this.removeUnsubmittedSeals;
var w = this.activeSeal.section.querySelector("img");
if (w.addEventListener("mousedown", o.eventPreventDefault), w.addEventListener("touchstart", o.eventPreventDefault), window.KGPdfViewerWebApp.mobile ? w.addEventListener("touchstart", this.pressStart) : w.addEventListener("contextmenu", this.createRightMenu), this.activeSeal.stampDone = !1, this.activeSeal.qfzSeal) {
if (this.activeSeal.qfzSeal.length > 0) {
this.activeSeal.isStampOfQfz = !0;
var S = h.height / h.viewport.scale;
this.activeSeal.bottom = S - this.activeSeal.top - this.activeSeal.height, this.activeSeal.pageAttr.bottom = this.activeSeal.bottom, this.activeSeal.qfzSeal.forEach(function (e) {
e.top = t.activeSeal.top, e.width *= t.activeSeal.height / e.height, e.height = t.activeSeal.height
})
}
} else this.activeSeal.isStampOfQfz = !1;
this.activeSeal.isStampOfQfz ? (this.seals.push(new c.default(b, this.activeSeal)), b.parentNode.removeChild(b), b.innerHTML = "", b.style.display = "none", b.style.zIndex = "-996") : this.seals.push(this.activeSeal);
for (var _ = 0; _ < this.seals.length; _++) if (this.seals[_].sealData) for (var k = function (e) {
var n = t.seals[_].sealData.qfzSeal[e], r = t.seals[_].section.id + "-" + n.page,
i = t.app.pdfViewer.getPageView(n.page - 1).pdfPage.tempStamps[r];
i.style.border = "1px dashed transparent", i.addEventListener("mouseover", function () {
i.style.border = "1px dashed #000"
}), i.addEventListener("mouseleave", function () {
i.style.border = "1px dashed transparent"
});
var a = i.querySelector(".deleteTempStampSection");
i.querySelector("img").addEventListener("mousedown", o.eventPreventDefault), i.querySelector("img").addEventListener("touchstart", o.eventPreventDefault), window.KGPdfViewerWebApp.mobile ? i.querySelector("img").addEventListener("touchstart", t.pressStart) : i.querySelector("img").addEventListener("contextmenu", t.createRightMenu), a && i.removeChild(a)
}, x = 0; x < this.seals[_].sealData.qfzSeal.length; x++) k(x);
g[this.activeSeal.section.id] = (0, d.cloneObj)(this.activeSeal), this.onDocumentContextmenu(e), this.bindDragEvent()
} else {
window.KGPdfViewerWebApp.mobile && this.app.KGPrepareStampConfirm.hide();
var P = (0, u.leftTopTransformToLeftBottom)({
x: this.activeSeal.left,
y: this.activeSeal.top
}, h.height / y);
f([{
page: this.activeSeal.page,
x: P.x,
y: P.y - this.activeSeal.height,
width: this.activeSeal.width,
height: this.activeSeal.height,
sealName: this.activeSeal.sealName,
imgdata: this.activeSeal.imgdata.split("data:image/png;base64,")[1],
keysn: this.activeSeal.keysn,
type: "prepareStamp"
}]).then(function (n) {
if (n.data.status) {
var r = t.activeSeal.section.querySelector("img");
r.addEventListener("mousedown", o.eventPreventDefault), r.addEventListener("touchstart", o.eventPreventDefault), window.KGPdfViewerWebApp.mobile ? r.addEventListener("touchstart", t.pressStart) : r.addEventListener("contextmenu", t.createRightMenu), t.activeSeal.stampDone = !0, t.activeSeal.section.querySelector("img").style.opacity = "1", t.seals.push(t.activeSeal), g[t.activeSeal.section.id] = (0, d.cloneObj)(t.activeSeal)
} else t.app.KGAlertPrompt.open(n.data.message);
t.onDocumentContextmenu(e)
}).catch(function () {
t.onDocumentContextmenu(e)
})
}
}
}
}
}, {
key: "createRightMenu", value: function (e) {
var t = this;
e.preventDefault(), v();
var n = (0, i.convertScreenToViewportPoint)(e, this.app.pdfSidebar), r = n.pageNumber, a = n.pageX, s = n.pageY,
l = this.app.pdfViewer.getPageView(r - 1), c = l.pdfPage, u = l.viewport, d = c.prepareStamps, h = u.scale,
p = function (e, t) {
var n = document.createElement("div");
return n.id = "rightMenu", n.style.position = "absolute", n.style["background-color"] = "white", n.style.border = "1px solid #999", n.style.zIndex = "200", n.style.left = e + "px", n.style.top = t + "px", n
}(a, s);
l.viewport.width < parseFloat(a) + 80 && (p.style.left = (0, i.getNumbOfPx)(p.style.left) - 80 + "px"), l.viewport.height < parseFloat(s) + 37 && (p.style.top = (0, i.getNumbOfPx)(p.style.top) - 37 + "px");
var f = void 0;
if ("IMG" === e.target.nodeName) {
var g = e.target.parentNode, y = void 0, b = void 0;
this.seals.forEach(function (e, t) {
if (e.sealData) for (var n = 0; n < e.sealData.qfzSeal.length; n++) {
var r = e.sealData.qfzSeal[n];
e.section.id + "-" + r.page === g.id && (y = e, b = t)
} else e.section.id === g.id && (y = e, b = t)
});
var w = function () {
if (y.sealData) {
for (var e = 0; e < y.sealData.qfzSeal.length; e++) {
var n = y.sealData.qfzSeal[e], r = y.section.id + "-" + n.page,
i = t.app.pdfViewer.getPageView(n.page - 1), a = i.annotationLayer, o = i.pdfPage.tempStamps,
s = document.getElementById(r);
o.hasOwnProperty(r) && delete o[r], s && a && a.div && a.div.removeChild(s)
}
t.seals.splice(b, 1)
} else g.parentNode.removeChild(g), t.seals.splice(b, 1);
for (var l in d) if (d[l].section.id === y.section.id) {
delete d[l];
break
}
};
f = (y.sealData ? y.sealData.stampDone : y.stampDone) ? function () {
v(), m(r, a / h, s / h).then(function (e) {
e.data.status ? w() : t.app.KGAlertPrompt.open(e.data.message)
})
} : function () {
v(), w(), t.seals.filter(function (e) {
return !e.stampDone
}).length <= 0 && (t.onDocumentContextmenu(e), t.app.KGPrepareStampConfirm.hide())
}
}
if ("SECTION" === e.target.nodeName) {
var S = e.target;
f = function () {
v(), m(r, a / h, s / h).then(function (e) {
e.data.status ? e.data.delSeals ? t.deleteMoreSeal(e.data.delSeals, t.app.pdfViewer) : t.deleteOneStamp(l, c, S) : t.app.KGAlertPrompt.open(e.data.message)
})
}
}
var _ = function () {
var e = document.createElement("span");
return e.classList.add("menuDeleteSeal"), e.style.width = "44px", e.style.textAlign = "center", e.setAttribute("data-l10n-id", "menuDelete"), e.addEventListener("contextmenu", o.eventPreventDefault), e
}();
this.app.l10n.translate(_), _.addEventListener("click", f), p.appendChild(_), l.div.appendChild(p), document.body.addEventListener("click", v)
}
}, {
key: "deleteOneStamp", value: function (e, t, n) {
var r = this, i = n.getAttribute("data-annotation-id");
t.delAnnotions || (t.delAnnotions = {}), t.delAnnotions[i] = !0, t.reloadOperatorList = !0, n.parentNode.removeChild(n), e.deleteStampCallback = function () {
var n = e.div.querySelector(".canvasWrapper"), i = e.div.querySelector(".textLayer");
n && e.div.removeChild(n), i && e.div.removeChild(i);
var a = r.app.pdfThumbnailViewer.getThumbnail(t.pageIndex);
a.renderingState = 0, a.setImage(e)
}, e.renderingState = 0, e.renderingQueue.renderView(e)
}
}, {
key: "deleteMoreSeal", value: function (e, t) {
var n = t.app;
for (var r in e) {
var i = r, a = e[r], o = t.getPageView(i), s = o.pdfPage, l = o.div.querySelector(".annotationLayer");
if (l) for (var c = 0; c < a.length; c++) for (var u = l.children, d = 0; d < u.length; d++) {
var h = u[d], p = h.getAttribute("data-annotation-id");
a[c] == p && (c + 1 == a.length ? this.deleteOneStamp(o, o.pdfPage, h) : this.deleteOneStamp(o, o.pdfPage, h, !1))
} else {
s.delAnnotions || (s.delAnnotions = {});
for (var f = 0; f < a.length; f++) {
var m = a[f];
s.delAnnotions[m] = !0
}
s.reloadOperatorList = !0;
var v = n.pdfThumbnailViewer.getThumbnail(s.pageIndex);
v.renderingState = 0, v.setImage(o)
}
}
}
}, {
key: "bindDragEvent", value: function () {
var e = this, t = this;
window.KGPdfViewerWebApp.mobile ? this.seals.forEach(function (t) {
t.section && !t.stampDone && (t.section.addEventListener("touchstart", e.onMoveStart), t.section.addEventListener("touchmove", e.onMoving), t.section.addEventListener("touchend", e.onMoveEnd))
}) : (this.seals.forEach(function (n) {
if (n.section && !n.stampDone) if (n.sealData) for (var r = 0; r < n.sealData.qfzSeal.length; r++) {
var i = n.sealData.qfzSeal[r], a = n.section.id + "-" + i.page,
o = e.app.pdfViewer.getPageView(i.page - 1).pdfPage.tempStamps[a];
o.querySelector("img");
o && o.addEventListener("mousedown", t.onMoveStart)
} else n.section.addEventListener("mousedown", e.onMoveStart)
}), document.body.addEventListener("mousemove", this.onMoving), document.body.addEventListener("mouseup", this.onMoveEnd))
}
}, {
key: "unbindDragEvent", value: function () {
var e = this;
window.KGPdfViewerWebApp.mobile ? this.seals.forEach(function (t) {
t.section && (t.section.removeEventListener("touchstart", e.onMoveStart), t.section.removeEventListener("touchmove", e.onMoving), t.section.removeEventListener("touchend", e.onMoveEnd), t.section.addEventListener("touchstart", e.pressStart), t.section.addEventListener("touchmove", e.pressEnd), t.section.addEventListener("touchend", e.pressEnd))
}) : (this.seals.forEach(function (t) {
t.section && t.section.removeEventListener("mousedown", e.onMoveStart)
}), document.body.removeEventListener("mousemove", this.onMoving), document.body.removeEventListener("mouseup", this.onMoveEnd))
}
}, {
key: "pressStart", value: function (e) {
var t = this;
e.preventDefault(), window.KGPdfViewerWebApp.mobile && (this.timer = setTimeout(function () {
t.pressEnd(), t.createRightMenu(e)
}, 500))
}
}, {
key: "pressEnd", value: function () {
clearTimeout(this.timer)
}
}, {
key: "onMoveStart", value: function (e) {
v(), e && "IMG" === e.target.nodeName && (0 === e.button || window.KGPdfViewerWebApp.mobile) && (this.movingData.movingSection = e.target.parentNode, window.KGPdfViewerWebApp.mobile ? (this.movingData.startX = e.touches[0].pageX, this.movingData.startY = e.touches[0].pageY) : (this.movingData.offsetX = e.offsetX, this.movingData.offsetY = e.offsetY), this.movingData.isMoving = !0, this.pressStart(e))
}
}, {
key: "onMoving", value: function (e) {
var t = this;
if (this.pressEnd(), this.movingData.isMoving) {
e.preventDefault();
var n = (0, i.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (n) {
var r = n.pageX, a = n.pageY, o = n.pageNumber, s = this.app.pdfViewer.getPageView(Number(o) - 1),
c = s.viewport.scale, u = s.pdfPage.prepareStamps, h = null;
if (this.seals.forEach(function (e, n) {
if (e.sealData) for (var r = 0; r < e.sealData.qfzSeal.length; r++) {
var i = e.sealData.qfzSeal[r];
e.section.id + "-" + i.page === t.movingData.movingSection.id && (h = e)
} else e.section.id === t.movingData.movingSection.id && (h = e)
}), h && !h.sealData) {
if (window.KGPdfViewerWebApp.mobile) {
var p = e.touches[0].pageX - this.movingData.startX, f = e.touches[0].pageY - this.movingData.startY;
this.movingData.startX = e.touches[0].pageX, this.movingData.startY = e.touches[0].pageY, h.left = h.left + p / c, h.top = h.top + f / c
} else h.left = r / c - this.movingData.offsetX, h.top = a / c - this.movingData.offsetY;
(0, l.setSectionStyle)(this.movingData.movingSection, c, h.left, h.top);
var m = !1, v = this.app.pagesCount, g = s.height / c, y = Number(h.page), b = Number(o);
if (window.KGPdfViewerWebApp.mobile ? (y > 1 && h.top < 0 && -h.top > (0, i.getNumbOfPx)(h.section.style.height) / 2 && (m = !0, h.page--, h.top = h.top + s.height / c, (0, l.setSectionStyle)(this.movingData.movingSection, c, h.left, h.top)), y < v && h.top + (0, i.getNumbOfPx)(h.section.style.height) / 2 > g && (m = !0, h.page++, h.top = h.top - s.height / c, (0, l.setSectionStyle)(this.movingData.movingSection, c, h.left, h.top))) : (y > 1 && b < y && (m = !0, h.page--), y < v && b > y && (m = !0, h.page++)), m) {
this.movingData.movingSection.parentNode.removeChild(this.movingData.movingSection);
var w = this.app.pdfViewer.getPageView(h.page - 1);
w.annotationLayer.div || (w.annotationLayer.div = document.createElement("div"), w.annotationLayer.div.className = "annotationLayer", w.div.appendChild(w.annotationLayer.div)), w.annotationLayer.div.appendChild(this.movingData.movingSection);
var S = this.app.pdfViewer.getPageView(y - 1).pdfPage.prepareStamps;
for (var _ in S) if (S[_].section.id === h.section.id) {
delete S[_];
break
}
u[h.section.id] = (0, d.cloneObj)(h)
}
} else if (h && h.sealData) {
var k = s.width / c, x = s.height / c, P = r / c - this.movingData.offsetX,
C = a / c - this.movingData.offsetY;
h.sealData.xsacle = P / k, h.sealData.ysacle = C / x, h.sealData.pageAttr.bottom = x - C - (0, i.getNumbOfPx)(h.section.style.height);
for (var A = 0; A < h.sealData.qfzSeal.length; A++) {
var T = h.sealData.qfzSeal[A];
T.top = C;
var E = h.section.id + "-" + T.page, D = this.app.pdfViewer.getPageView(T.page - 1).pdfPage.tempStamps;
D.hasOwnProperty(E) && (0, l.setSectionStyle)(D[E], c, null, C)
}
}
}
}
}
}, {
key: "onMoveEnd", value: function (e) {
this.pressEnd(), this.movingData.isMoving && (this.movingData.isMoving = !1)
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_CertValidity = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(42), a = n(55);
var o = "kg-certValidaty-dontShow";
t.KG_CertValidity = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.options = n, this.overlayName = this.options.overlayName, this.container = this.options.container, this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.close.bind(this)), this.alertPrompt = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, this.resolve = null, this.dontShowToday = !1, this.createDom(), this.init()
}
return r(e, [{
key: "createDom", value: function () {
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.container.appendChild(e);
var t = document.createElement("div");
t.classList.add("kg_dialog_title"), t.setAttribute("data-l10n-id", "alert_title"), e.appendChild(t), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", e.appendChild(this.closeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.container.appendChild(n), this.content = document.createElement("p"), this.content.classList.add("KG_AlertPrompt_Content"), this.content.classList.add("icon-info"), n.appendChild(this.content);
var r = document.createElement("div");
r.classList.add("KG_Form_Footer"), r.classList.add("KG_Clearfix"), n.appendChild(r), this.checkboxWrapper = document.createElement("div"), this.checkboxWrapper.classList.add("kg_checkbox_wrapper"), r.appendChild(this.checkboxWrapper), this.checkbox = document.createElement("input"), this.checkbox.setAttribute("type", "checkbox"), this.checkbox.id = "dontShowToday", this.checkboxWrapper.appendChild(this.checkbox);
var i = document.createElement("span");
i.innerHTML = "不再提示(当天有效)", this.checkboxWrapper.appendChild(i), this.cancelBtn = document.createElement("button"), this.cancelBtn.innerHTML = "确定", this.cancelBtn.classList.add("btn"), this.cancelBtn.classList.add("btn-primary"), this.cancelBtn.style.float = "right", r.appendChild(this.cancelBtn), this.okBtn = document.createElement("button"), this.okBtn.innerHTML = "前往续期", this.okBtn.classList.add("btn"), this.okBtn.classList.add("btn-border-primary"), this.okBtn.style.float = "right", r.appendChild(this.okBtn), this.app.l10n.translate(this.container)
}
}, {
key: "init", value: function () {
this.okBtn.addEventListener("click", this.goToRenewal.bind(this)), this.cancelBtn.addEventListener("click", this.cancel.bind(this)), this.closeBtn.addEventListener("click", this.close.bind(this)), this.checkboxWrapper.addEventListener("click", this.onCheckBoxWrapperClick.bind(this))
}
}, {
key: "onCheckBoxWrapperClick", value: function (e) {
this.dontShowToday ? (this.dontShowToday = !1, this.checkboxWrapper.classList.remove("kg_checkbox_wrapper-checked")) : (this.dontShowToday = !0, this.checkboxWrapper.classList.add("kg_checkbox_wrapper-checked"))
}
}, {
key: "verify", value: function (e, t) {
var n = this;
this.resolve = t;
var r = this.getDontShowTodayFromCookie();
if ("false" == r || null == r) {
this.dontShowToday = !1, this.checkboxWrapper.classList.remove("kg_checkbox_wrapper-checked");
var o = new a.iWebAssist({clientType: "0"});
Promise.all([o.promise]).then(function () {
return o.getPublicParam("Customer", "ValidateCertExpireTime")
}).then(function (t) {
"true" == t.toLowerCase() ? o.getPublicParam("Public", "HintRemainingDays").then(function (t) {
(0, i.getCert)(e, function (e) {
return window.KGPdfViewerWebApp.certExpiryVerify(e, t)
}, function (e) {
if (e.status) switch (e.certStatus) {
case 0:
n.content.innerHTML = "电子印章已过期,请立即续期!", n.cancelBtn.style.display = "none", n.checkboxWrapper.style.display = "none", n.container.querySelector(".kg_dialog_header").style.width = "310px", n.container.querySelector(".dialog").style.width = "310px", n.open();
break;
case 1:
n.content.innerHTML = '电子印章还有 <span class="certDays">' + e.days + "天</span> 到期,请尽快续期!", n.cancelBtn.style.display = "inline-block", n.checkboxWrapper.style.display = "block", n.container.querySelector(".kg_dialog_header").style.width = "420px", n.container.querySelector(".dialog").style.width = "420px", n.open();
break;
case 2:
n.resolve()
}
}, function (e) {
n.close(), n.alertPrompt.open(e)
})
}) : n.resolve()
})
} else this.resolve()
}
}, {
key: "goToRenewal", value: function () {
var e = this;
this.overlayManager.close(this.overlayName), window.KGPdfViewerWebApp.getTipPrompt().reset("正在跳转...");
var t = new a.iWebAssist({clientType: "0"});
Promise.all([t.promise]).then(function () {
return t.getPublicParam("Customer", "ValidateCertUpdateURL")
}).then(function (t) {
t ? window.open(t) : e.alertPrompt.open("读取配置文件失败!"), window.KGPdfViewerWebApp.getTipPrompt().close()
})
}
}, {
key: "open", value: function () {
this.overlayManager.open(this.overlayName)
}
}, {
key: "close", value: function () {
this.saveDontShowTodayInCookie(), this.overlayManager._active.indexOf(this.overlayName) > -1 && this.overlayManager.close(this.overlayName), window.KGPdfViewerWebApp.getTipPrompt().close()
}
}, {
key: "cancel", value: function () {
this.saveDontShowTodayInCookie(), this.overlayManager._active.indexOf(this.overlayName) > -1 && this.overlayManager.close(this.overlayName), this.resolve()
}
}, {
key: "saveDontShowTodayInCookie", value: function () {
if (this.dontShowToday) {
var e = new Date;
e.setTime(e.getTime() + 864e5), document.cookie = o + "=true;expires=" + e.toGMTString()
} else document.cookie = o + "=false;expires=-1"
}
}, {
key: "getDontShowTodayFromCookie", value: function () {
for (var e = document.cookie.split("; "), t = null, n = 0; n < e.length; n++) {
var r = e[n].split("=");
if (r[0] == o) {
t = r[1];
break
}
}
return t
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_OpenLocalFile = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(9), a = n(21);
t.KG_OpenLocalFile = function () {
function e(t, n, r) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.appConfig = n, this.button = n.KG_OpenLocalFile.button, this.secondaryButton = n.KG_OpenLocalFile.secondaryButton, this.overlayName = n.KG_ProgressPrompt.overlayName, this.container = n.KG_ProgressPrompt.container, this.uploadLocalFileSuccess = window.KGPdfViewerWebApp.uploadLocalFileSuccess.bind(window.KGPdfViewerWebApp), this.fileInput = null, this.cancelBtn = null, this.closeBtn = null, this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, this.close, !1), this.createDom(), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this, t = window.KGPdfViewerWebApp.btnPositionConfig, n = t.toolbar, r = t.sidebar;
n.indexOf("openLocalFile") > -1 && (this.button.removeAttribute("hidden"), this.button.addEventListener("click", function () {
return e.fileInput.click()
})), r.indexOf("openLocalFile") > -1 && (this.secondaryButton.removeAttribute("hidden"), this.secondaryButton.addEventListener("click", function () {
return e.fileInput.click()
})), this.cancelBtn.addEventListener("click", this.close.bind(this)), this.closeBtn.addEventListener("click", this.close.bind(this))
}
}, {
key: "createDom", value: function () {
this.fileInput = document.createElement("input"), this.fileInput.id = "fileInput", this.fileInput.className = "fileInput", this.fileInput.setAttribute("type", "file"), this.fileInput.oncontextmenu = i.noContextMenuHandler, document.body.appendChild(this.fileInput), this.fileInput.value = null, this.fileInput.addEventListener("change", this.fileInputChange.bind(this));
var e = document.createElement("div");
e.classList.add("kg_dialog_header"), this.container.appendChild(e);
var t = document.createElement("div");
t.classList.add("kg_dialog_title"), t.innerHTML = "上传中", e.appendChild(t), this.closeBtn = document.createElement("button"), this.closeBtn.classList.add("kg_dialog_close"), this.closeBtn.innerHTML = "×", e.appendChild(this.closeBtn);
var n = document.createElement("div");
n.classList.add("dialog"), this.container.appendChild(n), this.progressBar = document.createElement("div"), this.progressBar.classList.add("kg_progress"), n.appendChild(this.progressBar), this.progress = document.createElement("div"), this.progress.classList.add("kg_progress_active"), this.progressBar.appendChild(this.progress), this.uploadPercent = document.createElement("div"), this.uploadPercent.innerHTML = "0%", n.appendChild(this.uploadPercent);
var r = document.createElement("div");
r.classList.add("KG_Form_Footer"), n.appendChild(r), this.cancelBtn = document.createElement("button"), this.cancelBtn.setAttribute("data-l10n-id", "password_cancel"), this.cancelBtn.classList.add("btn"), r.appendChild(this.cancelBtn)
}
}, {
key: "fileInputChange", value: function (e) {
var t = e.target.files;
if (t && 0 !== t.length) {
var n = t[0], r = n.name, i = r.substring(r.lastIndexOf(".") + 1).toLowerCase();
if ("pdf" != i && "ofd" != i) return this.app.KGAlertPrompt.closeCallback = null, void this.app.KGAlertPrompt.open("仅支持 PDF 或 OFD 文档");
this.uploadFile(n)
}
}
}, {
key: "uploadFile", value: function (e) {
var t = this, n = new FormData;
n.append("file", e);
var r = a.axios.CancelToken;
this.source = r.source(), (0, a.axios)({
url: window.KGPdfViewerWebApp.uploadLocalFileUrl,
method: "POST",
data: n,
cancelToken: this.source.token,
headers: {"Content-Type": "multipart/form-data"},
onUploadProgress: function (e) {
var n = e.loaded / e.total;
t.open(n)
}
}).then(function (e) {
t.close(), window.KGPdfViewerWebApp.uploadLocalFileSuccess(e)
}).catch(function (e) {
a.axios.isCancel(e) ? console.log("Upload canceled") : (t.close(), t.app.KGAlertPrompt.closeCallback = null, t.app.KGAlertPrompt.open(e.message || e || "上传失败"))
})
}
}, {
key: "open", value: function (e) {
var t = this;
new Promise(function (e) {
-1 == t.overlayManager._active.indexOf(t.overlayName) ? (t.uploadPercent.innerHTML = "0%", t.progress.style.width = "0px", t.overlayManager.open(t.overlayName).then(function () {
e()
})) : e()
}).then(function () {
var n = t.progressBar.offsetWidth;
t.progress.style.width = n * e + "px", t.uploadPercent.innerHTML = Math.round(1e4 * e) / 100 + "%"
})
}
}, {
key: "close", value: function () {
var e = this;
new Promise(function (t) {
-1 == e.overlayManager._active.indexOf(e.overlayName) ? t() : e.overlayManager.close(e.overlayName).then(function () {
t()
})
}).then(function () {
e.source && e.source.cancel && e.source.cancel()
})
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_IndicateSeal = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(21), a = p(n(56)), o = n(16), s = n(70), l = p(n(182)), c = n(37), u = n(69), d = p(n(17)), h = n(450);
function p(e) {
return e && e.__esModule ? e : {default: e}
}
function f() {
var e = document.getElementById("indicateSeal-rightMenu");
e && e.parentNode.removeChild(e)
}
var m = 80, v = 52, g = 1.8, y = 12, b = 10, w = "simsun", S = 16, _ = 19;
t.KG_IndicateSeal = function () {
function e(t, n, r) {
var i = this;
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), l.default.path = "./stamp/laydate/", this.app = t, this.appConfig = n, this.button = n.KG_IndicateSeal.button, this.secondaryButton = n.KG_IndicateSeal.secondaryButton, this.overlayName = n.KG_IndicateSeal.overlayName, this.container = n.KG_IndicateSeal.container, this.closeBtn = this.container.querySelector(".kg_dialog_close"), this.form = this.container.querySelector("form"), this.nameInput = this.form.querySelectorAll("input")[0], this.numberInput = this.form.querySelectorAll("input")[1], this.dateInput = this.form.querySelectorAll("input")[2], this.colorInput = this.form.querySelectorAll("input")[3], this.canvas = this.container.querySelector("canvas"), this.okBtn = this.form.querySelector(".btn.btn-primary"), this.cancelBtn = this.form.querySelector(".btn"), this.stampMobileTip = document.getElementById("stamp-mobile-tip"), this.stampMobieCancel = document.getElementById("stamp-mobile-cancel");
var a = window.KGPdfViewerWebApp, o = a.indicateSealConfig, s = a.indicateSealDefaultConfig, c = a.userId;
this.defaultConfig = {
authorName: o.authorName || c,
name: o.name || s.name,
number: o.number || s.number,
color: o.color || s.color
}, this.overlayManager = r, this.overlayManager.register(this.overlayName, this.container, function () {
return i.close()
}, !1), this.onDocumentContextmenu = this.onDocumentContextmenu.bind(this), this.onDocumentClick = this.onDocumentClick.bind(this), this.onMouseMove = this.onMouseMove.bind(this), this.createRightMenu = this.createRightMenu.bind(this), this.onDocumentTouchStart = this.onDocumentTouchStart.bind(this), this.onDocumentTouchMove = this.onDocumentTouchMove.bind(this), this.onDocumentTouchEnd = this.onDocumentTouchEnd.bind(this), this.sealData = null, this.seals = [], this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this, t = window.KGPdfViewerWebApp.btnPositionConfig, n = t.toolbar, r = t.sidebar;
n.indexOf("indicateSeal") > -1 && (this.button.removeAttribute("hidden"), this.button.addEventListener("click", function () {
return e.open()
})), r.indexOf("indicateSeal") > -1 && (this.secondaryButton.removeAttribute("hidden"), this.secondaryButton.addEventListener("click", function () {
return e.open()
})), this.closeBtn.addEventListener("click", function () {
return e.close()
}), this.nameInput.value = this.defaultConfig.name, this.nameInput.setAttribute("readonly", !0), this.nameInput.addEventListener("input", function () {
return e.handleNameChange()
}), this.numberInput.value = this.defaultConfig.number, this.numberInput.addEventListener("input", function () {
return e.handleNumberChange()
}), this.dateInput.value = (0, a.default)().format("YYYY年M月D日"), l.default.render({
elem: this.dateInput,
value: new Date,
format: "yyyy年M月d日",
showBottom: !1,
done: function (t) {
return e.handleDateChange(t)
},
ready: function (t) {
return e.handleDateChange(t)
}
}), this.colorInput.jscolor.fromString(this.defaultConfig.color.slice(1)), this.colorInput.addEventListener("change", function () {
return e.handleColorChange()
}), this.form.addEventListener("submit", function (t) {
t.preventDefault(), e.submit()
}), this.cancelBtn.addEventListener("click", function () {
return e.close()
}), document.body.addEventListener("click", f), this.app.l10n.translate(this.container)
}
}, {
key: "handleNameChange", value: function () {
this.nameInput.value.length > 3 && (this.nameInput.value = this.nameInput.value.slice(0, 3)), this.render()
}
}, {
key: "handleNumberChange", value: function () {
this.numberInput.value.length > 6 && (this.numberInput.value = this.numberInput.value.slice(0, 6)), this.render()
}
}, {
key: "handleDateChange", value: function (e) {
this.dateInput.value = "string" == typeof e ? e : e.year + "年" + e.month + "月" + e.date + "日", this.render()
}
}, {
key: "handleColorChange", value: function () {
this.render()
}
}, {
key: "render", value: function () {
var e = this.nameInput.value, t = this.numberInput.value, n = this.dateInput.value,
r = "#" + this.colorInput.value, i = this.canvas, a = i.width, o = i.height, s = i.getContext("2d"),
l = 3 * g, c = 3 * m, u = 3 * v, d = 3 * S, h = u - 2 * l, p = c - d - 3 * l, f = 3 * _, k = u - f - 3 * l,
x = 3 * y, P = 3 * b, C = w, A = {x: (a - c) / 2, y: (o - u) / 2};
s.clearRect(0, 0, a, o), s.fillStyle = r, s.lineWidth = .5, s.strokeStyle = r, s.fillRect(A.x, A.y, c, u);
var T = A.x + l, E = A.y + l;
s.clearRect(T, E, d, h);
var D = A.x + 2 * l + d, I = A.y + l;
s.clearRect(D, I, p, f);
var L = A.x + 2 * l + d, O = A.y + 2 * l + f;
s.clearRect(L, O, p, k), s.textAlign = "center", s.textBaseline = "middle";
for (var M = 0; M < e.length; M++) {
var N = e[M], R = T + d / 2 + .475 * x, W = E + h / 2;
switch (e.length) {
case 2:
switch (M) {
case 0:
W -= .75 * x;
break;
case 1:
W += .5 * x
}
break;
case 3:
switch (M) {
case 0:
W -= 1.25 * x;
break;
case 1:
W -= .1 * x;
break;
case 2:
W += x
}
}
s.save(), s.scale(.8, 1.05), s.font = "normal bold " + x + "px " + C, s.strokeText(N, R, W), s.fillText(N, R, W), s.restore()
}
s.font = "normal bold " + x + "px " + C, s.save(), s.scale(.8, 1.05), s.strokeText("第", D + p / 2 - .975 * x, I + f / 2 - .1 * x), s.fillText("第", D + p / 2 - .975 * x, I + f / 2 - .1 * x), s.strokeText("号", D + p + 1.2 * x, I + f / 2 - .1 * x), s.fillText("号", D + p + 1.2 * x, I + f / 2 - .1 * x), s.restore(), s.save(), s.scale(1, 1.5), s.font = "normal bold " + P + "px simsun", s.strokeText(t, D + p / 2 - .025 * P, I + f / 2 - .5 * x), s.fillText(t, D + p / 2 - .025 * P, I + f / 2 - .5 * x - .5), s.restore(), s.font = "normal bold " + .85 * x + "px " + C, s.save(), s.scale(.8, 1.05), s.strokeText("年", L + 2.8 * x, O + 1.05 * x), s.fillText("年", L + 2.8 * x, O + 1.05 * x), s.strokeText("月", L + 4.575 * x, O + 1.05 * x), s.fillText("月", L + 4.575 * x, O + 1.05 * x), s.strokeText("日", L + 6.15 * x, O + 1.05 * x), s.fillText("日", L + 6.15 * x, O + 1.05 * x), s.restore();
var V = n.split("年")[0], F = n.split("年")[1].split("月")[0], G = n.split("年")[1].split("月")[1].split("日")[0];
s.save(), s.scale(.8, 1.5), s.font = "normal bold " + .8 * P + "px " + C;
var B = O + k / 2 - 1.3 * P;
s.strokeText(V, L + 1.85 * P, B), s.fillText(V, L + 1.85 * P, B - .5), s.strokeText(F, L + 4.375 * P, B), s.fillText(F, L + 4.375 * P, B - .5), s.strokeText(G, L + 6.475 * P, B), s.fillText(G, L + 6.475 * P, B - .5), s.restore()
}
}, {
key: "submit", value: function () {
var e = this;
if (this.nameInput.value) if (this.numberInput.value) {
var t = this.canvas.getContext("2d").getImageData((this.canvas.width - 3 * m) / 2, (this.canvas.height - 3 * v) / 2, 3 * m, 3 * v),
n = document.createElement("canvas");
n.width = 3 * m, n.height = 3 * v, n.getContext("2d").putImageData(t, 0, 0);
var r = n.toDataURL("image/png", 1);
this.sealData = {
originImgData: r,
imgData: r,
width: m,
height: v,
customType: "indicateSeal"
}, document.body.style.cursor = "move", this.close().then(function () {
1 == window.KGPdfViewerWebApp.mobile ? (e.stampMobileTip.style.display = "block", e.stampMobieCancel.addEventListener("click", e.onDocumentContextmenu), document.body.addEventListener("touchstart", e.onDocumentTouchStart), document.body.addEventListener("touchmove", e.onDocumentTouchMove), document.body.addEventListener("touchend", e.onDocumentTouchEnd)) : (document.body.addEventListener("contextmenu", e.onDocumentContextmenu), document.body.addEventListener("mousemove", e.onMouseMove), document.body.addEventListener("click", e.onDocumentClick))
})
} else this.app.KGAlertPrompt.open("批示序号不能为空!"); else this.app.KGAlertPrompt.open("领导姓名不能为空!")
}
}, {
key: "onDocumentTouchStart", value: function (e) {
this.touchEvent = e
}
}, {
key: "onDocumentTouchMove", value: function (e) {
this.touchEvent = null
}
}, {
key: "onDocumentTouchEnd", value: function (e) {
null != this.touchEvent && (this.onMouseMove(this.touchEvent), this.onDocumentClick(this.touchEvent))
}
}, {
key: "onDocumentContextmenu", value: function (e) {
0 == window.KGPdfViewerWebApp.mobile && e.preventDefault(), e.stopPropagation(), (0, s.removeSealSection)(s.activeSealClassName), this.sealData = null, document.body.style.cursor = "default", 1 == window.KGPdfViewerWebApp.mobile ? (this.stampMobileTip.style.display = "none", this.stampMobieCancel.removeEventListener("click", this.onDocumentContextmenu), document.body.removeEventListener("touchstart", this.onDocumentTouchStart), document.body.removeEventListener("touchmove", this.onDocumentTouchMove), document.body.removeEventListener("touchend", this.onDocumentTouchEnd)) : (document.body.removeEventListener("contextmenu", this.onDocumentContextmenu), document.body.removeEventListener("click", this.onDocumentClick), document.body.removeEventListener("mousemove", this.onMouseMove))
}
}, {
key: "onDocumentClick", value: function (e) {
var t = this;
this.stampMobileTip.style.display = "none";
var n = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (n) {
var r = n.pageNumber, i = n.pageX, l = n.pageY, u = this.app.pdfViewer.getPageView(r - 1), p = u.pdfPage,
f = u.canvas, m = u.viewport, v = m.viewBox[3];
if (i < 0 || i > u.width || l < 0 || l > u.height) return;
document.body.removeEventListener("mousemove", this.onMouseMove), this.sealData.left = (0, c.getNumbOfPx)(this.sealData.section.style.left), this.sealData.top = (0, c.getNumbOfPx)(this.sealData.section.style.top), this.sealData.width = (0, c.getNumbOfPx)(this.sealData.section.style.width), this.sealData.height = (0, c.getNumbOfPx)(this.sealData.section.style.height), this.sealData.page = r, this.sealData.createTime = (0, a.default)().format("YYYY-MM-DD HH:mm:ss");
var g = window.KGPdfViewerWebApp.getTipPrompt();
g.open("正在加盖批示...");
var y = {};
y.width = this.sealData.width, y.height = this.sealData.height, y.createTime = this.sealData.createTime, y.x = this.sealData.left, y.y = v - this.sealData.height - this.sealData.top, y.styleId = "12", y.styleName = "Stamp", y.pageNo = this.sealData.page, y.curDateTime = "D:" + (0, a.default)().format("YYYYMMDDHHmmss") + "+08'00'", y.authorName = this.defaultConfig.authorName, y.annotInfo = JSON.stringify({
customType: this.sealData.customType,
type: y.styleName,
author: y.authorName
});
var b = this.sealData.originImgData.split(",")[1];
y.annotSignature = d.default.parse(b).toString();
var w = JSON.stringify({d: [y]}).slice(5, -1);
window.KGPdfViewerWebApp.saveAnnotations(w).then(function (n) {
if (g.close(), "status" in n && !1 === n.status) t.app.KGAlertPrompt.open(n.message); else {
if (t.sealData.section.classList.add("stampAnnotation"), t.sealData.section.classList.remove(s.activeSealClassName), p.textToSeals.push(t.sealData), t.seals.push(t.sealData), t.sealData.section.querySelector("img").addEventListener("mousedown", s.eventPreventDefault), 0 == window.KGPdfViewerWebApp.mobile) t.sealData.section.querySelector("img").addEventListener("contextmenu", t.createRightMenu); else {
var r = null;
t.sealData.section.querySelector("img").addEventListener("contextmenu", function (e) {
e.preventDefault(), e.stopPropagation()
}), t.sealData.section.querySelector("img").addEventListener("touchstart", function (e) {
r = setTimeout(function () {
t.createRightMenu(e)
}, 500)
}), t.sealData.section.querySelector("img").addEventListener("touchend", function () {
clearTimeout(r)
})
}
var i = t.sealData.section.querySelector("img");
i.style.opacity = 0;
var a = f.getContext("2d");
a.globalCompositeOperation = "multiply", "multiply" !== a.globalCompositeOperation && (a.globalAlpha = .85);
var l = m.scale * (u.canvas.width / u.canvas.offsetWidth),
d = ((0, c.getNumbOfPx)(t.sealData.section.style.left) + 1) * l,
v = ((0, c.getNumbOfPx)(t.sealData.section.style.top) + 1) * l,
b = (0, c.getNumbOfPx)(t.sealData.section.style.width) * l,
w = (0, c.getNumbOfPx)(t.sealData.section.style.height) * l;
a.drawImage(i, d, v, b, w);
var S = t.app.pdfThumbnailViewer.getThumbnail(p.pageIndex);
S.renderingState = o.RenderingStates.INITIAL, S.setImage(u);
var _ = new h.PopupElement({
container: t.sealData.section,
trigger: t.sealData.section,
color: null,
title: y.authorName,
contents: "",
hideWrapper: !0,
viewport: m
}).render();
_.style.left = t.sealData.section.style.width, t.sealData.section.appendChild(_), window.KGPdfViewerWebApp.indicateSealSuccess({
name: t.nameInput.value,
number: t.numberInput.value,
date: t.dateInput.value,
color: "#" + t.colorInput.value
})
}
t.onDocumentContextmenu(e)
}).catch(function (n) {
t.onDocumentContextmenu(e)
})
}
}
}, {
key: "onMouseMove", value: function (e) {
var t = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar);
if (t) {
var n = t.node, r = t.pageNumber, i = t.pageX, a = t.pageY, o = (0, s.sealSectionId)(r);
n.style.overflow = "hidden";
var l = this.app.pdfViewer.getPageView(r - 1), d = l.annotationLayer, h = l.viewport.scale;
if (d.div || (d.div = document.createElement("div"), d.div.className = "annotationLayer", n.appendChild(d.div)), i > 0 && a > 0) {
this.sealData.section = document.getElementById(o);
var p = i / h - this.sealData.width / 2, f = a / h - this.sealData.height / 2;
if (this.sealData.section) (0, u.setSectionStyle)(this.sealData.section, h, p, f); else {
(0, s.removeSealSection)(s.activeSealClassName);
var m = (new Date).getTime();
this.sealData.section = (0, s.createSealSection)(this.sealData, o, m, s.activeSealClassName, p, f, h), d.div.appendChild(this.sealData.section)
}
} else (0, s.removeSealSection)(s.activeSealClassName)
} else (0, s.removeSealSection)(s.activeSealClassName)
}
}, {
key: "createRightMenu", value: function (e) {
var t = this;
e && (e.preventDefault(), function (e, t, n) {
f();
var r = (0, c.convertScreenToViewportPoint)(t, e.pdfSidebar), i = r.pageNumber, a = r.pageX, o = r.pageY,
l = e.pdfViewer.getPageView(i - 1), u = l.viewport.scale, d = document.createElement("div");
d.id = "indicateSeal-rightMenu", d.style.position = "absolute", d.style["background-color"] = "white", d.style.border = "1px solid #999", d.style.zIndex = "200", l.viewport.width < parseFloat(a) + 94 && (a -= 94), l.viewport.height < parseFloat(o) + 70 && (o -= 70), d.style.top = o + "px", d.style.left = a + "px";
var h = document.createElement("span");
h.classList.add("menuDeleteSeal"), h.setAttribute("data-l10n-id", "menuDeleteIndicateSeal"), d.appendChild(h), h.addEventListener("contextmenu", s.eventPreventDefault), h.addEventListener("click", function () {
return n(i, a / u, o / u)
}), l.div.appendChild(d), e.l10n.translate(d)
}(this.app, e, function () {
return t.delete(e)
}))
}
}, {
key: "delete", value: function (e) {
var t = this, n = (0, c.convertScreenToViewportPoint)(e, this.app.pdfSidebar), r = n.pageNumber, a = n.pageX,
s = n.pageY, l = this.app.pdfViewer.getPageView(r - 1), u = l.viewport, d = l.pdfPage, h = u.scale;
f();
var p = {
action: "deleteAnnot",
documentId: window.KGPdfViewerWebApp.documentId,
authorName: this.defaultConfig.authorName,
page: r,
x: a / h,
y: s / h,
type: "Stamp"
}, m = window.KGPdfViewerWebApp.getTipPrompt();
return m.open("正在删除批示..."), i.myaxios.post(window.KGPdfViewerWebApp.getDocTypeUrl(), p).then(function (n) {
if (m.close(), n.data.status) {
var i = e.target.parentNode, a = i.getAttribute("data-annotation-id");
if ("IMG" === e.target.nodeName) {
for (var s = 0; s < d.textToSeals.length; s++) if (d.textToSeals[s].section.id === i.id) {
d.textToSeals.splice(s, 1);
break
}
for (var c = 0; c < t.seals.length; c++) if (t.seals[c].section.id === i.id) {
t.seals.splice(c, 1);
break
}
} else d.delAnnotions || (d.delAnnotions = {}), d.delAnnotions[a] = !0, d.reloadOperatorList = !0;
i.parentNode.removeChild(i), l.deleteStampCallback = function () {
var e = l.div.querySelector(".canvasWrapper"), n = l.div.querySelector(".textLayer");
e && l.div.removeChild(e), n && l.div.removeChild(n);
var i = t.app.pdfThumbnailViewer.getThumbnail(r - 1);
i.renderingState = o.RenderingStates.INITIAL, i.setImage(l)
}, l.renderingState = o.RenderingStates.INITIAL, l.renderingQueue.renderView(l)
} else t.app.KGAlertPrompt.open(n.data.message || "删除批示失败!")
})
}
}, {
key: "open", value: function () {
var e = this;
return this.app.secondaryToolbar.close(), new Promise(function (t) {
e.overlayManager._active.indexOf(e.overlayName) > -1 ? t() : e.overlayManager.open(e.overlayName).then(function () {
t()
})
}).then(function () {
e.nameInput.value = e.defaultConfig.name, e.numberInput.value = e.defaultConfig.number, e.colorInput.jscolor.fromString(e.defaultConfig.color.slice(1)), e.dateInput.value = (0, a.default)().format("YYYY年M月D日"), e.render()
})
}
}, {
key: "close", value: function () {
this.colorInput.jscolor.hide();
var e = document.querySelector(".layui-laydate");
return e && document.body.removeChild(e), this.overlayManager._active.indexOf(this.overlayName) > -1 ? this.overlayManager.close(this.overlayName) : Promise.resolve()
}
}]), e
}()
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PopupElement = t.AnnotationLayer = void 0;
var r = function () {
return function (e, t) {
if (Array.isArray(e)) return e;
if (Symbol.iterator in Object(e)) return function (e, t) {
var n = [], r = !0, i = !1, a = void 0;
try {
for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ;
} catch (e) {
i = !0, a = e
} finally {
try {
!r && s.return && s.return()
} finally {
if (i) throw a
}
}
return n
}(e, t);
throw new TypeError("Invalid attempt to destructure non-iterable instance")
}
}(), i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(179), o = n(180), s = n(62), l = n(2);
function c(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}
function u(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function d(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var h = function () {
function e() {
d(this, e)
}
return i(e, null, [{
key: "create", value: function (e) {
switch (e.data.annotationType) {
case o.AnnotationType.LINK:
return new m(e);
case o.AnnotationType.TEXT:
return new v(e);
case o.AnnotationType.WIDGET:
switch (e.data.fieldType) {
case"Tx":
return new y(e);
case"Btn":
if (e.data.radioButton) return new w(e);
if (e.data.checkBox) return new b(e);
(0, o.warn)("Unimplemented button widget annotation: pushbutton");
break;
case"Ch":
return new S(e)
}
return new g(e);
case o.AnnotationType.POPUP:
return new _(e);
case o.AnnotationType.LINE:
return new x(e);
case o.AnnotationType.SQUARE:
return new P(e);
case o.AnnotationType.CIRCLE:
return new C(e);
case o.AnnotationType.POLYLINE:
return new A(e);
case o.AnnotationType.POLYGON:
return new T(e);
case o.AnnotationType.HIGHLIGHT:
return new E(e);
case o.AnnotationType.UNDERLINE:
return new D(e);
case o.AnnotationType.SQUIGGLY:
return new I(e);
case o.AnnotationType.STRIKEOUT:
return new L(e);
case o.AnnotationType.STAMP:
return new O(e);
case o.AnnotationType.FILEATTACHMENT:
return new M(e);
case"prepareStamp":
return new f(e);
default:
return new p(e)
}
}
}]), e
}(), p = function () {
function e(t) {
var n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
d(this, e), this.isRenderable = n, this.data = t.data, this.layer = t.layer, this.page = t.page, this.pdfPageView = t.pdfPageView, this.viewport = t.viewport, this.linkService = t.linkService, this.downloadManager = t.downloadManager, this.imageResourcesPath = t.imageResourcesPath, this.renderInteractiveForms = t.renderInteractiveForms, this.svgFactory = t.svgFactory, "GoldGrid:AddSeal" !== this.data.subtype && "Sig" !== this.data.fieldType || (this.isRenderable = !0), this.isRenderable && (this.container = this._createContainer(r))
}
return i(e, [{
key: "_createContainer", value: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = this.data, n = this.page,
r = this.viewport, i = document.createElement("section"), s = t.rect[2] - t.rect[0],
l = t.rect[3] - t.rect[1];
i.setAttribute("data-annotation-id", t.id), i.setAttribute("data-goldGridSeal-id", t.goldGridSealId);
var c = o.Util.normalizeRect([t.rect[0], n.view[3] - t.rect[1] + n.view[1], t.rect[2], n.view[3] - t.rect[3] + n.view[1]]);
if (a.CustomStyle.setProp("transform", i, "matrix(" + r.transform.join(",") + ")"), a.CustomStyle.setProp("transformOrigin", i, -c[0] + "px " + -c[1] + "px"), !e && t.borderStyle.width > 0) {
i.style.borderWidth = t.borderStyle.width + "px", t.borderStyle.style !== o.AnnotationBorderStyleType.UNDERLINE && (s -= 2 * t.borderStyle.width, l -= 2 * t.borderStyle.width);
var u = t.borderStyle.horizontalCornerRadius, d = t.borderStyle.verticalCornerRadius;
if (u > 0 || d > 0) {
var h = u + "px / " + d + "px";
a.CustomStyle.setProp("borderRadius", i, h)
}
switch (t.borderStyle.style) {
case o.AnnotationBorderStyleType.SOLID:
i.style.borderStyle = "solid";
break;
case o.AnnotationBorderStyleType.DASHED:
i.style.borderStyle = "dashed";
break;
case o.AnnotationBorderStyleType.BEVELED:
(0, o.warn)("Unimplemented border style: beveled");
break;
case o.AnnotationBorderStyleType.INSET:
(0, o.warn)("Unimplemented border style: inset");
break;
case o.AnnotationBorderStyleType.UNDERLINE:
i.style.borderBottomStyle = "solid"
}
t.color ? i.style.borderColor = o.Util.makeCssRgb(0 | t.color[0], 0 | t.color[1], 0 | t.color[2]) : i.style.borderWidth = 0
}
return i.style.left = c[0] + "px", i.style.top = c[1] + "px", "Stamp" === t.subtype ? (i.style.width = s - 1 + "px", i.style.height = l - 1 + "px") : (i.style.width = s + "px", i.style.height = l + "px"), i
}
}, {
key: "_createPopup", value: function (e, t, n) {
t || ((t = document.createElement("div")).style.height = e.style.height, t.style.width = e.style.width, e.appendChild(t));
var r = new k({
container: e,
trigger: t,
color: n.color,
title: n.title,
contents: n.contents,
hideWrapper: !0,
viewport: this.viewport
}).render();
r.style.left = e.style.width, e.appendChild(r)
}
}, {
key: "render", value: function () {
var e = this.pdfPageView.div,
t = (e.querySelector(".canvasWrapper"), e.querySelector(".textLayer"), this.layer, this.container),
n = this.container.style.width, r = this.container.style.height,
i = (0, s.createSealNode)(this.page, this.pdfPageView, t, n, r, this);
return this.container.appendChild(i), this.container
}
}]), e
}(), f = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, (0, l.functionalJudgment)("prepareStamp")))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "stampAnnotation", window.KGPdfViewerWebApp.mobile ? (this.container.addEventListener("touchstart", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.pressStart), this.container.addEventListener("touchmove", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.pressEnd), this.container.addEventListener("touchend", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.pressEnd)) : this.container.addEventListener("contextmenu", window.KGPdfViewerWebApp.PDFViewerApplication.KGPrepareStamp.createRightMenu), this.container
}
}]), t
}(), m = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.url || e.data.dest || e.data.action);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "linkAnnotation";
var e = document.createElement("a");
return (0, a.addLinkAttributes)(e, {
url: this.data.url,
target: this.data.newWindow ? a.LinkTarget.BLANK : void 0
}), this.data.url || (this.data.action ? this._bindNamedAction(e, this.data.action) : this._bindLink(e, this.data.dest)), this.container.appendChild(e), this.container
}
}, {
key: "_bindLink", value: function (e, t) {
var n = this;
e.href = this.linkService.getDestinationHash(t), e.onclick = function () {
return t && n.linkService.navigateTo(t), !1
}, t && (e.className = "internalLink")
}
}, {
key: "_bindNamedAction", value: function (e, t) {
var n = this;
e.href = this.linkService.getAnchorUrl(""), e.onclick = function () {
return n.linkService.executeNamedAction(t), !1
}, e.className = "internalLink"
}
}]), t
}(), v = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "textAnnotation";
var e = document.createElement("img");
return e.style.height = this.container.style.height, e.style.width = this.container.style.width, e.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", e.alt = "[{{type}} Annotation]", e.dataset.l10nId = "text_annotation_type", e.dataset.l10nArgs = JSON.stringify({type: this.data.name}), this.data.hasPopup || this._createPopup(this.container, e, this.data), this.container.appendChild(e), this.container
}
}]), t
}(), g = function (e) {
function t() {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container
}
}]), t
}(), y = function (e) {
function t(e) {
d(this, t);
var n = e.renderInteractiveForms || !e.data.hasAppearance && !!e.data.fieldValue;
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "textWidgetAnnotation";
var e = null;
if (this.renderInteractiveForms) {
if (this.data.multiLine ? (e = document.createElement("textarea")).textContent = this.data.fieldValue : ((e = document.createElement("input")).type = "text", e.setAttribute("value", this.data.fieldValue)), e.disabled = this.data.readOnly, null !== this.data.maxLen && (e.maxLength = this.data.maxLen), this.data.comb) {
var t = (this.data.rect[2] - this.data.rect[0]) / this.data.maxLen;
e.classList.add("comb"), e.style.letterSpacing = "calc(" + t + "px - 1ch)"
}
} else {
(e = document.createElement("div")).textContent = this.data.fieldValue, e.style.verticalAlign = "middle", e.style.display = "table-cell";
var n = null;
this.data.fontRefName && (n = this.page.commonObjs.getData(this.data.fontRefName)), this._setTextStyle(e, n)
}
if (null !== this.data.textAlignment && (e.style.textAlign = ["left", "center", "right"][this.data.textAlignment]), !0 === window.KGPdfViewerWebApp.useTextWidget) {
var r = window.KGPdfViewerWebApp.PDFViewerApplication, i = r.KG_TextWidget, a = r.KG_TextConfirm;
i.setTextWidgetValue(this.data.fieldName, this.data.fieldValue), e.onchange = function (e) {
i.setTextWidgetValue(this.data.fieldName, e.target.value)
}.bind(this), e.onkeyup = function (e) {
a.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}, {
key: "_setTextStyle", value: function (e, t) {
var n = e.style;
if (n.fontSize = this.data.fontSize + "px", n.direction = this.data.fontDirection < 0 ? "rtl" : "ltr", t) {
n.fontWeight = t.black ? t.bold ? "900" : "bold" : t.bold ? "bold" : "normal", n.fontStyle = t.italic ? "italic" : "normal";
var r = t.loadedName ? '"' + t.loadedName + '", ' : "", i = t.fallbackName || "Helvetica, sans-serif";
n.fontFamily = r + i
}
}
}]), t
}(), b = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, e.renderInteractiveForms))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "buttonWidgetAnnotation checkBox";
var e = document.createElement("input");
if (e.disabled = this.data.readOnly, e.type = "checkbox", this.data.fieldValue && "Off" !== this.data.fieldValue && e.setAttribute("checked", !0), !0 === window.KGPdfViewerWebApp.useTextWidget) {
var t = window.KGPdfViewerWebApp.PDFViewerApplication, n = t.KG_TextWidget, r = t.KG_TextConfirm,
i = this.data.fieldValue ? this.data.fieldValue : "Off";
n.setTextWidgetValue(this.data.fieldName, i), e.onchange = function (e) {
var t = e.target.checked ? "0" : "Off";
n.setTextWidgetValue(this.data.fieldName, t), r.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}]), t
}(), w = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, e.renderInteractiveForms))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "buttonWidgetAnnotation radioButton";
var e = document.createElement("input");
if (e.disabled = this.data.readOnly, e.type = "radio", e.name = this.data.fieldName, e.value = this.data.buttonValue, this.data.fieldValue === this.data.buttonValue && e.setAttribute("checked", !0), !0 === window.KGPdfViewerWebApp.useTextWidget) {
var t = window.KGPdfViewerWebApp.PDFViewerApplication, n = t.KG_TextWidget, r = t.KG_TextConfirm,
i = this.data.fieldValue ? this.data.fieldValue : "-1";
n.setTextWidgetValue(this.data.fieldName, i), e.onchange = function (e) {
n.setTextWidgetValue(this.data.fieldName, e.target.value), r.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}]), t
}(), S = function (e) {
function t(e) {
return d(this, t), c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, e.renderInteractiveForms))
}
return u(t, g), i(t, [{
key: "render", value: function () {
this.container.className = "choiceWidgetAnnotation";
var e = document.createElement("select");
e.disabled = this.data.readOnly, this.data.combo || (e.size = this.data.options.length, this.data.multiSelect && (e.multiple = !0));
for (var t = 0, n = this.data.options.length; t < n; t++) {
var r = this.data.options[t], i = document.createElement("option");
i.textContent = r.displayValue, i.value = r.exportValue, this.data.fieldValue.indexOf(r.displayValue) >= 0 && i.setAttribute("selected", !0), e.appendChild(i)
}
if (!0 === window.KGPdfViewerWebApp.useTextWidget) {
var a = window.KGPdfViewerWebApp.PDFViewerApplication, o = a.KG_TextWidget, s = a.KG_TextConfirm;
o.setTextWidgetValue(this.data.fieldName, this.data.fieldValue[0]), e.onchange = function (e) {
o.setTextWidgetValue(this.data.fieldName, e.target.value), s.show()
}.bind(this)
}
return this.container.appendChild(e), this.container
}
}]), t
}(), _ = function (e) {
function t(e) {
d(this, t);
var n = !(!e.data.title && !e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))
}
return u(t, p), i(t, [{
key: "render", value: function () {
if (this.container.className = "popupAnnotation", ["Line", "Square", "Circle", "PolyLine", "Polygon"].indexOf(this.data.parentType) >= 0) return this.container;
var e = '[data-annotation-id="' + this.data.parentId + '"]', t = this.layer.querySelector(e);
if (!t) return this.container;
var n = new k({
container: this.container,
trigger: t,
color: this.data.color,
title: this.data.title,
contents: this.data.contents
}), r = parseFloat(t.style.left), i = parseFloat(t.style.width);
return a.CustomStyle.setProp("transformOrigin", this.container, -(r + i) + "px -" + t.style.top), this.container.style.left = r + i + "px", this.container.appendChild(n.render()), this.container
}
}]), t
}(), k = function () {
function e(t) {
d(this, e), this.container = t.container, this.trigger = t.trigger, this.color = t.color, this.title = t.title, this.contents = t.contents, this.hideWrapper = t.hideWrapper || !1, this.viewport = t.viewport, this.pinned = !1
}
return i(e, [{
key: "render", value: function () {
var e = document.createElement("div");
e.className = "popupWrapper", this.hideElement = this.hideWrapper ? e : this.container, this.hideElement.setAttribute("hidden", !0);
var t = document.createElement("div");
t.className = "popup", t.style.fontSize = "14px";
var n = this.color;
if (n) {
var r = .7 * (255 - n[0]) + n[0], i = .7 * (255 - n[1]) + n[1], a = .7 * (255 - n[2]) + n[2];
t.style.backgroundColor = o.Util.makeCssRgb(0 | r, 0 | i, 0 | a)
}
var s = this._formatContents(this.contents), l = document.createElement("h1");
return l.textContent = this.title, this.trigger.addEventListener("click", this._toggle.bind(this)), this.trigger.addEventListener("mouseover", this._show.bind(this, !1)), this.trigger.addEventListener("mouseout", this._hide.bind(this, !1)), t.addEventListener("click", this._hide.bind(this, !0)), t.appendChild(l), t.appendChild(s), e.appendChild(t), e
}
}, {
key: "_formatContents", value: function (e) {
for (var t = document.createElement("p"), n = e.split(/(?:\r\n?|\n)/), r = 0, i = n.length; r < i; ++r) {
var a = n[r];
t.appendChild(document.createTextNode(a)), r < i - 1 && t.appendChild(document.createElement("br"))
}
return t
}
}, {
key: "_toggle", value: function () {
this.pinned ? this._hide(!0) : this._show(!0)
}
}, {
key: "_show", value: function () {
if (arguments.length > 0 && void 0 !== arguments[0] && arguments[0] && (this.pinned = !0), this.hideElement.hasAttribute("hidden") && (this.hideElement.removeAttribute("hidden"), this.container.style.zIndex += 1, this.viewport)) {
var e = Number(this.container.style.width.slice(0, -2)), t = Number(this.container.style.height.slice(0, -2)),
n = Number(this.container.style.left.slice(0, -2)), r = Number(this.container.style.top.slice(0, -2)),
i = this.viewport.viewBox[2], a = this.viewport.viewBox[3], o = this.viewport.scale;
e + n + 50 > i && (this.hideElement.style.left = "-" + (this.hideElement.querySelector(".popup").offsetWidth + 5 * o) + "px"), t + r + 50 > a && (this.hideElement.style.top = "-" + t + "px")
}
}
}, {
key: "_hide", value: function () {
(!(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]) && (this.pinned = !1), this.hideElement.hasAttribute("hidden") || this.pinned || (this.hideElement.setAttribute("hidden", !0), this.container.style.zIndex -= 1)
}
}]), e
}(), x = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents), r = window.KGPdfViewerWebApp.globalAnnotation;
r && (n = -1 == (r.hideList || []).indexOf(e.data.title));
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "lineAnnotation";
var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], i = this.svgFactory.create(t, n),
a = this.svgFactory.createElement("line"), o = r(e.lineCoordinates, 4), s = o[0], l = o[1], c = o[2],
u = o[3], d = void 0, h = void 0, p = void 0, f = void 0;
l < u && s < c ? (d = e.rect[2] - c, p = e.rect[2] - s, h = e.rect[3] - l, f = e.rect[3] - u) : (d = e.rect[2] - s, p = e.rect[2] - c, h = e.rect[3] - u, f = e.rect[3] - l), a.setAttribute("x1", d), a.setAttribute("y1", h), a.setAttribute("x2", p), a.setAttribute("y2", f), a.setAttribute("stroke-width", e.borderStyle.width), a.setAttribute("stroke", "transparent");
var m = r(e.color, 3), v = m[0], g = m[1], y = m[2];
return this.container.setAttribute("data-rgb", "rgb(" + v + "," + g + "," + y + ")"), this.container.setAttribute("data-author", e.title), i.appendChild(a), this.container.appendChild(i), this.container
}
}]), t
}(), P = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents), r = window.KGPdfViewerWebApp.globalAnnotation;
r && (n = -1 == (r.hideList || []).indexOf(e.data.title));
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "squareAnnotation";
var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], i = this.svgFactory.create(t, n),
a = e.borderStyle.width, o = this.svgFactory.createElement("rect");
o.setAttribute("x", a / 2), o.setAttribute("y", a / 2), o.setAttribute("width", t - a), o.setAttribute("height", n - a), o.setAttribute("stroke-width", a), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "none");
var s = r(e.color, 3), l = s[0], c = s[1], u = s[2];
return this.container.setAttribute("data-rgb", "rgb(" + l + "," + c + "," + u + ")"), this.container.setAttribute("data-author", e.title), i.appendChild(o), this.container.appendChild(i), this.container
}
}]), t
}(), C = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents), r = window.KGPdfViewerWebApp.globalAnnotation;
r && (n = -1 == (r.hideList || []).indexOf(e.data.title));
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "circleAnnotation";
var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], i = this.svgFactory.create(t, n),
a = e.borderStyle.width, o = this.svgFactory.createElement("ellipse");
o.setAttribute("cx", t / 2), o.setAttribute("cy", n / 2), o.setAttribute("rx", t / 2 - a / 2), o.setAttribute("ry", n / 2 - a / 2), o.setAttribute("stroke-width", a), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "none");
var s = r(e.color, 3), l = s[0], c = s[1], u = s[2];
return this.container.setAttribute("data-rgb", "rgb(" + l + "," + c + "," + u + ")"), this.container.setAttribute("data-author", e.title), i.appendChild(o), this.container.appendChild(i), this.container
}
}]), t
}(), A = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents),
r = c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0));
return r.containerClassName = "polylineAnnotation", r.svgElementName = "svg:polyline", r
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = this.containerClassName;
for (var e = this.data, t = e.rect[2] - e.rect[0], n = e.rect[3] - e.rect[1], r = this.svgFactory.create(t, n), i = e.vertices, a = [], o = 0, s = i.length; o < s; o++) {
var l = i[o].x - e.rect[0], c = e.rect[3] - i[o].y;
a.push(l + "," + c)
}
a = a.join(" ");
var u = e.borderStyle.width, d = this.svgFactory.createElement(this.svgElementName);
return d.setAttribute("points", a), d.setAttribute("stroke-width", u), d.setAttribute("stroke", "transparent"), d.setAttribute("fill", "none"), r.appendChild(d), this.container.append(r), this._createPopup(this.container, d, e), this.container
}
}]), t
}(), T = function (e) {
function t(e) {
d(this, t);
var n = c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.containerClassName = "polygonAnnotation", n.svgElementName = "svg:polygon", n
}
return u(t, A), t
}(), E = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "highlightAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), D = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "underlineAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), I = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "squigglyAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), L = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
return this.container.className = "strikeoutAnnotation", this.data.hasPopup || this._createPopup(this.container, null, this.data), this.container
}
}]), t
}(), O = function (e) {
function t(e) {
d(this, t);
var n = !!(e.data.hasPopup || e.data.title || e.data.contents);
return c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, !0))
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "stampAnnotation";
var e = this.data.color;
if (e && (this.container.setAttribute("data-color", "rgb(" + e[0] + ", " + e[1] + ", " + e[2] + ")"), this.container.childNododes || this.container.classList.add("stamp-mask-annotation")), window.KGPdfViewerWebApp.indicateSeal) if (0 == window.KGPdfViewerWebApp.mobile) this.container.addEventListener("contextmenu", window.KGPdfViewerWebApp.PDFViewerApplication.KG_IndicateSeal.createRightMenu); else {
var t = null;
this.container.addEventListener("contextmenu", function (e) {
e.preventDefault(), e.stopPropagation()
}), this.container.addEventListener("touchstart", function (e) {
t = setTimeout(function () {
window.KGPdfViewerWebApp.PDFViewerApplication.KG_IndicateSeal.createRightMenu(e)
}, 500)
}), this.container.addEventListener("touchend", function () {
clearTimeout(t)
})
}
return this.container
}
}]), t
}(), M = function (e) {
function t(e) {
d(this, t);
var n = c(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, !0)), r = n.data.file;
return n.filename = (0, a.getFilenameFromUrl)(r.filename), n.content = r.content, n.linkService.onFileAttachmentAnnotation({
id: (0, o.stringToPDFString)(r.filename),
filename: r.filename,
content: r.content
}), n
}
return u(t, p), i(t, [{
key: "render", value: function () {
this.container.className = "fileAttachmentAnnotation";
var e = document.createElement("div");
return e.style.height = this.container.style.height, e.style.width = this.container.style.width, e.addEventListener("dblclick", this._download.bind(this)), this.data.hasPopup || !this.data.title && !this.data.contents || this._createPopup(this.container, e, this.data), this.container.appendChild(e), this.container
}
}, {
key: "_download", value: function () {
this.downloadManager ? this.downloadManager.downloadData(this.content, this.filename, "") : (0, o.warn)("Download cannot be started due to unavailable download manager")
}
}]), t
}(), N = function () {
function e() {
d(this, e)
}
return i(e, null, [{
key: "render", value: function (e) {
for (var t = 0, n = e.annotations.length; t < n; t++) {
var r = e.annotations[t];
if (r) {
var i = h.create({
data: r,
layer: e.div,
page: e.page,
pdfPageView: e.pdfPageView,
viewport: e.viewport,
linkService: e.linkService,
downloadManager: e.downloadManager,
imageResourcesPath: e.imageResourcesPath || (0, a.getDefaultSetting)("imageResourcesPath"),
renderInteractiveForms: e.renderInteractiveForms || !1,
svgFactory: new a.DOMSVGFactory
});
i.isRenderable && e.div.appendChild(i.render())
}
}
}
}, {
key: "update", value: function (e) {
for (var t = 0, n = e.annotations.length; t < n; t++) {
var r = e.annotations[t], i = e.div.querySelector('[data-annotation-id="' + r.id + '"]');
i && a.CustomStyle.setProp("transform", i, "matrix(" + e.viewport.transform.join(",") + ")")
}
e.div.removeAttribute("hidden")
}
}]), e
}();
t.AnnotationLayer = N, t.PopupElement = k
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_SealPreLocation = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(62), a = n(2);
var o = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.seal = null, this.annotId = null, this.hasStamp = !1, this.previewMultipleStampConfig = window.KGPdfViewerWebApp.multipleStamp, window.KGPdfViewerWebApp.multipleStamp = !1
}
return r(e, [{
key: "renderPreSeal", value: function (e) {
this.seal = e, "mm" === e.unit && (e.width = (0, a.mmCovertToPx)(e.width), e.height = (0, a.mmCovertToPx)(e.height), e.left = (0, a.mmCovertToPx)(e.left), e.top = (0, a.mmCovertToPx)(e.top)), e.left = e.left - e.width / 2, e.top = e.top - e.height / 2, this.createPreSealSection()
}
}, {
key: "createPreSealSection", value: function () {
var e = this.seal, t = this.app.pdfViewer.getPageView(e.page - 1), n = t.viewport.scale,
r = (new Date).getTime();
this.annotId = r;
var i = this.app.pdfStamp._createSection(e, r, r, "", e.left, e.top, n);
t.pdfPage.newStamps[r] = i, this.app.pdfStamp.updatePageView(t, i)
}
}, {
key: "deletePreSeal", value: function () {
var e = this.app, t = e.pdfViewer.getPageView(this.seal.page - 1), n = t.pdfPage,
r = document.getElementById(this.annotId);
(0, i.deleteOneSeal)(t, e, n, r)
}
}]), e
}();
t.KG_SealPreLocation = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_RotateDocument = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(183), a = n(2);
function o(e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
return n
}
return Array.from(e)
}
var s = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.intercept = this.intercept.bind(this), this.updateStyle = this.updateStyle.bind(this), this.disableButtons = this.disableButtons.bind(this), this.listenRotatePages = this.listenRotatePages.bind(this), this.displayRotateButton = this.displayRotateButton.bind(this), this.viewer = document.getElementById("viewer"), this.viewerContainer = document.getElementById("viewerContainer"), this.toolbarWrapper = document.getElementById("toolbarWrapper"), this.secondaryToolbarWrapper = document.getElementById("secondaryToolbarWrapper"), this.viewerContainer.addEventListener("click", this.intercept), this.toolbarWrapper.addEventListener("click", this.intercept), this.secondaryToolbarWrapper.addEventListener("click", this.intercept), this.disableList = [].concat(o(this.toolbarWrapper.children), o(this.secondaryToolbarWrapper.children)), this.init()
}
return r(e, [{
key: "init", value: function () {
var e = this;
this.listenRotatePages(), this.displayRotateButton(), this.initialRotation = this.app.pdfViewer.getPageView(0).rotation, this.prompt = new i.KG_ModalFactory(this.app, this.app.overlayManager, {
overlayName: "KG_RotateDocumentModalOverlay",
message: "当前文档已被旋转过且未还原,请还原后再操作!",
width: 320,
buttons: [{
content: "还原", callback: function () {
var t = e.app.pdfViewer.getPageView(0).rotation;
if (t != e.initialRotation) {
var n = (e.initialRotation - t) % 360;
e.app.rotatePages(n)
}
}, type: "primary"
}, {
content: "关闭", callback: function () {
}
}]
})
}
}, {
key: "listenRotatePages", value: function () {
var e = this;
this.app.rotatePages = (0, a.proxyFunction)("after", this.app.rotatePages, function () {
var t = e.app.pdfViewer.getPageView(0).rotation, n = e.initialRotation != t;
e.updateStyle(n, e.viewer), e.disableButtons(n)
})
}
}, {
key: "disableButtons", value: function (e) {
var t = this;
e ? (this.toolbarWrapper.style.cursor = "pointer", this.secondaryToolbarWrapper.style.cursor = "pointer") : (this.toolbarWrapper.style.cursor = "default", this.secondaryToolbarWrapper.style.cursor = "default"), this.disableList.map(function (n) {
t.updateStyle(e, n)
})
}
}, {
key: "intercept", value: function () {
var e = this.app.pdfViewer.getPageView(0).rotation, t = this.initialRotation != e;
this.updateStyle(t, this.viewer), t && this.prompt.open()
}
}, {
key: "updateStyle", value: function (e, t) {
t.style["pointer-events"] = e ? "none" : "auto"
}
}, {
key: "displayRotateButton", value: function () {
["pageRotateCw", "pageRotateCcw"].map(function (e) {
var t = ".toolbarButton." + e, n = document.querySelector(t);
n.removeAttribute("hidden"), n.addEventListener("click", function () {
return document.getElementById(e).click()
})
})
}
}]), e
}();
t.KG_RotateDocument = s
}, function (e, t, n) {
"use strict";
var r = n(454), i = n(87), a = n(87), o = n(38).buildOptions, s = n(456);
t.parse = function (e, t, n) {
if (n) {
!0 === n && (n = {});
var l = s.validate(e, n);
if (!0 !== l) throw Error(l.err.msg)
}
t = o(t, a.defaultOptions, a.props);
var c = i.getTraversalObj(e, t);
return r.convertToJson(c, t)
}, t.convertTonimn = n(457).convert2nimn, t.getTraversalObj = i.getTraversalObj, t.convertToJson = r.convertToJson, t.convertToJsonString = n(458).convertToJsonString, t.validate = s.validate, t.j2xParser = n(459), t.parseToNimn = function (e, n, r) {
return t.convertTonimn(t.getTraversalObj(e, r), n, r)
}
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(38);
t.convertToJson = function e(t, n) {
var a = {};
if (!(t.child && !i.isEmptyObject(t.child) || t.attrsMap && !i.isEmptyObject(t.attrsMap))) return i.isExist(t.val) ? t.val : "";
i.isExist(t.val) && ("string" != typeof t.val || "" !== t.val && t.val !== n.cdataPositionChar) && ("strict" === n.arrayMode ? a[n.textNodeName] = [t.val] : a[n.textNodeName] = t.val), i.merge(a, t.attrsMap, n.arrayMode);
for (var o = Object.keys(t.child), s = 0; s < o.length; s++) {
var l = o[s];
if (t.child[l] && t.child[l].length > 1) for (var c in a[l] = [], t.child[l]) t.child[l].hasOwnProperty(c) && a[l].push(e(t.child[l][c], n)); else if (!0 === n.arrayMode) {
var u = e(t.child[l][0], n);
"object" === (void 0 === u ? "undefined" : r(u)) ? a[l] = [u] : a[l] = u
} else "strict" === n.arrayMode ? a[l] = [e(t.child[l][0], n)] : a[l] = e(t.child[l][0], n)
}
return a
}
}, function (e, t, n) {
"use strict";
e.exports = function (e, t, n) {
this.tagname = e, this.parent = t, this.child = {}, this.attrsMap = {}, this.val = n, this.addChild = function (e) {
Array.isArray(this.child[e.tagname]) ? this.child[e.tagname].push(e) : this.child[e.tagname] = [e]
}
}
}, function (e, t, n) {
"use strict";
var r = n(38), i = {allowBooleanAttributes: !1}, a = ["allowBooleanAttributes"];
function o(e, t) {
for (var n = t; t < e.length; t++) if ("?" != e[t] && " " != e[t]) ; else {
var r = e.substr(n, t - n);
if (t > 5 && "xml" === r) return f("InvalidXml", "XML declaration allowed only at the start of the document.", v(e, t));
if ("?" == e[t] && ">" == e[t + 1]) {
t++;
break
}
}
return t
}
function s(e, t) {
if (e.length > t + 5 && "-" === e[t + 1] && "-" === e[t + 2]) {
for (t += 3; t < e.length; t++) if ("-" === e[t] && "-" === e[t + 1] && ">" === e[t + 2]) {
t += 2;
break
}
} else if (e.length > t + 8 && "D" === e[t + 1] && "O" === e[t + 2] && "C" === e[t + 3] && "T" === e[t + 4] && "Y" === e[t + 5] && "P" === e[t + 6] && "E" === e[t + 7]) {
var n = 1;
for (t += 8; t < e.length; t++) if ("<" === e[t]) n++; else if (">" === e[t] && 0 === --n) break
} else if (e.length > t + 9 && "[" === e[t + 1] && "C" === e[t + 2] && "D" === e[t + 3] && "A" === e[t + 4] && "T" === e[t + 5] && "A" === e[t + 6] && "[" === e[t + 7]) for (t += 8; t < e.length; t++) if ("]" === e[t] && "]" === e[t + 1] && ">" === e[t + 2]) {
t += 2;
break
}
return t
}
t.validate = function (e, t) {
t = r.buildOptions(t, i, a);
var n, l = [], c = !1, d = !1;
"\ufeff" === e[0] && (e = e.substr(1));
for (var m = 0; m < e.length; m++) {
if ("<" !== e[m]) {
if (" " === e[m] || "\t" === e[m] || "\n" === e[m] || "\r" === e[m]) continue;
return f("InvalidChar", "char '" + e[m] + "' is not expected.", v(e, m))
}
if ("?" === e[++m]) {
if ((m = o(e, ++m)).err) return m
} else {
if ("!" === e[m]) {
m = s(e, m);
continue
}
var g = !1;
"/" === e[m] && (g = !0, m++);
for (var y = ""; m < e.length && ">" !== e[m] && " " !== e[m] && "\t" !== e[m] && "\n" !== e[m] && "\r" !== e[m]; m++) y += e[m];
if ("/" === (y = y.trim())[y.length - 1] && (y = y.substring(0, y.length - 1), m--), n = y, !r.isName(n)) {
return f("InvalidTag", 0 === y.trim().length ? "There is an unnecessary space between tag name and backward slash '</ ..'." : "Tag '" + y + "' is an invalid name.", v(e, m))
}
var b = u(e, m);
if (!1 === b) return f("InvalidAttr", "Attributes for '" + y + "' have open quote.", v(e, m));
var w = b.value;
if (m = b.index, "/" === w[w.length - 1]) {
var S = h(w = w.substring(0, w.length - 1), t);
if (!0 !== S) return f(S.err.code, S.err.msg, v(e, m - w.length + S.err.line));
c = !0
} else if (g) {
if (!b.tagClosed) return f("InvalidTag", "Closing tag '" + y + "' doesn't have proper closing.", v(e, m));
if (w.trim().length > 0) return f("InvalidTag", "Closing tag '" + y + "' can't have attributes or invalid starting.", v(e, m));
var _ = l.pop();
if (y !== _) return f("InvalidTag", "Closing tag '" + _ + "' is expected inplace of '" + y + "'.", v(e, m));
0 == l.length && (d = !0)
} else {
var k = h(w, t);
if (!0 !== k) return f(k.err.code, k.err.msg, v(e, m - w.length + k.err.line));
if (!0 === d) return f("InvalidXml", "Multiple possible root nodes found.", v(e, m));
l.push(y), c = !0
}
for (m++; m < e.length; m++) {
if ("<" === e[m]) {
if ("!" === e[m + 1]) {
m = s(e, ++m);
continue
}
break
}
if ("&" === e[m]) {
var x = p(e, m);
if (-1 == x) return f("InvalidChar", "char '&' is not expected.", v(e, m));
m = x
}
}
"<" === e[m] && m--
}
}
return c ? !(l.length > 0) || f("InvalidXml", "Invalid '" + JSON.stringify(l, null, 4).replace(/\r?\n/g, "") + "' found.", 1) : f("InvalidXml", "Start tag expected.", 1)
};
var l = '"', c = "'";
function u(e, t) {
for (var n = "", r = "", i = !1; t < e.length; t++) {
if (e[t] === l || e[t] === c) if ("" === r) r = e[t]; else {
if (r !== e[t]) continue;
r = ""
} else if (">" === e[t] && "" === r) {
i = !0;
break
}
n += e[t]
}
return "" === r && {value: n, index: t, tagClosed: i}
}
var d = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
function h(e, t) {
for (var n = r.getAllMatches(e, d), i = {}, a = 0; a < n.length; a++) {
if (0 === n[a][1].length) return f("InvalidAttr", "Attribute '" + n[a][2] + "' has no space in starting.", g(e, n[a][0]));
if (void 0 === n[a][3] && !t.allowBooleanAttributes) return f("InvalidAttr", "boolean attribute '" + n[a][2] + "' is not allowed.", g(e, n[a][0]));
var o = n[a][2];
if (!m(o)) return f("InvalidAttr", "Attribute '" + o + "' is an invalid name.", g(e, n[a][0]));
if (i.hasOwnProperty(o)) return f("InvalidAttr", "Attribute '" + o + "' is repeated.", g(e, n[a][0]));
i[o] = 1
}
return !0
}
function p(e, t) {
if (";" === e[++t]) return -1;
if ("#" === e[t]) return function (e, t) {
var n = /\d/;
for ("x" === e[t] && (t++, n = /[\da-fA-F]/); t < e.length; t++) {
if (";" === e[t]) return t;
if (!e[t].match(n)) break
}
return -1
}(e, ++t);
for (var n = 0; t < e.length; t++, n++) if (!(e[t].match(/\w/) && n < 20)) {
if (";" === e[t]) break;
return -1
}
return t
}
function f(e, t, n) {
return {err: {code: e, msg: t, line: n}}
}
function m(e) {
return r.isName(e)
}
function v(e, t) {
return e.substring(0, t).split(/\r?\n/).length
}
function g(e, t) {
return e.indexOf(t) + t.length
}
}, function (e, t, n) {
"use strict";
var r = function (e) {
return String.fromCharCode(e)
}, i = {
nilChar: r(176),
missingChar: r(201),
nilPremitive: r(175),
missingPremitive: r(200),
emptyChar: r(178),
emptyValue: r(177),
boundryChar: r(179),
objStart: r(198),
arrStart: r(204),
arrayEnd: r(185)
},
a = [i.nilChar, i.nilPremitive, i.missingChar, i.missingPremitive, i.boundryChar, i.emptyChar, i.emptyValue, i.arrayEnd, i.objStart, i.arrStart],
o = function e(t, n, r) {
if ("string" == typeof n) return t && t[0] && void 0 !== t[0].val ? s(t[0].val, n) : s(t, n);
var a,
o = void 0 === (a = t) ? i.missingChar : null === a ? i.nilChar : !(a.child && 0 === Object.keys(a.child).length && (!a.attrsMap || 0 === Object.keys(a.attrsMap).length)) || i.emptyChar;
if (!0 === o) {
var c = "";
if (Array.isArray(n)) {
c += i.arrStart;
var u = n[0], d = t.length;
if ("string" == typeof u) for (var h = 0; h < d; h++) {
var p = s(t[h].val, u);
c = l(c, p)
} else for (var f = 0; f < d; f++) {
var m = e(t[f], u, r);
c = l(c, m)
}
c += i.arrayEnd
} else {
c += i.objStart;
var v = Object.keys(n);
for (var g in Array.isArray(t) && (t = t[0]), v) {
var y = v[g], b = void 0;
b = !r.ignoreAttributes && t.attrsMap && t.attrsMap[y] ? e(t.attrsMap[y], n[y], r) : y === r.textNodeName ? e(t.val, n[y], r) : e(t.child[y], n[y], r), c = l(c, b)
}
}
return c
}
return o
}, s = function (e) {
switch (e) {
case void 0:
return i.missingPremitive;
case null:
return i.nilPremitive;
case"":
return i.emptyValue;
default:
return e
}
}, l = function (e, t) {
return c(t[0]) || c(e[e.length - 1]) || (e += i.boundryChar), e + t
}, c = function (e) {
return -1 !== a.indexOf(e)
};
var u = n(87), d = n(38).buildOptions;
t.convert2nimn = function (e, t, n) {
return n = d(n, u.defaultOptions, u.props), o(e, t, n)
}
}, function (e, t, n) {
"use strict";
var r = n(38), i = n(38).buildOptions, a = n(87), o = function e(t, n, i) {
for (var a, o = "{", s = Object.keys(t.child), l = 0; l < s.length; l++) {
var c = s[l];
if (t.child[c] && t.child[c].length > 1) {
for (var u in o += '"' + c + '" : [ ', t.child[c]) o += e(t.child[c][u], n) + " , ";
o = o.substr(0, o.length - 1) + " ] "
} else o += '"' + c + '" : ' + e(t.child[c][0], n) + " ,"
}
return r.merge(o, t.attrsMap), r.isEmptyObject(o) ? r.isExist(t.val) ? t.val : "" : (r.isExist(t.val) && ("string" != typeof t.val || "" !== t.val && t.val !== n.cdataPositionChar) && (o += '"' + n.textNodeName + '" : ' + (!0 !== (a = t.val) && !1 !== a && isNaN(a) ? '"' + a + '"' : a)), "," === o[o.length - 1] && (o = o.substr(0, o.length - 2)), o + "}")
};
t.convertToJsonString = function (e, t) {
return (t = i(t, a.defaultOptions, a.props)).indentBy = t.indentBy || "", o(e, t, 0)
}
}, function (e, t, n) {
"use strict";
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = n(38).buildOptions, a = {
attributeNamePrefix: "@_",
attrNodeName: !1,
textNodeName: "#text",
ignoreAttributes: !0,
cdataTagName: !1,
cdataPositionChar: "\\c",
format: !1,
indentBy: " ",
supressEmptyNode: !1,
tagValueProcessor: function (e) {
return e
},
attrValueProcessor: function (e) {
return e
}
},
o = ["attributeNamePrefix", "attrNodeName", "textNodeName", "ignoreAttributes", "cdataTagName", "cdataPositionChar", "format", "indentBy", "supressEmptyNode", "tagValueProcessor", "attrValueProcessor"];
function s(e) {
this.options = i(e, a, o), this.options.ignoreAttributes || this.options.attrNodeName ? this.isAttribute = function () {
return !1
} : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = m), this.options.cdataTagName ? this.isCDATA = v : this.isCDATA = function () {
return !1
}, this.replaceCDATAstr = l, this.replaceCDATAarr = c, this.options.format ? (this.indentate = f, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function () {
return ""
}, this.tagEndChar = ">", this.newLine = ""), this.options.supressEmptyNode ? (this.buildTextNode = p, this.buildObjNode = d) : (this.buildTextNode = h, this.buildObjNode = u), this.buildTextValNode = h, this.buildObjectNode = u
}
function l(e, t) {
return e = this.options.tagValueProcessor("" + e), "" === this.options.cdataPositionChar || "" === e ? e + "<![CDATA[" + t + "]]" + this.tagEndChar : e.replace(this.options.cdataPositionChar, "<![CDATA[" + t + "]]" + this.tagEndChar)
}
function c(e, t) {
if (e = this.options.tagValueProcessor("" + e), "" === this.options.cdataPositionChar || "" === e) return e + "<![CDATA[" + t.join("]]><![CDATA[") + "]]" + this.tagEndChar;
for (var n in t) e = e.replace(this.options.cdataPositionChar, "<![CDATA[" + t[n] + "]]>");
return e + this.newLine
}
function u(e, t, n, r) {
return n && !e.includes("<") ? this.indentate(r) + "<" + t + n + ">" + e + "</" + t + this.tagEndChar : this.indentate(r) + "<" + t + n + this.tagEndChar + e + this.indentate(r) + "</" + t + this.tagEndChar
}
function d(e, t, n, r) {
return "" !== e ? this.buildObjectNode(e, t, n, r) : this.indentate(r) + "<" + t + n + "/" + this.tagEndChar
}
function h(e, t, n, r) {
return this.indentate(r) + "<" + t + n + ">" + this.options.tagValueProcessor(e) + "</" + t + this.tagEndChar
}
function p(e, t, n, r) {
return "" !== e ? this.buildTextValNode(e, t, n, r) : this.indentate(r) + "<" + t + n + "/" + this.tagEndChar
}
function f(e) {
return this.options.indentBy.repeat(e)
}
function m(e) {
return !!e.startsWith(this.options.attributeNamePrefix) && e.substr(this.attrPrefixLen)
}
function v(e) {
return e === this.options.cdataTagName
}
s.prototype.parse = function (e) {
return this.j2x(e, 0).val
}, s.prototype.j2x = function (e, t) {
for (var n = "", i = "", a = Object.keys(e), o = a.length, s = 0; s < o; s++) {
var l = a[s];
if (void 0 === e[l]) ; else if (null === e[l]) i += this.indentate(t) + "<" + l + "/" + this.tagEndChar; else if (e[l] instanceof Date) i += this.buildTextNode(e[l], l, "", t); else if ("object" !== r(e[l])) {
var c = this.isAttribute(l);
c ? n += " " + c + '="' + this.options.attrValueProcessor("" + e[l]) + '"' : this.isCDATA(l) ? e[this.options.textNodeName] ? i += this.replaceCDATAstr(e[this.options.textNodeName], e[l]) : i += this.replaceCDATAstr("", e[l]) : l === this.options.textNodeName ? e[this.options.cdataTagName] || (i += this.options.tagValueProcessor("" + e[l])) : i += this.buildTextNode(e[l], l, "", t)
} else if (Array.isArray(e[l])) if (this.isCDATA(l)) i += this.indentate(t), e[this.options.textNodeName] ? i += this.replaceCDATAarr(e[this.options.textNodeName], e[l]) : i += this.replaceCDATAarr("", e[l]); else for (var u = e[l].length, d = 0; d < u; d++) {
var h = e[l][d];
if (void 0 === h) ; else if (null === h) i += this.indentate(t) + "<" + l + "/" + this.tagEndChar; else if ("object" === (void 0 === h ? "undefined" : r(h))) {
var p = this.j2x(h, t + 1);
i += this.buildObjNode(p.val, l, p.attrStr, t)
} else i += this.buildTextNode(h, l, "", t)
} else if (this.options.attrNodeName && l === this.options.attrNodeName) for (var f = Object.keys(e[l]), m = f.length, v = 0; v < m; v++) n += " " + f[v] + '="' + this.options.attrValueProcessor("" + e[l][f[v]]) + '"'; else {
var g = this.j2x(e[l], t + 1);
i += this.buildObjNode(g.val, l, g.attrStr, t)
}
}
return {attrStr: n, val: i}
}, e.exports = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r, i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, a = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), o = n(461), s = (r = o) && r.__esModule ? r : {default: r}, l = n(462), c = n(186), u = n(2), d = n(176);
var h = {
printerList: [],
fileDownloadUrl: "",
clientServiceCallbackUrl: "",
showPannel: !1,
print: {copies: 1, maxCopies: -1, printerName: "", pageArea: "", signStatus: 1, printType: 0, collateCopies: !1},
watermark: {
rotate: 0,
fontName: "",
fontSize: "",
fontColor: "rgb(0, 0, 0)",
x: 0,
y: 0,
image: "",
opacity: 1,
density: 0,
creator: window.KGPdfViewerWebApp.userId,
downloadMarker: !0,
marker: "金格科技",
showMarkerPanel: !0
},
path: "",
customParam: "",
before: function (e) {
return console.log("[准备打印]", e), !0
},
success: function (e, t) {
console.log("[打印成功]", e, t)
},
error: function (e, t) {
console.log("[打印失败]", e, t)
}
}, p = function (e) {
var t = Object.assign({}, e), n = t.fontColor;
if (0 != n.indexOf("#")) {
n = n.match(/\((.+?)\)/g).toString().replace("(", "").replace(")", "").split(",")
} else n = (0, u.convertHex)(n.slice(1));
return {
path: t.path,
downloadGrayStamp: t.signStatus,
downloadMarker: t.downloadMarker,
marker: t.marker,
creator: t.creator,
fontName: t.fontName,
fontSize: t.fontSize,
rotation: t.rotate,
red: n[0],
green: n[1],
blue: n[2],
alpha: 255 * t.opacity,
x: t.x,
y: t.y,
density: t.density,
image: t.image
}
}, f = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.SRComponent = new c.SRComponent({
onError: function (e) {
return Promise.reject(e)
}
});
var n = {};
"object" === i(t.KGPdfViewerWebApp.surreadPrint) && Object.assign(n, t.KGPdfViewerWebApp.surreadPrint), t.KGPdfViewerWebApp.surreadPrint = h, this.combineConfig(n), this.initPageArea = this.app.KGPdfViewerWebApp.surreadPrint.print.pageArea, this.initPrintType = this.app.KGPdfViewerWebApp.surreadPrint.print.printType
}
return a(e, [{
key: "combineConfig", value: function (e) {
var t = this;
Object.keys(e).forEach(function (n) {
switch (n) {
case"customParam":
if (s.default.isString(e.customParam)) t.app.KGPdfViewerWebApp.surreadPrint.customParam = e.customParam; else {
var r = "[打印参数配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(r)
}
break;
case"before":
if (s.default.isFunction(e.before)) t.app.KGPdfViewerWebApp.surreadPrint.before = e.before; else {
var i = "[打印参数配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(i)
}
break;
case"success":
if (s.default.isFunction(e.success)) t.app.KGPdfViewerWebApp.surreadPrint.success = e.success; else {
var a = "[打印参数配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(a)
}
break;
case"error":
if (s.default.isFunction(e.error)) t.app.KGPdfViewerWebApp.surreadPrint.error = e.error; else {
var o = "[打印参数配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(o)
}
break;
case"print":
if (s.default.isPlainObject(e.print)) Object.keys(h.print).forEach(function (n) {
e.print.hasOwnProperty(n) && (t.app.KGPdfViewerWebApp.surreadPrint.print[n] = e.print[n])
}); else {
var l = "[打印参数配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(l)
}
break;
case"watermark":
if (s.default.isPlainObject(e.watermark)) Object.keys(h.watermark).forEach(function (n) {
e.watermark.hasOwnProperty(n) && (t.app.KGPdfViewerWebApp.surreadPrint.watermark[n] = e.watermark[n])
}); else {
var c = "[打印参数配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(c)
}
break;
case"showPannel":
if (s.default.isBoolean(e.showPannel)) t.app.KGPdfViewerWebApp.surreadPrint.showPannel = e.showPannel; else {
var u = "[打印参数配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(u)
}
break;
case"fileDownloadUrl":
if (s.default.isString(e.fileDownloadUrl)) t.app.KGPdfViewerWebApp.surreadPrint.fileDownloadUrl = e.fileDownloadUrl; else {
var d = "[打印参数配配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(d)
}
break;
case"clientServiceCallbackUrl":
if (s.default.isString(e.clientServiceCallbackUrl)) t.app.KGPdfViewerWebApp.surreadPrint.clientServiceCallbackUrl = e.clientServiceCallbackUrl; else {
var p = "[打印参数配配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(p)
}
break;
case"path":
if (s.default.isString(e.path)) t.app.KGPdfViewerWebApp.surreadPrint.path = e.path; else {
var f = "[打印参数配配置异常] " + n + " 参数类型不正确:" + e[n];
console.warn(f)
}
break;
default:
console.warn("[打印参数配置异常] 暂不支持该参数:" + n)
}
})
}
}, {
key: "getPrinters", value: function () {
var e = this;
return this.SRComponent.getPrinterList().then(function (t) {
var n = t.split(",");
return e.app.KGPdfViewerWebApp.surreadPrint.printerList = n
}).catch(function (t) {
var n = t.message;
return e.app.KGAlertPrompt.open(n), Promise.reject(n)
})
}
}, {
key: "getService", value: function () {
var e = this;
return this.SRComponent.isServiceBusy().then(function (e) {
if (e) {
return Promise.reject({message: "打印机正在工作"})
}
return Promise.resolve(!0)
}).catch(function (t) {
var n = t.message;
return e.app.KGAlertPrompt.open(n)
})
}
}, {
key: "query", value: function () {
var e = this;
return this.SRComponent.resultRequest().then(function (t) {
return 5 == t.ret_code ? e.query() : Promise.resolve(t)
}).catch(function (t) {
var n = t.message;
return e.app.KGAlertPrompt.open(n), Promise.reject()
})
}
}, {
key: "print", value: function () {
var e = this;
this.getService().then(function (t) {
t && e.getPrinters().then(function () {
var t = e.app.KGPdfViewerWebApp.surreadPrint, n = t, r = n.path, i = n.print, a = n.watermark,
o = n.showPannel, s = n.printerList, c = n.fileDownloadUrl, u = n.clientServiceCallbackUrl,
f = function (t) {
e.onBefore().then(function () {
return o && l.SurreadPrint.destroy(), e.SRComponent.setNotifyAddress(u)
}).then(function (e) {
return e ? d.axios.post(c, t) : Promise.reject("超阅客户端程序异常")
}).then(function (t) {
var n = t.data, r = n.code, i = n.message, a = n.down;
n.url;
if (0 != r) return Promise.reject(i);
var o = Object.assign({}, window.KGPdfViewerWebApp.surreadPrint.print, {fileUrl: a});
return e.SRComponent.printFile(o).then(function (t) {
return 5 == t.ret_code ? e.query() : Promise.resolve(t)
})
}).then(e.onSuccess.bind(e)).catch(e.onError.bind(e))
};
if (o) l.SurreadPrint.init(), l.SurreadPrint.set(Object.assign({}, i, a, {
printerList: s,
pageArea: e.initPageArea,
printType: e.initPrintType.toString(),
pagesCount: window.KGPdfViewerWebApp.PDFViewerApplication.pagesCount
}), function (e) {
var n = e.print, i = e.watermark;
n.pageArea = function (e) {
var t = window.KGPdfViewerWebApp.PDFViewerApplication.pdfViewer, n = t.currentPageNumber,
r = t.pagesCount;
switch (e) {
case"current":
return n.toString();
case"all":
return "1-" + r;
default:
return e
}
}(n.pageArea), t = Object.assign(t, {print: n}, {watermark: i});
var a = p(Object.assign({}, {path: r}, h.print, {print: n}, h.watermark, {watermark: i}));
f(a)
}, function () {
l.SurreadPrint.destroy()
}), l.SurreadPrint.show(); else {
var m = p(Object.assign({}, {path: r}, h.print, {print: i}, h.watermark, {watermark: a}));
f(m)
}
})
})
}
}, {
key: "onBefore", value: function () {
var e = this.app.KGPdfViewerWebApp.surreadPrint, t = e.customParam, n = e.print, r = e.watermark, a = e.before;
return new Promise(function (e, o) {
var s = a({customParam: t, print: n, watermark: r});
("object" === (void 0 === s ? "undefined" : i(s)) && "function" == typeof s.then || !0 === s) && e(s), o(new Error("before取消打印"))
})
}
}, {
key: "onSuccess", value: function (e) {
var t = this.app.KGPdfViewerWebApp.surreadPrint, n = t.customParam, r = t.print, i = t.watermark;
(0, t.success)(e, {customParam: n, print: r, watermark: i})
}
}, {
key: "onError", value: function (e) {
var t = this.app.KGPdfViewerWebApp.surreadPrint, n = t.customParam, r = t.print, i = t.watermark, a = t.error;
this.app.KGAlertPrompt.open(e), a(e, {customParam: n, print: r, watermark: i})
}
}]), e
}();
t.default = f
}, function (e, t, n) {
"use strict";
(function (e) {
var r, i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
(function () {
var a, o = 200, s = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", l = "Expected a function",
c = "Invalid `variable` option passed into `_.template`", u = "__lodash_hash_undefined__", d = 500,
h = "__lodash_placeholder__", p = 1, f = 2, m = 4, v = 1, g = 2, y = 1, b = 2, w = 4, S = 8, _ = 16, k = 32,
x = 64, P = 128, C = 256, A = 512, T = 30, E = "...", D = 800, I = 16, L = 1, O = 2, M = 1 / 0,
N = 9007199254740991, R = 1.7976931348623157e308, W = NaN, V = 4294967295, F = V - 1, G = V >>> 1,
B = [["ary", P], ["bind", y], ["bindKey", b], ["curry", S], ["curryRight", _], ["flip", A], ["partial", k], ["partialRight", x], ["rearg", C]],
K = "[object Arguments]", j = "[object Array]", z = "[object AsyncFunction]", U = "[object Boolean]",
q = "[object Date]", H = "[object DOMException]", Y = "[object Error]", X = "[object Function]",
J = "[object GeneratorFunction]", Q = "[object Map]", $ = "[object Number]", Z = "[object Null]",
ee = "[object Object]", te = "[object Proxy]", ne = "[object RegExp]", re = "[object Set]",
ie = "[object String]", ae = "[object Symbol]", oe = "[object Undefined]", se = "[object WeakMap]",
le = "[object WeakSet]", ce = "[object ArrayBuffer]", ue = "[object DataView]", de = "[object Float32Array]",
he = "[object Float64Array]", pe = "[object Int8Array]", fe = "[object Int16Array]", me = "[object Int32Array]",
ve = "[object Uint8Array]", ge = "[object Uint8ClampedArray]", ye = "[object Uint16Array]",
be = "[object Uint32Array]", we = /\b__p \+= '';/g, Se = /\b(__p \+=) '' \+/g,
_e = /(__e\(.*?\)|\b__t\)) \+\n'';/g, ke = /&(?:amp|lt|gt|quot|#39);/g, xe = /[&<>"']/g, Pe = RegExp(ke.source),
Ce = RegExp(xe.source), Ae = /<%-([\s\S]+?)%>/g, Te = /<%([\s\S]+?)%>/g, Ee = /<%=([\s\S]+?)%>/g,
De = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Ie = /^\w*$/,
Le = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
Oe = /[\\^$.*+?()[\]{}|]/g, Me = RegExp(Oe.source), Ne = /^\s+/, Re = /\s/,
We = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Ve = /\{\n\/\* \[wrapped with (.+)\] \*/, Fe = /,? & /,
Ge = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Be = /[()=,{}\[\]\/\s]/, Ke = /\\(\\)?/g,
je = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, ze = /\w*$/, Ue = /^[-+]0x[0-9a-f]+$/i, qe = /^0b[01]+$/i,
He = /^\[object .+?Constructor\]$/, Ye = /^0o[0-7]+$/i, Xe = /^(?:0|[1-9]\d*)$/,
Je = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Qe = /($^)/, $e = /['\n\r\u2028\u2029\\]/g,
Ze = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",
et = "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",
tt = "[\\ud800-\\udfff]", nt = "[" + et + "]", rt = "[" + Ze + "]", it = "\\d+", at = "[\\u2700-\\u27bf]",
ot = "[a-z\\xdf-\\xf6\\xf8-\\xff]",
st = "[^\\ud800-\\udfff" + et + it + "\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",
lt = "\\ud83c[\\udffb-\\udfff]", ct = "[^\\ud800-\\udfff]", ut = "(?:\\ud83c[\\udde6-\\uddff]){2}",
dt = "[\\ud800-\\udbff][\\udc00-\\udfff]", ht = "[A-Z\\xc0-\\xd6\\xd8-\\xde]", pt = "(?:" + ot + "|" + st + ")",
ft = "(?:" + ht + "|" + st + ")", mt = "(?:" + rt + "|" + lt + ")" + "?",
vt = "[\\ufe0e\\ufe0f]?" + mt + ("(?:\\u200d(?:" + [ct, ut, dt].join("|") + ")[\\ufe0e\\ufe0f]?" + mt + ")*"),
gt = "(?:" + [at, ut, dt].join("|") + ")" + vt, yt = "(?:" + [ct + rt + "?", rt, ut, dt, tt].join("|") + ")",
bt = RegExp("[']", "g"), wt = RegExp(rt, "g"), St = RegExp(lt + "(?=" + lt + ")|" + yt + vt, "g"),
_t = RegExp([ht + "?" + ot + "+(?:['](?:d|ll|m|re|s|t|ve))?(?=" + [nt, ht, "$"].join("|") + ")", ft + "+(?:['](?:D|LL|M|RE|S|T|VE))?(?=" + [nt, ht + pt, "$"].join("|") + ")", ht + "?" + pt + "+(?:['](?:d|ll|m|re|s|t|ve))?", ht + "+(?:['](?:D|LL|M|RE|S|T|VE))?", "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", it, gt].join("|"), "g"),
kt = RegExp("[\\u200d\\ud800-\\udfff" + Ze + "\\ufe0e\\ufe0f]"),
xt = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,
Pt = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"],
Ct = -1, At = {};
At[de] = At[he] = At[pe] = At[fe] = At[me] = At[ve] = At[ge] = At[ye] = At[be] = !0, At[K] = At[j] = At[ce] = At[U] = At[ue] = At[q] = At[Y] = At[X] = At[Q] = At[$] = At[ee] = At[ne] = At[re] = At[ie] = At[se] = !1;
var Tt = {};
Tt[K] = Tt[j] = Tt[ce] = Tt[ue] = Tt[U] = Tt[q] = Tt[de] = Tt[he] = Tt[pe] = Tt[fe] = Tt[me] = Tt[Q] = Tt[$] = Tt[ee] = Tt[ne] = Tt[re] = Tt[ie] = Tt[ae] = Tt[ve] = Tt[ge] = Tt[ye] = Tt[be] = !0, Tt[Y] = Tt[X] = Tt[se] = !1;
var Et = {"\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029"}, Dt = parseFloat,
It = parseInt,
Lt = "object" == ("undefined" == typeof global ? "undefined" : i(global)) && global && global.Object === Object && global,
Ot = "object" == ("undefined" == typeof self ? "undefined" : i(self)) && self && self.Object === Object && self,
Mt = Lt || Ot || Function("return this")(), Nt = "object" == i(t) && t && !t.nodeType && t,
Rt = Nt && "object" == i(e) && e && !e.nodeType && e, Wt = Rt && Rt.exports === Nt, Vt = Wt && Lt.process,
Ft = function () {
try {
var e = Rt && Rt.require && Rt.require("util").types;
return e || Vt && Vt.binding && Vt.binding("util")
} catch (e) {
}
}(), Gt = Ft && Ft.isArrayBuffer, Bt = Ft && Ft.isDate, Kt = Ft && Ft.isMap, jt = Ft && Ft.isRegExp,
zt = Ft && Ft.isSet, Ut = Ft && Ft.isTypedArray;
function qt(e, t, n) {
switch (n.length) {
case 0:
return e.call(t);
case 1:
return e.call(t, n[0]);
case 2:
return e.call(t, n[0], n[1]);
case 3:
return e.call(t, n[0], n[1], n[2])
}
return e.apply(t, n)
}
function Ht(e, t, n, r) {
for (var i = -1, a = null == e ? 0 : e.length; ++i < a;) {
var o = e[i];
t(r, o, n(o), e)
}
return r
}
function Yt(e, t) {
for (var n = -1, r = null == e ? 0 : e.length; ++n < r && !1 !== t(e[n], n, e);) ;
return e
}
function Xt(e, t) {
for (var n = null == e ? 0 : e.length; n-- && !1 !== t(e[n], n, e);) ;
return e
}
function Jt(e, t) {
for (var n = -1, r = null == e ? 0 : e.length; ++n < r;) if (!t(e[n], n, e)) return !1;
return !0
}
function Qt(e, t) {
for (var n = -1, r = null == e ? 0 : e.length, i = 0, a = []; ++n < r;) {
var o = e[n];
t(o, n, e) && (a[i++] = o)
}
return a
}
function $t(e, t) {
return !!(null == e ? 0 : e.length) && cn(e, t, 0) > -1
}
function Zt(e, t, n) {
for (var r = -1, i = null == e ? 0 : e.length; ++r < i;) if (n(t, e[r])) return !0;
return !1
}
function en(e, t) {
for (var n = -1, r = null == e ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
return i
}
function tn(e, t) {
for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
return e
}
function nn(e, t, n, r) {
var i = -1, a = null == e ? 0 : e.length;
for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
return n
}
function rn(e, t, n, r) {
var i = null == e ? 0 : e.length;
for (r && i && (n = e[--i]); i--;) n = t(n, e[i], i, e);
return n
}
function an(e, t) {
for (var n = -1, r = null == e ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
return !1
}
var on = pn("length");
function sn(e, t, n) {
var r;
return n(e, function (e, n, i) {
if (t(e, n, i)) return r = n, !1
}), r
}
function ln(e, t, n, r) {
for (var i = e.length, a = n + (r ? 1 : -1); r ? a-- : ++a < i;) if (t(e[a], a, e)) return a;
return -1
}
function cn(e, t, n) {
return t == t ? function (e, t, n) {
var r = n - 1, i = e.length;
for (; ++r < i;) if (e[r] === t) return r;
return -1
}(e, t, n) : ln(e, dn, n)
}
function un(e, t, n, r) {
for (var i = n - 1, a = e.length; ++i < a;) if (r(e[i], t)) return i;
return -1
}
function dn(e) {
return e != e
}
function hn(e, t) {
var n = null == e ? 0 : e.length;
return n ? vn(e, t) / n : W
}
function pn(e) {
return function (t) {
return null == t ? a : t[e]
}
}
function fn(e) {
return function (t) {
return null == e ? a : e[t]
}
}
function mn(e, t, n, r, i) {
return i(e, function (e, i, a) {
n = r ? (r = !1, e) : t(n, e, i, a)
}), n
}
function vn(e, t) {
for (var n, r = -1, i = e.length; ++r < i;) {
var o = t(e[r]);
o !== a && (n = n === a ? o : n + o)
}
return n
}
function gn(e, t) {
for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
return r
}
function yn(e) {
return e ? e.slice(0, Nn(e) + 1).replace(Ne, "") : e
}
function bn(e) {
return function (t) {
return e(t)
}
}
function wn(e, t) {
return en(t, function (t) {
return e[t]
})
}
function Sn(e, t) {
return e.has(t)
}
function _n(e, t) {
for (var n = -1, r = e.length; ++n < r && cn(t, e[n], 0) > -1;) ;
return n
}
function kn(e, t) {
for (var n = e.length; n-- && cn(t, e[n], 0) > -1;) ;
return n
}
var xn = fn({
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"Ç": "C",
"ç": "c",
"Ð": "D",
"ð": "d",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"Ñ": "N",
"ñ": "n",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"Ý": "Y",
"ý": "y",
"ÿ": "y",
"Æ": "Ae",
"æ": "ae",
"Þ": "Th",
"þ": "th",
"ß": "ss",
"Ā": "A",
"Ă": "A",
"Ą": "A",
"ā": "a",
"ă": "a",
"ą": "a",
"Ć": "C",
"Ĉ": "C",
"Ċ": "C",
"Č": "C",
"ć": "c",
"ĉ": "c",
"ċ": "c",
"č": "c",
"Ď": "D",
"Đ": "D",
"ď": "d",
"đ": "d",
"Ē": "E",
"Ĕ": "E",
"Ė": "E",
"Ę": "E",
"Ě": "E",
"ē": "e",
"ĕ": "e",
"ė": "e",
"ę": "e",
"ě": "e",
"Ĝ": "G",
"Ğ": "G",
"Ġ": "G",
"Ģ": "G",
"ĝ": "g",
"ğ": "g",
"ġ": "g",
"ģ": "g",
"Ĥ": "H",
"Ħ": "H",
"ĥ": "h",
"ħ": "h",
"Ĩ": "I",
"Ī": "I",
"Ĭ": "I",
"Į": "I",
"İ": "I",
"ĩ": "i",
"ī": "i",
"ĭ": "i",
"į": "i",
"ı": "i",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"ĸ": "k",
"Ĺ": "L",
"Ļ": "L",
"Ľ": "L",
"Ŀ": "L",
"Ł": "L",
"ĺ": "l",
"ļ": "l",
"ľ": "l",
"ŀ": "l",
"ł": "l",
"Ń": "N",
"Ņ": "N",
"Ň": "N",
"Ŋ": "N",
"ń": "n",
"ņ": "n",
"ň": "n",
"ŋ": "n",
"Ō": "O",
"Ŏ": "O",
"Ő": "O",
"ō": "o",
"ŏ": "o",
"ő": "o",
"Ŕ": "R",
"Ŗ": "R",
"Ř": "R",
"ŕ": "r",
"ŗ": "r",
"ř": "r",
"Ś": "S",
"Ŝ": "S",
"Ş": "S",
"Š": "S",
"ś": "s",
"ŝ": "s",
"ş": "s",
"š": "s",
"Ţ": "T",
"Ť": "T",
"Ŧ": "T",
"ţ": "t",
"ť": "t",
"ŧ": "t",
"Ũ": "U",
"Ū": "U",
"Ŭ": "U",
"Ů": "U",
"Ű": "U",
"Ų": "U",
"ũ": "u",
"ū": "u",
"ŭ": "u",
"ů": "u",
"ű": "u",
"ų": "u",
"Ŵ": "W",
"ŵ": "w",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Ź": "Z",
"Ż": "Z",
"Ž": "Z",
"ź": "z",
"ż": "z",
"ž": "z",
"IJ": "IJ",
"ij": "ij",
"Œ": "Oe",
"œ": "oe",
"ʼn": "'n",
"ſ": "s"
}), Pn = fn({"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;"});
function Cn(e) {
return "\\" + Et[e]
}
function An(e) {
return kt.test(e)
}
function Tn(e) {
var t = -1, n = Array(e.size);
return e.forEach(function (e, r) {
n[++t] = [r, e]
}), n
}
function En(e, t) {
return function (n) {
return e(t(n))
}
}
function Dn(e, t) {
for (var n = -1, r = e.length, i = 0, a = []; ++n < r;) {
var o = e[n];
o !== t && o !== h || (e[n] = h, a[i++] = n)
}
return a
}
function In(e) {
var t = -1, n = Array(e.size);
return e.forEach(function (e) {
n[++t] = e
}), n
}
function Ln(e) {
var t = -1, n = Array(e.size);
return e.forEach(function (e) {
n[++t] = [e, e]
}), n
}
function On(e) {
return An(e) ? function (e) {
var t = St.lastIndex = 0;
for (; St.test(e);) ++t;
return t
}(e) : on(e)
}
function Mn(e) {
return An(e) ? function (e) {
return e.match(St) || []
}(e) : function (e) {
return e.split("")
}(e)
}
function Nn(e) {
for (var t = e.length; t-- && Re.test(e.charAt(t));) ;
return t
}
var Rn = fn({"&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&#39;": "'"});
var Wn = function e(t) {
var n, r = (t = null == t ? Mt : Wn.defaults(Mt.Object(), t, Wn.pick(Mt, Pt))).Array, Re = t.Date, Ze = t.Error,
et = t.Function, tt = t.Math, nt = t.Object, rt = t.RegExp, it = t.String, at = t.TypeError, ot = r.prototype,
st = et.prototype, lt = nt.prototype, ct = t["__core-js_shared__"], ut = st.toString, dt = lt.hasOwnProperty,
ht = 0, pt = (n = /[^.]+$/.exec(ct && ct.keys && ct.keys.IE_PROTO || "")) ? "Symbol(src)_1." + n : "",
ft = lt.toString, mt = ut.call(nt), vt = Mt._,
gt = rt("^" + ut.call(dt).replace(Oe, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
yt = Wt ? t.Buffer : a, St = t.Symbol, kt = t.Uint8Array, Et = yt ? yt.allocUnsafe : a,
Lt = En(nt.getPrototypeOf, nt), Ot = nt.create, Nt = lt.propertyIsEnumerable, Rt = ot.splice,
Vt = St ? St.isConcatSpreadable : a, Ft = St ? St.iterator : a, on = St ? St.toStringTag : a,
fn = function () {
try {
var e = Ba(nt, "defineProperty");
return e({}, "", {}), e
} catch (e) {
}
}(), Vn = t.clearTimeout !== Mt.clearTimeout && t.clearTimeout, Fn = Re && Re.now !== Mt.Date.now && Re.now,
Gn = t.setTimeout !== Mt.setTimeout && t.setTimeout, Bn = tt.ceil, Kn = tt.floor,
jn = nt.getOwnPropertySymbols, zn = yt ? yt.isBuffer : a, Un = t.isFinite, qn = ot.join, Hn = En(nt.keys, nt),
Yn = tt.max, Xn = tt.min, Jn = Re.now, Qn = t.parseInt, $n = tt.random, Zn = ot.reverse,
er = Ba(t, "DataView"), tr = Ba(t, "Map"), nr = Ba(t, "Promise"), rr = Ba(t, "Set"), ir = Ba(t, "WeakMap"),
ar = Ba(nt, "create"), or = ir && new ir, sr = {}, lr = fo(er), cr = fo(tr), ur = fo(nr), dr = fo(rr),
hr = fo(ir), pr = St ? St.prototype : a, fr = pr ? pr.valueOf : a, mr = pr ? pr.toString : a;
function vr(e) {
if (Is(e) && !ws(e) && !(e instanceof wr)) {
if (e instanceof br) return e;
if (dt.call(e, "__wrapped__")) return mo(e)
}
return new br(e)
}
var gr = function () {
function e() {
}
return function (t) {
if (!Ds(t)) return {};
if (Ot) return Ot(t);
e.prototype = t;
var n = new e;
return e.prototype = a, n
}
}();
function yr() {
}
function br(e, t) {
this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = a
}
function wr(e) {
this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = V, this.__views__ = []
}
function Sr(e) {
var t = -1, n = null == e ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1])
}
}
function _r(e) {
var t = -1, n = null == e ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1])
}
}
function kr(e) {
var t = -1, n = null == e ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1])
}
}
function xr(e) {
var t = -1, n = null == e ? 0 : e.length;
for (this.__data__ = new kr; ++t < n;) this.add(e[t])
}
function Pr(e) {
var t = this.__data__ = new _r(e);
this.size = t.size
}
function Cr(e, t) {
var n = ws(e), r = !n && bs(e), i = !n && !r && xs(e), a = !n && !r && !i && Fs(e), o = n || r || i || a,
s = o ? gn(e.length, it) : [], l = s.length;
for (var c in e) !t && !dt.call(e, c) || o && ("length" == c || i && ("offset" == c || "parent" == c) || a && ("buffer" == c || "byteLength" == c || "byteOffset" == c) || Ya(c, l)) || s.push(c);
return s
}
function Ar(e) {
var t = e.length;
return t ? e[xi(0, t - 1)] : a
}
function Tr(e, t) {
return uo(aa(e), Wr(t, 0, e.length))
}
function Er(e) {
return uo(aa(e))
}
function Dr(e, t, n) {
(n === a || vs(e[t], n)) && (n !== a || t in e) || Nr(e, t, n)
}
function Ir(e, t, n) {
var r = e[t];
dt.call(e, t) && vs(r, n) && (n !== a || t in e) || Nr(e, t, n)
}
function Lr(e, t) {
for (var n = e.length; n--;) if (vs(e[n][0], t)) return n;
return -1
}
function Or(e, t, n, r) {
return Kr(e, function (e, i, a) {
t(r, e, n(e), a)
}), r
}
function Mr(e, t) {
return e && oa(t, sl(t), e)
}
function Nr(e, t, n) {
"__proto__" == t && fn ? fn(e, t, {configurable: !0, enumerable: !0, value: n, writable: !0}) : e[t] = n
}
function Rr(e, t) {
for (var n = -1, i = t.length, o = r(i), s = null == e; ++n < i;) o[n] = s ? a : nl(e, t[n]);
return o
}
function Wr(e, t, n) {
return e == e && (n !== a && (e = e <= n ? e : n), t !== a && (e = e >= t ? e : t)), e
}
function Vr(e, t, n, r, i, o) {
var s, l = t & p, c = t & f, u = t & m;
if (n && (s = i ? n(e, r, i, o) : n(e)), s !== a) return s;
if (!Ds(e)) return e;
var d = ws(e);
if (d) {
if (s = function (e) {
var t = e.length, n = new e.constructor(t);
return t && "string" == typeof e[0] && dt.call(e, "index") && (n.index = e.index, n.input = e.input), n
}(e), !l) return aa(e, s)
} else {
var h = za(e), v = h == X || h == J;
if (xs(e)) return Zi(e, l);
if (h == ee || h == K || v && !i) {
if (s = c || v ? {} : qa(e), !l) return c ? function (e, t) {
return oa(e, ja(e), t)
}(e, function (e, t) {
return e && oa(t, ll(t), e)
}(s, e)) : function (e, t) {
return oa(e, Ka(e), t)
}(e, Mr(s, e))
} else {
if (!Tt[h]) return i ? e : {};
s = function (e, t, n) {
var r, i, a, o = e.constructor;
switch (t) {
case ce:
return ea(e);
case U:
case q:
return new o(+e);
case ue:
return function (e, t) {
var n = t ? ea(e.buffer) : e.buffer;
return new e.constructor(n, e.byteOffset, e.byteLength)
}(e, n);
case de:
case he:
case pe:
case fe:
case me:
case ve:
case ge:
case ye:
case be:
return ta(e, n);
case Q:
return new o;
case $:
case ie:
return new o(e);
case ne:
return (a = new (i = e).constructor(i.source, ze.exec(i))).lastIndex = i.lastIndex, a;
case re:
return new o;
case ae:
return r = e, fr ? nt(fr.call(r)) : {}
}
}(e, h, l)
}
}
o || (o = new Pr);
var g = o.get(e);
if (g) return g;
o.set(e, s), Rs(e) ? e.forEach(function (r) {
s.add(Vr(r, t, n, r, e, o))
}) : Ls(e) && e.forEach(function (r, i) {
s.set(i, Vr(r, t, n, i, e, o))
});
var y = d ? a : (u ? c ? Ma : Oa : c ? ll : sl)(e);
return Yt(y || e, function (r, i) {
y && (r = e[i = r]), Ir(s, i, Vr(r, t, n, i, e, o))
}), s
}
function Fr(e, t, n) {
var r = n.length;
if (null == e) return !r;
for (e = nt(e); r--;) {
var i = n[r], o = t[i], s = e[i];
if (s === a && !(i in e) || !o(s)) return !1
}
return !0
}
function Gr(e, t, n) {
if ("function" != typeof e) throw new at(l);
return oo(function () {
e.apply(a, n)
}, t)
}
function Br(e, t, n, r) {
var i = -1, a = $t, s = !0, l = e.length, c = [], u = t.length;
if (!l) return c;
n && (t = en(t, bn(n))), r ? (a = Zt, s = !1) : t.length >= o && (a = Sn, s = !1, t = new xr(t));
e:for (; ++i < l;) {
var d = e[i], h = null == n ? d : n(d);
if (d = r || 0 !== d ? d : 0, s && h == h) {
for (var p = u; p--;) if (t[p] === h) continue e;
c.push(d)
} else a(t, h, r) || c.push(d)
}
return c
}
vr.templateSettings = {
escape: Ae,
evaluate: Te,
interpolate: Ee,
variable: "",
imports: {_: vr}
}, vr.prototype = yr.prototype, vr.prototype.constructor = vr, br.prototype = gr(yr.prototype), br.prototype.constructor = br, wr.prototype = gr(yr.prototype), wr.prototype.constructor = wr, Sr.prototype.clear = function () {
this.__data__ = ar ? ar(null) : {}, this.size = 0
}, Sr.prototype.delete = function (e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0, t
}, Sr.prototype.get = function (e) {
var t = this.__data__;
if (ar) {
var n = t[e];
return n === u ? a : n
}
return dt.call(t, e) ? t[e] : a
}, Sr.prototype.has = function (e) {
var t = this.__data__;
return ar ? t[e] !== a : dt.call(t, e)
}, Sr.prototype.set = function (e, t) {
var n = this.__data__;
return this.size += this.has(e) ? 0 : 1, n[e] = ar && t === a ? u : t, this
}, _r.prototype.clear = function () {
this.__data__ = [], this.size = 0
}, _r.prototype.delete = function (e) {
var t = this.__data__, n = Lr(t, e);
return !(n < 0 || (n == t.length - 1 ? t.pop() : Rt.call(t, n, 1), --this.size, 0))
}, _r.prototype.get = function (e) {
var t = this.__data__, n = Lr(t, e);
return n < 0 ? a : t[n][1]
}, _r.prototype.has = function (e) {
return Lr(this.__data__, e) > -1
}, _r.prototype.set = function (e, t) {
var n = this.__data__, r = Lr(n, e);
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this
}, kr.prototype.clear = function () {
this.size = 0, this.__data__ = {hash: new Sr, map: new (tr || _r), string: new Sr}
}, kr.prototype.delete = function (e) {
var t = Fa(this, e).delete(e);
return this.size -= t ? 1 : 0, t
}, kr.prototype.get = function (e) {
return Fa(this, e).get(e)
}, kr.prototype.has = function (e) {
return Fa(this, e).has(e)
}, kr.prototype.set = function (e, t) {
var n = Fa(this, e), r = n.size;
return n.set(e, t), this.size += n.size == r ? 0 : 1, this
}, xr.prototype.add = xr.prototype.push = function (e) {
return this.__data__.set(e, u), this
}, xr.prototype.has = function (e) {
return this.__data__.has(e)
}, Pr.prototype.clear = function () {
this.__data__ = new _r, this.size = 0
}, Pr.prototype.delete = function (e) {
var t = this.__data__, n = t.delete(e);
return this.size = t.size, n
}, Pr.prototype.get = function (e) {
return this.__data__.get(e)
}, Pr.prototype.has = function (e) {
return this.__data__.has(e)
}, Pr.prototype.set = function (e, t) {
var n = this.__data__;
if (n instanceof _r) {
var r = n.__data__;
if (!tr || r.length < o - 1) return r.push([e, t]), this.size = ++n.size, this;
n = this.__data__ = new kr(r)
}
return n.set(e, t), this.size = n.size, this
};
var Kr = ca(Jr), jr = ca(Qr, !0);
function zr(e, t) {
var n = !0;
return Kr(e, function (e, r, i) {
return n = !!t(e, r, i)
}), n
}
function Ur(e, t, n) {
for (var r = -1, i = e.length; ++r < i;) {
var o = e[r], s = t(o);
if (null != s && (l === a ? s == s && !Vs(s) : n(s, l))) var l = s, c = o
}
return c
}
function qr(e, t) {
var n = [];
return Kr(e, function (e, r, i) {
t(e, r, i) && n.push(e)
}), n
}
function Hr(e, t, n, r, i) {
var a = -1, o = e.length;
for (n || (n = Ha), i || (i = []); ++a < o;) {
var s = e[a];
t > 0 && n(s) ? t > 1 ? Hr(s, t - 1, n, r, i) : tn(i, s) : r || (i[i.length] = s)
}
return i
}
var Yr = ua(), Xr = ua(!0);
function Jr(e, t) {
return e && Yr(e, t, sl)
}
function Qr(e, t) {
return e && Xr(e, t, sl)
}
function $r(e, t) {
return Qt(t, function (t) {
return As(e[t])
})
}
function Zr(e, t) {
for (var n = 0, r = (t = Xi(t, e)).length; null != e && n < r;) e = e[po(t[n++])];
return n && n == r ? e : a
}
function ei(e, t, n) {
var r = t(e);
return ws(e) ? r : tn(r, n(e))
}
function ti(e) {
return null == e ? e === a ? oe : Z : on && on in nt(e) ? function (e) {
var t = dt.call(e, on), n = e[on];
try {
e[on] = a;
var r = !0
} catch (e) {
}
var i = ft.call(e);
return r && (t ? e[on] = n : delete e[on]), i
}(e) : function (e) {
return ft.call(e)
}(e)
}
function ni(e, t) {
return e > t
}
function ri(e, t) {
return null != e && dt.call(e, t)
}
function ii(e, t) {
return null != e && t in nt(e)
}
function ai(e, t, n) {
for (var i = n ? Zt : $t, o = e[0].length, s = e.length, l = s, c = r(s), u = 1 / 0, d = []; l--;) {
var h = e[l];
l && t && (h = en(h, bn(t))), u = Xn(h.length, u), c[l] = !n && (t || o >= 120 && h.length >= 120) ? new xr(l && h) : a
}
h = e[0];
var p = -1, f = c[0];
e:for (; ++p < o && d.length < u;) {
var m = h[p], v = t ? t(m) : m;
if (m = n || 0 !== m ? m : 0, !(f ? Sn(f, v) : i(d, v, n))) {
for (l = s; --l;) {
var g = c[l];
if (!(g ? Sn(g, v) : i(e[l], v, n))) continue e
}
f && f.push(v), d.push(m)
}
}
return d
}
function oi(e, t, n) {
var r = null == (e = ro(e, t = Xi(t, e))) ? e : e[po(Co(t))];
return null == r ? a : qt(r, e, n)
}
function si(e) {
return Is(e) && ti(e) == K
}
function li(e, t, n, r, i) {
return e === t || (null == e || null == t || !Is(e) && !Is(t) ? e != e && t != t : function (e, t, n, r, i, o) {
var s = ws(e), l = ws(t), c = s ? j : za(e), u = l ? j : za(t), d = (c = c == K ? ee : c) == ee,
h = (u = u == K ? ee : u) == ee, p = c == u;
if (p && xs(e)) {
if (!xs(t)) return !1;
s = !0, d = !1
}
if (p && !d) return o || (o = new Pr), s || Fs(e) ? Ia(e, t, n, r, i, o) : function (e, t, n, r, i, a, o) {
switch (n) {
case ue:
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
e = e.buffer, t = t.buffer;
case ce:
return !(e.byteLength != t.byteLength || !a(new kt(e), new kt(t)));
case U:
case q:
case $:
return vs(+e, +t);
case Y:
return e.name == t.name && e.message == t.message;
case ne:
case ie:
return e == t + "";
case Q:
var s = Tn;
case re:
var l = r & v;
if (s || (s = In), e.size != t.size && !l) return !1;
var c = o.get(e);
if (c) return c == t;
r |= g, o.set(e, t);
var u = Ia(s(e), s(t), r, i, a, o);
return o.delete(e), u;
case ae:
if (fr) return fr.call(e) == fr.call(t)
}
return !1
}(e, t, c, n, r, i, o);
if (!(n & v)) {
var f = d && dt.call(e, "__wrapped__"), m = h && dt.call(t, "__wrapped__");
if (f || m) {
var y = f ? e.value() : e, b = m ? t.value() : t;
return o || (o = new Pr), i(y, b, n, r, o)
}
}
return !!p && (o || (o = new Pr), function (e, t, n, r, i, o) {
var s = n & v, l = Oa(e), c = l.length, u = Oa(t).length;
if (c != u && !s) return !1;
for (var d = c; d--;) {
var h = l[d];
if (!(s ? h in t : dt.call(t, h))) return !1
}
var p = o.get(e), f = o.get(t);
if (p && f) return p == t && f == e;
var m = !0;
o.set(e, t), o.set(t, e);
for (var g = s; ++d < c;) {
h = l[d];
var y = e[h], b = t[h];
if (r) var w = s ? r(b, y, h, t, e, o) : r(y, b, h, e, t, o);
if (!(w === a ? y === b || i(y, b, n, r, o) : w)) {
m = !1;
break
}
g || (g = "constructor" == h)
}
if (m && !g) {
var S = e.constructor, _ = t.constructor;
S != _ && "constructor" in e && "constructor" in t && !("function" == typeof S && S instanceof S && "function" == typeof _ && _ instanceof _) && (m = !1)
}
return o.delete(e), o.delete(t), m
}(e, t, n, r, i, o))
}(e, t, n, r, li, i))
}
function ci(e, t, n, r) {
var i = n.length, o = i, s = !r;
if (null == e) return !o;
for (e = nt(e); i--;) {
var l = n[i];
if (s && l[2] ? l[1] !== e[l[0]] : !(l[0] in e)) return !1
}
for (; ++i < o;) {
var c = (l = n[i])[0], u = e[c], d = l[1];
if (s && l[2]) {
if (u === a && !(c in e)) return !1
} else {
var h = new Pr;
if (r) var p = r(u, d, c, e, t, h);
if (!(p === a ? li(d, u, v | g, r, h) : p)) return !1
}
}
return !0
}
function ui(e) {
return !(!Ds(e) || pt && pt in e) && (As(e) ? gt : He).test(fo(e))
}
function di(e) {
return "function" == typeof e ? e : null == e ? Ol : "object" == (void 0 === e ? "undefined" : i(e)) ? ws(e) ? gi(e[0], e[1]) : vi(e) : Kl(e)
}
function hi(e) {
if (!Za(e)) return Hn(e);
var t = [];
for (var n in nt(e)) dt.call(e, n) && "constructor" != n && t.push(n);
return t
}
function pi(e) {
if (!Ds(e)) return function (e) {
var t = [];
if (null != e) for (var n in nt(e)) t.push(n);
return t
}(e);
var t = Za(e), n = [];
for (var r in e) ("constructor" != r || !t && dt.call(e, r)) && n.push(r);
return n
}
function fi(e, t) {
return e < t
}
function mi(e, t) {
var n = -1, i = _s(e) ? r(e.length) : [];
return Kr(e, function (e, r, a) {
i[++n] = t(e, r, a)
}), i
}
function vi(e) {
var t = Ga(e);
return 1 == t.length && t[0][2] ? to(t[0][0], t[0][1]) : function (n) {
return n === e || ci(n, e, t)
}
}
function gi(e, t) {
return Ja(e) && eo(t) ? to(po(e), t) : function (n) {
var r = nl(n, e);
return r === a && r === t ? rl(n, e) : li(t, r, v | g)
}
}
function yi(e, t, n, r, i) {
e !== t && Yr(t, function (o, s) {
if (i || (i = new Pr), Ds(o)) !function (e, t, n, r, i, o, s) {
var l = io(e, n), c = io(t, n), u = s.get(c);
if (u) Dr(e, n, u); else {
var d = o ? o(l, c, n + "", e, t, s) : a, h = d === a;
if (h) {
var p = ws(c), f = !p && xs(c), m = !p && !f && Fs(c);
d = c, p || f || m ? ws(l) ? d = l : ks(l) ? d = aa(l) : f ? (h = !1, d = Zi(c, !0)) : m ? (h = !1, d = ta(c, !0)) : d = [] : Ms(c) || bs(c) ? (d = l, bs(l) ? d = Hs(l) : Ds(l) && !As(l) || (d = qa(c))) : h = !1
}
h && (s.set(c, d), i(d, c, r, o, s), s.delete(c)), Dr(e, n, d)
}
}(e, t, s, n, yi, r, i); else {
var l = r ? r(io(e, s), o, s + "", e, t, i) : a;
l === a && (l = o), Dr(e, s, l)
}
}, ll)
}
function bi(e, t) {
var n = e.length;
if (n) return Ya(t += t < 0 ? n : 0, n) ? e[t] : a
}
function wi(e, t, n) {
var r = -1;
return t = en(t = t.length ? en(t, function (e) {
return ws(e) ? function (t) {
return Zr(t, 1 === e.length ? e[0] : e)
} : e
}) : [Ol], bn(Va())), function (e, t) {
var n = e.length;
for (e.sort(t); n--;) e[n] = e[n].value;
return e
}(mi(e, function (e, n, i) {
return {
criteria: en(t, function (t) {
return t(e)
}), index: ++r, value: e
}
}), function (e, t) {
return function (e, t, n) {
for (var r = -1, i = e.criteria, a = t.criteria, o = i.length, s = n.length; ++r < o;) {
var l = na(i[r], a[r]);
if (l) {
if (r >= s) return l;
var c = n[r];
return l * ("desc" == c ? -1 : 1)
}
}
return e.index - t.index
}(e, t, n)
})
}
function Si(e, t, n) {
for (var r = -1, i = t.length, a = {}; ++r < i;) {
var o = t[r], s = Zr(e, o);
n(s, o) && Ei(a, Xi(o, e), s)
}
return a
}
function _i(e, t, n, r) {
var i = r ? un : cn, a = -1, o = t.length, s = e;
for (e === t && (t = aa(t)), n && (s = en(e, bn(n))); ++a < o;) for (var l = 0, c = t[a], u = n ? n(c) : c; (l = i(s, u, l, r)) > -1;) s !== e && Rt.call(s, l, 1), Rt.call(e, l, 1);
return e
}
function ki(e, t) {
for (var n = e ? t.length : 0, r = n - 1; n--;) {
var i = t[n];
if (n == r || i !== a) {
var a = i;
Ya(i) ? Rt.call(e, i, 1) : Bi(e, i)
}
}
return e
}
function xi(e, t) {
return e + Kn($n() * (t - e + 1))
}
function Pi(e, t) {
var n = "";
if (!e || t < 1 || t > N) return n;
do {
t % 2 && (n += e), (t = Kn(t / 2)) && (e += e)
} while (t);
return n
}
function Ci(e, t) {
return so(no(e, t, Ol), e + "")
}
function Ai(e) {
return Ar(vl(e))
}
function Ti(e, t) {
var n = vl(e);
return uo(n, Wr(t, 0, n.length))
}
function Ei(e, t, n, r) {
if (!Ds(e)) return e;
for (var i = -1, o = (t = Xi(t, e)).length, s = o - 1, l = e; null != l && ++i < o;) {
var c = po(t[i]), u = n;
if ("__proto__" === c || "constructor" === c || "prototype" === c) return e;
if (i != s) {
var d = l[c];
(u = r ? r(d, c, l) : a) === a && (u = Ds(d) ? d : Ya(t[i + 1]) ? [] : {})
}
Ir(l, c, u), l = l[c]
}
return e
}
var Di = or ? function (e, t) {
return or.set(e, t), e
} : Ol, Ii = fn ? function (e, t) {
return fn(e, "toString", {configurable: !0, enumerable: !1, value: Dl(t), writable: !0})
} : Ol;
function Li(e) {
return uo(vl(e))
}
function Oi(e, t, n) {
var i = -1, a = e.length;
t < 0 && (t = -t > a ? 0 : a + t), (n = n > a ? a : n) < 0 && (n += a), a = t > n ? 0 : n - t >>> 0, t >>>= 0;
for (var o = r(a); ++i < a;) o[i] = e[i + t];
return o
}
function Mi(e, t) {
var n;
return Kr(e, function (e, r, i) {
return !(n = t(e, r, i))
}), !!n
}
function Ni(e, t, n) {
var r = 0, i = null == e ? r : e.length;
if ("number" == typeof t && t == t && i <= G) {
for (; r < i;) {
var a = r + i >>> 1, o = e[a];
null !== o && !Vs(o) && (n ? o <= t : o < t) ? r = a + 1 : i = a
}
return i
}
return Ri(e, t, Ol, n)
}
function Ri(e, t, n, r) {
var i = 0, o = null == e ? 0 : e.length;
if (0 === o) return 0;
for (var s = (t = n(t)) != t, l = null === t, c = Vs(t), u = t === a; i < o;) {
var d = Kn((i + o) / 2), h = n(e[d]), p = h !== a, f = null === h, m = h == h, v = Vs(h);
if (s) var g = r || m; else g = u ? m && (r || p) : l ? m && p && (r || !f) : c ? m && p && !f && (r || !v) : !f && !v && (r ? h <= t : h < t);
g ? i = d + 1 : o = d
}
return Xn(o, F)
}
function Wi(e, t) {
for (var n = -1, r = e.length, i = 0, a = []; ++n < r;) {
var o = e[n], s = t ? t(o) : o;
if (!n || !vs(s, l)) {
var l = s;
a[i++] = 0 === o ? 0 : o
}
}
return a
}
function Vi(e) {
return "number" == typeof e ? e : Vs(e) ? W : +e
}
function Fi(e) {
if ("string" == typeof e) return e;
if (ws(e)) return en(e, Fi) + "";
if (Vs(e)) return mr ? mr.call(e) : "";
var t = e + "";
return "0" == t && 1 / e == -M ? "-0" : t
}
function Gi(e, t, n) {
var r = -1, i = $t, a = e.length, s = !0, l = [], c = l;
if (n) s = !1, i = Zt; else if (a >= o) {
var u = t ? null : Pa(e);
if (u) return In(u);
s = !1, i = Sn, c = new xr
} else c = t ? [] : l;
e:for (; ++r < a;) {
var d = e[r], h = t ? t(d) : d;
if (d = n || 0 !== d ? d : 0, s && h == h) {
for (var p = c.length; p--;) if (c[p] === h) continue e;
t && c.push(h), l.push(d)
} else i(c, h, n) || (c !== l && c.push(h), l.push(d))
}
return l
}
function Bi(e, t) {
return null == (e = ro(e, t = Xi(t, e))) || delete e[po(Co(t))]
}
function Ki(e, t, n, r) {
return Ei(e, t, n(Zr(e, t)), r)
}
function ji(e, t, n, r) {
for (var i = e.length, a = r ? i : -1; (r ? a-- : ++a < i) && t(e[a], a, e);) ;
return n ? Oi(e, r ? 0 : a, r ? a + 1 : i) : Oi(e, r ? a + 1 : 0, r ? i : a)
}
function zi(e, t) {
var n = e;
return n instanceof wr && (n = n.value()), nn(t, function (e, t) {
return t.func.apply(t.thisArg, tn([e], t.args))
}, n)
}
function Ui(e, t, n) {
var i = e.length;
if (i < 2) return i ? Gi(e[0]) : [];
for (var a = -1, o = r(i); ++a < i;) for (var s = e[a], l = -1; ++l < i;) l != a && (o[a] = Br(o[a] || s, e[l], t, n));
return Gi(Hr(o, 1), t, n)
}
function qi(e, t, n) {
for (var r = -1, i = e.length, o = t.length, s = {}; ++r < i;) {
var l = r < o ? t[r] : a;
n(s, e[r], l)
}
return s
}
function Hi(e) {
return ks(e) ? e : []
}
function Yi(e) {
return "function" == typeof e ? e : Ol
}
function Xi(e, t) {
return ws(e) ? e : Ja(e, t) ? [e] : ho(Ys(e))
}
var Ji = Ci;
function Qi(e, t, n) {
var r = e.length;
return n = n === a ? r : n, !t && n >= r ? e : Oi(e, t, n)
}
var $i = Vn || function (e) {
return Mt.clearTimeout(e)
};
function Zi(e, t) {
if (t) return e.slice();
var n = e.length, r = Et ? Et(n) : new e.constructor(n);
return e.copy(r), r
}
function ea(e) {
var t = new e.constructor(e.byteLength);
return new kt(t).set(new kt(e)), t
}
function ta(e, t) {
var n = t ? ea(e.buffer) : e.buffer;
return new e.constructor(n, e.byteOffset, e.length)
}
function na(e, t) {
if (e !== t) {
var n = e !== a, r = null === e, i = e == e, o = Vs(e), s = t !== a, l = null === t, c = t == t, u = Vs(t);
if (!l && !u && !o && e > t || o && s && c && !l && !u || r && s && c || !n && c || !i) return 1;
if (!r && !o && !u && e < t || u && n && i && !r && !o || l && n && i || !s && i || !c) return -1
}
return 0
}
function ra(e, t, n, i) {
for (var a = -1, o = e.length, s = n.length, l = -1, c = t.length, u = Yn(o - s, 0), d = r(c + u), h = !i; ++l < c;) d[l] = t[l];
for (; ++a < s;) (h || a < o) && (d[n[a]] = e[a]);
for (; u--;) d[l++] = e[a++];
return d
}
function ia(e, t, n, i) {
for (var a = -1, o = e.length, s = -1, l = n.length, c = -1, u = t.length, d = Yn(o - l, 0), h = r(d + u), p = !i; ++a < d;) h[a] = e[a];
for (var f = a; ++c < u;) h[f + c] = t[c];
for (; ++s < l;) (p || a < o) && (h[f + n[s]] = e[a++]);
return h
}
function aa(e, t) {
var n = -1, i = e.length;
for (t || (t = r(i)); ++n < i;) t[n] = e[n];
return t
}
function oa(e, t, n, r) {
var i = !n;
n || (n = {});
for (var o = -1, s = t.length; ++o < s;) {
var l = t[o], c = r ? r(n[l], e[l], l, n, e) : a;
c === a && (c = e[l]), i ? Nr(n, l, c) : Ir(n, l, c)
}
return n
}
function sa(e, t) {
return function (n, r) {
var i = ws(n) ? Ht : Or, a = t ? t() : {};
return i(n, e, Va(r, 2), a)
}
}
function la(e) {
return Ci(function (t, n) {
var r = -1, i = n.length, o = i > 1 ? n[i - 1] : a, s = i > 2 ? n[2] : a;
for (o = e.length > 3 && "function" == typeof o ? (i--, o) : a, s && Xa(n[0], n[1], s) && (o = i < 3 ? a : o, i = 1), t = nt(t); ++r < i;) {
var l = n[r];
l && e(t, l, r, o)
}
return t
})
}
function ca(e, t) {
return function (n, r) {
if (null == n) return n;
if (!_s(n)) return e(n, r);
for (var i = n.length, a = t ? i : -1, o = nt(n); (t ? a-- : ++a < i) && !1 !== r(o[a], a, o);) ;
return n
}
}
function ua(e) {
return function (t, n, r) {
for (var i = -1, a = nt(t), o = r(t), s = o.length; s--;) {
var l = o[e ? s : ++i];
if (!1 === n(a[l], l, a)) break
}
return t
}
}
function da(e) {
return function (t) {
var n = An(t = Ys(t)) ? Mn(t) : a, r = n ? n[0] : t.charAt(0), i = n ? Qi(n, 1).join("") : t.slice(1);
return r[e]() + i
}
}
function ha(e) {
return function (t) {
return nn(Al(bl(t).replace(bt, "")), e, "")
}
}
function pa(e) {
return function () {
var t = arguments;
switch (t.length) {
case 0:
return new e;
case 1:
return new e(t[0]);
case 2:
return new e(t[0], t[1]);
case 3:
return new e(t[0], t[1], t[2]);
case 4:
return new e(t[0], t[1], t[2], t[3]);
case 5:
return new e(t[0], t[1], t[2], t[3], t[4]);
case 6:
return new e(t[0], t[1], t[2], t[3], t[4], t[5]);
case 7:
return new e(t[0], t[1], t[2], t[3], t[4], t[5], t[6])
}
var n = gr(e.prototype), r = e.apply(n, t);
return Ds(r) ? r : n
}
}
function fa(e) {
return function (t, n, r) {
var i = nt(t);
if (!_s(t)) {
var o = Va(n, 3);
t = sl(t), n = function (e) {
return o(i[e], e, i)
}
}
var s = e(t, n, r);
return s > -1 ? i[o ? t[s] : s] : a
}
}
function ma(e) {
return La(function (t) {
var n = t.length, r = n, i = br.prototype.thru;
for (e && t.reverse(); r--;) {
var o = t[r];
if ("function" != typeof o) throw new at(l);
if (i && !s && "wrapper" == Ra(o)) var s = new br([], !0)
}
for (r = s ? r : n; ++r < n;) {
var c = Ra(o = t[r]), u = "wrapper" == c ? Na(o) : a;
s = u && Qa(u[0]) && u[1] == (P | S | k | C) && !u[4].length && 1 == u[9] ? s[Ra(u[0])].apply(s, u[3]) : 1 == o.length && Qa(o) ? s[c]() : s.thru(o)
}
return function () {
var e = arguments, r = e[0];
if (s && 1 == e.length && ws(r)) return s.plant(r).value();
for (var i = 0, a = n ? t[i].apply(this, e) : r; ++i < n;) a = t[i].call(this, a);
return a
}
})
}
function va(e, t, n, i, o, s, l, c, u, d) {
var h = t & P, p = t & y, f = t & b, m = t & (S | _), v = t & A, g = f ? a : pa(e);
return function y() {
for (var b = arguments.length, w = r(b), S = b; S--;) w[S] = arguments[S];
if (m) var _ = Wa(y), k = function (e, t) {
for (var n = e.length, r = 0; n--;) e[n] === t && ++r;
return r
}(w, _);
if (i && (w = ra(w, i, o, m)), s && (w = ia(w, s, l, m)), b -= k, m && b < d) {
var x = Dn(w, _);
return ka(e, t, va, y.placeholder, n, w, x, c, u, d - b)
}
var P = p ? n : this, C = f ? P[e] : e;
return b = w.length, c ? w = function (e, t) {
for (var n = e.length, r = Xn(t.length, n), i = aa(e); r--;) {
var o = t[r];
e[r] = Ya(o, n) ? i[o] : a
}
return e
}(w, c) : v && b > 1 && w.reverse(), h && u < b && (w.length = u), this && this !== Mt && this instanceof y && (C = g || pa(C)), C.apply(P, w)
}
}
function ga(e, t) {
return function (n, r) {
return function (e, t, n, r) {
return Jr(e, function (e, i, a) {
t(r, n(e), i, a)
}), r
}(n, e, t(r), {})
}
}
function ya(e, t) {
return function (n, r) {
var i;
if (n === a && r === a) return t;
if (n !== a && (i = n), r !== a) {
if (i === a) return r;
"string" == typeof n || "string" == typeof r ? (n = Fi(n), r = Fi(r)) : (n = Vi(n), r = Vi(r)), i = e(n, r)
}
return i
}
}
function ba(e) {
return La(function (t) {
return t = en(t, bn(Va())), Ci(function (n) {
var r = this;
return e(t, function (e) {
return qt(e, r, n)
})
})
})
}
function wa(e, t) {
var n = (t = t === a ? " " : Fi(t)).length;
if (n < 2) return n ? Pi(t, e) : t;
var r = Pi(t, Bn(e / On(t)));
return An(t) ? Qi(Mn(r), 0, e).join("") : r.slice(0, e)
}
function Sa(e) {
return function (t, n, i) {
return i && "number" != typeof i && Xa(t, n, i) && (n = i = a), t = js(t), n === a ? (n = t, t = 0) : n = js(n), function (e, t, n, i) {
for (var a = -1, o = Yn(Bn((t - e) / (n || 1)), 0), s = r(o); o--;) s[i ? o : ++a] = e, e += n;
return s
}(t, n, i = i === a ? t < n ? 1 : -1 : js(i), e)
}
}
function _a(e) {
return function (t, n) {
return "string" == typeof t && "string" == typeof n || (t = qs(t), n = qs(n)), e(t, n)
}
}
function ka(e, t, n, r, i, o, s, l, c, u) {
var d = t & S;
t |= d ? k : x, (t &= ~(d ? x : k)) & w || (t &= ~(y | b));
var h = [e, t, i, d ? o : a, d ? s : a, d ? a : o, d ? a : s, l, c, u], p = n.apply(a, h);
return Qa(e) && ao(p, h), p.placeholder = r, lo(p, e, t)
}
function xa(e) {
var t = tt[e];
return function (e, n) {
if (e = qs(e), (n = null == n ? 0 : Xn(zs(n), 292)) && Un(e)) {
var r = (Ys(e) + "e").split("e");
return +((r = (Ys(t(r[0] + "e" + (+r[1] + n))) + "e").split("e"))[0] + "e" + (+r[1] - n))
}
return t(e)
}
}
var Pa = rr && 1 / In(new rr([, -0]))[1] == M ? function (e) {
return new rr(e)
} : Vl;
function Ca(e) {
return function (t) {
var n = za(t);
return n == Q ? Tn(t) : n == re ? Ln(t) : function (e, t) {
return en(t, function (t) {
return [t, e[t]]
})
}(t, e(t))
}
}
function Aa(e, t, n, i, o, s, c, u) {
var d = t & b;
if (!d && "function" != typeof e) throw new at(l);
var p = i ? i.length : 0;
if (p || (t &= ~(k | x), i = o = a), c = c === a ? c : Yn(zs(c), 0), u = u === a ? u : zs(u), p -= o ? o.length : 0, t & x) {
var f = i, m = o;
i = o = a
}
var v = d ? a : Na(e), g = [e, t, n, i, o, f, m, s, c, u];
if (v && function (e, t) {
var n = e[1], r = t[1], i = n | r, a = i < (y | b | P),
o = r == P && n == S || r == P && n == C && e[7].length <= t[8] || r == (P | C) && t[7].length <= t[8] && n == S;
if (!a && !o) return e;
r & y && (e[2] = t[2], i |= n & y ? 0 : w);
var s = t[3];
if (s) {
var l = e[3];
e[3] = l ? ra(l, s, t[4]) : s, e[4] = l ? Dn(e[3], h) : t[4]
}
(s = t[5]) && (l = e[5], e[5] = l ? ia(l, s, t[6]) : s, e[6] = l ? Dn(e[5], h) : t[6]), (s = t[7]) && (e[7] = s), r & P && (e[8] = null == e[8] ? t[8] : Xn(e[8], t[8])), null == e[9] && (e[9] = t[9]), e[0] = t[0], e[1] = i
}(g, v), e = g[0], t = g[1], n = g[2], i = g[3], o = g[4], !(u = g[9] = g[9] === a ? d ? 0 : e.length : Yn(g[9] - p, 0)) && t & (S | _) && (t &= ~(S | _)), t && t != y) A = t == S || t == _ ? function (e, t, n) {
var i = pa(e);
return function o() {
for (var s = arguments.length, l = r(s), c = s, u = Wa(o); c--;) l[c] = arguments[c];
var d = s < 3 && l[0] !== u && l[s - 1] !== u ? [] : Dn(l, u);
return (s -= d.length) < n ? ka(e, t, va, o.placeholder, a, l, d, a, a, n - s) : qt(this && this !== Mt && this instanceof o ? i : e, this, l)
}
}(e, t, u) : t != k && t != (y | k) || o.length ? va.apply(a, g) : function (e, t, n, i) {
var a = t & y, o = pa(e);
return function t() {
for (var s = -1, l = arguments.length, c = -1, u = i.length, d = r(u + l), h = this && this !== Mt && this instanceof t ? o : e; ++c < u;) d[c] = i[c];
for (; l--;) d[c++] = arguments[++s];
return qt(h, a ? n : this, d)
}
}(e, t, n, i); else var A = function (e, t, n) {
var r = t & y, i = pa(e);
return function t() {
return (this && this !== Mt && this instanceof t ? i : e).apply(r ? n : this, arguments)
}
}(e, t, n);
return lo((v ? Di : ao)(A, g), e, t)
}
function Ta(e, t, n, r) {
return e === a || vs(e, lt[n]) && !dt.call(r, n) ? t : e
}
function Ea(e, t, n, r, i, o) {
return Ds(e) && Ds(t) && (o.set(t, e), yi(e, t, a, Ea, o), o.delete(t)), e
}
function Da(e) {
return Ms(e) ? a : e
}
function Ia(e, t, n, r, i, o) {
var s = n & v, l = e.length, c = t.length;
if (l != c && !(s && c > l)) return !1;
var u = o.get(e), d = o.get(t);
if (u && d) return u == t && d == e;
var h = -1, p = !0, f = n & g ? new xr : a;
for (o.set(e, t), o.set(t, e); ++h < l;) {
var m = e[h], y = t[h];
if (r) var b = s ? r(y, m, h, t, e, o) : r(m, y, h, e, t, o);
if (b !== a) {
if (b) continue;
p = !1;
break
}
if (f) {
if (!an(t, function (e, t) {
if (!Sn(f, t) && (m === e || i(m, e, n, r, o))) return f.push(t)
})) {
p = !1;
break
}
} else if (m !== y && !i(m, y, n, r, o)) {
p = !1;
break
}
}
return o.delete(e), o.delete(t), p
}
function La(e) {
return so(no(e, a, So), e + "")
}
function Oa(e) {
return ei(e, sl, Ka)
}
function Ma(e) {
return ei(e, ll, ja)
}
var Na = or ? function (e) {
return or.get(e)
} : Vl;
function Ra(e) {
for (var t = e.name + "", n = sr[t], r = dt.call(sr, t) ? n.length : 0; r--;) {
var i = n[r], a = i.func;
if (null == a || a == e) return i.name
}
return t
}
function Wa(e) {
return (dt.call(vr, "placeholder") ? vr : e).placeholder
}
function Va() {
var e = vr.iteratee || Ml;
return e = e === Ml ? di : e, arguments.length ? e(arguments[0], arguments[1]) : e
}
function Fa(e, t) {
var n, r, a = e.__data__;
return ("string" == (r = void 0 === (n = t) ? "undefined" : i(n)) || "number" == r || "symbol" == r || "boolean" == r ? "__proto__" !== n : null === n) ? a["string" == typeof t ? "string" : "hash"] : a.map
}
function Ga(e) {
for (var t = sl(e), n = t.length; n--;) {
var r = t[n], i = e[r];
t[n] = [r, i, eo(i)]
}
return t
}
function Ba(e, t) {
var n = function (e, t) {
return null == e ? a : e[t]
}(e, t);
return ui(n) ? n : a
}
var Ka = jn ? function (e) {
return null == e ? [] : (e = nt(e), Qt(jn(e), function (t) {
return Nt.call(e, t)
}))
} : Ul, ja = jn ? function (e) {
for (var t = []; e;) tn(t, Ka(e)), e = Lt(e);
return t
} : Ul, za = ti;
function Ua(e, t, n) {
for (var r = -1, i = (t = Xi(t, e)).length, a = !1; ++r < i;) {
var o = po(t[r]);
if (!(a = null != e && n(e, o))) break;
e = e[o]
}
return a || ++r != i ? a : !!(i = null == e ? 0 : e.length) && Es(i) && Ya(o, i) && (ws(e) || bs(e))
}
function qa(e) {
return "function" != typeof e.constructor || Za(e) ? {} : gr(Lt(e))
}
function Ha(e) {
return ws(e) || bs(e) || !!(Vt && e && e[Vt])
}
function Ya(e, t) {
var n = void 0 === e ? "undefined" : i(e);
return !!(t = null == t ? N : t) && ("number" == n || "symbol" != n && Xe.test(e)) && e > -1 && e % 1 == 0 && e < t
}
function Xa(e, t, n) {
if (!Ds(n)) return !1;
var r = void 0 === t ? "undefined" : i(t);
return !!("number" == r ? _s(n) && Ya(t, n.length) : "string" == r && t in n) && vs(n[t], e)
}
function Ja(e, t) {
if (ws(e)) return !1;
var n = void 0 === e ? "undefined" : i(e);
return !("number" != n && "symbol" != n && "boolean" != n && null != e && !Vs(e)) || Ie.test(e) || !De.test(e) || null != t && e in nt(t)
}
function Qa(e) {
var t = Ra(e), n = vr[t];
if ("function" != typeof n || !(t in wr.prototype)) return !1;
if (e === n) return !0;
var r = Na(n);
return !!r && e === r[0]
}
(er && za(new er(new ArrayBuffer(1))) != ue || tr && za(new tr) != Q || nr && "[object Promise]" != za(nr.resolve()) || rr && za(new rr) != re || ir && za(new ir) != se) && (za = function (e) {
var t = ti(e), n = t == ee ? e.constructor : a, r = n ? fo(n) : "";
if (r) switch (r) {
case lr:
return ue;
case cr:
return Q;
case ur:
return "[object Promise]";
case dr:
return re;
case hr:
return se
}
return t
});
var $a = ct ? As : ql;
function Za(e) {
var t = e && e.constructor;
return e === ("function" == typeof t && t.prototype || lt)
}
function eo(e) {
return e == e && !Ds(e)
}
function to(e, t) {
return function (n) {
return null != n && n[e] === t && (t !== a || e in nt(n))
}
}
function no(e, t, n) {
return t = Yn(t === a ? e.length - 1 : t, 0), function () {
for (var i = arguments, a = -1, o = Yn(i.length - t, 0), s = r(o); ++a < o;) s[a] = i[t + a];
a = -1;
for (var l = r(t + 1); ++a < t;) l[a] = i[a];
return l[t] = n(s), qt(e, this, l)
}
}
function ro(e, t) {
return t.length < 2 ? e : Zr(e, Oi(t, 0, -1))
}
function io(e, t) {
if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) return e[t]
}
var ao = co(Di), oo = Gn || function (e, t) {
return Mt.setTimeout(e, t)
}, so = co(Ii);
function lo(e, t, n) {
var r = t + "";
return so(e, function (e, t) {
var n = t.length;
if (!n) return e;
var r = n - 1;
return t[r] = (n > 1 ? "& " : "") + t[r], t = t.join(n > 2 ? ", " : " "), e.replace(We, "{\n/* [wrapped with " + t + "] */\n")
}(r, function (e, t) {
return Yt(B, function (n) {
var r = "_." + n[0];
t & n[1] && !$t(e, r) && e.push(r)
}), e.sort()
}(function (e) {
var t = e.match(Ve);
return t ? t[1].split(Fe) : []
}(r), n)))
}
function co(e) {
var t = 0, n = 0;
return function () {
var r = Jn(), i = I - (r - n);
if (n = r, i > 0) {
if (++t >= D) return arguments[0]
} else t = 0;
return e.apply(a, arguments)
}
}
function uo(e, t) {
var n = -1, r = e.length, i = r - 1;
for (t = t === a ? r : t; ++n < t;) {
var o = xi(n, i), s = e[o];
e[o] = e[n], e[n] = s
}
return e.length = t, e
}
var ho = function (e) {
var t = us(e, function (e) {
return n.size === d && n.clear(), e
}), n = t.cache;
return t
}(function (e) {
var t = [];
return 46 === e.charCodeAt(0) && t.push(""), e.replace(Le, function (e, n, r, i) {
t.push(r ? i.replace(Ke, "$1") : n || e)
}), t
});
function po(e) {
if ("string" == typeof e || Vs(e)) return e;
var t = e + "";
return "0" == t && 1 / e == -M ? "-0" : t
}
function fo(e) {
if (null != e) {
try {
return ut.call(e)
} catch (e) {
}
try {
return e + ""
} catch (e) {
}
}
return ""
}
function mo(e) {
if (e instanceof wr) return e.clone();
var t = new br(e.__wrapped__, e.__chain__);
return t.__actions__ = aa(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t
}
var vo = Ci(function (e, t) {
return ks(e) ? Br(e, Hr(t, 1, ks, !0)) : []
}), go = Ci(function (e, t) {
var n = Co(t);
return ks(n) && (n = a), ks(e) ? Br(e, Hr(t, 1, ks, !0), Va(n, 2)) : []
}), yo = Ci(function (e, t) {
var n = Co(t);
return ks(n) && (n = a), ks(e) ? Br(e, Hr(t, 1, ks, !0), a, n) : []
});
function bo(e, t, n) {
var r = null == e ? 0 : e.length;
if (!r) return -1;
var i = null == n ? 0 : zs(n);
return i < 0 && (i = Yn(r + i, 0)), ln(e, Va(t, 3), i)
}
function wo(e, t, n) {
var r = null == e ? 0 : e.length;
if (!r) return -1;
var i = r - 1;
return n !== a && (i = zs(n), i = n < 0 ? Yn(r + i, 0) : Xn(i, r - 1)), ln(e, Va(t, 3), i, !0)
}
function So(e) {
return null != e && e.length ? Hr(e, 1) : []
}
function _o(e) {
return e && e.length ? e[0] : a
}
var ko = Ci(function (e) {
var t = en(e, Hi);
return t.length && t[0] === e[0] ? ai(t) : []
}), xo = Ci(function (e) {
var t = Co(e), n = en(e, Hi);
return t === Co(n) ? t = a : n.pop(), n.length && n[0] === e[0] ? ai(n, Va(t, 2)) : []
}), Po = Ci(function (e) {
var t = Co(e), n = en(e, Hi);
return (t = "function" == typeof t ? t : a) && n.pop(), n.length && n[0] === e[0] ? ai(n, a, t) : []
});
function Co(e) {
var t = null == e ? 0 : e.length;
return t ? e[t - 1] : a
}
var Ao = Ci(To);
function To(e, t) {
return e && e.length && t && t.length ? _i(e, t) : e
}
var Eo = La(function (e, t) {
var n = null == e ? 0 : e.length, r = Rr(e, t);
return ki(e, en(t, function (e) {
return Ya(e, n) ? +e : e
}).sort(na)), r
});
function Do(e) {
return null == e ? e : Zn.call(e)
}
var Io = Ci(function (e) {
return Gi(Hr(e, 1, ks, !0))
}), Lo = Ci(function (e) {
var t = Co(e);
return ks(t) && (t = a), Gi(Hr(e, 1, ks, !0), Va(t, 2))
}), Oo = Ci(function (e) {
var t = Co(e);
return t = "function" == typeof t ? t : a, Gi(Hr(e, 1, ks, !0), a, t)
});
function Mo(e) {
if (!e || !e.length) return [];
var t = 0;
return e = Qt(e, function (e) {
if (ks(e)) return t = Yn(e.length, t), !0
}), gn(t, function (t) {
return en(e, pn(t))
})
}
function No(e, t) {
if (!e || !e.length) return [];
var n = Mo(e);
return null == t ? n : en(n, function (e) {
return qt(t, a, e)
})
}
var Ro = Ci(function (e, t) {
return ks(e) ? Br(e, t) : []
}), Wo = Ci(function (e) {
return Ui(Qt(e, ks))
}), Vo = Ci(function (e) {
var t = Co(e);
return ks(t) && (t = a), Ui(Qt(e, ks), Va(t, 2))
}), Fo = Ci(function (e) {
var t = Co(e);
return t = "function" == typeof t ? t : a, Ui(Qt(e, ks), a, t)
}), Go = Ci(Mo);
var Bo = Ci(function (e) {
var t = e.length, n = t > 1 ? e[t - 1] : a;
return No(e, n = "function" == typeof n ? (e.pop(), n) : a)
});
function Ko(e) {
var t = vr(e);
return t.__chain__ = !0, t
}
function jo(e, t) {
return t(e)
}
var zo = La(function (e) {
var t = e.length, n = t ? e[0] : 0, r = this.__wrapped__, i = function (t) {
return Rr(t, e)
};
return !(t > 1 || this.__actions__.length) && r instanceof wr && Ya(n) ? ((r = r.slice(n, +n + (t ? 1 : 0))).__actions__.push({
func: jo,
args: [i],
thisArg: a
}), new br(r, this.__chain__).thru(function (e) {
return t && !e.length && e.push(a), e
})) : this.thru(i)
});
var Uo = sa(function (e, t, n) {
dt.call(e, n) ? ++e[n] : Nr(e, n, 1)
});
var qo = fa(bo), Ho = fa(wo);
function Yo(e, t) {
return (ws(e) ? Yt : Kr)(e, Va(t, 3))
}
function Xo(e, t) {
return (ws(e) ? Xt : jr)(e, Va(t, 3))
}
var Jo = sa(function (e, t, n) {
dt.call(e, n) ? e[n].push(t) : Nr(e, n, [t])
});
var Qo = Ci(function (e, t, n) {
var i = -1, a = "function" == typeof t, o = _s(e) ? r(e.length) : [];
return Kr(e, function (e) {
o[++i] = a ? qt(t, e, n) : oi(e, t, n)
}), o
}), $o = sa(function (e, t, n) {
Nr(e, n, t)
});
function Zo(e, t) {
return (ws(e) ? en : mi)(e, Va(t, 3))
}
var es = sa(function (e, t, n) {
e[n ? 0 : 1].push(t)
}, function () {
return [[], []]
});
var ts = Ci(function (e, t) {
if (null == e) return [];
var n = t.length;
return n > 1 && Xa(e, t[0], t[1]) ? t = [] : n > 2 && Xa(t[0], t[1], t[2]) && (t = [t[0]]), wi(e, Hr(t, 1), [])
}), ns = Fn || function () {
return Mt.Date.now()
};
function rs(e, t, n) {
return t = n ? a : t, t = e && null == t ? e.length : t, Aa(e, P, a, a, a, a, t)
}
function is(e, t) {
var n;
if ("function" != typeof t) throw new at(l);
return e = zs(e), function () {
return --e > 0 && (n = t.apply(this, arguments)), e <= 1 && (t = a), n
}
}
var as = Ci(function (e, t, n) {
var r = y;
if (n.length) {
var i = Dn(n, Wa(as));
r |= k
}
return Aa(e, r, t, n, i)
}), os = Ci(function (e, t, n) {
var r = y | b;
if (n.length) {
var i = Dn(n, Wa(os));
r |= k
}
return Aa(t, r, e, n, i)
});
function ss(e, t, n) {
var r, i, o, s, c, u, d = 0, h = !1, p = !1, f = !0;
if ("function" != typeof e) throw new at(l);
function m(t) {
var n = r, o = i;
return r = i = a, d = t, s = e.apply(o, n)
}
function v(e) {
var n = e - u;
return u === a || n >= t || n < 0 || p && e - d >= o
}
function g() {
var e = ns();
if (v(e)) return y(e);
c = oo(g, function (e) {
var n = t - (e - u);
return p ? Xn(n, o - (e - d)) : n
}(e))
}
function y(e) {
return c = a, f && r ? m(e) : (r = i = a, s)
}
function b() {
var e = ns(), n = v(e);
if (r = arguments, i = this, u = e, n) {
if (c === a) return function (e) {
return d = e, c = oo(g, t), h ? m(e) : s
}(u);
if (p) return $i(c), c = oo(g, t), m(u)
}
return c === a && (c = oo(g, t)), s
}
return t = qs(t) || 0, Ds(n) && (h = !!n.leading, o = (p = "maxWait" in n) ? Yn(qs(n.maxWait) || 0, t) : o, f = "trailing" in n ? !!n.trailing : f), b.cancel = function () {
c !== a && $i(c), d = 0, r = u = i = c = a
}, b.flush = function () {
return c === a ? s : y(ns())
}, b
}
var ls = Ci(function (e, t) {
return Gr(e, 1, t)
}), cs = Ci(function (e, t, n) {
return Gr(e, qs(t) || 0, n)
});
function us(e, t) {
if ("function" != typeof e || null != t && "function" != typeof t) throw new at(l);
var n = function n() {
var r = arguments, i = t ? t.apply(this, r) : r[0], a = n.cache;
if (a.has(i)) return a.get(i);
var o = e.apply(this, r);
return n.cache = a.set(i, o) || a, o
};
return n.cache = new (us.Cache || kr), n
}
function ds(e) {
if ("function" != typeof e) throw new at(l);
return function () {
var t = arguments;
switch (t.length) {
case 0:
return !e.call(this);
case 1:
return !e.call(this, t[0]);
case 2:
return !e.call(this, t[0], t[1]);
case 3:
return !e.call(this, t[0], t[1], t[2])
}
return !e.apply(this, t)
}
}
us.Cache = kr;
var hs = Ji(function (e, t) {
var n = (t = 1 == t.length && ws(t[0]) ? en(t[0], bn(Va())) : en(Hr(t, 1), bn(Va()))).length;
return Ci(function (r) {
for (var i = -1, a = Xn(r.length, n); ++i < a;) r[i] = t[i].call(this, r[i]);
return qt(e, this, r)
})
}), ps = Ci(function (e, t) {
var n = Dn(t, Wa(ps));
return Aa(e, k, a, t, n)
}), fs = Ci(function (e, t) {
var n = Dn(t, Wa(fs));
return Aa(e, x, a, t, n)
}), ms = La(function (e, t) {
return Aa(e, C, a, a, a, t)
});
function vs(e, t) {
return e === t || e != e && t != t
}
var gs = _a(ni), ys = _a(function (e, t) {
return e >= t
}), bs = si(function () {
return arguments
}()) ? si : function (e) {
return Is(e) && dt.call(e, "callee") && !Nt.call(e, "callee")
}, ws = r.isArray, Ss = Gt ? bn(Gt) : function (e) {
return Is(e) && ti(e) == ce
};
function _s(e) {
return null != e && Es(e.length) && !As(e)
}
function ks(e) {
return Is(e) && _s(e)
}
var xs = zn || ql, Ps = Bt ? bn(Bt) : function (e) {
return Is(e) && ti(e) == q
};
function Cs(e) {
if (!Is(e)) return !1;
var t = ti(e);
return t == Y || t == H || "string" == typeof e.message && "string" == typeof e.name && !Ms(e)
}
function As(e) {
if (!Ds(e)) return !1;
var t = ti(e);
return t == X || t == J || t == z || t == te
}
function Ts(e) {
return "number" == typeof e && e == zs(e)
}
function Es(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <= N
}
function Ds(e) {
var t = void 0 === e ? "undefined" : i(e);
return null != e && ("object" == t || "function" == t)
}
function Is(e) {
return null != e && "object" == (void 0 === e ? "undefined" : i(e))
}
var Ls = Kt ? bn(Kt) : function (e) {
return Is(e) && za(e) == Q
};
function Os(e) {
return "number" == typeof e || Is(e) && ti(e) == $
}
function Ms(e) {
if (!Is(e) || ti(e) != ee) return !1;
var t = Lt(e);
if (null === t) return !0;
var n = dt.call(t, "constructor") && t.constructor;
return "function" == typeof n && n instanceof n && ut.call(n) == mt
}
var Ns = jt ? bn(jt) : function (e) {
return Is(e) && ti(e) == ne
};
var Rs = zt ? bn(zt) : function (e) {
return Is(e) && za(e) == re
};
function Ws(e) {
return "string" == typeof e || !ws(e) && Is(e) && ti(e) == ie
}
function Vs(e) {
return "symbol" == (void 0 === e ? "undefined" : i(e)) || Is(e) && ti(e) == ae
}
var Fs = Ut ? bn(Ut) : function (e) {
return Is(e) && Es(e.length) && !!At[ti(e)]
};
var Gs = _a(fi), Bs = _a(function (e, t) {
return e <= t
});
function Ks(e) {
if (!e) return [];
if (_s(e)) return Ws(e) ? Mn(e) : aa(e);
if (Ft && e[Ft]) return function (e) {
for (var t, n = []; !(t = e.next()).done;) n.push(t.value);
return n
}(e[Ft]());
var t = za(e);
return (t == Q ? Tn : t == re ? In : vl)(e)
}
function js(e) {
return e ? (e = qs(e)) === M || e === -M ? (e < 0 ? -1 : 1) * R : e == e ? e : 0 : 0 === e ? e : 0
}
function zs(e) {
var t = js(e), n = t % 1;
return t == t ? n ? t - n : t : 0
}
function Us(e) {
return e ? Wr(zs(e), 0, V) : 0
}
function qs(e) {
if ("number" == typeof e) return e;
if (Vs(e)) return W;
if (Ds(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = Ds(t) ? t + "" : t
}
if ("string" != typeof e) return 0 === e ? e : +e;
e = yn(e);
var n = qe.test(e);
return n || Ye.test(e) ? It(e.slice(2), n ? 2 : 8) : Ue.test(e) ? W : +e
}
function Hs(e) {
return oa(e, ll(e))
}
function Ys(e) {
return null == e ? "" : Fi(e)
}
var Xs = la(function (e, t) {
if (Za(t) || _s(t)) oa(t, sl(t), e); else for (var n in t) dt.call(t, n) && Ir(e, n, t[n])
}), Js = la(function (e, t) {
oa(t, ll(t), e)
}), Qs = la(function (e, t, n, r) {
oa(t, ll(t), e, r)
}), $s = la(function (e, t, n, r) {
oa(t, sl(t), e, r)
}), Zs = La(Rr);
var el = Ci(function (e, t) {
e = nt(e);
var n = -1, r = t.length, i = r > 2 ? t[2] : a;
for (i && Xa(t[0], t[1], i) && (r = 1); ++n < r;) for (var o = t[n], s = ll(o), l = -1, c = s.length; ++l < c;) {
var u = s[l], d = e[u];
(d === a || vs(d, lt[u]) && !dt.call(e, u)) && (e[u] = o[u])
}
return e
}), tl = Ci(function (e) {
return e.push(a, Ea), qt(ul, a, e)
});
function nl(e, t, n) {
var r = null == e ? a : Zr(e, t);
return r === a ? n : r
}
function rl(e, t) {
return null != e && Ua(e, t, ii)
}
var il = ga(function (e, t, n) {
null != t && "function" != typeof t.toString && (t = ft.call(t)), e[t] = n
}, Dl(Ol)), al = ga(function (e, t, n) {
null != t && "function" != typeof t.toString && (t = ft.call(t)), dt.call(e, t) ? e[t].push(n) : e[t] = [n]
}, Va), ol = Ci(oi);
function sl(e) {
return _s(e) ? Cr(e) : hi(e)
}
function ll(e) {
return _s(e) ? Cr(e, !0) : pi(e)
}
var cl = la(function (e, t, n) {
yi(e, t, n)
}), ul = la(function (e, t, n, r) {
yi(e, t, n, r)
}), dl = La(function (e, t) {
var n = {};
if (null == e) return n;
var r = !1;
t = en(t, function (t) {
return t = Xi(t, e), r || (r = t.length > 1), t
}), oa(e, Ma(e), n), r && (n = Vr(n, p | f | m, Da));
for (var i = t.length; i--;) Bi(n, t[i]);
return n
});
var hl = La(function (e, t) {
return null == e ? {} : function (e, t) {
return Si(e, t, function (t, n) {
return rl(e, n)
})
}(e, t)
});
function pl(e, t) {
if (null == e) return {};
var n = en(Ma(e), function (e) {
return [e]
});
return t = Va(t), Si(e, n, function (e, n) {
return t(e, n[0])
})
}
var fl = Ca(sl), ml = Ca(ll);
function vl(e) {
return null == e ? [] : wn(e, sl(e))
}
var gl = ha(function (e, t, n) {
return t = t.toLowerCase(), e + (n ? yl(t) : t)
});
function yl(e) {
return Cl(Ys(e).toLowerCase())
}
function bl(e) {
return (e = Ys(e)) && e.replace(Je, xn).replace(wt, "")
}
var wl = ha(function (e, t, n) {
return e + (n ? "-" : "") + t.toLowerCase()
}), Sl = ha(function (e, t, n) {
return e + (n ? " " : "") + t.toLowerCase()
}), _l = da("toLowerCase");
var kl = ha(function (e, t, n) {
return e + (n ? "_" : "") + t.toLowerCase()
});
var xl = ha(function (e, t, n) {
return e + (n ? " " : "") + Cl(t)
});
var Pl = ha(function (e, t, n) {
return e + (n ? " " : "") + t.toUpperCase()
}), Cl = da("toUpperCase");
function Al(e, t, n) {
return e = Ys(e), (t = n ? a : t) === a ? function (e) {
return xt.test(e)
}(e) ? function (e) {
return e.match(_t) || []
}(e) : function (e) {
return e.match(Ge) || []
}(e) : e.match(t) || []
}
var Tl = Ci(function (e, t) {
try {
return qt(e, a, t)
} catch (e) {
return Cs(e) ? e : new Ze(e)
}
}), El = La(function (e, t) {
return Yt(t, function (t) {
t = po(t), Nr(e, t, as(e[t], e))
}), e
});
function Dl(e) {
return function () {
return e
}
}
var Il = ma(), Ll = ma(!0);
function Ol(e) {
return e
}
function Ml(e) {
return di("function" == typeof e ? e : Vr(e, p))
}
var Nl = Ci(function (e, t) {
return function (n) {
return oi(n, e, t)
}
}), Rl = Ci(function (e, t) {
return function (n) {
return oi(e, n, t)
}
});
function Wl(e, t, n) {
var r = sl(t), i = $r(t, r);
null != n || Ds(t) && (i.length || !r.length) || (n = t, t = e, e = this, i = $r(t, sl(t)));
var a = !(Ds(n) && "chain" in n && !n.chain), o = As(e);
return Yt(i, function (n) {
var r = t[n];
e[n] = r, o && (e.prototype[n] = function () {
var t = this.__chain__;
if (a || t) {
var n = e(this.__wrapped__);
return (n.__actions__ = aa(this.__actions__)).push({
func: r,
args: arguments,
thisArg: e
}), n.__chain__ = t, n
}
return r.apply(e, tn([this.value()], arguments))
})
}), e
}
function Vl() {
}
var Fl = ba(en), Gl = ba(Jt), Bl = ba(an);
function Kl(e) {
return Ja(e) ? pn(po(e)) : function (e) {
return function (t) {
return Zr(t, e)
}
}(e)
}
var jl = Sa(), zl = Sa(!0);
function Ul() {
return []
}
function ql() {
return !1
}
var Hl = ya(function (e, t) {
return e + t
}, 0), Yl = xa("ceil"), Xl = ya(function (e, t) {
return e / t
}, 1), Jl = xa("floor");
var Ql, $l = ya(function (e, t) {
return e * t
}, 1), Zl = xa("round"), ec = ya(function (e, t) {
return e - t
}, 0);
return vr.after = function (e, t) {
if ("function" != typeof t) throw new at(l);
return e = zs(e), function () {
if (--e < 1) return t.apply(this, arguments)
}
}, vr.ary = rs, vr.assign = Xs, vr.assignIn = Js, vr.assignInWith = Qs, vr.assignWith = $s, vr.at = Zs, vr.before = is, vr.bind = as, vr.bindAll = El, vr.bindKey = os, vr.castArray = function () {
if (!arguments.length) return [];
var e = arguments[0];
return ws(e) ? e : [e]
}, vr.chain = Ko, vr.chunk = function (e, t, n) {
t = (n ? Xa(e, t, n) : t === a) ? 1 : Yn(zs(t), 0);
var i = null == e ? 0 : e.length;
if (!i || t < 1) return [];
for (var o = 0, s = 0, l = r(Bn(i / t)); o < i;) l[s++] = Oi(e, o, o += t);
return l
}, vr.compact = function (e) {
for (var t = -1, n = null == e ? 0 : e.length, r = 0, i = []; ++t < n;) {
var a = e[t];
a && (i[r++] = a)
}
return i
}, vr.concat = function () {
var e = arguments.length;
if (!e) return [];
for (var t = r(e - 1), n = arguments[0], i = e; i--;) t[i - 1] = arguments[i];
return tn(ws(n) ? aa(n) : [n], Hr(t, 1))
}, vr.cond = function (e) {
var t = null == e ? 0 : e.length, n = Va();
return e = t ? en(e, function (e) {
if ("function" != typeof e[1]) throw new at(l);
return [n(e[0]), e[1]]
}) : [], Ci(function (n) {
for (var r = -1; ++r < t;) {
var i = e[r];
if (qt(i[0], this, n)) return qt(i[1], this, n)
}
})
}, vr.conforms = function (e) {
return function (e) {
var t = sl(e);
return function (n) {
return Fr(n, e, t)
}
}(Vr(e, p))
}, vr.constant = Dl, vr.countBy = Uo, vr.create = function (e, t) {
var n = gr(e);
return null == t ? n : Mr(n, t)
}, vr.curry = function e(t, n, r) {
var i = Aa(t, S, a, a, a, a, a, n = r ? a : n);
return i.placeholder = e.placeholder, i
}, vr.curryRight = function e(t, n, r) {
var i = Aa(t, _, a, a, a, a, a, n = r ? a : n);
return i.placeholder = e.placeholder, i
}, vr.debounce = ss, vr.defaults = el, vr.defaultsDeep = tl, vr.defer = ls, vr.delay = cs, vr.difference = vo, vr.differenceBy = go, vr.differenceWith = yo, vr.drop = function (e, t, n) {
var r = null == e ? 0 : e.length;
return r ? Oi(e, (t = n || t === a ? 1 : zs(t)) < 0 ? 0 : t, r) : []
}, vr.dropRight = function (e, t, n) {
var r = null == e ? 0 : e.length;
return r ? Oi(e, 0, (t = r - (t = n || t === a ? 1 : zs(t))) < 0 ? 0 : t) : []
}, vr.dropRightWhile = function (e, t) {
return e && e.length ? ji(e, Va(t, 3), !0, !0) : []
}, vr.dropWhile = function (e, t) {
return e && e.length ? ji(e, Va(t, 3), !0) : []
}, vr.fill = function (e, t, n, r) {
var i = null == e ? 0 : e.length;
return i ? (n && "number" != typeof n && Xa(e, t, n) && (n = 0, r = i), function (e, t, n, r) {
var i = e.length;
for ((n = zs(n)) < 0 && (n = -n > i ? 0 : i + n), (r = r === a || r > i ? i : zs(r)) < 0 && (r += i), r = n > r ? 0 : Us(r); n < r;) e[n++] = t;
return e
}(e, t, n, r)) : []
}, vr.filter = function (e, t) {
return (ws(e) ? Qt : qr)(e, Va(t, 3))
}, vr.flatMap = function (e, t) {
return Hr(Zo(e, t), 1)
}, vr.flatMapDeep = function (e, t) {
return Hr(Zo(e, t), M)
}, vr.flatMapDepth = function (e, t, n) {
return n = n === a ? 1 : zs(n), Hr(Zo(e, t), n)
}, vr.flatten = So, vr.flattenDeep = function (e) {
return null != e && e.length ? Hr(e, M) : []
}, vr.flattenDepth = function (e, t) {
return null != e && e.length ? Hr(e, t = t === a ? 1 : zs(t)) : []
}, vr.flip = function (e) {
return Aa(e, A)
}, vr.flow = Il, vr.flowRight = Ll, vr.fromPairs = function (e) {
for (var t = -1, n = null == e ? 0 : e.length, r = {}; ++t < n;) {
var i = e[t];
r[i[0]] = i[1]
}
return r
}, vr.functions = function (e) {
return null == e ? [] : $r(e, sl(e))
}, vr.functionsIn = function (e) {
return null == e ? [] : $r(e, ll(e))
}, vr.groupBy = Jo, vr.initial = function (e) {
return null != e && e.length ? Oi(e, 0, -1) : []
}, vr.intersection = ko, vr.intersectionBy = xo, vr.intersectionWith = Po, vr.invert = il, vr.invertBy = al, vr.invokeMap = Qo, vr.iteratee = Ml, vr.keyBy = $o, vr.keys = sl, vr.keysIn = ll, vr.map = Zo, vr.mapKeys = function (e, t) {
var n = {};
return t = Va(t, 3), Jr(e, function (e, r, i) {
Nr(n, t(e, r, i), e)
}), n
}, vr.mapValues = function (e, t) {
var n = {};
return t = Va(t, 3), Jr(e, function (e, r, i) {
Nr(n, r, t(e, r, i))
}), n
}, vr.matches = function (e) {
return vi(Vr(e, p))
}, vr.matchesProperty = function (e, t) {
return gi(e, Vr(t, p))
}, vr.memoize = us, vr.merge = cl, vr.mergeWith = ul, vr.method = Nl, vr.methodOf = Rl, vr.mixin = Wl, vr.negate = ds, vr.nthArg = function (e) {
return e = zs(e), Ci(function (t) {
return bi(t, e)
})
}, vr.omit = dl, vr.omitBy = function (e, t) {
return pl(e, ds(Va(t)))
}, vr.once = function (e) {
return is(2, e)
}, vr.orderBy = function (e, t, n, r) {
return null == e ? [] : (ws(t) || (t = null == t ? [] : [t]), ws(n = r ? a : n) || (n = null == n ? [] : [n]), wi(e, t, n))
}, vr.over = Fl, vr.overArgs = hs, vr.overEvery = Gl, vr.overSome = Bl, vr.partial = ps, vr.partialRight = fs, vr.partition = es, vr.pick = hl, vr.pickBy = pl, vr.property = Kl, vr.propertyOf = function (e) {
return function (t) {
return null == e ? a : Zr(e, t)
}
}, vr.pull = Ao, vr.pullAll = To, vr.pullAllBy = function (e, t, n) {
return e && e.length && t && t.length ? _i(e, t, Va(n, 2)) : e
}, vr.pullAllWith = function (e, t, n) {
return e && e.length && t && t.length ? _i(e, t, a, n) : e
}, vr.pullAt = Eo, vr.range = jl, vr.rangeRight = zl, vr.rearg = ms, vr.reject = function (e, t) {
return (ws(e) ? Qt : qr)(e, ds(Va(t, 3)))
}, vr.remove = function (e, t) {
var n = [];
if (!e || !e.length) return n;
var r = -1, i = [], a = e.length;
for (t = Va(t, 3); ++r < a;) {
var o = e[r];
t(o, r, e) && (n.push(o), i.push(r))
}
return ki(e, i), n
}, vr.rest = function (e, t) {
if ("function" != typeof e) throw new at(l);
return Ci(e, t = t === a ? t : zs(t))
}, vr.reverse = Do,vr.sampleSize = function (e, t, n) {
return t = (n ? Xa(e, t, n) : t === a) ? 1 : zs(t), (ws(e) ? Tr : Ti)(e, t)
},vr.set = function (e, t, n) {
return null == e ? e : Ei(e, t, n)
},vr.setWith = function (e, t, n, r) {
return r = "function" == typeof r ? r : a, null == e ? e : Ei(e, t, n, r)
},vr.shuffle = function (e) {
return (ws(e) ? Er : Li)(e)
},vr.slice = function (e, t, n) {
var r = null == e ? 0 : e.length;
return r ? (n && "number" != typeof n && Xa(e, t, n) ? (t = 0, n = r) : (t = null == t ? 0 : zs(t), n = n === a ? r : zs(n)), Oi(e, t, n)) : []
},vr.sortBy = ts,vr.sortedUniq = function (e) {
return e && e.length ? Wi(e) : []
},vr.sortedUniqBy = function (e, t) {
return e && e.length ? Wi(e, Va(t, 2)) : []
},vr.split = function (e, t, n) {
return n && "number" != typeof n && Xa(e, t, n) && (t = n = a), (n = n === a ? V : n >>> 0) ? (e = Ys(e)) && ("string" == typeof t || null != t && !Ns(t)) && !(t = Fi(t)) && An(e) ? Qi(Mn(e), 0, n) : e.split(t, n) : []
},vr.spread = function (e, t) {
if ("function" != typeof e) throw new at(l);
return t = null == t ? 0 : Yn(zs(t), 0), Ci(function (n) {
var r = n[t], i = Qi(n, 0, t);
return r && tn(i, r), qt(e, this, i)
})
},vr.tail = function (e) {
var t = null == e ? 0 : e.length;
return t ? Oi(e, 1, t) : []
},vr.take = function (e, t, n) {
return e && e.length ? Oi(e, 0, (t = n || t === a ? 1 : zs(t)) < 0 ? 0 : t) : []
},vr.takeRight = function (e, t, n) {
var r = null == e ? 0 : e.length;
return r ? Oi(e, (t = r - (t = n || t === a ? 1 : zs(t))) < 0 ? 0 : t, r) : []
},vr.takeRightWhile = function (e, t) {
return e && e.length ? ji(e, Va(t, 3), !1, !0) : []
},vr.takeWhile = function (e, t) {
return e && e.length ? ji(e, Va(t, 3)) : []
},vr.tap = function (e, t) {
return t(e), e
},vr.throttle = function (e, t, n) {
var r = !0, i = !0;
if ("function" != typeof e) throw new at(l);
return Ds(n) && (r = "leading" in n ? !!n.leading : r, i = "trailing" in n ? !!n.trailing : i), ss(e, t, {
leading: r,
maxWait: t,
trailing: i
})
},vr.thru = jo,vr.toArray = Ks,vr.toPairs = fl,vr.toPairsIn = ml,vr.toPath = function (e) {
return ws(e) ? en(e, po) : Vs(e) ? [e] : aa(ho(Ys(e)))
},vr.toPlainObject = Hs,vr.transform = function (e, t, n) {
var r = ws(e), i = r || xs(e) || Fs(e);
if (t = Va(t, 4), null == n) {
var a = e && e.constructor;
n = i ? r ? new a : [] : Ds(e) && As(a) ? gr(Lt(e)) : {}
}
return (i ? Yt : Jr)(e, function (e, r, i) {
return t(n, e, r, i)
}), n
},vr.unary = function (e) {
return rs(e, 1)
},vr.union = Io,vr.unionBy = Lo,vr.unionWith = Oo,vr.uniq = function (e) {
return e && e.length ? Gi(e) : []
},vr.uniqBy = function (e, t) {
return e && e.length ? Gi(e, Va(t, 2)) : []
},vr.uniqWith = function (e, t) {
return t = "function" == typeof t ? t : a, e && e.length ? Gi(e, a, t) : []
},vr.unset = function (e, t) {
return null == e || Bi(e, t)
},vr.unzip = Mo,vr.unzipWith = No,vr.update = function (e, t, n) {
return null == e ? e : Ki(e, t, Yi(n))
},vr.updateWith = function (e, t, n, r) {
return r = "function" == typeof r ? r : a, null == e ? e : Ki(e, t, Yi(n), r)
},vr.values = vl,vr.valuesIn = function (e) {
return null == e ? [] : wn(e, ll(e))
},vr.without = Ro,vr.words = Al,vr.wrap = function (e, t) {
return ps(Yi(t), e)
},vr.xor = Wo,vr.xorBy = Vo,vr.xorWith = Fo,vr.zip = Go,vr.zipObject = function (e, t) {
return qi(e || [], t || [], Ir)
},vr.zipObjectDeep = function (e, t) {
return qi(e || [], t || [], Ei)
},vr.zipWith = Bo,vr.entries = fl,vr.entriesIn = ml,vr.extend = Js,vr.extendWith = Qs,Wl(vr, vr),vr.add = Hl,vr.attempt = Tl,vr.camelCase = gl,vr.capitalize = yl,vr.ceil = Yl,vr.clamp = function (e, t, n) {
return n === a && (n = t, t = a), n !== a && (n = (n = qs(n)) == n ? n : 0), t !== a && (t = (t = qs(t)) == t ? t : 0), Wr(qs(e), t, n)
},vr.clone = function (e) {
return Vr(e, m)
},vr.cloneDeep = function (e) {
return Vr(e, p | m)
},vr.cloneDeepWith = function (e, t) {
return Vr(e, p | m, t = "function" == typeof t ? t : a)
},vr.cloneWith = function (e, t) {
return Vr(e, m, t = "function" == typeof t ? t : a)
},vr.conformsTo = function (e, t) {
return null == t || Fr(e, t, sl(t))
},vr.deburr = bl,vr.defaultTo = function (e, t) {
return null == e || e != e ? t : e
},vr.divide = Xl,vr.endsWith = function (e, t, n) {
e = Ys(e), t = Fi(t);
var r = e.length, i = n = n === a ? r : Wr(zs(n), 0, r);
return (n -= t.length) >= 0 && e.slice(n, i) == t
},vr.eq = vs,vr.escape = function (e) {
return (e = Ys(e)) && Ce.test(e) ? e.replace(xe, Pn) : e
},vr.escapeRegExp = function (e) {
return (e = Ys(e)) && Me.test(e) ? e.replace(Oe, "\\$&") : e
},vr.every = function (e, t, n) {
var r = ws(e) ? Jt : zr;
return n && Xa(e, t, n) && (t = a), r(e, Va(t, 3))
},vr.find = qo,vr.findIndex = bo,vr.findKey = function (e, t) {
return sn(e, Va(t, 3), Jr)
},vr.findLast = Ho,vr.findLastIndex = wo,vr.findLastKey = function (e, t) {
return sn(e, Va(t, 3), Qr)
},vr.floor = Jl,vr.forEach = Yo,vr.forEachRight = Xo,vr.forIn = function (e, t) {
return null == e ? e : Yr(e, Va(t, 3), ll)
},vr.forInRight = function (e, t) {
return null == e ? e : Xr(e, Va(t, 3), ll)
},vr.forOwn = function (e, t) {
return e && Jr(e, Va(t, 3))
},vr.forOwnRight = function (e, t) {
return e && Qr(e, Va(t, 3))
},vr.get = nl,vr.gt = gs,vr.gte = ys,vr.has = function (e, t) {
return null != e && Ua(e, t, ri)
},vr.hasIn = rl,vr.head = _o,vr.identity = Ol,vr.includes = function (e, t, n, r) {
e = _s(e) ? e : vl(e), n = n && !r ? zs(n) : 0;
var i = e.length;
return n < 0 && (n = Yn(i + n, 0)), Ws(e) ? n <= i && e.indexOf(t, n) > -1 : !!i && cn(e, t, n) > -1
},vr.indexOf = function (e, t, n) {
var r = null == e ? 0 : e.length;
if (!r) return -1;
var i = null == n ? 0 : zs(n);
return i < 0 && (i = Yn(r + i, 0)), cn(e, t, i)
},vr.inRange = function (e, t, n) {
return t = js(t), n === a ? (n = t, t = 0) : n = js(n), function (e, t, n) {
return e >= Xn(t, n) && e < Yn(t, n)
}(e = qs(e), t, n)
},vr.invoke = ol,vr.isArguments = bs,vr.isArray = ws,vr.isArrayBuffer = Ss,vr.isArrayLike = _s,vr.isArrayLikeObject = ks,vr.isBoolean = function (e) {
return !0 === e || !1 === e || Is(e) && ti(e) == U
},vr.isBuffer = xs,vr.isDate = Ps,vr.isElement = function (e) {
return Is(e) && 1 === e.nodeType && !Ms(e)
},vr.isEmpty = function (e) {
if (null == e) return !0;
if (_s(e) && (ws(e) || "string" == typeof e || "function" == typeof e.splice || xs(e) || Fs(e) || bs(e))) return !e.length;
var t = za(e);
if (t == Q || t == re) return !e.size;
if (Za(e)) return !hi(e).length;
for (var n in e) if (dt.call(e, n)) return !1;
return !0
},vr.isEqual = function (e, t) {
return li(e, t)
},vr.isEqualWith = function (e, t, n) {
var r = (n = "function" == typeof n ? n : a) ? n(e, t) : a;
return r === a ? li(e, t, a, n) : !!r
},vr.isError = Cs,vr.isFinite = function (e) {
return "number" == typeof e && Un(e)
},vr.isFunction = As,vr.isInteger = Ts,vr.isLength = Es,vr.isMap = Ls,vr.isMatch = function (e, t) {
return e === t || ci(e, t, Ga(t))
},vr.isMatchWith = function (e, t, n) {
return n = "function" == typeof n ? n : a, ci(e, t, Ga(t), n)
},vr.isNaN = function (e) {
return Os(e) && e != +e
},vr.isNative = function (e) {
if ($a(e)) throw new Ze(s);
return ui(e)
},vr.isNil = function (e) {
return null == e
},vr.isNull = function (e) {
return null === e
},vr.isNumber = Os,vr.isObject = Ds,vr.isObjectLike = Is,vr.isPlainObject = Ms,vr.isRegExp = Ns,vr.isSafeInteger = function (e) {
return Ts(e) && e >= -N && e <= N
},vr.isSet = Rs,vr.isString = Ws,vr.isSymbol = Vs,vr.isTypedArray = Fs,vr.isUndefined = function (e) {
return e === a
},vr.isWeakMap = function (e) {
return Is(e) && za(e) == se
},vr.isWeakSet = function (e) {
return Is(e) && ti(e) == le
},vr.join = function (e, t) {
return null == e ? "" : qn.call(e, t)
},vr.kebabCase = wl,vr.last = Co,vr.lastIndexOf = function (e, t, n) {
var r = null == e ? 0 : e.length;
if (!r) return -1;
var i = r;
return n !== a && (i = (i = zs(n)) < 0 ? Yn(r + i, 0) : Xn(i, r - 1)), t == t ? function (e, t, n) {
for (var r = n + 1; r--;) if (e[r] === t) return r;
return r
}(e, t, i) : ln(e, dn, i, !0)
},vr.lowerCase = Sl,vr.lowerFirst = _l,vr.lt = Gs,vr.lte = Bs,vr.max = function (e) {
return e && e.length ? Ur(e, Ol, ni) : a
},vr.maxBy = function (e, t) {
return e && e.length ? Ur(e, Va(t, 2), ni) : a
},vr.mean = function (e) {
return hn(e, Ol)
},vr.meanBy = function (e, t) {
return hn(e, Va(t, 2))
},vr.min = function (e) {
return e && e.length ? Ur(e, Ol, fi) : a
},vr.minBy = function (e, t) {
return e && e.length ? Ur(e, Va(t, 2), fi) : a
},vr.stubArray = Ul,vr.stubFalse = ql,vr.stubObject = function () {
return {}
},vr.stubString = function () {
return ""
},vr.stubTrue = function () {
return !0
},vr.multiply = $l,vr.nth = function (e, t) {
return e && e.length ? bi(e, zs(t)) : a
},vr.noConflict = function () {
return Mt._ === this && (Mt._ = vt), this
},vr.noop = Vl,vr.now = ns,vr.pad = function (e, t, n) {
e = Ys(e);
var r = (t = zs(t)) ? On(e) : 0;
if (!t || r >= t) return e;
var i = (t - r) / 2;
return wa(Kn(i), n) + e + wa(Bn(i), n)
},vr.padEnd = function (e, t, n) {
e = Ys(e);
var r = (t = zs(t)) ? On(e) : 0;
return t && r < t ? e + wa(t - r, n) : e
},vr.padStart = function (e, t, n) {
e = Ys(e);
var r = (t = zs(t)) ? On(e) : 0;
return t && r < t ? wa(t - r, n) + e : e
},vr.parseInt = function (e, t, n) {
return n || null == t ? t = 0 : t && (t = +t), Qn(Ys(e).replace(Ne, ""), t || 0)
},vr.random = function (e, t, n) {
if (n && "boolean" != typeof n && Xa(e, t, n) && (t = n = a), n === a && ("boolean" == typeof t ? (n = t, t = a) : "boolean" == typeof e && (n = e, e = a)), e === a && t === a ? (e = 0, t = 1) : (e = js(e), t === a ? (t = e, e = 0) : t = js(t)), e > t) {
var r = e;
e = t, t = r
}
if (n || e % 1 || t % 1) {
var i = $n();
return Xn(e + i * (t - e + Dt("1e-" + ((i + "").length - 1))), t)
}
return xi(e, t)
},vr.reduce = function (e, t, n) {
var r = ws(e) ? nn : mn, i = arguments.length < 3;
return r(e, Va(t, 4), n, i, Kr)
},vr.reduceRight = function (e, t, n) {
var r = ws(e) ? rn : mn, i = arguments.length < 3;
return r(e, Va(t, 4), n, i, jr)
},vr.repeat = function (e, t, n) {
return t = (n ? Xa(e, t, n) : t === a) ? 1 : zs(t), Pi(Ys(e), t)
},vr.replace = function () {
var e = arguments, t = Ys(e[0]);
return e.length < 3 ? t : t.replace(e[1], e[2])
},vr.result = function (e, t, n) {
var r = -1, i = (t = Xi(t, e)).length;
for (i || (i = 1, e = a); ++r < i;) {
var o = null == e ? a : e[po(t[r])];
o === a && (r = i, o = n), e = As(o) ? o.call(e) : o
}
return e
},vr.round = Zl,vr.runInContext = e,vr.sample = function (e) {
return (ws(e) ? Ar : Ai)(e)
},vr.size = function (e) {
if (null == e) return 0;
if (_s(e)) return Ws(e) ? On(e) : e.length;
var t = za(e);
return t == Q || t == re ? e.size : hi(e).length
},vr.snakeCase = kl,vr.some = function (e, t, n) {
var r = ws(e) ? an : Mi;
return n && Xa(e, t, n) && (t = a), r(e, Va(t, 3))
},vr.sortedIndex = function (e, t) {
return Ni(e, t)
},vr.sortedIndexBy = function (e, t, n) {
return Ri(e, t, Va(n, 2))
},vr.sortedIndexOf = function (e, t) {
var n = null == e ? 0 : e.length;
if (n) {
var r = Ni(e, t);
if (r < n && vs(e[r], t)) return r
}
return -1
},vr.sortedLastIndex = function (e, t) {
return Ni(e, t, !0)
},vr.sortedLastIndexBy = function (e, t, n) {
return Ri(e, t, Va(n, 2), !0)
},vr.sortedLastIndexOf = function (e, t) {
if (null != e && e.length) {
var n = Ni(e, t, !0) - 1;
if (vs(e[n], t)) return n
}
return -1
},vr.startCase = xl,vr.startsWith = function (e, t, n) {
return e = Ys(e), n = null == n ? 0 : Wr(zs(n), 0, e.length), t = Fi(t), e.slice(n, n + t.length) == t
},vr.subtract = ec,vr.sum = function (e) {
return e && e.length ? vn(e, Ol) : 0
},vr.sumBy = function (e, t) {
return e && e.length ? vn(e, Va(t, 2)) : 0
},vr.template = function (e, t, n) {
var r = vr.templateSettings;
n && Xa(e, t, n) && (t = a), e = Ys(e), t = Qs({}, t, r, Ta);
var i, o, s = Qs({}, t.imports, r.imports, Ta), l = sl(s), u = wn(s, l), d = 0, h = t.interpolate || Qe,
p = "__p += '",
f = rt((t.escape || Qe).source + "|" + h.source + "|" + (h === Ee ? je : Qe).source + "|" + (t.evaluate || Qe).source + "|$", "g"),
m = "//# sourceURL=" + (dt.call(t, "sourceURL") ? (t.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Ct + "]") + "\n";
e.replace(f, function (t, n, r, a, s, l) {
return r || (r = a), p += e.slice(d, l).replace($e, Cn), n && (i = !0, p += "' +\n__e(" + n + ") +\n'"), s && (o = !0, p += "';\n" + s + ";\n__p += '"), r && (p += "' +\n((__t = (" + r + ")) == null ? '' : __t) +\n'"), d = l + t.length, t
}), p += "';\n";
var v = dt.call(t, "variable") && t.variable;
if (v) {
if (Be.test(v)) throw new Ze(c)
} else p = "with (obj) {\n" + p + "\n}\n";
p = (o ? p.replace(we, "") : p).replace(Se, "$1").replace(_e, "$1;"), p = "function(" + (v || "obj") + ") {\n" + (v ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (i ? ", __e = _.escape" : "") + (o ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + p + "return __p\n}";
var g = Tl(function () {
return et(l, m + "return " + p).apply(a, u)
});
if (g.source = p, Cs(g)) throw g;
return g
},vr.times = function (e, t) {
if ((e = zs(e)) < 1 || e > N) return [];
var n = V, r = Xn(e, V);
t = Va(t), e -= V;
for (var i = gn(r, t); ++n < e;) t(n);
return i
},vr.toFinite = js,vr.toInteger = zs,vr.toLength = Us,vr.toLower = function (e) {
return Ys(e).toLowerCase()
},vr.toNumber = qs,vr.toSafeInteger = function (e) {
return e ? Wr(zs(e), -N, N) : 0 === e ? e : 0
},vr.toString = Ys,vr.toUpper = function (e) {
return Ys(e).toUpperCase()
},vr.trim = function (e, t, n) {
if ((e = Ys(e)) && (n || t === a)) return yn(e);
if (!e || !(t = Fi(t))) return e;
var r = Mn(e), i = Mn(t);
return Qi(r, _n(r, i), kn(r, i) + 1).join("")
},vr.trimEnd = function (e, t, n) {
if ((e = Ys(e)) && (n || t === a)) return e.slice(0, Nn(e) + 1);
if (!e || !(t = Fi(t))) return e;
var r = Mn(e);
return Qi(r, 0, kn(r, Mn(t)) + 1).join("")
},vr.trimStart = function (e, t, n) {
if ((e = Ys(e)) && (n || t === a)) return e.replace(Ne, "");
if (!e || !(t = Fi(t))) return e;
var r = Mn(e);
return Qi(r, _n(r, Mn(t))).join("")
},vr.truncate = function (e, t) {
var n = T, r = E;
if (Ds(t)) {
var i = "separator" in t ? t.separator : i;
n = "length" in t ? zs(t.length) : n, r = "omission" in t ? Fi(t.omission) : r
}
var o = (e = Ys(e)).length;
if (An(e)) {
var s = Mn(e);
o = s.length
}
if (n >= o) return e;
var l = n - On(r);
if (l < 1) return r;
var c = s ? Qi(s, 0, l).join("") : e.slice(0, l);
if (i === a) return c + r;
if (s && (l += c.length - l), Ns(i)) {
if (e.slice(l).search(i)) {
var u, d = c;
for (i.global || (i = rt(i.source, Ys(ze.exec(i)) + "g")), i.lastIndex = 0; u = i.exec(d);) var h = u.index;
c = c.slice(0, h === a ? l : h)
}
} else if (e.indexOf(Fi(i), l) != l) {
var p = c.lastIndexOf(i);
p > -1 && (c = c.slice(0, p))
}
return c + r
},vr.unescape = function (e) {
return (e = Ys(e)) && Pe.test(e) ? e.replace(ke, Rn) : e
},vr.uniqueId = function (e) {
var t = ++ht;
return Ys(e) + t
},vr.upperCase = Pl,vr.upperFirst = Cl,vr.each = Yo,vr.eachRight = Xo,vr.first = _o,Wl(vr, (Ql = {}, Jr(vr, function (e, t) {
dt.call(vr.prototype, t) || (Ql[t] = e)
}), Ql), {chain: !1}),vr.VERSION = "4.17.21",Yt(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function (e) {
vr[e].placeholder = vr
}),Yt(["drop", "take"], function (e, t) {
wr.prototype[e] = function (n) {
n = n === a ? 1 : Yn(zs(n), 0);
var r = this.__filtered__ && !t ? new wr(this) : this.clone();
return r.__filtered__ ? r.__takeCount__ = Xn(n, r.__takeCount__) : r.__views__.push({
size: Xn(n, V),
type: e + (r.__dir__ < 0 ? "Right" : "")
}), r
}, wr.prototype[e + "Right"] = function (t) {
return this.reverse()[e](t).reverse()
}
}),Yt(["filter", "map", "takeWhile"], function (e, t) {
var n = t + 1, r = n == L || 3 == n;
wr.prototype[e] = function (e) {
var t = this.clone();
return t.__iteratees__.push({iteratee: Va(e, 3), type: n}), t.__filtered__ = t.__filtered__ || r, t
}
}),Yt(["head", "last"], function (e, t) {
var n = "take" + (t ? "Right" : "");
wr.prototype[e] = function () {
return this[n](1).value()[0]
}
}),Yt(["initial", "tail"], function (e, t) {
var n = "drop" + (t ? "" : "Right");
wr.prototype[e] = function () {
return this.__filtered__ ? new wr(this) : this[n](1)
}
}),wr.prototype.compact = function () {
return this.filter(Ol)
},wr.prototype.find = function (e) {
return this.filter(e).head()
},wr.prototype.findLast = function (e) {
return this.reverse().find(e)
},wr.prototype.invokeMap = Ci(function (e, t) {
return "function" == typeof e ? new wr(this) : this.map(function (n) {
return oi(n, e, t)
})
}),wr.prototype.reject = function (e) {
return this.filter(ds(Va(e)))
},wr.prototype.slice = function (e, t) {
e = zs(e);
var n = this;
return n.__filtered__ && (e > 0 || t < 0) ? new wr(n) : (e < 0 ? n = n.takeRight(-e) : e && (n = n.drop(e)), t !== a && (n = (t = zs(t)) < 0 ? n.dropRight(-t) : n.take(t - e)), n)
},wr.prototype.takeRightWhile = function (e) {
return this.reverse().takeWhile(e).reverse()
},wr.prototype.toArray = function () {
return this.take(V)
},Jr(wr.prototype, function (e, t) {
var n = /^(?:filter|find|map|reject)|While$/.test(t), r = /^(?:head|last)$/.test(t),
i = vr[r ? "take" + ("last" == t ? "Right" : "") : t], o = r || /^find/.test(t);
i && (vr.prototype[t] = function () {
var t = this.__wrapped__, s = r ? [1] : arguments, l = t instanceof wr, c = s[0], u = l || ws(t),
d = function (e) {
var t = i.apply(vr, tn([e], s));
return r && h ? t[0] : t
};
u && n && "function" == typeof c && 1 != c.length && (l = u = !1);
var h = this.__chain__, p = !!this.__actions__.length, f = o && !h, m = l && !p;
if (!o && u) {
t = m ? t : new wr(this);
var v = e.apply(t, s);
return v.__actions__.push({func: jo, args: [d], thisArg: a}), new br(v, h)
}
return f && m ? e.apply(this, s) : (v = this.thru(d), f ? r ? v.value()[0] : v.value() : v)
})
}),Yt(["pop", "push", "shift", "sort", "splice", "unshift"], function (e) {
var t = ot[e], n = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru", r = /^(?:pop|shift)$/.test(e);
vr.prototype[e] = function () {
var e = arguments;
if (r && !this.__chain__) {
var i = this.value();
return t.apply(ws(i) ? i : [], e)
}
return this[n](function (n) {
return t.apply(ws(n) ? n : [], e)
})
}
}),Jr(wr.prototype, function (e, t) {
var n = vr[t];
if (n) {
var r = n.name + "";
dt.call(sr, r) || (sr[r] = []), sr[r].push({name: t, func: n})
}
}),sr[va(a, b).name] = [{name: "wrapper", func: a}],wr.prototype.clone = function () {
var e = new wr(this.__wrapped__);
return e.__actions__ = aa(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this.__filtered__, e.__iteratees__ = aa(this.__iteratees__), e.__takeCount__ = this.__takeCount__, e.__views__ = aa(this.__views__), e
},wr.prototype.reverse = function () {
if (this.__filtered__) {
var e = new wr(this);
e.__dir__ = -1, e.__filtered__ = !0
} else (e = this.clone()).__dir__ *= -1;
return e
},wr.prototype.value = function () {
var e = this.__wrapped__.value(), t = this.__dir__, n = ws(e), r = t < 0, i = n ? e.length : 0,
a = function (e, t, n) {
for (var r = -1, i = n.length; ++r < i;) {
var a = n[r], o = a.size;
switch (a.type) {
case"drop":
e += o;
break;
case"dropRight":
t -= o;
break;
case"take":
t = Xn(t, e + o);
break;
case"takeRight":
e = Yn(e, t - o)
}
}
return {start: e, end: t}
}(0, i, this.__views__), o = a.start, s = a.end, l = s - o, c = r ? s : o - 1, u = this.__iteratees__,
d = u.length, h = 0, p = Xn(l, this.__takeCount__);
if (!n || !r && i == l && p == l) return zi(e, this.__actions__);
var f = [];
e:for (; l-- && h < p;) {
for (var m = -1, v = e[c += t]; ++m < d;) {
var g = u[m], y = g.iteratee, b = g.type, w = y(v);
if (b == O) v = w; else if (!w) {
if (b == L) continue e;
break e
}
}
f[h++] = v
}
return f
},vr.prototype.at = zo,vr.prototype.chain = function () {
return Ko(this)
},vr.prototype.commit = function () {
return new br(this.value(), this.__chain__)
},vr.prototype.next = function () {
this.__values__ === a && (this.__values__ = Ks(this.value()));
var e = this.__index__ >= this.__values__.length;
return {done: e, value: e ? a : this.__values__[this.__index__++]}
},vr.prototype.plant = function (e) {
for (var t, n = this; n instanceof yr;) {
var r = mo(n);
r.__index__ = 0, r.__values__ = a, t ? i.__wrapped__ = r : t = r;
var i = r;
n = n.__wrapped__
}
return i.__wrapped__ = e, t
},vr.prototype.reverse = function () {
var e = this.__wrapped__;
if (e instanceof wr) {
var t = e;
return this.__actions__.length && (t = new wr(this)), (t = t.reverse()).__actions__.push({
func: jo,
args: [Do],
thisArg: a
}), new br(t, this.__chain__)
}
return this.thru(Do)
},vr.prototype.toJSON = vr.prototype.valueOf = vr.prototype.value = function () {
return zi(this.__wrapped__, this.__actions__)
},vr.prototype.first = vr.prototype.head,Ft && (vr.prototype[Ft] = function () {
return this
}),vr
}();
"object" == i(n(121)) && n(121) ? (Mt._ = Wn, (r = function () {
return Wn
}.call(t, n, t, e)) === a || (e.exports = r)) : Rt ? ((Rt.exports = Wn)._ = Wn, Nt._ = Wn) : Mt._ = Wn
}).call(void 0)
}).call(t, n(61)(e))
}, function (e, t, n) {
"use strict";
(function (e) {
Object.defineProperty(t, "__esModule", {value: !0});
var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
function r(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
})), n.push.apply(n, r)
}
return n
}
function i(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? r(Object(n), !0).forEach(function (t) {
a(e, t, n[t])
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : r(Object(n)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
})
}
return e
}
function a(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function o(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
function s(e, t) {
return function (e) {
if (Array.isArray(e)) return e
}(e) || function (e, t) {
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
if (null == n) return;
var r, i, a = [], o = !0, s = !1;
try {
for (n = n.call(e); !(o = (r = n.next()).done) && (a.push(r.value), !t || a.length !== t); o = !0) ;
} catch (e) {
s = !0, i = e
} finally {
try {
o || null == n.return || n.return()
} finally {
if (s) throw i
}
}
return a
}(e, t) || function (e, t) {
if (!e) return;
if ("string" == typeof e) return l(e, t);
var n = Object.prototype.toString.call(e).slice(8, -1);
"Object" === n && e.constructor && (n = e.constructor.name);
if ("Map" === n || "Set" === n) return Array.from(e);
if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return l(e, t)
}(e, t) || function () {
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 l(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
return r
}
function c(e) {
"@babel/helpers - typeof";
return (c = "function" == typeof Symbol && "symbol" == n(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : n(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : n(e)
})(e)
}
var u = {exports: {}}, d = {}, h = Object.getOwnPropertySymbols, p = Object.prototype.hasOwnProperty,
f = Object.prototype.propertyIsEnumerable;
var m = function () {
try {
if (!Object.assign) return !1;
var e = new String("abc");
if (e[5] = "de", "5" === Object.getOwnPropertyNames(e)[0]) return !1;
for (var t = {}, n = 0; n < 10; n++) t["_" + String.fromCharCode(n)] = n;
if ("0123456789" !== Object.getOwnPropertyNames(t).map(function (e) {
return t[e]
}).join("")) return !1;
var r = {};
return "abcdefghijklmnopqrst".split("").forEach(function (e) {
r[e] = e
}), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, r)).join("")
} catch (e) {
return !1
}
}() ? Object.assign : function (e, t) {
for (var n, r, i = function (e) {
if (null === e || void 0 === e) throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(e)
}(e), a = 1; a < arguments.length; a++) {
for (var o in n = Object(arguments[a])) p.call(n, o) && (i[o] = n[o]);
if (h) {
r = h(n);
for (var s = 0; s < r.length; s++) f.call(n, r[s]) && (i[r[s]] = n[r[s]])
}
}
return i
}, v = m, g = 60103, y = 60106;
d.Fragment = 60107, d.StrictMode = 60108, d.Profiler = 60114;
var b = 60109, w = 60110, S = 60112;
d.Suspense = 60113;
var _ = 60115, k = 60116;
if ("function" == typeof Symbol && Symbol.for) {
var x = Symbol.for;
g = x("react.element"), y = x("react.portal"), d.Fragment = x("react.fragment"), d.StrictMode = x("react.strict_mode"), d.Profiler = x("react.profiler"), b = x("react.provider"), w = x("react.context"), S = x("react.forward_ref"), d.Suspense = x("react.suspense"), _ = x("react.memo"), k = x("react.lazy")
}
var P = "function" == typeof Symbol && Symbol.iterator;
function C(e) {
for (var t = "https://reactjs.org/docs/error-decoder.html?invariant=" + e, n = 1; n < arguments.length; n++) t += "&args[]=" + encodeURIComponent(arguments[n]);
return "Minified React error #" + e + "; visit " + t + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
}
var A = {
isMounted: function () {
return !1
}, enqueueForceUpdate: function () {
}, enqueueReplaceState: function () {
}, enqueueSetState: function () {
}
}, T = {};
function E(e, t, n) {
this.props = e, this.context = t, this.refs = T, this.updater = n || A
}
function D() {
}
function I(e, t, n) {
this.props = e, this.context = t, this.refs = T, this.updater = n || A
}
E.prototype.isReactComponent = {}, E.prototype.setState = function (e, t) {
if ("object" !== c(e) && "function" != typeof e && null != e) throw Error(C(85));
this.updater.enqueueSetState(this, e, t, "setState")
}, E.prototype.forceUpdate = function (e) {
this.updater.enqueueForceUpdate(this, e, "forceUpdate")
}, D.prototype = E.prototype;
var L = I.prototype = new D;
L.constructor = I, v(L, E.prototype), L.isPureReactComponent = !0;
var O = {current: null}, M = Object.prototype.hasOwnProperty, N = {key: !0, ref: !0, __self: !0, __source: !0};
function R(e, t, n) {
var r, i = {}, a = null, o = null;
if (null != t) for (r in void 0 !== t.ref && (o = t.ref), void 0 !== t.key && (a = "" + t.key), t) M.call(t, r) && !N.hasOwnProperty(r) && (i[r] = t[r]);
var s = arguments.length - 2;
if (1 === s) i.children = n; else if (1 < s) {
for (var l = Array(s), c = 0; c < s; c++) l[c] = arguments[c + 2];
i.children = l
}
if (e && e.defaultProps) for (r in s = e.defaultProps) void 0 === i[r] && (i[r] = s[r]);
return {$$typeof: g, type: e, key: a, ref: o, props: i, _owner: O.current}
}
function W(e) {
return "object" === c(e) && null !== e && e.$$typeof === g
}
var V = /\/+/g;
function F(e, t) {
return "object" === c(e) && null !== e && null != e.key ? function (e) {
var t = {"=": "=0", ":": "=2"};
return "$" + e.replace(/[=:]/g, function (e) {
return t[e]
})
}("" + e.key) : t.toString(36)
}
function G(e, t, n, r, i) {
var a = c(e);
"undefined" !== a && "boolean" !== a || (e = null);
var o = !1;
if (null === e) o = !0; else switch (a) {
case"string":
case"number":
o = !0;
break;
case"object":
switch (e.$$typeof) {
case g:
case y:
o = !0
}
}
if (o) return i = i(o = e), e = "" === r ? "." + F(o, 0) : r, Array.isArray(i) ? (n = "", null != e && (n = e.replace(V, "$&/") + "/"), G(i, t, n, "", function (e) {
return e
})) : null != i && (W(i) && (i = function (e, t) {
return {$$typeof: g, type: e.type, key: t, ref: e.ref, props: e.props, _owner: e._owner}
}(i, n + (!i.key || o && o.key === i.key ? "" : ("" + i.key).replace(V, "$&/") + "/") + e)), t.push(i)), 1;
if (o = 0, r = "" === r ? "." : r + ":", Array.isArray(e)) for (var s = 0; s < e.length; s++) {
var l = r + F(a = e[s], s);
o += G(a, t, n, l, i)
} else if ("function" == typeof (l = function (e) {
return null === e || "object" !== c(e) ? null : "function" == typeof (e = P && e[P] || e["@@iterator"]) ? e : null
}(e))) for (e = l.call(e), s = 0; !(a = e.next()).done;) o += G(a = a.value, t, n, l = r + F(a, s++), i); else if ("object" === a) throw t = "" + e, Error(C(31, "[object Object]" === t ? "object with keys {" + Object.keys(e).join(", ") + "}" : t));
return o
}
function B(e, t, n) {
if (null == e) return e;
var r = [], i = 0;
return G(e, r, "", "", function (e) {
return t.call(n, e, i++)
}), r
}
function K(e) {
if (-1 === e._status) {
var t = e._result;
t = t(), e._status = 0, e._result = t, t.then(function (t) {
0 === e._status && (t = t.default, e._status = 1, e._result = t)
}, function (t) {
0 === e._status && (e._status = 2, e._result = t)
})
}
if (1 === e._status) return e._result;
throw e._result
}
var j = {current: null};
function z() {
var e = j.current;
if (null === e) throw Error(C(321));
return e
}
var U = {
ReactCurrentDispatcher: j,
ReactCurrentBatchConfig: {transition: 0},
ReactCurrentOwner: O,
IsSomeRendererActing: {current: !1},
assign: v
};
d.Children = {
map: B, forEach: function (e, t, n) {
B(e, function () {
t.apply(this, arguments)
}, n)
}, count: function (e) {
var t = 0;
return B(e, function () {
t++
}), t
}, toArray: function (e) {
return B(e, function (e) {
return e
}) || []
}, only: function (e) {
if (!W(e)) throw Error(C(143));
return e
}
}, d.Component = E, d.PureComponent = I, d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = U, d.cloneElement = function (e, t, n) {
if (null === e || void 0 === e) throw Error(C(267, e));
var r = v({}, e.props), i = e.key, a = e.ref, o = e._owner;
if (null != t) {
if (void 0 !== t.ref && (a = t.ref, o = O.current), void 0 !== t.key && (i = "" + t.key), e.type && e.type.defaultProps) var s = e.type.defaultProps;
for (l in t) M.call(t, l) && !N.hasOwnProperty(l) && (r[l] = void 0 === t[l] && void 0 !== s ? s[l] : t[l])
}
var l = arguments.length - 2;
if (1 === l) r.children = n; else if (1 < l) {
s = Array(l);
for (var c = 0; c < l; c++) s[c] = arguments[c + 2];
r.children = s
}
return {$$typeof: g, type: e.type, key: i, ref: a, props: r, _owner: o}
}, d.createContext = function (e, t) {
return void 0 === t && (t = null), (e = {
$$typeof: w,
_calculateChangedBits: t,
_currentValue: e,
_currentValue2: e,
_threadCount: 0,
Provider: null,
Consumer: null
}).Provider = {$$typeof: b, _context: e}, e.Consumer = e
}, d.createElement = R, d.createFactory = function (e) {
var t = R.bind(null, e);
return t.type = e, t
}, d.createRef = function () {
return {current: null}
}, d.forwardRef = function (e) {
return {$$typeof: S, render: e}
}, d.isValidElement = W, d.lazy = function (e) {
return {$$typeof: k, _payload: {_status: -1, _result: e}, _init: K}
}, d.memo = function (e, t) {
return {$$typeof: _, type: e, compare: void 0 === t ? null : t}
}, d.useCallback = function (e, t) {
return z().useCallback(e, t)
}, d.useContext = function (e, t) {
return z().useContext(e, t)
}, d.useDebugValue = function () {
}, d.useEffect = function (e, t) {
return z().useEffect(e, t)
}, d.useImperativeHandle = function (e, t, n) {
return z().useImperativeHandle(e, t, n)
}, d.useLayoutEffect = function (e, t) {
return z().useLayoutEffect(e, t)
}, d.useMemo = function (e, t) {
return z().useMemo(e, t)
}, d.useReducer = function (e, t, n) {
return z().useReducer(e, t, n)
}, d.useRef = function (e) {
return z().useRef(e)
}, d.useState = function (e) {
return z().useState(e)
}, d.version = "17.0.2", u.exports = d;
var q = u.exports, H = {exports: {}}, Y = {}, X = {exports: {}}, J = {};
!function (e) {
var t, n, r, i;
if ("object" === ("undefined" == typeof performance ? "undefined" : c(performance)) && "function" == typeof performance.now) {
var a = performance;
e.unstable_now = function () {
return a.now()
}
} else {
var o = Date, s = o.now();
e.unstable_now = function () {
return o.now() - s
}
}
if ("undefined" == typeof window || "function" != typeof MessageChannel) {
var l = null, u = null, d = function t() {
if (null !== l) try {
var n = e.unstable_now();
l(!0, n), l = null
} catch (e) {
throw setTimeout(t, 0), e
}
};
t = function (e) {
null !== l ? setTimeout(t, 0, e) : (l = e, setTimeout(d, 0))
}, n = function (e, t) {
u = setTimeout(e, t)
}, r = function () {
clearTimeout(u)
}, e.unstable_shouldYield = function () {
return !1
}, i = e.unstable_forceFrameRate = function () {
}
} else {
var h = window.setTimeout, p = window.clearTimeout;
if ("undefined" != typeof console) {
var f = window.cancelAnimationFrame;
"function" != typeof window.requestAnimationFrame && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), "function" != typeof f && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")
}
var m = !1, v = null, g = -1, y = 5, b = 0;
e.unstable_shouldYield = function () {
return e.unstable_now() >= b
}, i = function () {
}, e.unstable_forceFrameRate = function (e) {
0 > e || 125 < e ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : y = 0 < e ? Math.floor(1e3 / e) : 5
};
var w = new MessageChannel, S = w.port2;
w.port1.onmessage = function () {
if (null !== v) {
var t = e.unstable_now();
b = t + y;
try {
v(!0, t) ? S.postMessage(null) : (m = !1, v = null)
} catch (e) {
throw S.postMessage(null), e
}
} else m = !1
}, t = function (e) {
v = e, m || (m = !0, S.postMessage(null))
}, n = function (t, n) {
g = h(function () {
t(e.unstable_now())
}, n)
}, r = function () {
p(g), g = -1
}
}
function _(e, t) {
var n = e.length;
e.push(t);
e:for (; ;) {
var r = n - 1 >>> 1, i = e[r];
if (!(void 0 !== i && 0 < P(i, t))) break e;
e[r] = t, e[n] = i, n = r
}
}
function k(e) {
return void 0 === (e = e[0]) ? null : e
}
function x(e) {
var t = e[0];
if (void 0 !== t) {
var n = e.pop();
if (n !== t) {
e[0] = n;
e:for (var r = 0, i = e.length; r < i;) {
var a = 2 * (r + 1) - 1, o = e[a], s = a + 1, l = e[s];
if (void 0 !== o && 0 > P(o, n)) void 0 !== l && 0 > P(l, o) ? (e[r] = l, e[s] = n, r = s) : (e[r] = o, e[a] = n, r = a); else {
if (!(void 0 !== l && 0 > P(l, n))) break e;
e[r] = l, e[s] = n, r = s
}
}
}
return t
}
return null
}
function P(e, t) {
var n = e.sortIndex - t.sortIndex;
return 0 !== n ? n : e.id - t.id
}
var C = [], A = [], T = 1, E = null, D = 3, I = !1, L = !1, O = !1;
function M(e) {
for (var t = k(A); null !== t;) {
if (null === t.callback) x(A); else {
if (!(t.startTime <= e)) break;
x(A), t.sortIndex = t.expirationTime, _(C, t)
}
t = k(A)
}
}
function N(e) {
if (O = !1, M(e), !L) if (null !== k(C)) L = !0, t(R); else {
var r = k(A);
null !== r && n(N, r.startTime - e)
}
}
function R(t, i) {
L = !1, O && (O = !1, r()), I = !0;
var a = D;
try {
for (M(i), E = k(C); null !== E && (!(E.expirationTime > i) || t && !e.unstable_shouldYield());) {
var o = E.callback;
if ("function" == typeof o) {
E.callback = null, D = E.priorityLevel;
var s = o(E.expirationTime <= i);
i = e.unstable_now(), "function" == typeof s ? E.callback = s : E === k(C) && x(C), M(i)
} else x(C);
E = k(C)
}
if (null !== E) var l = !0; else {
var c = k(A);
null !== c && n(N, c.startTime - i), l = !1
}
return l
} finally {
E = null, D = a, I = !1
}
}
var W = i;
e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function (e) {
e.callback = null
}, e.unstable_continueExecution = function () {
L || I || (L = !0, t(R))
}, e.unstable_getCurrentPriorityLevel = function () {
return D
}, e.unstable_getFirstCallbackNode = function () {
return k(C)
}, e.unstable_next = function (e) {
switch (D) {
case 1:
case 2:
case 3:
var t = 3;
break;
default:
t = D
}
var n = D;
D = t;
try {
return e()
} finally {
D = n
}
}, e.unstable_pauseExecution = function () {
}, e.unstable_requestPaint = W, e.unstable_runWithPriority = function (e, t) {
switch (e) {
case 1:
case 2:
case 3:
case 4:
case 5:
break;
default:
e = 3
}
var n = D;
D = e;
try {
return t()
} finally {
D = n
}
}, e.unstable_scheduleCallback = function (i, a, o) {
var s = e.unstable_now();
switch ("object" === c(o) && null !== o ? o = "number" == typeof (o = o.delay) && 0 < o ? s + o : s : o = s, i) {
case 1:
var l = -1;
break;
case 2:
l = 250;
break;
case 5:
l = 1073741823;
break;
case 4:
l = 1e4;
break;
default:
l = 5e3
}
return i = {
id: T++,
callback: a,
priorityLevel: i,
startTime: o,
expirationTime: l = o + l,
sortIndex: -1
}, o > s ? (i.sortIndex = o, _(A, i), null === k(C) && i === k(A) && (O ? r() : O = !0, n(N, o - s))) : (i.sortIndex = l, _(C, i), L || I || (L = !0, t(R))), i
}, e.unstable_wrapCallback = function (e) {
var t = D;
return function () {
var n = D;
D = t;
try {
return e.apply(this, arguments)
} finally {
D = n
}
}
}
}(J), X.exports = J;
var Q = u.exports, $ = m, Z = X.exports;
function ee(e) {
for (var t = "https://reactjs.org/docs/error-decoder.html?invariant=" + e, n = 1; n < arguments.length; n++) t += "&args[]=" + encodeURIComponent(arguments[n]);
return "Minified React error #" + e + "; visit " + t + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
}
if (!Q) throw Error(ee(227));
var te = new Set, ne = {};
function re(e, t) {
ie(e, t), ie(e + "Capture", t)
}
function ie(e, t) {
for (ne[e] = t, e = 0; e < t.length; e++) te.add(t[e])
}
var ae = !("undefined" == typeof window || void 0 === window.document || void 0 === window.document.createElement),
oe = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
se = Object.prototype.hasOwnProperty, le = {}, ce = {};
function ue(e, t, n, r) {
if (null === t || void 0 === t || function (e, t, n, r) {
if (null !== n && 0 === n.type) return !1;
switch (c(t)) {
case"function":
case"symbol":
return !0;
case"boolean":
return !r && (null !== n ? !n.acceptsBooleans : "data-" !== (e = e.toLowerCase().slice(0, 5)) && "aria-" !== e);
default:
return !1
}
}(e, t, n, r)) return !0;
if (r) return !1;
if (null !== n) switch (n.type) {
case 3:
return !t;
case 4:
return !1 === t;
case 5:
return isNaN(t);
case 6:
return isNaN(t) || 1 > t
}
return !1
}
function de(e, t, n, r, i, a, o) {
this.acceptsBooleans = 2 === t || 3 === t || 4 === t, this.attributeName = r, this.attributeNamespace = i, this.mustUseProperty = n, this.propertyName = e, this.type = t, this.sanitizeURL = a, this.removeEmptyString = o
}
var he = {};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function (e) {
he[e] = new de(e, 0, !1, e, null, !1, !1)
}), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function (e) {
var t = e[0];
he[t] = new de(t, 1, !1, e[1], null, !1, !1)
}), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function (e) {
he[e] = new de(e, 2, !1, e.toLowerCase(), null, !1, !1)
}), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function (e) {
he[e] = new de(e, 2, !1, e, null, !1, !1)
}), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function (e) {
he[e] = new de(e, 3, !1, e.toLowerCase(), null, !1, !1)
}), ["checked", "multiple", "muted", "selected"].forEach(function (e) {
he[e] = new de(e, 3, !0, e, null, !1, !1)
}), ["capture", "download"].forEach(function (e) {
he[e] = new de(e, 4, !1, e, null, !1, !1)
}), ["cols", "rows", "size", "span"].forEach(function (e) {
he[e] = new de(e, 6, !1, e, null, !1, !1)
}), ["rowSpan", "start"].forEach(function (e) {
he[e] = new de(e, 5, !1, e.toLowerCase(), null, !1, !1)
});
var pe = /[\-:]([a-z])/g;
function fe(e) {
return e[1].toUpperCase()
}
function me(e, t, n, r) {
var i = he.hasOwnProperty(t) ? he[t] : null;
(null !== i ? 0 === i.type : !r && (2 < t.length && ("o" === t[0] || "O" === t[0]) && ("n" === t[1] || "N" === t[1]))) || (ue(t, n, i, r) && (n = null), r || null === i ? function (e) {
return !!se.call(ce, e) || !se.call(le, e) && (oe.test(e) ? ce[e] = !0 : (le[e] = !0, !1))
}(t) && (null === n ? e.removeAttribute(t) : e.setAttribute(t, "" + n)) : i.mustUseProperty ? e[i.propertyName] = null === n ? 3 !== i.type && "" : n : (t = i.attributeName, r = i.attributeNamespace, null === n ? e.removeAttribute(t) : (n = 3 === (i = i.type) || 4 === i && !0 === n ? "" : "" + n, r ? e.setAttributeNS(r, t, n) : e.setAttribute(t, n))))
}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function (e) {
var t = e.replace(pe, fe);
he[t] = new de(t, 1, !1, e, null, !1, !1)
}), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function (e) {
var t = e.replace(pe, fe);
he[t] = new de(t, 1, !1, e, "http://www.w3.org/1999/xlink", !1, !1)
}), ["xml:base", "xml:lang", "xml:space"].forEach(function (e) {
var t = e.replace(pe, fe);
he[t] = new de(t, 1, !1, e, "http://www.w3.org/XML/1998/namespace", !1, !1)
}), ["tabIndex", "crossOrigin"].forEach(function (e) {
he[e] = new de(e, 1, !1, e.toLowerCase(), null, !1, !1)
}), he.xlinkHref = new de("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function (e) {
he[e] = new de(e, 1, !1, e.toLowerCase(), null, !0, !0)
});
var ve = Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ge = 60103, ye = 60106, be = 60107, we = 60108,
Se = 60114, _e = 60109, ke = 60110, xe = 60112, Pe = 60113, Ce = 60120, Ae = 60115, Te = 60116, Ee = 60121,
De = 60128, Ie = 60129, Le = 60130, Oe = 60131;
if ("function" == typeof Symbol && Symbol.for) {
var Me = Symbol.for;
ge = Me("react.element"), ye = Me("react.portal"), be = Me("react.fragment"), we = Me("react.strict_mode"), Se = Me("react.profiler"), _e = Me("react.provider"), ke = Me("react.context"), xe = Me("react.forward_ref"), Pe = Me("react.suspense"), Ce = Me("react.suspense_list"), Ae = Me("react.memo"), Te = Me("react.lazy"), Ee = Me("react.block"), Me("react.scope"), De = Me("react.opaque.id"), Ie = Me("react.debug_trace_mode"), Le = Me("react.offscreen"), Oe = Me("react.legacy_hidden")
}
var Ne, Re = "function" == typeof Symbol && Symbol.iterator;
function We(e) {
return null === e || "object" !== c(e) ? null : "function" == typeof (e = Re && e[Re] || e["@@iterator"]) ? e : null
}
function Ve(e) {
if (void 0 === Ne) try {
throw Error()
} catch (e) {
var t = e.stack.trim().match(/\n( *(at )?)/);
Ne = t && t[1] || ""
}
return "\n" + Ne + e
}
var Fe = !1;
function Ge(e, t) {
if (!e || Fe) return "";
Fe = !0;
var n = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
try {
if (t) if (t = function () {
throw Error()
}, Object.defineProperty(t.prototype, "props", {
set: function () {
throw Error()
}
}), "object" === ("undefined" == typeof Reflect ? "undefined" : c(Reflect)) && Reflect.construct) {
try {
Reflect.construct(t, [])
} catch (e) {
var r = e
}
Reflect.construct(e, [], t)
} else {
try {
t.call()
} catch (e) {
r = e
}
e.call(t.prototype)
} else {
try {
throw Error()
} catch (e) {
r = e
}
e()
}
} catch (e) {
if (e && r && "string" == typeof e.stack) {
for (var i = e.stack.split("\n"), a = r.stack.split("\n"), o = i.length - 1, s = a.length - 1; 1 <= o && 0 <= s && i[o] !== a[s];) s--;
for (; 1 <= o && 0 <= s; o--, s--) if (i[o] !== a[s]) {
if (1 !== o || 1 !== s) do {
if (o--, 0 > --s || i[o] !== a[s]) return "\n" + i[o].replace(" at new ", " at ")
} while (1 <= o && 0 <= s);
break
}
}
} finally {
Fe = !1, Error.prepareStackTrace = n
}
return (e = e ? e.displayName || e.name : "") ? Ve(e) : ""
}
function Be(e) {
switch (e.tag) {
case 5:
return Ve(e.type);
case 16:
return Ve("Lazy");
case 13:
return Ve("Suspense");
case 19:
return Ve("SuspenseList");
case 0:
case 2:
case 15:
return e = Ge(e.type, !1);
case 11:
return e = Ge(e.type.render, !1);
case 22:
return e = Ge(e.type._render, !1);
case 1:
return e = Ge(e.type, !0);
default:
return ""
}
}
function Ke(e) {
if (null == e) return null;
if ("function" == typeof e) return e.displayName || e.name || null;
if ("string" == typeof e) return e;
switch (e) {
case be:
return "Fragment";
case ye:
return "Portal";
case Se:
return "Profiler";
case we:
return "StrictMode";
case Pe:
return "Suspense";
case Ce:
return "SuspenseList"
}
if ("object" === c(e)) switch (e.$$typeof) {
case ke:
return (e.displayName || "Context") + ".Consumer";
case _e:
return (e._context.displayName || "Context") + ".Provider";
case xe:
var t = e.render;
return t = t.displayName || t.name || "", e.displayName || ("" !== t ? "ForwardRef(" + t + ")" : "ForwardRef");
case Ae:
return Ke(e.type);
case Ee:
return Ke(e._render);
case Te:
t = e._payload, e = e._init;
try {
return Ke(e(t))
} catch (e) {
}
}
return null
}
function je(e) {
switch (c(e)) {
case"boolean":
case"number":
case"object":
case"string":
case"undefined":
return e;
default:
return ""
}
}
function ze(e) {
var t = e.type;
return (e = e.nodeName) && "input" === e.toLowerCase() && ("checkbox" === t || "radio" === t)
}
function Ue(e) {
e._valueTracker || (e._valueTracker = function (e) {
var t = ze(e) ? "checked" : "value", n = Object.getOwnPropertyDescriptor(e.constructor.prototype, t),
r = "" + e[t];
if (!e.hasOwnProperty(t) && void 0 !== n && "function" == typeof n.get && "function" == typeof n.set) {
var i = n.get, a = n.set;
return Object.defineProperty(e, t, {
configurable: !0, get: function () {
return i.call(this)
}, set: function (e) {
r = "" + e, a.call(this, e)
}
}), Object.defineProperty(e, t, {enumerable: n.enumerable}), {
getValue: function () {
return r
}, setValue: function (e) {
r = "" + e
}, stopTracking: function () {
e._valueTracker = null, delete e[t]
}
}
}
}(e))
}
function qe(e) {
if (!e) return !1;
var t = e._valueTracker;
if (!t) return !0;
var n = t.getValue(), r = "";
return e && (r = ze(e) ? e.checked ? "true" : "false" : e.value), (e = r) !== n && (t.setValue(e), !0)
}
function He(e) {
if (void 0 === (e = e || ("undefined" != typeof document ? document : void 0))) return null;
try {
return e.activeElement || e.body
} catch (t) {
return e.body
}
}
function Ye(e, t) {
var n = t.checked;
return $({}, t, {
defaultChecked: void 0,
defaultValue: void 0,
value: void 0,
checked: null != n ? n : e._wrapperState.initialChecked
})
}
function Xe(e, t) {
var n = null == t.defaultValue ? "" : t.defaultValue, r = null != t.checked ? t.checked : t.defaultChecked;
n = je(null != t.value ? t.value : n), e._wrapperState = {
initialChecked: r,
initialValue: n,
controlled: "checkbox" === t.type || "radio" === t.type ? null != t.checked : null != t.value
}
}
function Je(e, t) {
null != (t = t.checked) && me(e, "checked", t, !1)
}
function Qe(e, t) {
Je(e, t);
var n = je(t.value), r = t.type;
if (null != n) "number" === r ? (0 === n && "" === e.value || e.value != n) && (e.value = "" + n) : e.value !== "" + n && (e.value = "" + n); else if ("submit" === r || "reset" === r) return void e.removeAttribute("value");
t.hasOwnProperty("value") ? Ze(e, t.type, n) : t.hasOwnProperty("defaultValue") && Ze(e, t.type, je(t.defaultValue)), null == t.checked && null != t.defaultChecked && (e.defaultChecked = !!t.defaultChecked)
}
function $e(e, t, n) {
if (t.hasOwnProperty("value") || t.hasOwnProperty("defaultValue")) {
var r = t.type;
if (!("submit" !== r && "reset" !== r || void 0 !== t.value && null !== t.value)) return;
t = "" + e._wrapperState.initialValue, n || t === e.value || (e.value = t), e.defaultValue = t
}
"" !== (n = e.name) && (e.name = ""), e.defaultChecked = !!e._wrapperState.initialChecked, "" !== n && (e.name = n)
}
function Ze(e, t, n) {
"number" === t && He(e.ownerDocument) === e || (null == n ? e.defaultValue = "" + e._wrapperState.initialValue : e.defaultValue !== "" + n && (e.defaultValue = "" + n))
}
function et(e, t) {
return e = $({children: void 0}, t), (t = function (e) {
var t = "";
return Q.Children.forEach(e, function (e) {
null != e && (t += e)
}), t
}(t.children)) && (e.children = t), e
}
function tt(e, t, n, r) {
if (e = e.options, t) {
t = {};
for (var i = 0; i < n.length; i++) t["$" + n[i]] = !0;
for (n = 0; n < e.length; n++) i = t.hasOwnProperty("$" + e[n].value), e[n].selected !== i && (e[n].selected = i), i && r && (e[n].defaultSelected = !0)
} else {
for (n = "" + je(n), t = null, i = 0; i < e.length; i++) {
if (e[i].value === n) return e[i].selected = !0, void (r && (e[i].defaultSelected = !0));
null !== t || e[i].disabled || (t = e[i])
}
null !== t && (t.selected = !0)
}
}
function nt(e, t) {
if (null != t.dangerouslySetInnerHTML) throw Error(ee(91));
return $({}, t, {value: void 0, defaultValue: void 0, children: "" + e._wrapperState.initialValue})
}
function rt(e, t) {
var n = t.value;
if (null == n) {
if (n = t.children, t = t.defaultValue, null != n) {
if (null != t) throw Error(ee(92));
if (Array.isArray(n)) {
if (!(1 >= n.length)) throw Error(ee(93));
n = n[0]
}
t = n
}
null == t && (t = ""), n = t
}
e._wrapperState = {initialValue: je(n)}
}
function it(e, t) {
var n = je(t.value), r = je(t.defaultValue);
null != n && ((n = "" + n) !== e.value && (e.value = n), null == t.defaultValue && e.defaultValue !== n && (e.defaultValue = n)), null != r && (e.defaultValue = "" + r)
}
function at(e) {
var t = e.textContent;
t === e._wrapperState.initialValue && "" !== t && null !== t && (e.value = t)
}
var ot = {
html: "http://www.w3.org/1999/xhtml",
mathml: "http://www.w3.org/1998/Math/MathML",
svg: "http://www.w3.org/2000/svg"
};
function st(e) {
switch (e) {
case"svg":
return "http://www.w3.org/2000/svg";
case"math":
return "http://www.w3.org/1998/Math/MathML";
default:
return "http://www.w3.org/1999/xhtml"
}
}
function lt(e, t) {
return null == e || "http://www.w3.org/1999/xhtml" === e ? st(t) : "http://www.w3.org/2000/svg" === e && "foreignObject" === t ? "http://www.w3.org/1999/xhtml" : e
}
var ct, ut, dt = (ut = function (e, t) {
if (e.namespaceURI !== ot.svg || "innerHTML" in e) e.innerHTML = t; else {
for ((ct = ct || document.createElement("div")).innerHTML = "<svg>" + t.valueOf().toString() + "</svg>", t = ct.firstChild; e.firstChild;) e.removeChild(e.firstChild);
for (; t.firstChild;) e.appendChild(t.firstChild)
}
}, "undefined" != typeof MSApp && MSApp.execUnsafeLocalFunction ? function (e, t, n, r) {
MSApp.execUnsafeLocalFunction(function () {
return ut(e, t)
})
} : ut);
function ht(e, t) {
if (t) {
var n = e.firstChild;
if (n && n === e.lastChild && 3 === n.nodeType) return void (n.nodeValue = t)
}
e.textContent = t
}
var pt = {
animationIterationCount: !0,
borderImageOutset: !0,
borderImageSlice: !0,
borderImageWidth: !0,
boxFlex: !0,
boxFlexGroup: !0,
boxOrdinalGroup: !0,
columnCount: !0,
columns: !0,
flex: !0,
flexGrow: !0,
flexPositive: !0,
flexShrink: !0,
flexNegative: !0,
flexOrder: !0,
gridArea: !0,
gridRow: !0,
gridRowEnd: !0,
gridRowSpan: !0,
gridRowStart: !0,
gridColumn: !0,
gridColumnEnd: !0,
gridColumnSpan: !0,
gridColumnStart: !0,
fontWeight: !0,
lineClamp: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
tabSize: !0,
widows: !0,
zIndex: !0,
zoom: !0,
fillOpacity: !0,
floodOpacity: !0,
stopOpacity: !0,
strokeDasharray: !0,
strokeDashoffset: !0,
strokeMiterlimit: !0,
strokeOpacity: !0,
strokeWidth: !0
}, ft = ["Webkit", "ms", "Moz", "O"];
function mt(e, t, n) {
return null == t || "boolean" == typeof t || "" === t ? "" : n || "number" != typeof t || 0 === t || pt.hasOwnProperty(e) && pt[e] ? ("" + t).trim() : t + "px"
}
function vt(e, t) {
for (var n in e = e.style, t) if (t.hasOwnProperty(n)) {
var r = 0 === n.indexOf("--"), i = mt(n, t[n], r);
"float" === n && (n = "cssFloat"), r ? e.setProperty(n, i) : e[n] = i
}
}
Object.keys(pt).forEach(function (e) {
ft.forEach(function (t) {
t = t + e.charAt(0).toUpperCase() + e.substring(1), pt[t] = pt[e]
})
});
var gt = $({menuitem: !0}, {
area: !0,
base: !0,
br: !0,
col: !0,
embed: !0,
hr: !0,
img: !0,
input: !0,
keygen: !0,
link: !0,
meta: !0,
param: !0,
source: !0,
track: !0,
wbr: !0
});
function yt(e, t) {
if (t) {
if (gt[e] && (null != t.children || null != t.dangerouslySetInnerHTML)) throw Error(ee(137, e));
if (null != t.dangerouslySetInnerHTML) {
if (null != t.children) throw Error(ee(60));
if (!("object" === c(t.dangerouslySetInnerHTML) && "__html" in t.dangerouslySetInnerHTML)) throw Error(ee(61))
}
if (null != t.style && "object" !== c(t.style)) throw Error(ee(62))
}
}
function bt(e, t) {
if (-1 === e.indexOf("-")) return "string" == typeof t.is;
switch (e) {
case"annotation-xml":
case"color-profile":
case"font-face":
case"font-face-src":
case"font-face-uri":
case"font-face-format":
case"font-face-name":
case"missing-glyph":
return !1;
default:
return !0
}
}
function wt(e) {
return (e = e.target || e.srcElement || window).correspondingUseElement && (e = e.correspondingUseElement), 3 === e.nodeType ? e.parentNode : e
}
var St = null, _t = null, kt = null;
function xt(e) {
if (e = qi(e)) {
if ("function" != typeof St) throw Error(ee(280));
var t = e.stateNode;
t && (t = Yi(t), St(e.stateNode, e.type, t))
}
}
function Pt(e) {
_t ? kt ? kt.push(e) : kt = [e] : _t = e
}
function Ct() {
if (_t) {
var e = _t, t = kt;
if (kt = _t = null, xt(e), t) for (e = 0; e < t.length; e++) xt(t[e])
}
}
function At(e, t) {
return e(t)
}
function Tt(e, t, n, r, i) {
return e(t, n, r, i)
}
function Et() {
}
var Dt = At, It = !1, Lt = !1;
function Ot() {
null === _t && null === kt || (Et(), Ct())
}
function Mt(e, t) {
var n = e.stateNode;
if (null === n) return null;
var r = Yi(n);
if (null === r) return null;
n = r[t];
e:switch (t) {
case"onClick":
case"onClickCapture":
case"onDoubleClick":
case"onDoubleClickCapture":
case"onMouseDown":
case"onMouseDownCapture":
case"onMouseMove":
case"onMouseMoveCapture":
case"onMouseUp":
case"onMouseUpCapture":
case"onMouseEnter":
(r = !r.disabled) || (r = !("button" === (e = e.type) || "input" === e || "select" === e || "textarea" === e)), e = !r;
break e;
default:
e = !1
}
if (e) return null;
if (n && "function" != typeof n) throw Error(ee(231, t, c(n)));
return n
}
var Nt = !1;
if (ae) try {
var Rt = {};
Object.defineProperty(Rt, "passive", {
get: function () {
Nt = !0
}
}), window.addEventListener("test", Rt, Rt), window.removeEventListener("test", Rt, Rt)
} catch (ut) {
Nt = !1
}
var Wt = !1, Vt = null, Ft = !1, Gt = null, Bt = {
onError: function (e) {
Wt = !0, Vt = e
}
};
function Kt(e, t, n, r, i, a, o, s, l) {
Wt = !1, Vt = null, function (e, t, n, r, i, a, o, s, l) {
var c = Array.prototype.slice.call(arguments, 3);
try {
t.apply(n, c)
} catch (e) {
this.onError(e)
}
}.apply(Bt, arguments)
}
function jt(e) {
var t = e, n = e;
if (e.alternate) for (; t.return;) t = t.return; else {
e = t;
do {
0 != (1026 & (t = e).flags) && (n = t.return), e = t.return
} while (e)
}
return 3 === t.tag ? n : null
}
function zt(e) {
if (13 === e.tag) {
var t = e.memoizedState;
if (null === t && (null !== (e = e.alternate) && (t = e.memoizedState)), null !== t) return t.dehydrated
}
return null
}
function Ut(e) {
if (jt(e) !== e) throw Error(ee(188))
}
function qt(e) {
if (!(e = function (e) {
var t = e.alternate;
if (!t) {
if (null === (t = jt(e))) throw Error(ee(188));
return t !== e ? null : e
}
for (var n = e, r = t; ;) {
var i = n.return;
if (null === i) break;
var a = i.alternate;
if (null === a) {
if (null !== (r = i.return)) {
n = r;
continue
}
break
}
if (i.child === a.child) {
for (a = i.child; a;) {
if (a === n) return Ut(i), e;
if (a === r) return Ut(i), t;
a = a.sibling
}
throw Error(ee(188))
}
if (n.return !== r.return) n = i, r = a; else {
for (var o = !1, s = i.child; s;) {
if (s === n) {
o = !0, n = i, r = a;
break
}
if (s === r) {
o = !0, r = i, n = a;
break
}
s = s.sibling
}
if (!o) {
for (s = a.child; s;) {
if (s === n) {
o = !0, n = a, r = i;
break
}
if (s === r) {
o = !0, r = a, n = i;
break
}
s = s.sibling
}
if (!o) throw Error(ee(189))
}
}
if (n.alternate !== r) throw Error(ee(190))
}
if (3 !== n.tag) throw Error(ee(188));
return n.stateNode.current === n ? e : t
}(e))) return null;
for (var t = e; ;) {
if (5 === t.tag || 6 === t.tag) return t;
if (t.child) t.child.return = t, t = t.child; else {
if (t === e) break;
for (; !t.sibling;) {
if (!t.return || t.return === e) return null;
t = t.return
}
t.sibling.return = t.return, t = t.sibling
}
}
return null
}
function Ht(e, t) {
for (var n = e.alternate; null !== t;) {
if (t === e || t === n) return !0;
t = t.return
}
return !1
}
var Yt, Xt, Jt, Qt, $t = !1, Zt = [], en = null, tn = null, nn = null, rn = new Map, an = new Map, on = [],
sn = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
function ln(e, t, n, r, i) {
return {blockedOn: e, domEventName: t, eventSystemFlags: 16 | n, nativeEvent: i, targetContainers: [r]}
}
function cn(e, t) {
switch (e) {
case"focusin":
case"focusout":
en = null;
break;
case"dragenter":
case"dragleave":
tn = null;
break;
case"mouseover":
case"mouseout":
nn = null;
break;
case"pointerover":
case"pointerout":
rn.delete(t.pointerId);
break;
case"gotpointercapture":
case"lostpointercapture":
an.delete(t.pointerId)
}
}
function un(e, t, n, r, i, a) {
return null === e || e.nativeEvent !== a ? (e = ln(t, n, r, i, a), null !== t && (null !== (t = qi(t)) && Xt(t)), e) : (e.eventSystemFlags |= r, t = e.targetContainers, null !== i && -1 === t.indexOf(i) && t.push(i), e)
}
function dn(e) {
var t = Ui(e.target);
if (null !== t) {
var n = jt(t);
if (null !== n) if (13 === (t = n.tag)) {
if (null !== (t = zt(n))) return e.blockedOn = t, void Qt(e.lanePriority, function () {
Z.unstable_runWithPriority(e.priority, function () {
Jt(n)
})
})
} else if (3 === t && n.stateNode.hydrate) return void (e.blockedOn = 3 === n.tag ? n.stateNode.containerInfo : null)
}
e.blockedOn = null
}
function hn(e) {
if (null !== e.blockedOn) return !1;
for (var t = e.targetContainers; 0 < t.length;) {
var n = Hn(e.domEventName, e.eventSystemFlags, t[0], e.nativeEvent);
if (null !== n) return null !== (t = qi(n)) && Xt(t), e.blockedOn = n, !1;
t.shift()
}
return !0
}
function pn(e, t, n) {
hn(e) && n.delete(t)
}
function fn() {
for ($t = !1; 0 < Zt.length;) {
var e = Zt[0];
if (null !== e.blockedOn) {
null !== (e = qi(e.blockedOn)) && Yt(e);
break
}
for (var t = e.targetContainers; 0 < t.length;) {
var n = Hn(e.domEventName, e.eventSystemFlags, t[0], e.nativeEvent);
if (null !== n) {
e.blockedOn = n;
break
}
t.shift()
}
null === e.blockedOn && Zt.shift()
}
null !== en && hn(en) && (en = null), null !== tn && hn(tn) && (tn = null), null !== nn && hn(nn) && (nn = null), rn.forEach(pn), an.forEach(pn)
}
function mn(e, t) {
e.blockedOn === t && (e.blockedOn = null, $t || ($t = !0, Z.unstable_scheduleCallback(Z.unstable_NormalPriority, fn)))
}
function vn(e) {
function t(t) {
return mn(t, e)
}
if (0 < Zt.length) {
mn(Zt[0], e);
for (var n = 1; n < Zt.length; n++) {
var r = Zt[n];
r.blockedOn === e && (r.blockedOn = null)
}
}
for (null !== en && mn(en, e), null !== tn && mn(tn, e), null !== nn && mn(nn, e), rn.forEach(t), an.forEach(t), n = 0; n < on.length; n++) (r = on[n]).blockedOn === e && (r.blockedOn = null);
for (; 0 < on.length && null === (n = on[0]).blockedOn;) dn(n), null === n.blockedOn && on.shift()
}
function gn(e, t) {
var n = {};
return n[e.toLowerCase()] = t.toLowerCase(), n["Webkit" + e] = "webkit" + t, n["Moz" + e] = "moz" + t, n
}
var yn = {
animationend: gn("Animation", "AnimationEnd"),
animationiteration: gn("Animation", "AnimationIteration"),
animationstart: gn("Animation", "AnimationStart"),
transitionend: gn("Transition", "TransitionEnd")
}, bn = {}, wn = {};
function Sn(e) {
if (bn[e]) return bn[e];
if (!yn[e]) return e;
var t, n = yn[e];
for (t in n) if (n.hasOwnProperty(t) && t in wn) return bn[e] = n[t];
return e
}
ae && (wn = document.createElement("div").style, "AnimationEvent" in window || (delete yn.animationend.animation, delete yn.animationiteration.animation, delete yn.animationstart.animation), "TransitionEvent" in window || delete yn.transitionend.transition);
var _n = Sn("animationend"), kn = Sn("animationiteration"), xn = Sn("animationstart"), Pn = Sn("transitionend"),
Cn = new Map, An = new Map,
Tn = ["abort", "abort", _n, "animationEnd", kn, "animationIteration", xn, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", Pn, "transitionEnd", "waiting", "waiting"];
function En(e, t) {
for (var n = 0; n < e.length; n += 2) {
var r = e[n], i = e[n + 1];
i = "on" + (i[0].toUpperCase() + i.slice(1)), An.set(r, t), Cn.set(r, i), re(i, [r])
}
}
(0, Z.unstable_now)();
var Dn = 8;
function In(e) {
if (0 != (1 & e)) return Dn = 15, 1;
if (0 != (2 & e)) return Dn = 14, 2;
if (0 != (4 & e)) return Dn = 13, 4;
var t = 24 & e;
return 0 !== t ? (Dn = 12, t) : 0 != (32 & e) ? (Dn = 11, 32) : 0 !== (t = 192 & e) ? (Dn = 10, t) : 0 != (256 & e) ? (Dn = 9, 256) : 0 !== (t = 3584 & e) ? (Dn = 8, t) : 0 != (4096 & e) ? (Dn = 7, 4096) : 0 !== (t = 4186112 & e) ? (Dn = 6, t) : 0 !== (t = 62914560 & e) ? (Dn = 5, t) : 67108864 & e ? (Dn = 4, 67108864) : 0 != (134217728 & e) ? (Dn = 3, 134217728) : 0 !== (t = 805306368 & e) ? (Dn = 2, t) : 0 != (1073741824 & e) ? (Dn = 1, 1073741824) : (Dn = 8, e)
}
function Ln(e, t) {
var n = e.pendingLanes;
if (0 === n) return Dn = 0;
var r = 0, i = 0, a = e.expiredLanes, o = e.suspendedLanes, s = e.pingedLanes;
if (0 !== a) r = a, i = Dn = 15; else if (0 !== (a = 134217727 & n)) {
var l = a & ~o;
0 !== l ? (r = In(l), i = Dn) : 0 !== (s &= a) && (r = In(s), i = Dn)
} else 0 !== (a = n & ~o) ? (r = In(a), i = Dn) : 0 !== s && (r = In(s), i = Dn);
if (0 === r) return 0;
if (r = n & ((0 > (r = 31 - Vn(r)) ? 0 : 1 << r) << 1) - 1, 0 !== t && t !== r && 0 == (t & o)) {
if (In(t), i <= Dn) return t;
Dn = i
}
if (0 !== (t = e.entangledLanes)) for (e = e.entanglements, t &= r; 0 < t;) i = 1 << (n = 31 - Vn(t)), r |= e[n], t &= ~i;
return r
}
function On(e) {
return 0 !== (e = -1073741825 & e.pendingLanes) ? e : 1073741824 & e ? 1073741824 : 0
}
function Mn(e, t) {
switch (e) {
case 15:
return 1;
case 14:
return 2;
case 12:
return 0 === (e = Nn(24 & ~t)) ? Mn(10, t) : e;
case 10:
return 0 === (e = Nn(192 & ~t)) ? Mn(8, t) : e;
case 8:
return 0 === (e = Nn(3584 & ~t)) && (0 === (e = Nn(4186112 & ~t)) && (e = 512)), e;
case 2:
return 0 === (t = Nn(805306368 & ~t)) && (t = 268435456), t
}
throw Error(ee(358, e))
}
function Nn(e) {
return e & -e
}
function Rn(e) {
for (var t = [], n = 0; 31 > n; n++) t.push(e);
return t
}
function Wn(e, t, n) {
e.pendingLanes |= t;
var r = t - 1;
e.suspendedLanes &= r, e.pingedLanes &= r, (e = e.eventTimes)[t = 31 - Vn(t)] = n
}
var Vn = Math.clz32 ? Math.clz32 : function (e) {
return 0 === e ? 32 : 31 - (Fn(e) / Gn | 0) | 0
}, Fn = Math.log, Gn = Math.LN2;
var Bn = Z.unstable_UserBlockingPriority, Kn = Z.unstable_runWithPriority, jn = !0;
function zn(e, t, n, r) {
It || Et();
var i = qn, a = It;
It = !0;
try {
Tt(i, e, t, n, r)
} finally {
(It = a) || Ot()
}
}
function Un(e, t, n, r) {
Kn(Bn, qn.bind(null, e, t, n, r))
}
function qn(e, t, n, r) {
var i;
if (jn) if ((i = 0 == (4 & t)) && 0 < Zt.length && -1 < sn.indexOf(e)) e = ln(null, e, t, n, r), Zt.push(e); else {
var a = Hn(e, t, n, r);
if (null === a) i && cn(e, r); else {
if (i) {
if (-1 < sn.indexOf(e)) return e = ln(a, e, t, n, r), void Zt.push(e);
if (function (e, t, n, r, i) {
switch (t) {
case"focusin":
return en = un(en, e, t, n, r, i), !0;
case"dragenter":
return tn = un(tn, e, t, n, r, i), !0;
case"mouseover":
return nn = un(nn, e, t, n, r, i), !0;
case"pointerover":
var a = i.pointerId;
return rn.set(a, un(rn.get(a) || null, e, t, n, r, i)), !0;
case"gotpointercapture":
return a = i.pointerId, an.set(a, un(an.get(a) || null, e, t, n, r, i)), !0
}
return !1
}(a, e, t, n, r)) return;
cn(e, r)
}
xi(e, t, r, null, n)
}
}
}
function Hn(e, t, n, r) {
var i = wt(r);
if (null !== (i = Ui(i))) {
var a = jt(i);
if (null === a) i = null; else {
var o = a.tag;
if (13 === o) {
if (null !== (i = zt(a))) return i;
i = null
} else if (3 === o) {
if (a.stateNode.hydrate) return 3 === a.tag ? a.stateNode.containerInfo : null;
i = null
} else a !== i && (i = null)
}
}
return xi(e, t, r, i, n), null
}
var Yn = null, Xn = null, Jn = null;
function Qn() {
if (Jn) return Jn;
var e, t, n = Xn, r = n.length, i = "value" in Yn ? Yn.value : Yn.textContent, a = i.length;
for (e = 0; e < r && n[e] === i[e]; e++) ;
var o = r - e;
for (t = 1; t <= o && n[r - t] === i[a - t]; t++) ;
return Jn = i.slice(e, 1 < t ? 1 - t : void 0)
}
function $n(e) {
var t = e.keyCode;
return "charCode" in e ? 0 === (e = e.charCode) && 13 === t && (e = 13) : e = t, 10 === e && (e = 13), 32 <= e || 13 === e ? e : 0
}
function Zn() {
return !0
}
function er() {
return !1
}
function tr(e) {
function t(t, n, r, i, a) {
for (var o in this._reactName = t, this._targetInst = r, this.type = n, this.nativeEvent = i, this.target = a, this.currentTarget = null, e) e.hasOwnProperty(o) && (t = e[o], this[o] = t ? t(i) : i[o]);
return this.isDefaultPrevented = (null != i.defaultPrevented ? i.defaultPrevented : !1 === i.returnValue) ? Zn : er, this.isPropagationStopped = er, this
}
return $(t.prototype, {
preventDefault: function () {
this.defaultPrevented = !0;
var e = this.nativeEvent;
e && (e.preventDefault ? e.preventDefault() : "unknown" != typeof e.returnValue && (e.returnValue = !1), this.isDefaultPrevented = Zn)
}, stopPropagation: function () {
var e = this.nativeEvent;
e && (e.stopPropagation ? e.stopPropagation() : "unknown" != typeof e.cancelBubble && (e.cancelBubble = !0), this.isPropagationStopped = Zn)
}, persist: function () {
}, isPersistent: Zn
}), t
}
var nr, rr, ir, ar = {
eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function (e) {
return e.timeStamp || Date.now()
}, defaultPrevented: 0, isTrusted: 0
}, or = tr(ar), sr = $({}, ar, {view: 0, detail: 0}), lr = tr(sr), cr = $({}, sr, {
screenX: 0,
screenY: 0,
clientX: 0,
clientY: 0,
pageX: 0,
pageY: 0,
ctrlKey: 0,
shiftKey: 0,
altKey: 0,
metaKey: 0,
getModifierState: wr,
button: 0,
buttons: 0,
relatedTarget: function (e) {
return void 0 === e.relatedTarget ? e.fromElement === e.srcElement ? e.toElement : e.fromElement : e.relatedTarget
},
movementX: function (e) {
return "movementX" in e ? e.movementX : (e !== ir && (ir && "mousemove" === e.type ? (nr = e.screenX - ir.screenX, rr = e.screenY - ir.screenY) : rr = nr = 0, ir = e), nr)
},
movementY: function (e) {
return "movementY" in e ? e.movementY : rr
}
}), ur = tr(cr), dr = tr($({}, cr, {dataTransfer: 0})), hr = tr($({}, sr, {relatedTarget: 0})),
pr = tr($({}, ar, {animationName: 0, elapsedTime: 0, pseudoElement: 0})), fr = tr($({}, ar, {
clipboardData: function (e) {
return "clipboardData" in e ? e.clipboardData : window.clipboardData
}
})), mr = tr($({}, ar, {data: 0})), vr = {
Esc: "Escape",
Spacebar: " ",
Left: "ArrowLeft",
Up: "ArrowUp",
Right: "ArrowRight",
Down: "ArrowDown",
Del: "Delete",
Win: "OS",
Menu: "ContextMenu",
Apps: "ContextMenu",
Scroll: "ScrollLock",
MozPrintableKey: "Unidentified"
}, gr = {
8: "Backspace",
9: "Tab",
12: "Clear",
13: "Enter",
16: "Shift",
17: "Control",
18: "Alt",
19: "Pause",
20: "CapsLock",
27: "Escape",
32: " ",
33: "PageUp",
34: "PageDown",
35: "End",
36: "Home",
37: "ArrowLeft",
38: "ArrowUp",
39: "ArrowRight",
40: "ArrowDown",
45: "Insert",
46: "Delete",
112: "F1",
113: "F2",
114: "F3",
115: "F4",
116: "F5",
117: "F6",
118: "F7",
119: "F8",
120: "F9",
121: "F10",
122: "F11",
123: "F12",
144: "NumLock",
145: "ScrollLock",
224: "Meta"
}, yr = {Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey"};
function br(e) {
var t = this.nativeEvent;
return t.getModifierState ? t.getModifierState(e) : !!(e = yr[e]) && !!t[e]
}
function wr() {
return br
}
var Sr = tr($({}, sr, {
key: function (e) {
if (e.key) {
var t = vr[e.key] || e.key;
if ("Unidentified" !== t) return t
}
return "keypress" === e.type ? 13 === (e = $n(e)) ? "Enter" : String.fromCharCode(e) : "keydown" === e.type || "keyup" === e.type ? gr[e.keyCode] || "Unidentified" : ""
},
code: 0,
location: 0,
ctrlKey: 0,
shiftKey: 0,
altKey: 0,
metaKey: 0,
repeat: 0,
locale: 0,
getModifierState: wr,
charCode: function (e) {
return "keypress" === e.type ? $n(e) : 0
},
keyCode: function (e) {
return "keydown" === e.type || "keyup" === e.type ? e.keyCode : 0
},
which: function (e) {
return "keypress" === e.type ? $n(e) : "keydown" === e.type || "keyup" === e.type ? e.keyCode : 0
}
})), _r = tr($({}, cr, {
pointerId: 0,
width: 0,
height: 0,
pressure: 0,
tangentialPressure: 0,
tiltX: 0,
tiltY: 0,
twist: 0,
pointerType: 0,
isPrimary: 0
})), kr = tr($({}, sr, {
touches: 0,
targetTouches: 0,
changedTouches: 0,
altKey: 0,
metaKey: 0,
ctrlKey: 0,
shiftKey: 0,
getModifierState: wr
})), xr = tr($({}, ar, {propertyName: 0, elapsedTime: 0, pseudoElement: 0})), Pr = tr($({}, cr, {
deltaX: function (e) {
return "deltaX" in e ? e.deltaX : "wheelDeltaX" in e ? -e.wheelDeltaX : 0
}, deltaY: function (e) {
return "deltaY" in e ? e.deltaY : "wheelDeltaY" in e ? -e.wheelDeltaY : "wheelDelta" in e ? -e.wheelDelta : 0
}, deltaZ: 0, deltaMode: 0
})), Cr = [9, 13, 27, 32], Ar = ae && "CompositionEvent" in window, Tr = null;
ae && "documentMode" in document && (Tr = document.documentMode);
var Er = ae && "TextEvent" in window && !Tr, Dr = ae && (!Ar || Tr && 8 < Tr && 11 >= Tr),
Ir = String.fromCharCode(32), Lr = !1;
function Or(e, t) {
switch (e) {
case"keyup":
return -1 !== Cr.indexOf(t.keyCode);
case"keydown":
return 229 !== t.keyCode;
case"keypress":
case"mousedown":
case"focusout":
return !0;
default:
return !1
}
}
function Mr(e) {
return "object" === c(e = e.detail) && "data" in e ? e.data : null
}
var Nr = !1;
var Rr = {
color: !0,
date: !0,
datetime: !0,
"datetime-local": !0,
email: !0,
month: !0,
number: !0,
password: !0,
range: !0,
search: !0,
tel: !0,
text: !0,
time: !0,
url: !0,
week: !0
};
function Wr(e) {
var t = e && e.nodeName && e.nodeName.toLowerCase();
return "input" === t ? !!Rr[e.type] : "textarea" === t
}
function Vr(e, t, n, r) {
Pt(r), 0 < (t = Ci(t, "onChange")).length && (n = new or("onChange", "change", null, n, r), e.push({
event: n,
listeners: t
}))
}
var Fr = null, Gr = null;
function Br(e) {
yi(e, 0)
}
function Kr(e) {
if (qe(Hi(e))) return e
}
function jr(e, t) {
if ("change" === e) return t
}
var zr = !1;
if (ae) {
var Ur;
if (ae) {
var qr = "oninput" in document;
if (!qr) {
var Hr = document.createElement("div");
Hr.setAttribute("oninput", "return;"), qr = "function" == typeof Hr.oninput
}
Ur = qr
} else Ur = !1;
zr = Ur && (!document.documentMode || 9 < document.documentMode)
}
function Yr() {
Fr && (Fr.detachEvent("onpropertychange", Xr), Gr = Fr = null)
}
function Xr(e) {
if ("value" === e.propertyName && Kr(Gr)) {
var t = [];
if (Vr(t, Gr, e, wt(e)), e = Br, It) e(t); else {
It = !0;
try {
At(e, t)
} finally {
It = !1, Ot()
}
}
}
}
function Jr(e, t, n) {
"focusin" === e ? (Yr(), Gr = n, (Fr = t).attachEvent("onpropertychange", Xr)) : "focusout" === e && Yr()
}
function Qr(e) {
if ("selectionchange" === e || "keyup" === e || "keydown" === e) return Kr(Gr)
}
function $r(e, t) {
if ("click" === e) return Kr(t)
}
function Zr(e, t) {
if ("input" === e || "change" === e) return Kr(t)
}
var ei = "function" == typeof Object.is ? Object.is : function (e, t) {
return e === t && (0 !== e || 1 / e == 1 / t) || e != e && t != t
}, ti = Object.prototype.hasOwnProperty;
function ni(e, t) {
if (ei(e, t)) return !0;
if ("object" !== c(e) || null === e || "object" !== c(t) || null === t) return !1;
var n = Object.keys(e), r = Object.keys(t);
if (n.length !== r.length) return !1;
for (r = 0; r < n.length; r++) if (!ti.call(t, n[r]) || !ei(e[n[r]], t[n[r]])) return !1;
return !0
}
function ri(e) {
for (; e && e.firstChild;) e = e.firstChild;
return e
}
function ii(e, t) {
var n, r = ri(e);
for (e = 0; r;) {
if (3 === r.nodeType) {
if (n = e + r.textContent.length, e <= t && n >= t) return {node: r, offset: t - e};
e = n
}
e:{
for (; r;) {
if (r.nextSibling) {
r = r.nextSibling;
break e
}
r = r.parentNode
}
r = void 0
}
r = ri(r)
}
}
function ai() {
for (var e = window, t = He(); t instanceof e.HTMLIFrameElement;) {
try {
var n = "string" == typeof t.contentWindow.location.href
} catch (e) {
n = !1
}
if (!n) break;
t = He((e = t.contentWindow).document)
}
return t
}
function oi(e) {
var t = e && e.nodeName && e.nodeName.toLowerCase();
return t && ("input" === t && ("text" === e.type || "search" === e.type || "tel" === e.type || "url" === e.type || "password" === e.type) || "textarea" === t || "true" === e.contentEditable)
}
var si = ae && "documentMode" in document && 11 >= document.documentMode, li = null, ci = null, ui = null, di = !1;
function hi(e, t, n) {
var r = n.window === n ? n.document : 9 === n.nodeType ? n : n.ownerDocument;
di || null == li || li !== He(r) || ("selectionStart" in (r = li) && oi(r) ? r = {
start: r.selectionStart,
end: r.selectionEnd
} : r = {
anchorNode: (r = (r.ownerDocument && r.ownerDocument.defaultView || window).getSelection()).anchorNode,
anchorOffset: r.anchorOffset,
focusNode: r.focusNode,
focusOffset: r.focusOffset
}, ui && ni(ui, r) || (ui = r, 0 < (r = Ci(ci, "onSelect")).length && (t = new or("onSelect", "select", null, t, n), e.push({
event: t,
listeners: r
}), t.target = li)))
}
En("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "), 0), En("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "), 1), En(Tn, 2);
for (var pi = "change selectionchange textInput compositionstart compositionend compositionupdate".split(" "), fi = 0; fi < pi.length; fi++) An.set(pi[fi], 0);
ie("onMouseEnter", ["mouseout", "mouseover"]), ie("onMouseLeave", ["mouseout", "mouseover"]), ie("onPointerEnter", ["pointerout", "pointerover"]), ie("onPointerLeave", ["pointerout", "pointerover"]), re("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), re("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), re("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), re("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), re("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), re("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
var mi = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),
vi = new Set("cancel close invalid load scroll toggle".split(" ").concat(mi));
function gi(e, t, n) {
var r = e.type || "unknown-event";
e.currentTarget = n, function (e, t, n, r, i, a, o, s, l) {
if (Kt.apply(this, arguments), Wt) {
if (!Wt) throw Error(ee(198));
var c = Vt;
Wt = !1, Vt = null, Ft || (Ft = !0, Gt = c)
}
}(r, t, void 0, e), e.currentTarget = null
}
function yi(e, t) {
t = 0 != (4 & t);
for (var n = 0; n < e.length; n++) {
var r = e[n], i = r.event;
r = r.listeners;
e:{
var a = void 0;
if (t) for (var o = r.length - 1; 0 <= o; o--) {
var s = r[o], l = s.instance, c = s.currentTarget;
if (s = s.listener, l !== a && i.isPropagationStopped()) break e;
gi(i, s, c), a = l
} else for (o = 0; o < r.length; o++) {
if (l = (s = r[o]).instance, c = s.currentTarget, s = s.listener, l !== a && i.isPropagationStopped()) break e;
gi(i, s, c), a = l
}
}
}
if (Ft) throw e = Gt, Ft = !1, Gt = null, e
}
function bi(e, t) {
var n = Xi(t), r = e + "__bubble";
n.has(r) || (ki(t, e, 2, !1), n.add(r))
}
var wi = "_reactListening" + Math.random().toString(36).slice(2);
function Si(e) {
e[wi] || (e[wi] = !0, te.forEach(function (t) {
vi.has(t) || _i(t, !1, e, null), _i(t, !0, e, null)
}))
}
function _i(e, t, n, r) {
var i = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 0, a = n;
if ("selectionchange" === e && 9 !== n.nodeType && (a = n.ownerDocument), null !== r && !t && vi.has(e)) {
if ("scroll" !== e) return;
i |= 2, a = r
}
var o = Xi(a), s = e + "__" + (t ? "capture" : "bubble");
o.has(s) || (t && (i |= 4), ki(a, e, i, t), o.add(s))
}
function ki(e, t, n, r) {
var i = An.get(t);
switch (void 0 === i ? 2 : i) {
case 0:
i = zn;
break;
case 1:
i = Un;
break;
default:
i = qn
}
n = i.bind(null, t, n, e), i = void 0, !Nt || "touchstart" !== t && "touchmove" !== t && "wheel" !== t || (i = !0), r ? void 0 !== i ? e.addEventListener(t, n, {
capture: !0,
passive: i
}) : e.addEventListener(t, n, !0) : void 0 !== i ? e.addEventListener(t, n, {passive: i}) : e.addEventListener(t, n, !1)
}
function xi(e, t, n, r, i) {
var a = r;
if (0 == (1 & t) && 0 == (2 & t) && null !== r) e:for (; ;) {
if (null === r) return;
var o = r.tag;
if (3 === o || 4 === o) {
var s = r.stateNode.containerInfo;
if (s === i || 8 === s.nodeType && s.parentNode === i) break;
if (4 === o) for (o = r.return; null !== o;) {
var l = o.tag;
if ((3 === l || 4 === l) && ((l = o.stateNode.containerInfo) === i || 8 === l.nodeType && l.parentNode === i)) return;
o = o.return
}
for (; null !== s;) {
if (null === (o = Ui(s))) return;
if (5 === (l = o.tag) || 6 === l) {
r = a = o;
continue e
}
s = s.parentNode
}
}
r = r.return
}
!function (e, t, n) {
if (Lt) return e(t, n);
Lt = !0;
try {
Dt(e, t, n)
} finally {
Lt = !1, Ot()
}
}(function () {
var r = a, i = wt(n), o = [];
e:{
var s = Cn.get(e);
if (void 0 !== s) {
var l = or, c = e;
switch (e) {
case"keypress":
if (0 === $n(n)) break e;
case"keydown":
case"keyup":
l = Sr;
break;
case"focusin":
c = "focus", l = hr;
break;
case"focusout":
c = "blur", l = hr;
break;
case"beforeblur":
case"afterblur":
l = hr;
break;
case"click":
if (2 === n.button) break e;
case"auxclick":
case"dblclick":
case"mousedown":
case"mousemove":
case"mouseup":
case"mouseout":
case"mouseover":
case"contextmenu":
l = ur;
break;
case"drag":
case"dragend":
case"dragenter":
case"dragexit":
case"dragleave":
case"dragover":
case"dragstart":
case"drop":
l = dr;
break;
case"touchcancel":
case"touchend":
case"touchmove":
case"touchstart":
l = kr;
break;
case _n:
case kn:
case xn:
l = pr;
break;
case Pn:
l = xr;
break;
case"scroll":
l = lr;
break;
case"wheel":
l = Pr;
break;
case"copy":
case"cut":
case"paste":
l = fr;
break;
case"gotpointercapture":
case"lostpointercapture":
case"pointercancel":
case"pointerdown":
case"pointermove":
case"pointerout":
case"pointerover":
case"pointerup":
l = _r
}
var u = 0 != (4 & t), d = !u && "scroll" === e, h = u ? null !== s ? s + "Capture" : null : s;
u = [];
for (var p, f = r; null !== f;) {
var m = (p = f).stateNode;
if (5 === p.tag && null !== m && (p = m, null !== h && (null != (m = Mt(f, h)) && u.push(Pi(f, m, p)))), d) break;
f = f.return
}
0 < u.length && (s = new l(s, c, null, n, i), o.push({event: s, listeners: u}))
}
}
if (0 == (7 & t)) {
if (s = "mouseover" === e || "pointerover" === e, l = "mouseout" === e || "pointerout" === e, (!s || 0 != (16 & t) || !(c = n.relatedTarget || n.fromElement) || !Ui(c) && !c[ji]) && (l || s) && (s = i.window === i ? i : (s = i.ownerDocument) ? s.defaultView || s.parentWindow : window, l ? (l = r, null !== (c = (c = n.relatedTarget || n.toElement) ? Ui(c) : null) && (c !== (d = jt(c)) || 5 !== c.tag && 6 !== c.tag) && (c = null)) : (l = null, c = r), l !== c)) {
if (u = ur, m = "onMouseLeave", h = "onMouseEnter", f = "mouse", "pointerout" !== e && "pointerover" !== e || (u = _r, m = "onPointerLeave", h = "onPointerEnter", f = "pointer"), d = null == l ? s : Hi(l), p = null == c ? s : Hi(c), (s = new u(m, f + "leave", l, n, i)).target = d, s.relatedTarget = p, m = null, Ui(i) === r && ((u = new u(h, f + "enter", c, n, i)).target = p, u.relatedTarget = d, m = u), d = m, l && c) e:{
for (h = c, f = 0, p = u = l; p; p = Ai(p)) f++;
for (p = 0, m = h; m; m = Ai(m)) p++;
for (; 0 < f - p;) u = Ai(u), f--;
for (; 0 < p - f;) h = Ai(h), p--;
for (; f--;) {
if (u === h || null !== h && u === h.alternate) break e;
u = Ai(u), h = Ai(h)
}
u = null
} else u = null;
null !== l && Ti(o, s, l, u, !1), null !== c && null !== d && Ti(o, d, c, u, !0)
}
if ("select" === (l = (s = r ? Hi(r) : window).nodeName && s.nodeName.toLowerCase()) || "input" === l && "file" === s.type) var v = jr; else if (Wr(s)) if (zr) v = Zr; else {
v = Qr;
var g = Jr
} else (l = s.nodeName) && "input" === l.toLowerCase() && ("checkbox" === s.type || "radio" === s.type) && (v = $r);
switch (v && (v = v(e, r)) ? Vr(o, v, n, i) : (g && g(e, s, r), "focusout" === e && (g = s._wrapperState) && g.controlled && "number" === s.type && Ze(s, "number", s.value)), g = r ? Hi(r) : window, e) {
case"focusin":
(Wr(g) || "true" === g.contentEditable) && (li = g, ci = r, ui = null);
break;
case"focusout":
ui = ci = li = null;
break;
case"mousedown":
di = !0;
break;
case"contextmenu":
case"mouseup":
case"dragend":
di = !1, hi(o, n, i);
break;
case"selectionchange":
if (si) break;
case"keydown":
case"keyup":
hi(o, n, i)
}
var y;
if (Ar) e:{
switch (e) {
case"compositionstart":
var b = "onCompositionStart";
break e;
case"compositionend":
b = "onCompositionEnd";
break e;
case"compositionupdate":
b = "onCompositionUpdate";
break e
}
b = void 0
} else Nr ? Or(e, n) && (b = "onCompositionEnd") : "keydown" === e && 229 === n.keyCode && (b = "onCompositionStart");
b && (Dr && "ko" !== n.locale && (Nr || "onCompositionStart" !== b ? "onCompositionEnd" === b && Nr && (y = Qn()) : (Xn = "value" in (Yn = i) ? Yn.value : Yn.textContent, Nr = !0)), 0 < (g = Ci(r, b)).length && (b = new mr(b, e, null, n, i), o.push({
event: b,
listeners: g
}), y ? b.data = y : null !== (y = Mr(n)) && (b.data = y))), (y = Er ? function (e, t) {
switch (e) {
case"compositionend":
return Mr(t);
case"keypress":
return 32 !== t.which ? null : (Lr = !0, Ir);
case"textInput":
return (e = t.data) === Ir && Lr ? null : e;
default:
return null
}
}(e, n) : function (e, t) {
if (Nr) return "compositionend" === e || !Ar && Or(e, t) ? (e = Qn(), Jn = Xn = Yn = null, Nr = !1, e) : null;
switch (e) {
case"paste":
return null;
case"keypress":
if (!(t.ctrlKey || t.altKey || t.metaKey) || t.ctrlKey && t.altKey) {
if (t.char && 1 < t.char.length) return t.char;
if (t.which) return String.fromCharCode(t.which)
}
return null;
case"compositionend":
return Dr && "ko" !== t.locale ? null : t.data;
default:
return null
}
}(e, n)) && (0 < (r = Ci(r, "onBeforeInput")).length && (i = new mr("onBeforeInput", "beforeinput", null, n, i), o.push({
event: i,
listeners: r
}), i.data = y))
}
yi(o, t)
})
}
function Pi(e, t, n) {
return {instance: e, listener: t, currentTarget: n}
}
function Ci(e, t) {
for (var n = t + "Capture", r = []; null !== e;) {
var i = e, a = i.stateNode;
5 === i.tag && null !== a && (i = a, null != (a = Mt(e, n)) && r.unshift(Pi(e, a, i)), null != (a = Mt(e, t)) && r.push(Pi(e, a, i))), e = e.return
}
return r
}
function Ai(e) {
if (null === e) return null;
do {
e = e.return
} while (e && 5 !== e.tag);
return e || null
}
function Ti(e, t, n, r, i) {
for (var a = t._reactName, o = []; null !== n && n !== r;) {
var s = n, l = s.alternate, c = s.stateNode;
if (null !== l && l === r) break;
5 === s.tag && null !== c && (s = c, i ? null != (l = Mt(n, a)) && o.unshift(Pi(n, l, s)) : i || null != (l = Mt(n, a)) && o.push(Pi(n, l, s))), n = n.return
}
0 !== o.length && e.push({event: t, listeners: o})
}
function Ei() {
}
var Di = null, Ii = null;
function Li(e, t) {
switch (e) {
case"button":
case"input":
case"select":
case"textarea":
return !!t.autoFocus
}
return !1
}
function Oi(e, t) {
return "textarea" === e || "option" === e || "noscript" === e || "string" == typeof t.children || "number" == typeof t.children || "object" === c(t.dangerouslySetInnerHTML) && null !== t.dangerouslySetInnerHTML && null != t.dangerouslySetInnerHTML.__html
}
var Mi = "function" == typeof setTimeout ? setTimeout : void 0,
Ni = "function" == typeof clearTimeout ? clearTimeout : void 0;
function Ri(e) {
1 === e.nodeType ? e.textContent = "" : 9 === e.nodeType && (null != (e = e.body) && (e.textContent = ""))
}
function Wi(e) {
for (; null != e; e = e.nextSibling) {
var t = e.nodeType;
if (1 === t || 3 === t) break
}
return e
}
function Vi(e) {
e = e.previousSibling;
for (var t = 0; e;) {
if (8 === e.nodeType) {
var n = e.data;
if ("$" === n || "$!" === n || "$?" === n) {
if (0 === t) return e;
t--
} else "/$" === n && t++
}
e = e.previousSibling
}
return null
}
var Fi = 0;
var Gi = Math.random().toString(36).slice(2), Bi = "__reactFiber$" + Gi, Ki = "__reactProps$" + Gi,
ji = "__reactContainer$" + Gi, zi = "__reactEvents$" + Gi;
function Ui(e) {
var t = e[Bi];
if (t) return t;
for (var n = e.parentNode; n;) {
if (t = n[ji] || n[Bi]) {
if (n = t.alternate, null !== t.child || null !== n && null !== n.child) for (e = Vi(e); null !== e;) {
if (n = e[Bi]) return n;
e = Vi(e)
}
return t
}
n = (e = n).parentNode
}
return null
}
function qi(e) {
return !(e = e[Bi] || e[ji]) || 5 !== e.tag && 6 !== e.tag && 13 !== e.tag && 3 !== e.tag ? null : e
}
function Hi(e) {
if (5 === e.tag || 6 === e.tag) return e.stateNode;
throw Error(ee(33))
}
function Yi(e) {
return e[Ki] || null
}
function Xi(e) {
var t = e[zi];
return void 0 === t && (t = e[zi] = new Set), t
}
var Ji = [], Qi = -1;
function $i(e) {
return {current: e}
}
function Zi(e) {
0 > Qi || (e.current = Ji[Qi], Ji[Qi] = null, Qi--)
}
function ea(e, t) {
Ji[++Qi] = e.current, e.current = t
}
var ta = {}, na = $i(ta), ra = $i(!1), ia = ta;
function aa(e, t) {
var n = e.type.contextTypes;
if (!n) return ta;
var r = e.stateNode;
if (r && r.__reactInternalMemoizedUnmaskedChildContext === t) return r.__reactInternalMemoizedMaskedChildContext;
var i, a = {};
for (i in n) a[i] = t[i];
return r && ((e = e.stateNode).__reactInternalMemoizedUnmaskedChildContext = t, e.__reactInternalMemoizedMaskedChildContext = a), a
}
function oa(e) {
return null !== (e = e.childContextTypes) && void 0 !== e
}
function sa() {
Zi(ra), Zi(na)
}
function la(e, t, n) {
if (na.current !== ta) throw Error(ee(168));
ea(na, t), ea(ra, n)
}
function ca(e, t, n) {
var r = e.stateNode;
if (e = t.childContextTypes, "function" != typeof r.getChildContext) return n;
for (var i in r = r.getChildContext()) if (!(i in e)) throw Error(ee(108, Ke(t) || "Unknown", i));
return $({}, n, r)
}
function ua(e) {
return e = (e = e.stateNode) && e.__reactInternalMemoizedMergedChildContext || ta, ia = na.current, ea(na, e), ea(ra, ra.current), !0
}
function da(e, t, n) {
var r = e.stateNode;
if (!r) throw Error(ee(169));
n ? (e = ca(e, t, ia), r.__reactInternalMemoizedMergedChildContext = e, Zi(ra), Zi(na), ea(na, e)) : Zi(ra), ea(ra, n)
}
var ha = null, pa = null, fa = Z.unstable_runWithPriority, ma = Z.unstable_scheduleCallback,
va = Z.unstable_cancelCallback, ga = Z.unstable_shouldYield, ya = Z.unstable_requestPaint, ba = Z.unstable_now,
wa = Z.unstable_getCurrentPriorityLevel, Sa = Z.unstable_ImmediatePriority, _a = Z.unstable_UserBlockingPriority,
ka = Z.unstable_NormalPriority, xa = Z.unstable_LowPriority, Pa = Z.unstable_IdlePriority, Ca = {},
Aa = void 0 !== ya ? ya : function () {
}, Ta = null, Ea = null, Da = !1, Ia = ba(), La = 1e4 > Ia ? ba : function () {
return ba() - Ia
};
function Oa() {
switch (wa()) {
case Sa:
return 99;
case _a:
return 98;
case ka:
return 97;
case xa:
return 96;
case Pa:
return 95;
default:
throw Error(ee(332))
}
}
function Ma(e) {
switch (e) {
case 99:
return Sa;
case 98:
return _a;
case 97:
return ka;
case 96:
return xa;
case 95:
return Pa;
default:
throw Error(ee(332))
}
}
function Na(e, t) {
return e = Ma(e), fa(e, t)
}
function Ra(e, t, n) {
return e = Ma(e), ma(e, t, n)
}
function Wa() {
if (null !== Ea) {
var e = Ea;
Ea = null, va(e)
}
Va()
}
function Va() {
if (!Da && null !== Ta) {
Da = !0;
var e = 0;
try {
var t = Ta;
Na(99, function () {
for (; e < t.length; e++) {
var n = t[e];
do {
n = n(!0)
} while (null !== n)
}
}), Ta = null
} catch (t) {
throw null !== Ta && (Ta = Ta.slice(e + 1)), ma(Sa, Wa), t
} finally {
Da = !1
}
}
}
var Fa = ve.ReactCurrentBatchConfig;
function Ga(e, t) {
if (e && e.defaultProps) {
for (var n in t = $({}, t), e = e.defaultProps) void 0 === t[n] && (t[n] = e[n]);
return t
}
return t
}
var Ba = $i(null), Ka = null, ja = null, za = null;
function Ua() {
za = ja = Ka = null
}
function qa(e) {
var t = Ba.current;
Zi(Ba), e.type._context._currentValue = t
}
function Ha(e, t) {
for (; null !== e;) {
var n = e.alternate;
if ((e.childLanes & t) === t) {
if (null === n || (n.childLanes & t) === t) break;
n.childLanes |= t
} else e.childLanes |= t, null !== n && (n.childLanes |= t);
e = e.return
}
}
function Ya(e, t) {
Ka = e, za = ja = null, null !== (e = e.dependencies) && null !== e.firstContext && (0 != (e.lanes & t) && (Ps = !0), e.firstContext = null)
}
function Xa(e, t) {
if (za !== e && !1 !== t && 0 !== t) if ("number" == typeof t && 1073741823 !== t || (za = e, t = 1073741823), t = {
context: e,
observedBits: t,
next: null
}, null === ja) {
if (null === Ka) throw Error(ee(308));
ja = t, Ka.dependencies = {lanes: 0, firstContext: t, responders: null}
} else ja = ja.next = t;
return e._currentValue
}
var Ja = !1;
function Qa(e) {
e.updateQueue = {
baseState: e.memoizedState,
firstBaseUpdate: null,
lastBaseUpdate: null,
shared: {pending: null},
effects: null
}
}
function $a(e, t) {
e = e.updateQueue, t.updateQueue === e && (t.updateQueue = {
baseState: e.baseState,
firstBaseUpdate: e.firstBaseUpdate,
lastBaseUpdate: e.lastBaseUpdate,
shared: e.shared,
effects: e.effects
})
}
function Za(e, t) {
return {eventTime: e, lane: t, tag: 0, payload: null, callback: null, next: null}
}
function eo(e, t) {
if (null !== (e = e.updateQueue)) {
var n = (e = e.shared).pending;
null === n ? t.next = t : (t.next = n.next, n.next = t), e.pending = t
}
}
function to(e, t) {
var n = e.updateQueue, r = e.alternate;
if (null !== r && n === (r = r.updateQueue)) {
var i = null, a = null;
if (null !== (n = n.firstBaseUpdate)) {
do {
var o = {
eventTime: n.eventTime,
lane: n.lane,
tag: n.tag,
payload: n.payload,
callback: n.callback,
next: null
};
null === a ? i = a = o : a = a.next = o, n = n.next
} while (null !== n);
null === a ? i = a = t : a = a.next = t
} else i = a = t;
return n = {
baseState: r.baseState,
firstBaseUpdate: i,
lastBaseUpdate: a,
shared: r.shared,
effects: r.effects
}, void (e.updateQueue = n)
}
null === (e = n.lastBaseUpdate) ? n.firstBaseUpdate = t : e.next = t, n.lastBaseUpdate = t
}
function no(e, t, n, r) {
var i = e.updateQueue;
Ja = !1;
var a = i.firstBaseUpdate, o = i.lastBaseUpdate, s = i.shared.pending;
if (null !== s) {
i.shared.pending = null;
var l = s, c = l.next;
l.next = null, null === o ? a = c : o.next = c, o = l;
var u = e.alternate;
if (null !== u) {
var d = (u = u.updateQueue).lastBaseUpdate;
d !== o && (null === d ? u.firstBaseUpdate = c : d.next = c, u.lastBaseUpdate = l)
}
}
if (null !== a) {
for (d = i.baseState, o = 0, u = c = l = null; ;) {
s = a.lane;
var h = a.eventTime;
if ((r & s) === s) {
null !== u && (u = u.next = {
eventTime: h,
lane: 0,
tag: a.tag,
payload: a.payload,
callback: a.callback,
next: null
});
e:{
var p = e, f = a;
switch (s = t, h = n, f.tag) {
case 1:
if ("function" == typeof (p = f.payload)) {
d = p.call(h, d, s);
break e
}
d = p;
break e;
case 3:
p.flags = -4097 & p.flags | 64;
case 0:
if (null === (s = "function" == typeof (p = f.payload) ? p.call(h, d, s) : p) || void 0 === s) break e;
d = $({}, d, s);
break e;
case 2:
Ja = !0
}
}
null !== a.callback && (e.flags |= 32, null === (s = i.effects) ? i.effects = [a] : s.push(a))
} else h = {
eventTime: h,
lane: s,
tag: a.tag,
payload: a.payload,
callback: a.callback,
next: null
}, null === u ? (c = u = h, l = d) : u = u.next = h, o |= s;
if (null === (a = a.next)) {
if (null === (s = i.shared.pending)) break;
a = s.next, s.next = null, i.lastBaseUpdate = s, i.shared.pending = null
}
}
null === u && (l = d), i.baseState = l, i.firstBaseUpdate = c, i.lastBaseUpdate = u, Tl |= o, e.lanes = o, e.memoizedState = d
}
}
function ro(e, t, n) {
if (e = t.effects, t.effects = null, null !== e) for (t = 0; t < e.length; t++) {
var r = e[t], i = r.callback;
if (null !== i) {
if (r.callback = null, r = n, "function" != typeof i) throw Error(ee(191, i));
i.call(r)
}
}
}
var io = (new Q.Component).refs;
function ao(e, t, n, r) {
n = null === (n = n(r, t = e.memoizedState)) || void 0 === n ? t : $({}, t, n), e.memoizedState = n, 0 === e.lanes && (e.updateQueue.baseState = n)
}
var oo = {
isMounted: function (e) {
return !!(e = e._reactInternals) && jt(e) === e
}, enqueueSetState: function (e, t, n) {
e = e._reactInternals;
var r = Zl(), i = ec(e), a = Za(r, i);
a.payload = t, void 0 !== n && null !== n && (a.callback = n), eo(e, a), tc(e, i, r)
}, enqueueReplaceState: function (e, t, n) {
e = e._reactInternals;
var r = Zl(), i = ec(e), a = Za(r, i);
a.tag = 1, a.payload = t, void 0 !== n && null !== n && (a.callback = n), eo(e, a), tc(e, i, r)
}, enqueueForceUpdate: function (e, t) {
e = e._reactInternals;
var n = Zl(), r = ec(e), i = Za(n, r);
i.tag = 2, void 0 !== t && null !== t && (i.callback = t), eo(e, i), tc(e, r, n)
}
};
function so(e, t, n, r, i, a, o) {
return "function" == typeof (e = e.stateNode).shouldComponentUpdate ? e.shouldComponentUpdate(r, a, o) : !t.prototype || !t.prototype.isPureReactComponent || (!ni(n, r) || !ni(i, a))
}
function lo(e, t, n) {
var r = !1, i = ta, a = t.contextType;
return "object" === c(a) && null !== a ? a = Xa(a) : (i = oa(t) ? ia : na.current, a = (r = null !== (r = t.contextTypes) && void 0 !== r) ? aa(e, i) : ta), t = new t(n, a), e.memoizedState = null !== t.state && void 0 !== t.state ? t.state : null, t.updater = oo, e.stateNode = t, t._reactInternals = e, r && ((e = e.stateNode).__reactInternalMemoizedUnmaskedChildContext = i, e.__reactInternalMemoizedMaskedChildContext = a), t
}
function co(e, t, n, r) {
e = t.state, "function" == typeof t.componentWillReceiveProps && t.componentWillReceiveProps(n, r), "function" == typeof t.UNSAFE_componentWillReceiveProps && t.UNSAFE_componentWillReceiveProps(n, r), t.state !== e && oo.enqueueReplaceState(t, t.state, null)
}
function uo(e, t, n, r) {
var i = e.stateNode;
i.props = n, i.state = e.memoizedState, i.refs = io, Qa(e);
var a = t.contextType;
"object" === c(a) && null !== a ? i.context = Xa(a) : (a = oa(t) ? ia : na.current, i.context = aa(e, a)), no(e, n, i, r), i.state = e.memoizedState, "function" == typeof (a = t.getDerivedStateFromProps) && (ao(e, t, a, n), i.state = e.memoizedState), "function" == typeof t.getDerivedStateFromProps || "function" == typeof i.getSnapshotBeforeUpdate || "function" != typeof i.UNSAFE_componentWillMount && "function" != typeof i.componentWillMount || (t = i.state, "function" == typeof i.componentWillMount && i.componentWillMount(), "function" == typeof i.UNSAFE_componentWillMount && i.UNSAFE_componentWillMount(), t !== i.state && oo.enqueueReplaceState(i, i.state, null), no(e, n, i, r), i.state = e.memoizedState), "function" == typeof i.componentDidMount && (e.flags |= 4)
}
var ho = Array.isArray;
function po(e, t, n) {
if (null !== (e = n.ref) && "function" != typeof e && "object" !== c(e)) {
if (n._owner) {
if (n = n._owner) {
if (1 !== n.tag) throw Error(ee(309));
var r = n.stateNode
}
if (!r) throw Error(ee(147, e));
var i = "" + e;
return null !== t && null !== t.ref && "function" == typeof t.ref && t.ref._stringRef === i ? t.ref : ((t = function (e) {
var t = r.refs;
t === io && (t = r.refs = {}), null === e ? delete t[i] : t[i] = e
})._stringRef = i, t)
}
if ("string" != typeof e) throw Error(ee(284));
if (!n._owner) throw Error(ee(290, e))
}
return e
}
function fo(e, t) {
if ("textarea" !== e.type) throw Error(ee(31, "[object Object]" === Object.prototype.toString.call(t) ? "object with keys {" + Object.keys(t).join(", ") + "}" : t))
}
function mo(e) {
function t(t, n) {
if (e) {
var r = t.lastEffect;
null !== r ? (r.nextEffect = n, t.lastEffect = n) : t.firstEffect = t.lastEffect = n, n.nextEffect = null, n.flags = 8
}
}
function n(n, r) {
if (!e) return null;
for (; null !== r;) t(n, r), r = r.sibling;
return null
}
function r(e, t) {
for (e = new Map; null !== t;) null !== t.key ? e.set(t.key, t) : e.set(t.index, t), t = t.sibling;
return e
}
function i(e, t) {
return (e = Ec(e, t)).index = 0, e.sibling = null, e
}
function a(t, n, r) {
return t.index = r, e ? null !== (r = t.alternate) ? (r = r.index) < n ? (t.flags = 2, n) : r : (t.flags = 2, n) : n
}
function o(t) {
return e && null === t.alternate && (t.flags = 2), t
}
function s(e, t, n, r) {
return null === t || 6 !== t.tag ? ((t = Oc(n, e.mode, r)).return = e, t) : ((t = i(t, n)).return = e, t)
}
function l(e, t, n, r) {
return null !== t && t.elementType === n.type ? ((r = i(t, n.props)).ref = po(e, t, n), r.return = e, r) : ((r = Dc(n.type, n.key, n.props, null, e.mode, r)).ref = po(e, t, n), r.return = e, r)
}
function u(e, t, n, r) {
return null === t || 4 !== t.tag || t.stateNode.containerInfo !== n.containerInfo || t.stateNode.implementation !== n.implementation ? ((t = Mc(n, e.mode, r)).return = e, t) : ((t = i(t, n.children || [])).return = e, t)
}
function d(e, t, n, r, a) {
return null === t || 7 !== t.tag ? ((t = Ic(n, e.mode, r, a)).return = e, t) : ((t = i(t, n)).return = e, t)
}
function h(e, t, n) {
if ("string" == typeof t || "number" == typeof t) return (t = Oc("" + t, e.mode, n)).return = e, t;
if ("object" === c(t) && null !== t) {
switch (t.$$typeof) {
case ge:
return (n = Dc(t.type, t.key, t.props, null, e.mode, n)).ref = po(e, null, t), n.return = e, n;
case ye:
return (t = Mc(t, e.mode, n)).return = e, t
}
if (ho(t) || We(t)) return (t = Ic(t, e.mode, n, null)).return = e, t;
fo(e, t)
}
return null
}
function p(e, t, n, r) {
var i = null !== t ? t.key : null;
if ("string" == typeof n || "number" == typeof n) return null !== i ? null : s(e, t, "" + n, r);
if ("object" === c(n) && null !== n) {
switch (n.$$typeof) {
case ge:
return n.key === i ? n.type === be ? d(e, t, n.props.children, r, i) : l(e, t, n, r) : null;
case ye:
return n.key === i ? u(e, t, n, r) : null
}
if (ho(n) || We(n)) return null !== i ? null : d(e, t, n, r, null);
fo(e, n)
}
return null
}
function f(e, t, n, r, i) {
if ("string" == typeof r || "number" == typeof r) return s(t, e = e.get(n) || null, "" + r, i);
if ("object" === c(r) && null !== r) {
switch (r.$$typeof) {
case ge:
return e = e.get(null === r.key ? n : r.key) || null, r.type === be ? d(t, e, r.props.children, i, r.key) : l(t, e, r, i);
case ye:
return u(t, e = e.get(null === r.key ? n : r.key) || null, r, i)
}
if (ho(r) || We(r)) return d(t, e = e.get(n) || null, r, i, null);
fo(t, r)
}
return null
}
return function (s, l, u, d) {
var m = "object" === c(u) && null !== u && u.type === be && null === u.key;
m && (u = u.props.children);
var v = "object" === c(u) && null !== u;
if (v) switch (u.$$typeof) {
case ge:
e:{
for (v = u.key, m = l; null !== m;) {
if (m.key === v) {
switch (m.tag) {
case 7:
if (u.type === be) {
n(s, m.sibling), (l = i(m, u.props.children)).return = s, s = l;
break e
}
break;
default:
if (m.elementType === u.type) {
n(s, m.sibling), (l = i(m, u.props)).ref = po(s, m, u), l.return = s, s = l;
break e
}
}
n(s, m);
break
}
t(s, m), m = m.sibling
}
u.type === be ? ((l = Ic(u.props.children, s.mode, d, u.key)).return = s, s = l) : ((d = Dc(u.type, u.key, u.props, null, s.mode, d)).ref = po(s, l, u), d.return = s, s = d)
}
return o(s);
case ye:
e:{
for (m = u.key; null !== l;) {
if (l.key === m) {
if (4 === l.tag && l.stateNode.containerInfo === u.containerInfo && l.stateNode.implementation === u.implementation) {
n(s, l.sibling), (l = i(l, u.children || [])).return = s, s = l;
break e
}
n(s, l);
break
}
t(s, l), l = l.sibling
}
(l = Mc(u, s.mode, d)).return = s, s = l
}
return o(s)
}
if ("string" == typeof u || "number" == typeof u) return u = "" + u, null !== l && 6 === l.tag ? (n(s, l.sibling), (l = i(l, u)).return = s, s = l) : (n(s, l), (l = Oc(u, s.mode, d)).return = s, s = l), o(s);
if (ho(u)) return function (i, o, s, l) {
for (var c = null, u = null, d = o, m = o = 0, v = null; null !== d && m < s.length; m++) {
d.index > m ? (v = d, d = null) : v = d.sibling;
var g = p(i, d, s[m], l);
if (null === g) {
null === d && (d = v);
break
}
e && d && null === g.alternate && t(i, d), o = a(g, o, m), null === u ? c = g : u.sibling = g, u = g, d = v
}
if (m === s.length) return n(i, d), c;
if (null === d) {
for (; m < s.length; m++) null !== (d = h(i, s[m], l)) && (o = a(d, o, m), null === u ? c = d : u.sibling = d, u = d);
return c
}
for (d = r(i, d); m < s.length; m++) null !== (v = f(d, i, m, s[m], l)) && (e && null !== v.alternate && d.delete(null === v.key ? m : v.key), o = a(v, o, m), null === u ? c = v : u.sibling = v, u = v);
return e && d.forEach(function (e) {
return t(i, e)
}), c
}(s, l, u, d);
if (We(u)) return function (i, o, s, l) {
var c = We(s);
if ("function" != typeof c) throw Error(ee(150));
if (null == (s = c.call(s))) throw Error(ee(151));
for (var u = c = null, d = o, m = o = 0, v = null, g = s.next(); null !== d && !g.done; m++, g = s.next()) {
d.index > m ? (v = d, d = null) : v = d.sibling;
var y = p(i, d, g.value, l);
if (null === y) {
null === d && (d = v);
break
}
e && d && null === y.alternate && t(i, d), o = a(y, o, m), null === u ? c = y : u.sibling = y, u = y, d = v
}
if (g.done) return n(i, d), c;
if (null === d) {
for (; !g.done; m++, g = s.next()) null !== (g = h(i, g.value, l)) && (o = a(g, o, m), null === u ? c = g : u.sibling = g, u = g);
return c
}
for (d = r(i, d); !g.done; m++, g = s.next()) null !== (g = f(d, i, m, g.value, l)) && (e && null !== g.alternate && d.delete(null === g.key ? m : g.key), o = a(g, o, m), null === u ? c = g : u.sibling = g, u = g);
return e && d.forEach(function (e) {
return t(i, e)
}), c
}(s, l, u, d);
if (v && fo(s, u), void 0 === u && !m) switch (s.tag) {
case 1:
case 22:
case 0:
case 11:
case 15:
throw Error(ee(152, Ke(s.type) || "Component"))
}
return n(s, l)
}
}
var vo = mo(!0), go = mo(!1), yo = {}, bo = $i(yo), wo = $i(yo), So = $i(yo);
function _o(e) {
if (e === yo) throw Error(ee(174));
return e
}
function ko(e, t) {
switch (ea(So, t), ea(wo, e), ea(bo, yo), e = t.nodeType) {
case 9:
case 11:
t = (t = t.documentElement) ? t.namespaceURI : lt(null, "");
break;
default:
t = lt(t = (e = 8 === e ? t.parentNode : t).namespaceURI || null, e = e.tagName)
}
Zi(bo), ea(bo, t)
}
function xo() {
Zi(bo), Zi(wo), Zi(So)
}
function Po(e) {
_o(So.current);
var t = _o(bo.current), n = lt(t, e.type);
t !== n && (ea(wo, e), ea(bo, n))
}
function Co(e) {
wo.current === e && (Zi(bo), Zi(wo))
}
var Ao = $i(0);
function To(e) {
for (var t = e; null !== t;) {
if (13 === t.tag) {
var n = t.memoizedState;
if (null !== n && (null === (n = n.dehydrated) || "$?" === n.data || "$!" === n.data)) return t
} else if (19 === t.tag && void 0 !== t.memoizedProps.revealOrder) {
if (0 != (64 & t.flags)) return t
} else if (null !== t.child) {
t.child.return = t, t = t.child;
continue
}
if (t === e) break;
for (; null === t.sibling;) {
if (null === t.return || t.return === e) return null;
t = t.return
}
t.sibling.return = t.return, t = t.sibling
}
return null
}
var Eo = null, Do = null, Io = !1;
function Lo(e, t) {
var n = Ac(5, null, null, 0);
n.elementType = "DELETED", n.type = "DELETED", n.stateNode = t, n.return = e, n.flags = 8, null !== e.lastEffect ? (e.lastEffect.nextEffect = n, e.lastEffect = n) : e.firstEffect = e.lastEffect = n
}
function Oo(e, t) {
switch (e.tag) {
case 5:
var n = e.type;
return null !== (t = 1 !== t.nodeType || n.toLowerCase() !== t.nodeName.toLowerCase() ? null : t) && (e.stateNode = t, !0);
case 6:
return null !== (t = "" === e.pendingProps || 3 !== t.nodeType ? null : t) && (e.stateNode = t, !0);
case 13:
default:
return !1
}
}
function Mo(e) {
if (Io) {
var t = Do;
if (t) {
var n = t;
if (!Oo(e, t)) {
if (!(t = Wi(n.nextSibling)) || !Oo(e, t)) return e.flags = -1025 & e.flags | 2, Io = !1, void (Eo = e);
Lo(Eo, n)
}
Eo = e, Do = Wi(t.firstChild)
} else e.flags = -1025 & e.flags | 2, Io = !1, Eo = e
}
}
function No(e) {
for (e = e.return; null !== e && 5 !== e.tag && 3 !== e.tag && 13 !== e.tag;) e = e.return;
Eo = e
}
function Ro(e) {
if (e !== Eo) return !1;
if (!Io) return No(e), Io = !0, !1;
var t = e.type;
if (5 !== e.tag || "head" !== t && "body" !== t && !Oi(t, e.memoizedProps)) for (t = Do; t;) Lo(e, t), t = Wi(t.nextSibling);
if (No(e), 13 === e.tag) {
if (!(e = null !== (e = e.memoizedState) ? e.dehydrated : null)) throw Error(ee(317));
e:{
for (e = e.nextSibling, t = 0; e;) {
if (8 === e.nodeType) {
var n = e.data;
if ("/$" === n) {
if (0 === t) {
Do = Wi(e.nextSibling);
break e
}
t--
} else "$" !== n && "$!" !== n && "$?" !== n || t++
}
e = e.nextSibling
}
Do = null
}
} else Do = Eo ? Wi(e.stateNode.nextSibling) : null;
return !0
}
function Wo() {
Do = Eo = null, Io = !1
}
var Vo = [];
function Fo() {
for (var e = 0; e < Vo.length; e++) Vo[e]._workInProgressVersionPrimary = null;
Vo.length = 0
}
var Go = ve.ReactCurrentDispatcher, Bo = ve.ReactCurrentBatchConfig, Ko = 0, jo = null, zo = null, Uo = null,
qo = !1, Ho = !1;
function Yo() {
throw Error(ee(321))
}
function Xo(e, t) {
if (null === t) return !1;
for (var n = 0; n < t.length && n < e.length; n++) if (!ei(e[n], t[n])) return !1;
return !0
}
function Jo(e, t, n, r, i, a) {
if (Ko = a, jo = t, t.memoizedState = null, t.updateQueue = null, t.lanes = 0, Go.current = null === e || null === e.memoizedState ? Ss : _s, e = n(r, i), Ho) {
a = 0;
do {
if (Ho = !1, !(25 > a)) throw Error(ee(301));
a += 1, Uo = zo = null, t.updateQueue = null, Go.current = ks, e = n(r, i)
} while (Ho)
}
if (Go.current = ws, t = null !== zo && null !== zo.next, Ko = 0, Uo = zo = jo = null, qo = !1, t) throw Error(ee(300));
return e
}
function Qo() {
var e = {memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null};
return null === Uo ? jo.memoizedState = Uo = e : Uo = Uo.next = e, Uo
}
function $o() {
if (null === zo) {
var e = jo.alternate;
e = null !== e ? e.memoizedState : null
} else e = zo.next;
var t = null === Uo ? jo.memoizedState : Uo.next;
if (null !== t) Uo = t, zo = e; else {
if (null === e) throw Error(ee(310));
e = {
memoizedState: (zo = e).memoizedState,
baseState: zo.baseState,
baseQueue: zo.baseQueue,
queue: zo.queue,
next: null
}, null === Uo ? jo.memoizedState = Uo = e : Uo = Uo.next = e
}
return Uo
}
function Zo(e, t) {
return "function" == typeof t ? t(e) : t
}
function es(e) {
var t = $o(), n = t.queue;
if (null === n) throw Error(ee(311));
n.lastRenderedReducer = e;
var r = zo, i = r.baseQueue, a = n.pending;
if (null !== a) {
if (null !== i) {
var o = i.next;
i.next = a.next, a.next = o
}
r.baseQueue = i = a, n.pending = null
}
if (null !== i) {
i = i.next, r = r.baseState;
var s = o = a = null, l = i;
do {
var c = l.lane;
if ((Ko & c) === c) null !== s && (s = s.next = {
lane: 0,
action: l.action,
eagerReducer: l.eagerReducer,
eagerState: l.eagerState,
next: null
}), r = l.eagerReducer === e ? l.eagerState : e(r, l.action); else {
var u = {lane: c, action: l.action, eagerReducer: l.eagerReducer, eagerState: l.eagerState, next: null};
null === s ? (o = s = u, a = r) : s = s.next = u, jo.lanes |= c, Tl |= c
}
l = l.next
} while (null !== l && l !== i);
null === s ? a = r : s.next = o, ei(r, t.memoizedState) || (Ps = !0), t.memoizedState = r, t.baseState = a, t.baseQueue = s, n.lastRenderedState = r
}
return [t.memoizedState, n.dispatch]
}
function ts(e) {
var t = $o(), n = t.queue;
if (null === n) throw Error(ee(311));
n.lastRenderedReducer = e;
var r = n.dispatch, i = n.pending, a = t.memoizedState;
if (null !== i) {
n.pending = null;
var o = i = i.next;
do {
a = e(a, o.action), o = o.next
} while (o !== i);
ei(a, t.memoizedState) || (Ps = !0), t.memoizedState = a, null === t.baseQueue && (t.baseState = a), n.lastRenderedState = a
}
return [a, r]
}
function ns(e, t, n) {
var r = t._getVersion;
r = r(t._source);
var i = t._workInProgressVersionPrimary;
if (null !== i ? e = i === r : (e = e.mutableReadLanes, (e = (Ko & e) === e) && (t._workInProgressVersionPrimary = r, Vo.push(t))), e) return n(t._source);
throw Vo.push(t), Error(ee(350))
}
function rs(e, t, n, r) {
var i = wl;
if (null === i) throw Error(ee(349));
var a = t._getVersion, o = a(t._source), s = Go.current, l = s.useState(function () {
return ns(i, t, n)
}), c = l[1], u = l[0];
l = Uo;
var d = e.memoizedState, h = d.refs, p = h.getSnapshot, f = d.source;
d = d.subscribe;
var m = jo;
return e.memoizedState = {refs: h, source: t, subscribe: r}, s.useEffect(function () {
h.getSnapshot = n, h.setSnapshot = c;
var e = a(t._source);
if (!ei(o, e)) {
e = n(t._source), ei(u, e) || (c(e), e = ec(m), i.mutableReadLanes |= e & i.pendingLanes), e = i.mutableReadLanes, i.entangledLanes |= e;
for (var r = i.entanglements, s = e; 0 < s;) {
var l = 31 - Vn(s), d = 1 << l;
r[l] |= e, s &= ~d
}
}
}, [n, t, r]), s.useEffect(function () {
return r(t._source, function () {
var e = h.getSnapshot, n = h.setSnapshot;
try {
n(e(t._source));
var r = ec(m);
i.mutableReadLanes |= r & i.pendingLanes
} catch (e) {
n(function () {
throw e
})
}
})
}, [t, r]), ei(p, n) && ei(f, t) && ei(d, r) || ((e = {
pending: null,
dispatch: null,
lastRenderedReducer: Zo,
lastRenderedState: u
}).dispatch = c = bs.bind(null, jo, e), l.queue = e, l.baseQueue = null, u = ns(i, t, n), l.memoizedState = l.baseState = u), u
}
function is(e, t, n) {
return rs($o(), e, t, n)
}
function as(e) {
var t = Qo();
return "function" == typeof e && (e = e()), t.memoizedState = t.baseState = e, e = (e = t.queue = {
pending: null,
dispatch: null,
lastRenderedReducer: Zo,
lastRenderedState: e
}).dispatch = bs.bind(null, jo, e), [t.memoizedState, e]
}
function os(e, t, n, r) {
return e = {
tag: e,
create: t,
destroy: n,
deps: r,
next: null
}, null === (t = jo.updateQueue) ? (t = {lastEffect: null}, jo.updateQueue = t, t.lastEffect = e.next = e) : null === (n = t.lastEffect) ? t.lastEffect = e.next = e : (r = n.next, n.next = e, e.next = r, t.lastEffect = e), e
}
function ss(e) {
return e = {current: e}, Qo().memoizedState = e
}
function ls() {
return $o().memoizedState
}
function cs(e, t, n, r) {
var i = Qo();
jo.flags |= e, i.memoizedState = os(1 | t, n, void 0, void 0 === r ? null : r)
}
function us(e, t, n, r) {
var i = $o();
r = void 0 === r ? null : r;
var a = void 0;
if (null !== zo) {
var o = zo.memoizedState;
if (a = o.destroy, null !== r && Xo(r, o.deps)) return void os(t, n, a, r)
}
jo.flags |= e, i.memoizedState = os(1 | t, n, a, r)
}
function ds(e, t) {
return cs(516, 4, e, t)
}
function hs(e, t) {
return us(516, 4, e, t)
}
function ps(e, t) {
return us(4, 2, e, t)
}
function fs(e, t) {
return "function" == typeof t ? (e = e(), t(e), function () {
t(null)
}) : null !== t && void 0 !== t ? (e = e(), t.current = e, function () {
t.current = null
}) : void 0
}
function ms(e, t, n) {
return n = null !== n && void 0 !== n ? n.concat([e]) : null, us(4, 2, fs.bind(null, t, e), n)
}
function vs() {
}
function gs(e, t) {
var n = $o();
t = void 0 === t ? null : t;
var r = n.memoizedState;
return null !== r && null !== t && Xo(t, r[1]) ? r[0] : (n.memoizedState = [e, t], e)
}
function ys(e, t) {
var n = $o();
t = void 0 === t ? null : t;
var r = n.memoizedState;
return null !== r && null !== t && Xo(t, r[1]) ? r[0] : (e = e(), n.memoizedState = [e, t], e)
}
function bs(e, t, n) {
var r = Zl(), i = ec(e), a = {lane: i, action: n, eagerReducer: null, eagerState: null, next: null},
o = t.pending;
if (null === o ? a.next = a : (a.next = o.next, o.next = a), t.pending = a, o = e.alternate, e === jo || null !== o && o === jo) Ho = qo = !0; else {
if (0 === e.lanes && (null === o || 0 === o.lanes) && null !== (o = t.lastRenderedReducer)) try {
var s = t.lastRenderedState, l = o(s, n);
if (a.eagerReducer = o, a.eagerState = l, ei(l, s)) return
} catch (e) {
}
tc(e, i, r)
}
}
var ws = {
readContext: Xa,
useCallback: Yo,
useContext: Yo,
useEffect: Yo,
useImperativeHandle: Yo,
useLayoutEffect: Yo,
useMemo: Yo,
useReducer: Yo,
useRef: Yo,
useState: Yo,
useDebugValue: Yo,
useDeferredValue: Yo,
useTransition: Yo,
useMutableSource: Yo,
useOpaqueIdentifier: Yo,
unstable_isNewReconciler: !1
}, Ss = {
readContext: Xa, useCallback: function (e, t) {
return Qo().memoizedState = [e, void 0 === t ? null : t], e
}, useContext: Xa, useEffect: ds, useImperativeHandle: function (e, t, n) {
return n = null !== n && void 0 !== n ? n.concat([e]) : null, cs(4, 2, fs.bind(null, t, e), n)
}, useLayoutEffect: function (e, t) {
return cs(4, 2, e, t)
}, useMemo: function (e, t) {
var n = Qo();
return t = void 0 === t ? null : t, e = e(), n.memoizedState = [e, t], e
}, useReducer: function (e, t, n) {
var r = Qo();
return t = void 0 !== n ? n(t) : t, r.memoizedState = r.baseState = t, e = (e = r.queue = {
pending: null,
dispatch: null,
lastRenderedReducer: e,
lastRenderedState: t
}).dispatch = bs.bind(null, jo, e), [r.memoizedState, e]
}, useRef: ss, useState: as, useDebugValue: vs, useDeferredValue: function (e) {
var t = as(e), n = t[0], r = t[1];
return ds(function () {
var t = Bo.transition;
Bo.transition = 1;
try {
r(e)
} finally {
Bo.transition = t
}
}, [e]), n
}, useTransition: function () {
var e = as(!1), t = e[0];
return ss(e = function (e, t) {
var n = Oa();
Na(98 > n ? 98 : n, function () {
e(!0)
}), Na(97 < n ? 97 : n, function () {
var n = Bo.transition;
Bo.transition = 1;
try {
e(!1), t()
} finally {
Bo.transition = n
}
})
}.bind(null, e[1])), [e, t]
}, useMutableSource: function (e, t, n) {
var r = Qo();
return r.memoizedState = {refs: {getSnapshot: t, setSnapshot: null}, source: e, subscribe: n}, rs(r, e, t, n)
}, useOpaqueIdentifier: function () {
if (Io) {
var e = !1, t = function (e) {
return {$$typeof: De, toString: e, valueOf: e}
}(function () {
throw e || (e = !0, n("r:" + (Fi++).toString(36))), Error(ee(355))
}), n = as(t)[1];
return 0 == (2 & jo.mode) && (jo.flags |= 516, os(5, function () {
n("r:" + (Fi++).toString(36))
}, void 0, null)), t
}
return as(t = "r:" + (Fi++).toString(36)), t
}, unstable_isNewReconciler: !1
}, _s = {
readContext: Xa,
useCallback: gs,
useContext: Xa,
useEffect: hs,
useImperativeHandle: ms,
useLayoutEffect: ps,
useMemo: ys,
useReducer: es,
useRef: ls,
useState: function () {
return es(Zo)
},
useDebugValue: vs,
useDeferredValue: function (e) {
var t = es(Zo), n = t[0], r = t[1];
return hs(function () {
var t = Bo.transition;
Bo.transition = 1;
try {
r(e)
} finally {
Bo.transition = t
}
}, [e]), n
},
useTransition: function () {
var e = es(Zo)[0];
return [ls().current, e]
},
useMutableSource: is,
useOpaqueIdentifier: function () {
return es(Zo)[0]
},
unstable_isNewReconciler: !1
}, ks = {
readContext: Xa,
useCallback: gs,
useContext: Xa,
useEffect: hs,
useImperativeHandle: ms,
useLayoutEffect: ps,
useMemo: ys,
useReducer: ts,
useRef: ls,
useState: function () {
return ts(Zo)
},
useDebugValue: vs,
useDeferredValue: function (e) {
var t = ts(Zo), n = t[0], r = t[1];
return hs(function () {
var t = Bo.transition;
Bo.transition = 1;
try {
r(e)
} finally {
Bo.transition = t
}
}, [e]), n
},
useTransition: function () {
var e = ts(Zo)[0];
return [ls().current, e]
},
useMutableSource: is,
useOpaqueIdentifier: function () {
return ts(Zo)[0]
},
unstable_isNewReconciler: !1
}, xs = ve.ReactCurrentOwner, Ps = !1;
function Cs(e, t, n, r) {
t.child = null === e ? go(t, null, n, r) : vo(t, e.child, n, r)
}
function As(e, t, n, r, i) {
n = n.render;
var a = t.ref;
return Ya(t, i), r = Jo(e, t, n, r, a, i), null === e || Ps ? (t.flags |= 1, Cs(e, t, r, i), t.child) : (t.updateQueue = e.updateQueue, t.flags &= -517, e.lanes &= ~i, Ys(e, t, i))
}
function Ts(e, t, n, r, i, a) {
if (null === e) {
var o = n.type;
return "function" != typeof o || Tc(o) || void 0 !== o.defaultProps || null !== n.compare || void 0 !== n.defaultProps ? ((e = Dc(n.type, null, r, t, t.mode, a)).ref = t.ref, e.return = t, t.child = e) : (t.tag = 15, t.type = o, Es(e, t, o, r, i, a))
}
return o = e.child, 0 == (i & a) && (i = o.memoizedProps, (n = null !== (n = n.compare) ? n : ni)(i, r) && e.ref === t.ref) ? Ys(e, t, a) : (t.flags |= 1, (e = Ec(o, r)).ref = t.ref, e.return = t, t.child = e)
}
function Es(e, t, n, r, i, a) {
if (null !== e && ni(e.memoizedProps, r) && e.ref === t.ref) {
if (Ps = !1, 0 == (a & i)) return t.lanes = e.lanes, Ys(e, t, a);
0 != (16384 & e.flags) && (Ps = !0)
}
return Ls(e, t, n, r, a)
}
function Ds(e, t, n) {
var r = t.pendingProps, i = r.children, a = null !== e ? e.memoizedState : null;
if ("hidden" === r.mode || "unstable-defer-without-hiding" === r.mode) if (0 == (4 & t.mode)) t.memoizedState = {baseLanes: 0}, lc(t, n); else {
if (0 == (1073741824 & n)) return e = null !== a ? a.baseLanes | n : n, t.lanes = t.childLanes = 1073741824, t.memoizedState = {baseLanes: e}, lc(t, e), null;
t.memoizedState = {baseLanes: 0}, lc(t, null !== a ? a.baseLanes : n)
} else null !== a ? (r = a.baseLanes | n, t.memoizedState = null) : r = n, lc(t, r);
return Cs(e, t, i, n), t.child
}
function Is(e, t) {
var n = t.ref;
(null === e && null !== n || null !== e && e.ref !== n) && (t.flags |= 128)
}
function Ls(e, t, n, r, i) {
var a = oa(n) ? ia : na.current;
return a = aa(t, a), Ya(t, i), n = Jo(e, t, n, r, a, i), null === e || Ps ? (t.flags |= 1, Cs(e, t, n, i), t.child) : (t.updateQueue = e.updateQueue, t.flags &= -517, e.lanes &= ~i, Ys(e, t, i))
}
function Os(e, t, n, r, i) {
if (oa(n)) {
var a = !0;
ua(t)
} else a = !1;
if (Ya(t, i), null === t.stateNode) null !== e && (e.alternate = null, t.alternate = null, t.flags |= 2), lo(t, n, r), uo(t, n, r, i), r = !0; else if (null === e) {
var o = t.stateNode, s = t.memoizedProps;
o.props = s;
var l = o.context, u = n.contextType;
"object" === c(u) && null !== u ? u = Xa(u) : u = aa(t, u = oa(n) ? ia : na.current);
var d = n.getDerivedStateFromProps,
h = "function" == typeof d || "function" == typeof o.getSnapshotBeforeUpdate;
h || "function" != typeof o.UNSAFE_componentWillReceiveProps && "function" != typeof o.componentWillReceiveProps || (s !== r || l !== u) && co(t, o, r, u), Ja = !1;
var p = t.memoizedState;
o.state = p, no(t, r, o, i), l = t.memoizedState, s !== r || p !== l || ra.current || Ja ? ("function" == typeof d && (ao(t, n, d, r), l = t.memoizedState), (s = Ja || so(t, n, s, r, p, l, u)) ? (h || "function" != typeof o.UNSAFE_componentWillMount && "function" != typeof o.componentWillMount || ("function" == typeof o.componentWillMount && o.componentWillMount(), "function" == typeof o.UNSAFE_componentWillMount && o.UNSAFE_componentWillMount()), "function" == typeof o.componentDidMount && (t.flags |= 4)) : ("function" == typeof o.componentDidMount && (t.flags |= 4), t.memoizedProps = r, t.memoizedState = l), o.props = r, o.state = l, o.context = u, r = s) : ("function" == typeof o.componentDidMount && (t.flags |= 4), r = !1)
} else {
o = t.stateNode, $a(e, t), s = t.memoizedProps, u = t.type === t.elementType ? s : Ga(t.type, s), o.props = u, h = t.pendingProps, p = o.context, "object" === c(l = n.contextType) && null !== l ? l = Xa(l) : l = aa(t, l = oa(n) ? ia : na.current);
var f = n.getDerivedStateFromProps;
(d = "function" == typeof f || "function" == typeof o.getSnapshotBeforeUpdate) || "function" != typeof o.UNSAFE_componentWillReceiveProps && "function" != typeof o.componentWillReceiveProps || (s !== h || p !== l) && co(t, o, r, l), Ja = !1, p = t.memoizedState, o.state = p, no(t, r, o, i);
var m = t.memoizedState;
s !== h || p !== m || ra.current || Ja ? ("function" == typeof f && (ao(t, n, f, r), m = t.memoizedState), (u = Ja || so(t, n, u, r, p, m, l)) ? (d || "function" != typeof o.UNSAFE_componentWillUpdate && "function" != typeof o.componentWillUpdate || ("function" == typeof o.componentWillUpdate && o.componentWillUpdate(r, m, l), "function" == typeof o.UNSAFE_componentWillUpdate && o.UNSAFE_componentWillUpdate(r, m, l)), "function" == typeof o.componentDidUpdate && (t.flags |= 4), "function" == typeof o.getSnapshotBeforeUpdate && (t.flags |= 256)) : ("function" != typeof o.componentDidUpdate || s === e.memoizedProps && p === e.memoizedState || (t.flags |= 4), "function" != typeof o.getSnapshotBeforeUpdate || s === e.memoizedProps && p === e.memoizedState || (t.flags |= 256), t.memoizedProps = r, t.memoizedState = m), o.props = r, o.state = m, o.context = l, r = u) : ("function" != typeof o.componentDidUpdate || s === e.memoizedProps && p === e.memoizedState || (t.flags |= 4), "function" != typeof o.getSnapshotBeforeUpdate || s === e.memoizedProps && p === e.memoizedState || (t.flags |= 256), r = !1)
}
return Ms(e, t, n, r, a, i)
}
function Ms(e, t, n, r, i, a) {
Is(e, t);
var o = 0 != (64 & t.flags);
if (!r && !o) return i && da(t, n, !1), Ys(e, t, a);
r = t.stateNode, xs.current = t;
var s = o && "function" != typeof n.getDerivedStateFromError ? null : r.render();
return t.flags |= 1, null !== e && o ? (t.child = vo(t, e.child, null, a), t.child = vo(t, null, s, a)) : Cs(e, t, s, a), t.memoizedState = r.state, i && da(t, n, !0), t.child
}
function Ns(e) {
var t = e.stateNode;
t.pendingContext ? la(0, t.pendingContext, t.pendingContext !== t.context) : t.context && la(0, t.context, !1), ko(e, t.containerInfo)
}
var Rs, Ws, Vs, Fs, Gs = {dehydrated: null, retryLane: 0};
function Bs(e, t, n) {
var r, i = t.pendingProps, a = Ao.current, o = !1;
return (r = 0 != (64 & t.flags)) || (r = (null === e || null !== e.memoizedState) && 0 != (2 & a)), r ? (o = !0, t.flags &= -65) : null !== e && null === e.memoizedState || void 0 === i.fallback || !0 === i.unstable_avoidThisFallback || (a |= 1), ea(Ao, 1 & a), null === e ? (void 0 !== i.fallback && Mo(t), e = i.children, a = i.fallback, o ? (e = Ks(t, e, a, n), t.child.memoizedState = {baseLanes: n}, t.memoizedState = Gs, e) : "number" == typeof i.unstable_expectedLoadTime ? (e = Ks(t, e, a, n), t.child.memoizedState = {baseLanes: n}, t.memoizedState = Gs, t.lanes = 33554432, e) : ((n = Lc({
mode: "visible",
children: e
}, t.mode, n, null)).return = t, t.child = n)) : (e.memoizedState, o ? (i = zs(e, t, i.children, i.fallback, n), o = t.child, a = e.child.memoizedState, o.memoizedState = null === a ? {baseLanes: n} : {baseLanes: a.baseLanes | n}, o.childLanes = e.childLanes & ~n, t.memoizedState = Gs, i) : (n = js(e, t, i.children, n), t.memoizedState = null, n))
}
function Ks(e, t, n, r) {
var i = e.mode, a = e.child;
return t = {
mode: "hidden",
children: t
}, 0 == (2 & i) && null !== a ? (a.childLanes = 0, a.pendingProps = t) : a = Lc(t, i, 0, null), n = Ic(n, i, r, null), a.return = e, n.return = e, a.sibling = n, e.child = a, n
}
function js(e, t, n, r) {
var i = e.child;
return e = i.sibling, n = Ec(i, {
mode: "visible",
children: n
}), 0 == (2 & t.mode) && (n.lanes = r), n.return = t, n.sibling = null, null !== e && (e.nextEffect = null, e.flags = 8, t.firstEffect = t.lastEffect = e), t.child = n
}
function zs(e, t, n, r, i) {
var a = t.mode, o = e.child;
e = o.sibling;
var s = {mode: "hidden", children: n};
return 0 == (2 & a) && t.child !== o ? ((n = t.child).childLanes = 0, n.pendingProps = s, null !== (o = n.lastEffect) ? (t.firstEffect = n.firstEffect, t.lastEffect = o, o.nextEffect = null) : t.firstEffect = t.lastEffect = null) : n = Ec(o, s), null !== e ? r = Ec(e, r) : (r = Ic(r, a, i, null)).flags |= 2, r.return = t, n.return = t, n.sibling = r, t.child = n, r
}
function Us(e, t) {
e.lanes |= t;
var n = e.alternate;
null !== n && (n.lanes |= t), Ha(e.return, t)
}
function qs(e, t, n, r, i, a) {
var o = e.memoizedState;
null === o ? e.memoizedState = {
isBackwards: t,
rendering: null,
renderingStartTime: 0,
last: r,
tail: n,
tailMode: i,
lastEffect: a
} : (o.isBackwards = t, o.rendering = null, o.renderingStartTime = 0, o.last = r, o.tail = n, o.tailMode = i, o.lastEffect = a)
}
function Hs(e, t, n) {
var r = t.pendingProps, i = r.revealOrder, a = r.tail;
if (Cs(e, t, r.children, n), 0 != (2 & (r = Ao.current))) r = 1 & r | 2, t.flags |= 64; else {
if (null !== e && 0 != (64 & e.flags)) e:for (e = t.child; null !== e;) {
if (13 === e.tag) null !== e.memoizedState && Us(e, n); else if (19 === e.tag) Us(e, n); else if (null !== e.child) {
e.child.return = e, e = e.child;
continue
}
if (e === t) break e;
for (; null === e.sibling;) {
if (null === e.return || e.return === t) break e;
e = e.return
}
e.sibling.return = e.return, e = e.sibling
}
r &= 1
}
if (ea(Ao, r), 0 == (2 & t.mode)) t.memoizedState = null; else switch (i) {
case"forwards":
for (n = t.child, i = null; null !== n;) null !== (e = n.alternate) && null === To(e) && (i = n), n = n.sibling;
null === (n = i) ? (i = t.child, t.child = null) : (i = n.sibling, n.sibling = null), qs(t, !1, i, n, a, t.lastEffect);
break;
case"backwards":
for (n = null, i = t.child, t.child = null; null !== i;) {
if (null !== (e = i.alternate) && null === To(e)) {
t.child = i;
break
}
e = i.sibling, i.sibling = n, n = i, i = e
}
qs(t, !0, n, null, a, t.lastEffect);
break;
case"together":
qs(t, !1, null, null, void 0, t.lastEffect);
break;
default:
t.memoizedState = null
}
return t.child
}
function Ys(e, t, n) {
if (null !== e && (t.dependencies = e.dependencies), Tl |= t.lanes, 0 != (n & t.childLanes)) {
if (null !== e && t.child !== e.child) throw Error(ee(153));
if (null !== t.child) {
for (n = Ec(e = t.child, e.pendingProps), t.child = n, n.return = t; null !== e.sibling;) e = e.sibling, (n = n.sibling = Ec(e, e.pendingProps)).return = t;
n.sibling = null
}
return t.child
}
return null
}
function Xs(e, t) {
if (!Io) switch (e.tailMode) {
case"hidden":
t = e.tail;
for (var n = null; null !== t;) null !== t.alternate && (n = t), t = t.sibling;
null === n ? e.tail = null : n.sibling = null;
break;
case"collapsed":
n = e.tail;
for (var r = null; null !== n;) null !== n.alternate && (r = n), n = n.sibling;
null === r ? t || null === e.tail ? e.tail = null : e.tail.sibling = null : r.sibling = null
}
}
function Js(e, t, n) {
var r = t.pendingProps;
switch (t.tag) {
case 2:
case 16:
case 15:
case 0:
case 11:
case 7:
case 8:
case 12:
case 9:
case 14:
return null;
case 1:
return oa(t.type) && sa(), null;
case 3:
return xo(), Zi(ra), Zi(na), Fo(), (r = t.stateNode).pendingContext && (r.context = r.pendingContext, r.pendingContext = null), null !== e && null !== e.child || (Ro(t) ? t.flags |= 4 : r.hydrate || (t.flags |= 256)), Ws(t), null;
case 5:
Co(t);
var i = _o(So.current);
if (n = t.type, null !== e && null != t.stateNode) Vs(e, t, n, r, i), e.ref !== t.ref && (t.flags |= 128); else {
if (!r) {
if (null === t.stateNode) throw Error(ee(166));
return null
}
if (e = _o(bo.current), Ro(t)) {
r = t.stateNode, n = t.type;
var a = t.memoizedProps;
switch (r[Bi] = t, r[Ki] = a, n) {
case"dialog":
bi("cancel", r), bi("close", r);
break;
case"iframe":
case"object":
case"embed":
bi("load", r);
break;
case"video":
case"audio":
for (e = 0; e < mi.length; e++) bi(mi[e], r);
break;
case"source":
bi("error", r);
break;
case"img":
case"image":
case"link":
bi("error", r), bi("load", r);
break;
case"details":
bi("toggle", r);
break;
case"input":
Xe(r, a), bi("invalid", r);
break;
case"select":
r._wrapperState = {wasMultiple: !!a.multiple}, bi("invalid", r);
break;
case"textarea":
rt(r, a), bi("invalid", r)
}
for (var o in yt(n, a), e = null, a) a.hasOwnProperty(o) && (i = a[o], "children" === o ? "string" == typeof i ? r.textContent !== i && (e = ["children", i]) : "number" == typeof i && r.textContent !== "" + i && (e = ["children", "" + i]) : ne.hasOwnProperty(o) && null != i && "onScroll" === o && bi("scroll", r));
switch (n) {
case"input":
Ue(r), $e(r, a, !0);
break;
case"textarea":
Ue(r), at(r);
break;
case"select":
case"option":
break;
default:
"function" == typeof a.onClick && (r.onclick = Ei)
}
r = e, t.updateQueue = r, null !== r && (t.flags |= 4)
} else {
switch (o = 9 === i.nodeType ? i : i.ownerDocument, e === ot.html && (e = st(n)), e === ot.html ? "script" === n ? ((e = o.createElement("div")).innerHTML = "<script><\/script>", e = e.removeChild(e.firstChild)) : "string" == typeof r.is ? e = o.createElement(n, {is: r.is}) : (e = o.createElement(n), "select" === n && (o = e, r.multiple ? o.multiple = !0 : r.size && (o.size = r.size))) : e = o.createElementNS(e, n), e[Bi] = t, e[Ki] = r, Rs(e, t, !1, !1), t.stateNode = e, o = bt(n, r), n) {
case"dialog":
bi("cancel", e), bi("close", e), i = r;
break;
case"iframe":
case"object":
case"embed":
bi("load", e), i = r;
break;
case"video":
case"audio":
for (i = 0; i < mi.length; i++) bi(mi[i], e);
i = r;
break;
case"source":
bi("error", e), i = r;
break;
case"img":
case"image":
case"link":
bi("error", e), bi("load", e), i = r;
break;
case"details":
bi("toggle", e), i = r;
break;
case"input":
Xe(e, r), i = Ye(e, r), bi("invalid", e);
break;
case"option":
i = et(e, r);
break;
case"select":
e._wrapperState = {wasMultiple: !!r.multiple}, i = $({}, r, {value: void 0}), bi("invalid", e);
break;
case"textarea":
rt(e, r), i = nt(e, r), bi("invalid", e);
break;
default:
i = r
}
yt(n, i);
var s = i;
for (a in s) if (s.hasOwnProperty(a)) {
var l = s[a];
"style" === a ? vt(e, l) : "dangerouslySetInnerHTML" === a ? null != (l = l ? l.__html : void 0) && dt(e, l) : "children" === a ? "string" == typeof l ? ("textarea" !== n || "" !== l) && ht(e, l) : "number" == typeof l && ht(e, "" + l) : "suppressContentEditableWarning" !== a && "suppressHydrationWarning" !== a && "autoFocus" !== a && (ne.hasOwnProperty(a) ? null != l && "onScroll" === a && bi("scroll", e) : null != l && me(e, a, l, o))
}
switch (n) {
case"input":
Ue(e), $e(e, r, !1);
break;
case"textarea":
Ue(e), at(e);
break;
case"option":
null != r.value && e.setAttribute("value", "" + je(r.value));
break;
case"select":
e.multiple = !!r.multiple, null != (a = r.value) ? tt(e, !!r.multiple, a, !1) : null != r.defaultValue && tt(e, !!r.multiple, r.defaultValue, !0);
break;
default:
"function" == typeof i.onClick && (e.onclick = Ei)
}
Li(n, r) && (t.flags |= 4)
}
null !== t.ref && (t.flags |= 128)
}
return null;
case 6:
if (e && null != t.stateNode) Fs(e, t, e.memoizedProps, r); else {
if ("string" != typeof r && null === t.stateNode) throw Error(ee(166));
n = _o(So.current), _o(bo.current), Ro(t) ? (r = t.stateNode, n = t.memoizedProps, r[Bi] = t, r.nodeValue !== n && (t.flags |= 4)) : ((r = (9 === n.nodeType ? n : n.ownerDocument).createTextNode(r))[Bi] = t, t.stateNode = r)
}
return null;
case 13:
return Zi(Ao), r = t.memoizedState, 0 != (64 & t.flags) ? (t.lanes = n, t) : (r = null !== r, n = !1, null === e ? void 0 !== t.memoizedProps.fallback && Ro(t) : n = null !== e.memoizedState, r && !n && 0 != (2 & t.mode) && (null === e && !0 !== t.memoizedProps.unstable_avoidThisFallback || 0 != (1 & Ao.current) ? 0 === Pl && (Pl = 3) : (0 !== Pl && 3 !== Pl || (Pl = 4), null === wl || 0 == (134217727 & Tl) && 0 == (134217727 & El) || ic(wl, _l))), (r || n) && (t.flags |= 4), null);
case 4:
return xo(), Ws(t), null === e && Si(t.stateNode.containerInfo), null;
case 10:
return qa(t), null;
case 17:
return oa(t.type) && sa(), null;
case 19:
if (Zi(Ao), null === (r = t.memoizedState)) return null;
if (a = 0 != (64 & t.flags), null === (o = r.rendering)) if (a) Xs(r, !1); else {
if (0 !== Pl || null !== e && 0 != (64 & e.flags)) for (e = t.child; null !== e;) {
if (null !== (o = To(e))) {
for (t.flags |= 64, Xs(r, !1), null !== (a = o.updateQueue) && (t.updateQueue = a, t.flags |= 4), null === r.lastEffect && (t.firstEffect = null), t.lastEffect = r.lastEffect, r = n, n = t.child; null !== n;) e = r, (a = n).flags &= 2, a.nextEffect = null, a.firstEffect = null, a.lastEffect = null, null === (o = a.alternate) ? (a.childLanes = 0, a.lanes = e, a.child = null, a.memoizedProps = null, a.memoizedState = null, a.updateQueue = null, a.dependencies = null, a.stateNode = null) : (a.childLanes = o.childLanes, a.lanes = o.lanes, a.child = o.child, a.memoizedProps = o.memoizedProps, a.memoizedState = o.memoizedState, a.updateQueue = o.updateQueue, a.type = o.type, e = o.dependencies, a.dependencies = null === e ? null : {
lanes: e.lanes,
firstContext: e.firstContext
}), n = n.sibling;
return ea(Ao, 1 & Ao.current | 2), t.child
}
e = e.sibling
}
null !== r.tail && La() > Ol && (t.flags |= 64, a = !0, Xs(r, !1), t.lanes = 33554432)
} else {
if (!a) if (null !== (e = To(o))) {
if (t.flags |= 64, a = !0, null !== (n = e.updateQueue) && (t.updateQueue = n, t.flags |= 4), Xs(r, !0), null === r.tail && "hidden" === r.tailMode && !o.alternate && !Io) return null !== (t = t.lastEffect = r.lastEffect) && (t.nextEffect = null), null
} else 2 * La() - r.renderingStartTime > Ol && 1073741824 !== n && (t.flags |= 64, a = !0, Xs(r, !1), t.lanes = 33554432);
r.isBackwards ? (o.sibling = t.child, t.child = o) : (null !== (n = r.last) ? n.sibling = o : t.child = o, r.last = o)
}
return null !== r.tail ? (n = r.tail, r.rendering = n, r.tail = n.sibling, r.lastEffect = t.lastEffect, r.renderingStartTime = La(), n.sibling = null, t = Ao.current, ea(Ao, a ? 1 & t | 2 : 1 & t), n) : null;
case 23:
case 24:
return cc(), null !== e && null !== e.memoizedState != (null !== t.memoizedState) && "unstable-defer-without-hiding" !== r.mode && (t.flags |= 4), null
}
throw Error(ee(156, t.tag))
}
function Qs(e) {
switch (e.tag) {
case 1:
oa(e.type) && sa();
var t = e.flags;
return 4096 & t ? (e.flags = -4097 & t | 64, e) : null;
case 3:
if (xo(), Zi(ra), Zi(na), Fo(), 0 != (64 & (t = e.flags))) throw Error(ee(285));
return e.flags = -4097 & t | 64, e;
case 5:
return Co(e), null;
case 13:
return Zi(Ao), 4096 & (t = e.flags) ? (e.flags = -4097 & t | 64, e) : null;
case 19:
return Zi(Ao), null;
case 4:
return xo(), null;
case 10:
return qa(e), null;
case 23:
case 24:
return cc(), null;
default:
return null
}
}
function $s(e, t) {
try {
var n = "", r = t;
do {
n += Be(r), r = r.return
} while (r);
var i = n
} catch (e) {
i = "\nError generating stack: " + e.message + "\n" + e.stack
}
return {value: e, source: t, stack: i}
}
function Zs(e, t) {
try {
console.error(t.value)
} catch (e) {
setTimeout(function () {
throw e
})
}
}
Rs = function (e, t) {
for (var n = t.child; null !== n;) {
if (5 === n.tag || 6 === n.tag) e.appendChild(n.stateNode); else if (4 !== n.tag && null !== n.child) {
n.child.return = n, n = n.child;
continue
}
if (n === t) break;
for (; null === n.sibling;) {
if (null === n.return || n.return === t) return;
n = n.return
}
n.sibling.return = n.return, n = n.sibling
}
}, Ws = function () {
}, Vs = function (e, t, n, r) {
var i = e.memoizedProps;
if (i !== r) {
e = t.stateNode, _o(bo.current);
var a, o = null;
switch (n) {
case"input":
i = Ye(e, i), r = Ye(e, r), o = [];
break;
case"option":
i = et(e, i), r = et(e, r), o = [];
break;
case"select":
i = $({}, i, {value: void 0}), r = $({}, r, {value: void 0}), o = [];
break;
case"textarea":
i = nt(e, i), r = nt(e, r), o = [];
break;
default:
"function" != typeof i.onClick && "function" == typeof r.onClick && (e.onclick = Ei)
}
for (u in yt(n, r), n = null, i) if (!r.hasOwnProperty(u) && i.hasOwnProperty(u) && null != i[u]) if ("style" === u) {
var s = i[u];
for (a in s) s.hasOwnProperty(a) && (n || (n = {}), n[a] = "")
} else "dangerouslySetInnerHTML" !== u && "children" !== u && "suppressContentEditableWarning" !== u && "suppressHydrationWarning" !== u && "autoFocus" !== u && (ne.hasOwnProperty(u) ? o || (o = []) : (o = o || []).push(u, null));
for (u in r) {
var l = r[u];
if (s = null != i ? i[u] : void 0, r.hasOwnProperty(u) && l !== s && (null != l || null != s)) if ("style" === u) if (s) {
for (a in s) !s.hasOwnProperty(a) || l && l.hasOwnProperty(a) || (n || (n = {}), n[a] = "");
for (a in l) l.hasOwnProperty(a) && s[a] !== l[a] && (n || (n = {}), n[a] = l[a])
} else n || (o || (o = []), o.push(u, n)), n = l; else "dangerouslySetInnerHTML" === u ? (l = l ? l.__html : void 0, s = s ? s.__html : void 0, null != l && s !== l && (o = o || []).push(u, l)) : "children" === u ? "string" != typeof l && "number" != typeof l || (o = o || []).push(u, "" + l) : "suppressContentEditableWarning" !== u && "suppressHydrationWarning" !== u && (ne.hasOwnProperty(u) ? (null != l && "onScroll" === u && bi("scroll", e), o || s === l || (o = [])) : "object" === c(l) && null !== l && l.$$typeof === De ? l.toString() : (o = o || []).push(u, l))
}
n && (o = o || []).push("style", n);
var u = o;
(t.updateQueue = u) && (t.flags |= 4)
}
}, Fs = function (e, t, n, r) {
n !== r && (t.flags |= 4)
};
var el = "function" == typeof WeakMap ? WeakMap : Map;
function tl(e, t, n) {
(n = Za(-1, n)).tag = 3, n.payload = {element: null};
var r = t.value;
return n.callback = function () {
Wl || (Wl = !0, Vl = r), Zs(0, t)
}, n
}
function nl(e, t, n) {
(n = Za(-1, n)).tag = 3;
var r = e.type.getDerivedStateFromError;
if ("function" == typeof r) {
var i = t.value;
n.payload = function () {
return Zs(0, t), r(i)
}
}
var a = e.stateNode;
return null !== a && "function" == typeof a.componentDidCatch && (n.callback = function () {
"function" != typeof r && (null === Fl ? Fl = new Set([this]) : Fl.add(this), Zs(0, t));
var e = t.stack;
this.componentDidCatch(t.value, {componentStack: null !== e ? e : ""})
}), n
}
var rl = "function" == typeof WeakSet ? WeakSet : Set;
function il(e) {
var t = e.ref;
if (null !== t) if ("function" == typeof t) try {
t(null)
} catch (t) {
Pc(e, t)
} else t.current = null
}
function al(e, t) {
switch (t.tag) {
case 0:
case 11:
case 15:
case 22:
return;
case 1:
if (256 & t.flags && null !== e) {
var n = e.memoizedProps, r = e.memoizedState;
t = (e = t.stateNode).getSnapshotBeforeUpdate(t.elementType === t.type ? n : Ga(t.type, n), r), e.__reactInternalSnapshotBeforeUpdate = t
}
return;
case 3:
return void (256 & t.flags && Ri(t.stateNode.containerInfo));
case 5:
case 6:
case 4:
case 17:
return
}
throw Error(ee(163))
}
function ol(e, t, n) {
switch (n.tag) {
case 0:
case 11:
case 15:
case 22:
if (null !== (t = null !== (t = n.updateQueue) ? t.lastEffect : null)) {
e = t = t.next;
do {
if (3 == (3 & e.tag)) {
var r = e.create;
e.destroy = r()
}
e = e.next
} while (e !== t)
}
if (null !== (t = null !== (t = n.updateQueue) ? t.lastEffect : null)) {
e = t = t.next;
do {
var i = e;
r = i.next, 0 != (4 & (i = i.tag)) && 0 != (1 & i) && (_c(n, e), Sc(n, e)), e = r
} while (e !== t)
}
return;
case 1:
return e = n.stateNode, 4 & n.flags && (null === t ? e.componentDidMount() : (r = n.elementType === n.type ? t.memoizedProps : Ga(n.type, t.memoizedProps), e.componentDidUpdate(r, t.memoizedState, e.__reactInternalSnapshotBeforeUpdate))), void (null !== (t = n.updateQueue) && ro(n, t, e));
case 3:
if (null !== (t = n.updateQueue)) {
if (e = null, null !== n.child) switch (n.child.tag) {
case 5:
e = n.child.stateNode;
break;
case 1:
e = n.child.stateNode
}
ro(n, t, e)
}
return;
case 5:
return e = n.stateNode, void (null === t && 4 & n.flags && Li(n.type, n.memoizedProps) && e.focus());
case 6:
case 4:
case 12:
return;
case 13:
return void (null === n.memoizedState && (n = n.alternate, null !== n && (n = n.memoizedState, null !== n && (n = n.dehydrated, null !== n && vn(n)))));
case 19:
case 17:
case 20:
case 21:
case 23:
case 24:
return
}
throw Error(ee(163))
}
function sl(e, t) {
for (var n = e; ;) {
if (5 === n.tag) {
var r = n.stateNode;
if (t) "function" == typeof (r = r.style).setProperty ? r.setProperty("display", "none", "important") : r.display = "none"; else {
r = n.stateNode;
var i = n.memoizedProps.style;
i = void 0 !== i && null !== i && i.hasOwnProperty("display") ? i.display : null, r.style.display = mt("display", i)
}
} else if (6 === n.tag) n.stateNode.nodeValue = t ? "" : n.memoizedProps; else if ((23 !== n.tag && 24 !== n.tag || null === n.memoizedState || n === e) && null !== n.child) {
n.child.return = n, n = n.child;
continue
}
if (n === e) break;
for (; null === n.sibling;) {
if (null === n.return || n.return === e) return;
n = n.return
}
n.sibling.return = n.return, n = n.sibling
}
}
function ll(e, t) {
if (pa && "function" == typeof pa.onCommitFiberUnmount) try {
pa.onCommitFiberUnmount(ha, t)
} catch (e) {
}
switch (t.tag) {
case 0:
case 11:
case 14:
case 15:
case 22:
if (null !== (e = t.updateQueue) && null !== (e = e.lastEffect)) {
var n = e = e.next;
do {
var r = n, i = r.destroy;
if (r = r.tag, void 0 !== i) if (0 != (4 & r)) _c(t, n); else {
r = t;
try {
i()
} catch (e) {
Pc(r, e)
}
}
n = n.next
} while (n !== e)
}
break;
case 1:
if (il(t), "function" == typeof (e = t.stateNode).componentWillUnmount) try {
e.props = t.memoizedProps, e.state = t.memoizedState, e.componentWillUnmount()
} catch (e) {
Pc(t, e)
}
break;
case 5:
il(t);
break;
case 4:
hl(e, t)
}
}
function cl(e) {
e.alternate = null, e.child = null, e.dependencies = null, e.firstEffect = null, e.lastEffect = null, e.memoizedProps = null, e.memoizedState = null, e.pendingProps = null, e.return = null, e.updateQueue = null
}
function ul(e) {
return 5 === e.tag || 3 === e.tag || 4 === e.tag
}
function dl(e) {
e:{
for (var t = e.return; null !== t;) {
if (ul(t)) break e;
t = t.return
}
throw Error(ee(160))
}
var n = t;
switch (t = n.stateNode, n.tag) {
case 5:
var r = !1;
break;
case 3:
case 4:
t = t.containerInfo, r = !0;
break;
default:
throw Error(ee(161))
}
16 & n.flags && (ht(t, ""), n.flags &= -17);
e:t:for (n = e; ;) {
for (; null === n.sibling;) {
if (null === n.return || ul(n.return)) {
n = null;
break e
}
n = n.return
}
for (n.sibling.return = n.return, n = n.sibling; 5 !== n.tag && 6 !== n.tag && 18 !== n.tag;) {
if (2 & n.flags) continue t;
if (null === n.child || 4 === n.tag) continue t;
n.child.return = n, n = n.child
}
if (!(2 & n.flags)) {
n = n.stateNode;
break e
}
}
r ? function e(t, n, r) {
var i = t.tag, a = 5 === i || 6 === i;
if (a) t = a ? t.stateNode : t.stateNode.instance, n ? 8 === r.nodeType ? r.parentNode.insertBefore(t, n) : r.insertBefore(t, n) : (8 === r.nodeType ? (n = r.parentNode, n.insertBefore(t, r)) : (n = r, n.appendChild(t)), r = r._reactRootContainer, null !== r && void 0 !== r || null !== n.onclick || (n.onclick = Ei)); else if (4 !== i && (t = t.child, null !== t)) for (e(t, n, r), t = t.sibling; null !== t;) e(t, n, r), t = t.sibling
}(e, n, t) : function e(t, n, r) {
var i = t.tag, a = 5 === i || 6 === i;
if (a) t = a ? t.stateNode : t.stateNode.instance, n ? r.insertBefore(t, n) : r.appendChild(t); else if (4 !== i && (t = t.child, null !== t)) for (e(t, n, r), t = t.sibling; null !== t;) e(t, n, r), t = t.sibling
}(e, n, t)
}
function hl(e, t) {
for (var n, r, i = t, a = !1; ;) {
if (!a) {
a = i.return;
e:for (; ;) {
if (null === a) throw Error(ee(160));
switch (n = a.stateNode, a.tag) {
case 5:
r = !1;
break e;
case 3:
case 4:
n = n.containerInfo, r = !0;
break e
}
a = a.return
}
a = !0
}
if (5 === i.tag || 6 === i.tag) {
e:for (var o = e, s = i, l = s; ;) if (ll(o, l), null !== l.child && 4 !== l.tag) l.child.return = l, l = l.child; else {
if (l === s) break e;
for (; null === l.sibling;) {
if (null === l.return || l.return === s) break e;
l = l.return
}
l.sibling.return = l.return, l = l.sibling
}
r ? (o = n, s = i.stateNode, 8 === o.nodeType ? o.parentNode.removeChild(s) : o.removeChild(s)) : n.removeChild(i.stateNode)
} else if (4 === i.tag) {
if (null !== i.child) {
n = i.stateNode.containerInfo, r = !0, i.child.return = i, i = i.child;
continue
}
} else if (ll(e, i), null !== i.child) {
i.child.return = i, i = i.child;
continue
}
if (i === t) break;
for (; null === i.sibling;) {
if (null === i.return || i.return === t) return;
4 === (i = i.return).tag && (a = !1)
}
i.sibling.return = i.return, i = i.sibling
}
}
function pl(e, t) {
switch (t.tag) {
case 0:
case 11:
case 14:
case 15:
case 22:
var n = t.updateQueue;
if (null !== (n = null !== n ? n.lastEffect : null)) {
var r = n = n.next;
do {
3 == (3 & r.tag) && (e = r.destroy, r.destroy = void 0, void 0 !== e && e()), r = r.next
} while (r !== n)
}
return;
case 1:
return;
case 5:
if (null != (n = t.stateNode)) {
r = t.memoizedProps;
var i = null !== e ? e.memoizedProps : r;
e = t.type;
var a = t.updateQueue;
if (t.updateQueue = null, null !== a) {
for (n[Ki] = r, "input" === e && "radio" === r.type && null != r.name && Je(n, r), bt(e, i), t = bt(e, r), i = 0; i < a.length; i += 2) {
var o = a[i], s = a[i + 1];
"style" === o ? vt(n, s) : "dangerouslySetInnerHTML" === o ? dt(n, s) : "children" === o ? ht(n, s) : me(n, o, s, t)
}
switch (e) {
case"input":
Qe(n, r);
break;
case"textarea":
it(n, r);
break;
case"select":
e = n._wrapperState.wasMultiple, n._wrapperState.wasMultiple = !!r.multiple, null != (a = r.value) ? tt(n, !!r.multiple, a, !1) : e !== !!r.multiple && (null != r.defaultValue ? tt(n, !!r.multiple, r.defaultValue, !0) : tt(n, !!r.multiple, r.multiple ? [] : "", !1))
}
}
}
return;
case 6:
if (null === t.stateNode) throw Error(ee(162));
return void (t.stateNode.nodeValue = t.memoizedProps);
case 3:
return void ((n = t.stateNode).hydrate && (n.hydrate = !1, vn(n.containerInfo)));
case 12:
return;
case 13:
return null !== t.memoizedState && (Ll = La(), sl(t.child, !0)), void fl(t);
case 19:
return void fl(t);
case 17:
return;
case 23:
case 24:
return void sl(t, null !== t.memoizedState)
}
throw Error(ee(163))
}
function fl(e) {
var t = e.updateQueue;
if (null !== t) {
e.updateQueue = null;
var n = e.stateNode;
null === n && (n = e.stateNode = new rl), t.forEach(function (t) {
var r = function (e, t) {
var n = e.stateNode;
null !== n && n.delete(t), 0 == (t = 0) && (0 == (2 & (t = e.mode)) ? t = 1 : 0 == (4 & t) ? t = 99 === Oa() ? 1 : 2 : (0 === Xl && (Xl = Al), 0 === (t = Nn(62914560 & ~Xl)) && (t = 4194304))), n = Zl(), null !== (e = nc(e, t)) && (Wn(e, t, n), rc(e, n))
}.bind(null, e, t);
n.has(t) || (n.add(t), t.then(r, r))
})
}
}
function ml(e, t) {
return null !== e && (null === (e = e.memoizedState) || null !== e.dehydrated) && (null !== (t = t.memoizedState) && null === t.dehydrated)
}
var vl = Math.ceil, gl = ve.ReactCurrentDispatcher, yl = ve.ReactCurrentOwner, bl = 0, wl = null, Sl = null, _l = 0,
kl = 0, xl = $i(0), Pl = 0, Cl = null, Al = 0, Tl = 0, El = 0, Dl = 0, Il = null, Ll = 0, Ol = 1 / 0;
function Ml() {
Ol = La() + 500
}
var Nl, Rl = null, Wl = !1, Vl = null, Fl = null, Gl = !1, Bl = null, Kl = 90, jl = [], zl = [], Ul = null, ql = 0,
Hl = null, Yl = -1, Xl = 0, Jl = 0, Ql = null, $l = !1;
function Zl() {
return 0 != (48 & bl) ? La() : -1 !== Yl ? Yl : Yl = La()
}
function ec(e) {
if (0 == (2 & (e = e.mode))) return 1;
if (0 == (4 & e)) return 99 === Oa() ? 1 : 2;
if (0 === Xl && (Xl = Al), 0 !== Fa.transition) {
0 !== Jl && (Jl = null !== Il ? Il.pendingLanes : 0), e = Xl;
var t = 4186112 & ~Jl;
return 0 === (t &= -t) && (0 === (t = (e = 4186112 & ~e) & -e) && (t = 8192)), t
}
return e = Oa(), 0 != (4 & bl) && 98 === e ? e = Mn(12, Xl) : e = Mn(e = function (e) {
switch (e) {
case 99:
return 15;
case 98:
return 10;
case 97:
case 96:
return 8;
case 95:
return 2;
default:
return 0
}
}(e), Xl), e
}
function tc(e, t, n) {
if (50 < ql) throw ql = 0, Hl = null, Error(ee(185));
if (null === (e = nc(e, t))) return null;
Wn(e, t, n), e === wl && (El |= t, 4 === Pl && ic(e, _l));
var r = Oa();
1 === t ? 0 != (8 & bl) && 0 == (48 & bl) ? ac(e) : (rc(e, n), 0 === bl && (Ml(), Wa())) : (0 == (4 & bl) || 98 !== r && 99 !== r || (null === Ul ? Ul = new Set([e]) : Ul.add(e)), rc(e, n)), Il = e
}
function nc(e, t) {
e.lanes |= t;
var n = e.alternate;
for (null !== n && (n.lanes |= t), n = e, e = e.return; null !== e;) e.childLanes |= t, null !== (n = e.alternate) && (n.childLanes |= t), n = e, e = e.return;
return 3 === n.tag ? n.stateNode : null
}
function rc(e, t) {
for (var n = e.callbackNode, r = e.suspendedLanes, i = e.pingedLanes, a = e.expirationTimes, o = e.pendingLanes; 0 < o;) {
var s = 31 - Vn(o), l = 1 << s, c = a[s];
if (-1 === c) {
if (0 == (l & r) || 0 != (l & i)) {
c = t, In(l);
var u = Dn;
a[s] = 10 <= u ? c + 250 : 6 <= u ? c + 5e3 : -1
}
} else c <= t && (e.expiredLanes |= l);
o &= ~l
}
if (r = Ln(e, e === wl ? _l : 0), t = Dn, 0 === r) null !== n && (n !== Ca && va(n), e.callbackNode = null, e.callbackPriority = 0); else {
if (null !== n) {
if (e.callbackPriority === t) return;
n !== Ca && va(n)
}
15 === t ? (n = ac.bind(null, e), null === Ta ? (Ta = [n], Ea = ma(Sa, Va)) : Ta.push(n), n = Ca) : 14 === t ? n = Ra(99, ac.bind(null, e)) : n = Ra(n = function (e) {
switch (e) {
case 15:
case 14:
return 99;
case 13:
case 12:
case 11:
case 10:
return 98;
case 9:
case 8:
case 7:
case 6:
case 4:
case 5:
return 97;
case 3:
case 2:
case 1:
return 95;
case 0:
return 90;
default:
throw Error(ee(358, e))
}
}(t), function e(t) {
Yl = -1;
Jl = Xl = 0;
if (0 != (48 & bl)) throw Error(ee(327));
var n = t.callbackNode;
if (wc() && t.callbackNode !== n) return null;
var r = Ln(t, t === wl ? _l : 0);
if (0 === r) return null;
var i = r;
var a = bl;
bl |= 16;
var o = hc();
wl === t && _l === i || (Ml(), uc(t, i));
for (; ;) try {
mc();
break
} catch (e) {
dc(t, e)
}
Ua();
gl.current = o;
bl = a;
null !== Sl ? i = 0 : (wl = null, _l = 0, i = Pl);
if (0 != (Al & El)) uc(t, 0); else if (0 !== i) {
if (2 === i && (bl |= 64, t.hydrate && (t.hydrate = !1, Ri(t.containerInfo)), 0 !== (r = On(t)) && (i = pc(t, r))), 1 === i) throw n = Cl, uc(t, 0), ic(t, r), rc(t, La()), n;
switch (t.finishedWork = t.current.alternate, t.finishedLanes = r, i) {
case 0:
case 1:
throw Error(ee(345));
case 2:
yc(t);
break;
case 3:
if (ic(t, r), (62914560 & r) === r && 10 < (i = Ll + 500 - La())) {
if (0 !== Ln(t, 0)) break;
if (((a = t.suspendedLanes) & r) !== r) {
Zl(), t.pingedLanes |= t.suspendedLanes & a;
break
}
t.timeoutHandle = Mi(yc.bind(null, t), i);
break
}
yc(t);
break;
case 4:
if (ic(t, r), (4186112 & r) === r) break;
for (i = t.eventTimes, a = -1; 0 < r;) {
var s = 31 - Vn(r);
o = 1 << s, (s = i[s]) > a && (a = s), r &= ~o
}
if (r = a, 10 < (r = (120 > (r = La() - r) ? 120 : 480 > r ? 480 : 1080 > r ? 1080 : 1920 > r ? 1920 : 3e3 > r ? 3e3 : 4320 > r ? 4320 : 1960 * vl(r / 1960)) - r)) {
t.timeoutHandle = Mi(yc.bind(null, t), r);
break
}
yc(t);
break;
case 5:
yc(t);
break;
default:
throw Error(ee(329))
}
}
rc(t, La());
return t.callbackNode === n ? e.bind(null, t) : null
}.bind(null, e)), e.callbackPriority = t, e.callbackNode = n
}
}
function ic(e, t) {
for (t &= ~Dl, t &= ~El, e.suspendedLanes |= t, e.pingedLanes &= ~t, e = e.expirationTimes; 0 < t;) {
var n = 31 - Vn(t), r = 1 << n;
e[n] = -1, t &= ~r
}
}
function ac(e) {
if (0 != (48 & bl)) throw Error(ee(327));
if (wc(), e === wl && 0 != (e.expiredLanes & _l)) {
var t = _l, n = pc(e, t);
0 != (Al & El) && (n = pc(e, t = Ln(e, t)))
} else n = pc(e, t = Ln(e, 0));
if (0 !== e.tag && 2 === n && (bl |= 64, e.hydrate && (e.hydrate = !1, Ri(e.containerInfo)), 0 !== (t = On(e)) && (n = pc(e, t))), 1 === n) throw n = Cl, uc(e, 0), ic(e, t), rc(e, La()), n;
return e.finishedWork = e.current.alternate, e.finishedLanes = t, yc(e), rc(e, La()), null
}
function oc(e, t) {
var n = bl;
bl |= 1;
try {
return e(t)
} finally {
0 === (bl = n) && (Ml(), Wa())
}
}
function sc(e, t) {
var n = bl;
bl &= -2, bl |= 8;
try {
return e(t)
} finally {
0 === (bl = n) && (Ml(), Wa())
}
}
function lc(e, t) {
ea(xl, kl), kl |= t, Al |= t
}
function cc() {
kl = xl.current, Zi(xl)
}
function uc(e, t) {
e.finishedWork = null, e.finishedLanes = 0;
var n = e.timeoutHandle;
if (-1 !== n && (e.timeoutHandle = -1, Ni(n)), null !== Sl) for (n = Sl.return; null !== n;) {
var r = n;
switch (r.tag) {
case 1:
null !== (r = r.type.childContextTypes) && void 0 !== r && sa();
break;
case 3:
xo(), Zi(ra), Zi(na), Fo();
break;
case 5:
Co(r);
break;
case 4:
xo();
break;
case 13:
case 19:
Zi(Ao);
break;
case 10:
qa(r);
break;
case 23:
case 24:
cc()
}
n = n.return
}
wl = e, Sl = Ec(e.current, null), _l = kl = Al = t, Pl = 0, Cl = null, Dl = El = Tl = 0
}
function dc(e, t) {
for (; ;) {
var n = Sl;
try {
if (Ua(), Go.current = ws, qo) {
for (var r = jo.memoizedState; null !== r;) {
var i = r.queue;
null !== i && (i.pending = null), r = r.next
}
qo = !1
}
if (Ko = 0, Uo = zo = jo = null, Ho = !1, yl.current = null, null === n || null === n.return) {
Pl = 1, Cl = t, Sl = null;
break
}
e:{
var a = e, o = n.return, s = n, l = t;
if (t = _l, s.flags |= 2048, s.firstEffect = s.lastEffect = null, null !== l && "object" === c(l) && "function" == typeof l.then) {
var u = l;
if (0 == (2 & s.mode)) {
var d = s.alternate;
d ? (s.updateQueue = d.updateQueue, s.memoizedState = d.memoizedState, s.lanes = d.lanes) : (s.updateQueue = null, s.memoizedState = null)
}
var h = 0 != (1 & Ao.current), p = o;
do {
var f;
if (f = 13 === p.tag) {
var m = p.memoizedState;
if (null !== m) f = null !== m.dehydrated; else {
var v = p.memoizedProps;
f = void 0 !== v.fallback && (!0 !== v.unstable_avoidThisFallback || !h)
}
}
if (f) {
var g = p.updateQueue;
if (null === g) {
var y = new Set;
y.add(u), p.updateQueue = y
} else g.add(u);
if (0 == (2 & p.mode)) {
if (p.flags |= 64, s.flags |= 16384, s.flags &= -2981, 1 === s.tag) if (null === s.alternate) s.tag = 17; else {
var b = Za(-1, 1);
b.tag = 2, eo(s, b)
}
s.lanes |= 1;
break e
}
l = void 0, s = t;
var w = a.pingCache;
if (null === w ? (w = a.pingCache = new el, l = new Set, w.set(u, l)) : void 0 === (l = w.get(u)) && (l = new Set, w.set(u, l)), !l.has(s)) {
l.add(s);
var S = Cc.bind(null, a, u, s);
u.then(S, S)
}
p.flags |= 4096, p.lanes = t;
break e
}
p = p.return
} while (null !== p);
l = Error((Ke(s.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")
}
5 !== Pl && (Pl = 2), l = $s(l, s), p = o;
do {
switch (p.tag) {
case 3:
a = l, p.flags |= 4096, t &= -t, p.lanes |= t, to(p, tl(0, a, t));
break e;
case 1:
a = l;
var _ = p.type, k = p.stateNode;
if (0 == (64 & p.flags) && ("function" == typeof _.getDerivedStateFromError || null !== k && "function" == typeof k.componentDidCatch && (null === Fl || !Fl.has(k)))) {
p.flags |= 4096, t &= -t, p.lanes |= t, to(p, nl(p, a, t));
break e
}
}
p = p.return
} while (null !== p)
}
gc(n)
} catch (e) {
t = e, Sl === n && null !== n && (Sl = n = n.return);
continue
}
break
}
}
function hc() {
var e = gl.current;
return gl.current = ws, null === e ? ws : e
}
function pc(e, t) {
var n = bl;
bl |= 16;
var r = hc();
for (wl === e && _l === t || uc(e, t); ;) try {
fc();
break
} catch (t) {
dc(e, t)
}
if (Ua(), bl = n, gl.current = r, null !== Sl) throw Error(ee(261));
return wl = null, _l = 0, Pl
}
function fc() {
for (; null !== Sl;) vc(Sl)
}
function mc() {
for (; null !== Sl && !ga();) vc(Sl)
}
function vc(e) {
var t = Nl(e.alternate, e, kl);
e.memoizedProps = e.pendingProps, null === t ? gc(e) : Sl = t, yl.current = null
}
function gc(e) {
var t = e;
do {
var n = t.alternate;
if (e = t.return, 0 == (2048 & t.flags)) {
if (null !== (n = Js(n, t, kl))) return void (Sl = n);
if (24 !== (n = t).tag && 23 !== n.tag || null === n.memoizedState || 0 != (1073741824 & kl) || 0 == (4 & n.mode)) {
for (var r = 0, i = n.child; null !== i;) r |= i.lanes | i.childLanes, i = i.sibling;
n.childLanes = r
}
null !== e && 0 == (2048 & e.flags) && (null === e.firstEffect && (e.firstEffect = t.firstEffect), null !== t.lastEffect && (null !== e.lastEffect && (e.lastEffect.nextEffect = t.firstEffect), e.lastEffect = t.lastEffect), 1 < t.flags && (null !== e.lastEffect ? e.lastEffect.nextEffect = t : e.firstEffect = t, e.lastEffect = t))
} else {
if (null !== (n = Qs(t))) return n.flags &= 2047, void (Sl = n);
null !== e && (e.firstEffect = e.lastEffect = null, e.flags |= 2048)
}
if (null !== (t = t.sibling)) return void (Sl = t);
Sl = t = e
} while (null !== t);
0 === Pl && (Pl = 5)
}
function yc(e) {
var t = Oa();
return Na(99, function (e, t) {
do {
wc()
} while (null !== Bl);
if (0 != (48 & bl)) throw Error(ee(327));
var n = e.finishedWork;
if (null === n) return null;
if (e.finishedWork = null, e.finishedLanes = 0, n === e.current) throw Error(ee(177));
e.callbackNode = null;
var r = n.lanes | n.childLanes, i = r, a = e.pendingLanes & ~i;
e.pendingLanes = i, e.suspendedLanes = 0, e.pingedLanes = 0, e.expiredLanes &= i, e.mutableReadLanes &= i, e.entangledLanes &= i, i = e.entanglements;
for (var o = e.eventTimes, s = e.expirationTimes; 0 < a;) {
var l = 31 - Vn(a), c = 1 << l;
i[l] = 0, o[l] = -1, s[l] = -1, a &= ~c
}
if (null !== Ul && 0 == (24 & r) && Ul.has(e) && Ul.delete(e), e === wl && (Sl = wl = null, _l = 0), 1 < n.flags ? null !== n.lastEffect ? (n.lastEffect.nextEffect = n, r = n.firstEffect) : r = n : r = n.firstEffect, null !== r) {
if (i = bl, bl |= 32, yl.current = null, Di = jn, oi(o = ai())) {
if ("selectionStart" in o) s = {
start: o.selectionStart,
end: o.selectionEnd
}; else e:if (s = (s = o.ownerDocument) && s.defaultView || window, (c = s.getSelection && s.getSelection()) && 0 !== c.rangeCount) {
s = c.anchorNode, a = c.anchorOffset, l = c.focusNode, c = c.focusOffset;
try {
s.nodeType, l.nodeType
} catch (e) {
s = null;
break e
}
var u = 0, d = -1, h = -1, p = 0, f = 0, m = o, v = null;
t:for (; ;) {
for (var g; m !== s || 0 !== a && 3 !== m.nodeType || (d = u + a), m !== l || 0 !== c && 3 !== m.nodeType || (h = u + c), 3 === m.nodeType && (u += m.nodeValue.length), null !== (g = m.firstChild);) v = m, m = g;
for (; ;) {
if (m === o) break t;
if (v === s && ++p === a && (d = u), v === l && ++f === c && (h = u), null !== (g = m.nextSibling)) break;
v = (m = v).parentNode
}
m = g
}
s = -1 === d || -1 === h ? null : {start: d, end: h}
} else s = null;
s = s || {start: 0, end: 0}
} else s = null;
Ii = {focusedElem: o, selectionRange: s}, jn = !1, Ql = null, $l = !1, Rl = r;
do {
try {
bc()
} catch (e) {
if (null === Rl) throw Error(ee(330));
Pc(Rl, e), Rl = Rl.nextEffect
}
} while (null !== Rl);
Ql = null, Rl = r;
do {
try {
for (o = e; null !== Rl;) {
var y = Rl.flags;
if (16 & y && ht(Rl.stateNode, ""), 128 & y) {
var b = Rl.alternate;
if (null !== b) {
var w = b.ref;
null !== w && ("function" == typeof w ? w(null) : w.current = null)
}
}
switch (1038 & y) {
case 2:
dl(Rl), Rl.flags &= -3;
break;
case 6:
dl(Rl), Rl.flags &= -3, pl(Rl.alternate, Rl);
break;
case 1024:
Rl.flags &= -1025;
break;
case 1028:
Rl.flags &= -1025, pl(Rl.alternate, Rl);
break;
case 4:
pl(Rl.alternate, Rl);
break;
case 8:
hl(o, s = Rl);
var S = s.alternate;
cl(s), null !== S && cl(S)
}
Rl = Rl.nextEffect
}
} catch (e) {
if (null === Rl) throw Error(ee(330));
Pc(Rl, e), Rl = Rl.nextEffect
}
} while (null !== Rl);
if (w = Ii, b = ai(), y = w.focusedElem, o = w.selectionRange, b !== y && y && y.ownerDocument && function e(t, n) {
return !(!t || !n) && (t === n || (!t || 3 !== t.nodeType) && (n && 3 === n.nodeType ? e(t, n.parentNode) : "contains" in t ? t.contains(n) : !!t.compareDocumentPosition && !!(16 & t.compareDocumentPosition(n))))
}(y.ownerDocument.documentElement, y)) {
null !== o && oi(y) && (b = o.start, void 0 === (w = o.end) && (w = b), "selectionStart" in y ? (y.selectionStart = b, y.selectionEnd = Math.min(w, y.value.length)) : (w = (b = y.ownerDocument || document) && b.defaultView || window).getSelection && (w = w.getSelection(), s = y.textContent.length, S = Math.min(o.start, s), o = void 0 === o.end ? S : Math.min(o.end, s), !w.extend && S > o && (s = o, o = S, S = s), s = ii(y, S), a = ii(y, o), s && a && (1 !== w.rangeCount || w.anchorNode !== s.node || w.anchorOffset !== s.offset || w.focusNode !== a.node || w.focusOffset !== a.offset) && ((b = b.createRange()).setStart(s.node, s.offset), w.removeAllRanges(), S > o ? (w.addRange(b), w.extend(a.node, a.offset)) : (b.setEnd(a.node, a.offset), w.addRange(b))))), b = [];
for (w = y; w = w.parentNode;) 1 === w.nodeType && b.push({
element: w,
left: w.scrollLeft,
top: w.scrollTop
});
for ("function" == typeof y.focus && y.focus(), y = 0; y < b.length; y++) (w = b[y]).element.scrollLeft = w.left, w.element.scrollTop = w.top
}
jn = !!Di, Ii = Di = null, e.current = n, Rl = r;
do {
try {
for (y = e; null !== Rl;) {
var _ = Rl.flags;
if (36 & _ && ol(y, Rl.alternate, Rl), 128 & _) {
b = void 0;
var k = Rl.ref;
if (null !== k) {
var x = Rl.stateNode;
switch (Rl.tag) {
case 5:
b = x;
break;
default:
b = x
}
"function" == typeof k ? k(b) : k.current = b
}
}
Rl = Rl.nextEffect
}
} catch (e) {
if (null === Rl) throw Error(ee(330));
Pc(Rl, e), Rl = Rl.nextEffect
}
} while (null !== Rl);
Rl = null, Aa(), bl = i
} else e.current = n;
if (Gl) Gl = !1, Bl = e, Kl = t; else for (Rl = r; null !== Rl;) t = Rl.nextEffect, Rl.nextEffect = null, 8 & Rl.flags && ((_ = Rl).sibling = null, _.stateNode = null), Rl = t;
if (0 === (r = e.pendingLanes) && (Fl = null), 1 === r ? e === Hl ? ql++ : (ql = 0, Hl = e) : ql = 0, n = n.stateNode, pa && "function" == typeof pa.onCommitFiberRoot) try {
pa.onCommitFiberRoot(ha, n, void 0, 64 == (64 & n.current.flags))
} catch (e) {
}
if (rc(e, La()), Wl) throw Wl = !1, e = Vl, Vl = null, e;
return 0 != (8 & bl) ? null : (Wa(), null)
}.bind(null, e, t)), null
}
function bc() {
for (; null !== Rl;) {
var e = Rl.alternate;
$l || null === Ql || (0 != (8 & Rl.flags) ? Ht(Rl, Ql) && ($l = !0) : 13 === Rl.tag && ml(e, Rl) && Ht(Rl, Ql) && ($l = !0));
var t = Rl.flags;
0 != (256 & t) && al(e, Rl), 0 == (512 & t) || Gl || (Gl = !0, Ra(97, function () {
return wc(), null
})), Rl = Rl.nextEffect
}
}
function wc() {
if (90 !== Kl) {
var e = 97 < Kl ? 97 : Kl;
return Kl = 90, Na(e, kc)
}
return !1
}
function Sc(e, t) {
jl.push(t, e), Gl || (Gl = !0, Ra(97, function () {
return wc(), null
}))
}
function _c(e, t) {
zl.push(t, e), Gl || (Gl = !0, Ra(97, function () {
return wc(), null
}))
}
function kc() {
if (null === Bl) return !1;
var e = Bl;
if (Bl = null, 0 != (48 & bl)) throw Error(ee(331));
var t = bl;
bl |= 32;
var n = zl;
zl = [];
for (var r = 0; r < n.length; r += 2) {
var i = n[r], a = n[r + 1], o = i.destroy;
if (i.destroy = void 0, "function" == typeof o) try {
o()
} catch (e) {
if (null === a) throw Error(ee(330));
Pc(a, e)
}
}
for (n = jl, jl = [], r = 0; r < n.length; r += 2) {
i = n[r], a = n[r + 1];
try {
var s = i.create;
i.destroy = s()
} catch (e) {
if (null === a) throw Error(ee(330));
Pc(a, e)
}
}
for (s = e.current.firstEffect; null !== s;) e = s.nextEffect, s.nextEffect = null, 8 & s.flags && (s.sibling = null, s.stateNode = null), s = e;
return bl = t, Wa(), !0
}
function xc(e, t, n) {
eo(e, t = tl(0, t = $s(n, t), 1)), t = Zl(), null !== (e = nc(e, 1)) && (Wn(e, 1, t), rc(e, t))
}
function Pc(e, t) {
if (3 === e.tag) xc(e, e, t); else for (var n = e.return; null !== n;) {
if (3 === n.tag) {
xc(n, e, t);
break
}
if (1 === n.tag) {
var r = n.stateNode;
if ("function" == typeof n.type.getDerivedStateFromError || "function" == typeof r.componentDidCatch && (null === Fl || !Fl.has(r))) {
var i = nl(n, e = $s(t, e), 1);
if (eo(n, i), i = Zl(), null !== (n = nc(n, 1))) Wn(n, 1, i), rc(n, i); else if ("function" == typeof r.componentDidCatch && (null === Fl || !Fl.has(r))) try {
r.componentDidCatch(t, e)
} catch (e) {
}
break
}
}
n = n.return
}
}
function Cc(e, t, n) {
var r = e.pingCache;
null !== r && r.delete(t), t = Zl(), e.pingedLanes |= e.suspendedLanes & n, wl === e && (_l & n) === n && (4 === Pl || 3 === Pl && (62914560 & _l) === _l && 500 > La() - Ll ? uc(e, 0) : Dl |= n), rc(e, t)
}
function Ac(e, t, n, r) {
return new function (e, t, n, r) {
this.tag = e, this.key = n, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = t, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = r, this.flags = 0, this.lastEffect = this.firstEffect = this.nextEffect = null, this.childLanes = this.lanes = 0, this.alternate = null
}(e, t, n, r)
}
function Tc(e) {
return !(!(e = e.prototype) || !e.isReactComponent)
}
function Ec(e, t) {
var n = e.alternate;
return null === n ? ((n = Ac(e.tag, t, e.key, e.mode)).elementType = e.elementType, n.type = e.type, n.stateNode = e.stateNode, n.alternate = e, e.alternate = n) : (n.pendingProps = t, n.type = e.type, n.flags = 0, n.nextEffect = null, n.firstEffect = null, n.lastEffect = null), n.childLanes = e.childLanes, n.lanes = e.lanes, n.child = e.child, n.memoizedProps = e.memoizedProps, n.memoizedState = e.memoizedState, n.updateQueue = e.updateQueue, t = e.dependencies, n.dependencies = null === t ? null : {
lanes: t.lanes,
firstContext: t.firstContext
}, n.sibling = e.sibling, n.index = e.index, n.ref = e.ref, n
}
function Dc(e, t, n, r, i, a) {
var o = 2;
if (r = e, "function" == typeof e) Tc(e) && (o = 1); else if ("string" == typeof e) o = 5; else e:switch (e) {
case be:
return Ic(n.children, i, a, t);
case Ie:
o = 8, i |= 16;
break;
case we:
o = 8, i |= 1;
break;
case Se:
return (e = Ac(12, n, t, 8 | i)).elementType = Se, e.type = Se, e.lanes = a, e;
case Pe:
return (e = Ac(13, n, t, i)).type = Pe, e.elementType = Pe, e.lanes = a, e;
case Ce:
return (e = Ac(19, n, t, i)).elementType = Ce, e.lanes = a, e;
case Le:
return Lc(n, i, a, t);
case Oe:
return (e = Ac(24, n, t, i)).elementType = Oe, e.lanes = a, e;
default:
if ("object" === c(e) && null !== e) switch (e.$$typeof) {
case _e:
o = 10;
break e;
case ke:
o = 9;
break e;
case xe:
o = 11;
break e;
case Ae:
o = 14;
break e;
case Te:
o = 16, r = null;
break e;
case Ee:
o = 22;
break e
}
throw Error(ee(130, null == e ? e : c(e), ""))
}
return (t = Ac(o, n, t, i)).elementType = e, t.type = r, t.lanes = a, t
}
function Ic(e, t, n, r) {
return (e = Ac(7, e, r, t)).lanes = n, e
}
function Lc(e, t, n, r) {
return (e = Ac(23, e, r, t)).elementType = Le, e.lanes = n, e
}
function Oc(e, t, n) {
return (e = Ac(6, e, null, t)).lanes = n, e
}
function Mc(e, t, n) {
return (t = Ac(4, null !== e.children ? e.children : [], e.key, t)).lanes = n, t.stateNode = {
containerInfo: e.containerInfo,
pendingChildren: null,
implementation: e.implementation
}, t
}
function Nc(e, t, n, r) {
var i = t.current, a = Zl(), o = ec(i);
e:if (n) {
n = n._reactInternals;
t:{
if (jt(n) !== n || 1 !== n.tag) throw Error(ee(170));
var s = n;
do {
switch (s.tag) {
case 3:
s = s.stateNode.context;
break t;
case 1:
if (oa(s.type)) {
s = s.stateNode.__reactInternalMemoizedMergedChildContext;
break t
}
}
s = s.return
} while (null !== s);
throw Error(ee(171))
}
if (1 === n.tag) {
var l = n.type;
if (oa(l)) {
n = ca(n, l, s);
break e
}
}
n = s
} else n = ta;
return null === t.context ? t.context = n : t.pendingContext = n, (t = Za(a, o)).payload = {element: e}, null !== (r = void 0 === r ? null : r) && (t.callback = r), eo(i, t), tc(i, o, a), o
}
function Rc(e) {
if (!(e = e.current).child) return null;
switch (e.child.tag) {
case 5:
default:
return e.child.stateNode
}
}
function Wc(e, t) {
if (null !== (e = e.memoizedState) && null !== e.dehydrated) {
var n = e.retryLane;
e.retryLane = 0 !== n && n < t ? n : t
}
}
function Vc(e, t) {
Wc(e, t), (e = e.alternate) && Wc(e, t)
}
function Fc(e, t, n) {
var r = null != n && null != n.hydrationOptions && n.hydrationOptions.mutableSources || null;
if (n = new function (e, t, n) {
this.tag = t, this.containerInfo = e, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.pendingContext = this.context = null, this.hydrate = n, this.callbackNode = null, this.callbackPriority = 0, this.eventTimes = Rn(0), this.expirationTimes = Rn(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = Rn(0), this.mutableSourceEagerHydrationData = null
}(e, t, null != n && !0 === n.hydrate), t = Ac(3, null, null, 2 === t ? 7 : 1 === t ? 3 : 0), n.current = t, t.stateNode = n, Qa(t), e[ji] = n.current, Si(8 === e.nodeType ? e.parentNode : e), r) for (e = 0; e < r.length; e++) {
var i = (t = r[e])._getVersion;
i = i(t._source), null == n.mutableSourceEagerHydrationData ? n.mutableSourceEagerHydrationData = [t, i] : n.mutableSourceEagerHydrationData.push(t, i)
}
this._internalRoot = n
}
function Gc(e) {
return !(!e || 1 !== e.nodeType && 9 !== e.nodeType && 11 !== e.nodeType && (8 !== e.nodeType || " react-mount-point-unstable " !== e.nodeValue))
}
function Bc(e, t, n, r, i) {
var a = n._reactRootContainer;
if (a) {
var o = a._internalRoot;
if ("function" == typeof i) {
var s = i;
i = function () {
var e = Rc(o);
s.call(e)
}
}
Nc(t, o, e, i)
} else {
if (a = n._reactRootContainer = function (e, t) {
if (t || (t = !(!(t = e ? 9 === e.nodeType ? e.documentElement : e.firstChild : null) || 1 !== t.nodeType || !t.hasAttribute("data-reactroot"))), !t) for (var n; n = e.lastChild;) e.removeChild(n);
return new Fc(e, 0, t ? {hydrate: !0} : void 0)
}(n, r), o = a._internalRoot, "function" == typeof i) {
var l = i;
i = function () {
var e = Rc(o);
l.call(e)
}
}
sc(function () {
Nc(t, o, e, i)
})
}
return Rc(o)
}
function Kc(e, t) {
var n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
if (!Gc(t)) throw Error(ee(200));
return function (e, t, n) {
var r = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
return {$$typeof: ye, key: null == r ? null : "" + r, children: e, containerInfo: t, implementation: n}
}(e, t, null, n)
}
Nl = function (e, t, n) {
var r = t.lanes;
if (null !== e) if (e.memoizedProps !== t.pendingProps || ra.current) Ps = !0; else {
if (0 == (n & r)) {
switch (Ps = !1, t.tag) {
case 3:
Ns(t), Wo();
break;
case 5:
Po(t);
break;
case 1:
oa(t.type) && ua(t);
break;
case 4:
ko(t, t.stateNode.containerInfo);
break;
case 10:
r = t.memoizedProps.value;
var i = t.type._context;
ea(Ba, i._currentValue), i._currentValue = r;
break;
case 13:
if (null !== t.memoizedState) return 0 != (n & t.child.childLanes) ? Bs(e, t, n) : (ea(Ao, 1 & Ao.current), null !== (t = Ys(e, t, n)) ? t.sibling : null);
ea(Ao, 1 & Ao.current);
break;
case 19:
if (r = 0 != (n & t.childLanes), 0 != (64 & e.flags)) {
if (r) return Hs(e, t, n);
t.flags |= 64
}
if (null !== (i = t.memoizedState) && (i.rendering = null, i.tail = null, i.lastEffect = null), ea(Ao, Ao.current), r) break;
return null;
case 23:
case 24:
return t.lanes = 0, Ds(e, t, n)
}
return Ys(e, t, n)
}
Ps = 0 != (16384 & e.flags)
} else Ps = !1;
switch (t.lanes = 0, t.tag) {
case 2:
if (r = t.type, null !== e && (e.alternate = null, t.alternate = null, t.flags |= 2), e = t.pendingProps, i = aa(t, na.current), Ya(t, n), i = Jo(null, t, r, e, i, n), t.flags |= 1, "object" === c(i) && null !== i && "function" == typeof i.render && void 0 === i.$$typeof) {
if (t.tag = 1, t.memoizedState = null, t.updateQueue = null, oa(r)) {
var a = !0;
ua(t)
} else a = !1;
t.memoizedState = null !== i.state && void 0 !== i.state ? i.state : null, Qa(t);
var o = r.getDerivedStateFromProps;
"function" == typeof o && ao(t, r, o, e), i.updater = oo, t.stateNode = i, i._reactInternals = t, uo(t, r, e, n), t = Ms(null, t, r, !0, a, n)
} else t.tag = 0, Cs(null, t, i, n), t = t.child;
return t;
case 16:
i = t.elementType;
e:{
switch (null !== e && (e.alternate = null, t.alternate = null, t.flags |= 2), e = t.pendingProps, i = (a = i._init)(i._payload), t.type = i, a = t.tag = function (e) {
if ("function" == typeof e) return Tc(e) ? 1 : 0;
if (void 0 !== e && null !== e) {
if ((e = e.$$typeof) === xe) return 11;
if (e === Ae) return 14
}
return 2
}(i), e = Ga(i, e), a) {
case 0:
t = Ls(null, t, i, e, n);
break e;
case 1:
t = Os(null, t, i, e, n);
break e;
case 11:
t = As(null, t, i, e, n);
break e;
case 14:
t = Ts(null, t, i, Ga(i.type, e), r, n);
break e
}
throw Error(ee(306, i, ""))
}
return t;
case 0:
return r = t.type, i = t.pendingProps, Ls(e, t, r, i = t.elementType === r ? i : Ga(r, i), n);
case 1:
return r = t.type, i = t.pendingProps, Os(e, t, r, i = t.elementType === r ? i : Ga(r, i), n);
case 3:
if (Ns(t), r = t.updateQueue, null === e || null === r) throw Error(ee(282));
if (r = t.pendingProps, i = null !== (i = t.memoizedState) ? i.element : null, $a(e, t), no(t, r, null, n), (r = t.memoizedState.element) === i) Wo(), t = Ys(e, t, n); else {
if ((a = (i = t.stateNode).hydrate) && (Do = Wi(t.stateNode.containerInfo.firstChild), Eo = t, a = Io = !0), a) {
if (null != (e = i.mutableSourceEagerHydrationData)) for (i = 0; i < e.length; i += 2) (a = e[i])._workInProgressVersionPrimary = e[i + 1], Vo.push(a);
for (n = go(t, null, r, n), t.child = n; n;) n.flags = -3 & n.flags | 1024, n = n.sibling
} else Cs(e, t, r, n), Wo();
t = t.child
}
return t;
case 5:
return Po(t), null === e && Mo(t), r = t.type, i = t.pendingProps, a = null !== e ? e.memoizedProps : null, o = i.children, Oi(r, i) ? o = null : null !== a && Oi(r, a) && (t.flags |= 16), Is(e, t), Cs(e, t, o, n), t.child;
case 6:
return null === e && Mo(t), null;
case 13:
return Bs(e, t, n);
case 4:
return ko(t, t.stateNode.containerInfo), r = t.pendingProps, null === e ? t.child = vo(t, null, r, n) : Cs(e, t, r, n), t.child;
case 11:
return r = t.type, i = t.pendingProps, As(e, t, r, i = t.elementType === r ? i : Ga(r, i), n);
case 7:
return Cs(e, t, t.pendingProps, n), t.child;
case 8:
case 12:
return Cs(e, t, t.pendingProps.children, n), t.child;
case 10:
e:{
r = t.type._context, i = t.pendingProps, o = t.memoizedProps, a = i.value;
var s = t.type._context;
if (ea(Ba, s._currentValue), s._currentValue = a, null !== o) if (s = o.value, 0 === (a = ei(s, a) ? 0 : 0 | ("function" == typeof r._calculateChangedBits ? r._calculateChangedBits(s, a) : 1073741823))) {
if (o.children === i.children && !ra.current) {
t = Ys(e, t, n);
break e
}
} else for (null !== (s = t.child) && (s.return = t); null !== s;) {
var l = s.dependencies;
if (null !== l) {
o = s.child;
for (var u = l.firstContext; null !== u;) {
if (u.context === r && 0 != (u.observedBits & a)) {
1 === s.tag && ((u = Za(-1, n & -n)).tag = 2, eo(s, u)), s.lanes |= n, null !== (u = s.alternate) && (u.lanes |= n), Ha(s.return, n), l.lanes |= n;
break
}
u = u.next
}
} else o = 10 === s.tag && s.type === t.type ? null : s.child;
if (null !== o) o.return = s; else for (o = s; null !== o;) {
if (o === t) {
o = null;
break
}
if (null !== (s = o.sibling)) {
s.return = o.return, o = s;
break
}
o = o.return
}
s = o
}
Cs(e, t, i.children, n), t = t.child
}
return t;
case 9:
return i = t.type, r = (a = t.pendingProps).children, Ya(t, n), r = r(i = Xa(i, a.unstable_observedBits)), t.flags |= 1, Cs(e, t, r, n), t.child;
case 14:
return a = Ga(i = t.type, t.pendingProps), Ts(e, t, i, a = Ga(i.type, a), r, n);
case 15:
return Es(e, t, t.type, t.pendingProps, r, n);
case 17:
return r = t.type, i = t.pendingProps, i = t.elementType === r ? i : Ga(r, i), null !== e && (e.alternate = null, t.alternate = null, t.flags |= 2), t.tag = 1, oa(r) ? (e = !0, ua(t)) : e = !1, Ya(t, n), lo(t, r, i), uo(t, r, i, n), Ms(null, t, r, !0, e, n);
case 19:
return Hs(e, t, n);
case 23:
case 24:
return Ds(e, t, n)
}
throw Error(ee(156, t.tag))
}, Fc.prototype.render = function (e) {
Nc(e, this._internalRoot, null, null)
}, Fc.prototype.unmount = function () {
var e = this._internalRoot, t = e.containerInfo;
Nc(null, e, null, function () {
t[ji] = null
})
}, Yt = function (e) {
13 === e.tag && (tc(e, 4, Zl()), Vc(e, 4))
}, Xt = function (e) {
13 === e.tag && (tc(e, 67108864, Zl()), Vc(e, 67108864))
}, Jt = function (e) {
if (13 === e.tag) {
var t = Zl(), n = ec(e);
tc(e, n, t), Vc(e, n)
}
}, Qt = function (e, t) {
return t()
}, St = function (e, t, n) {
switch (t) {
case"input":
if (Qe(e, n), t = n.name, "radio" === n.type && null != t) {
for (n = e; n.parentNode;) n = n.parentNode;
for (n = n.querySelectorAll("input[name=" + JSON.stringify("" + t) + '][type="radio"]'), t = 0; t < n.length; t++) {
var r = n[t];
if (r !== e && r.form === e.form) {
var i = Yi(r);
if (!i) throw Error(ee(90));
qe(r), Qe(r, i)
}
}
}
break;
case"textarea":
it(e, n);
break;
case"select":
null != (t = n.value) && tt(e, !!n.multiple, t, !1)
}
}, At = oc, Tt = function (e, t, n, r, i) {
var a = bl;
bl |= 4;
try {
return Na(98, e.bind(null, t, n, r, i))
} finally {
0 === (bl = a) && (Ml(), Wa())
}
}, Et = function () {
0 == (49 & bl) && (function () {
if (null !== Ul) {
var e = Ul;
Ul = null, e.forEach(function (e) {
e.expiredLanes |= 24 & e.pendingLanes, rc(e, La())
})
}
Wa()
}(), wc())
}, Dt = function (e, t) {
var n = bl;
bl |= 2;
try {
return e(t)
} finally {
0 === (bl = n) && (Ml(), Wa())
}
};
var jc = {Events: [qi, Hi, Yi, Pt, Ct, wc, {current: !1}]},
zc = {findFiberByHostInstance: Ui, bundleType: 0, version: "17.0.2", rendererPackageName: "react-dom"}, Uc = {
bundleType: zc.bundleType,
version: zc.version,
rendererPackageName: zc.rendererPackageName,
rendererConfig: zc.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
overrideProps: null,
overridePropsDeletePath: null,
overridePropsRenamePath: null,
setSuspenseHandler: null,
scheduleUpdate: null,
currentDispatcherRef: ve.ReactCurrentDispatcher,
findHostInstanceByFiber: function (e) {
return null === (e = qt(e)) ? null : e.stateNode
},
findFiberByHostInstance: zc.findFiberByHostInstance || function () {
return null
},
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null
};
if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var qc = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (!qc.isDisabled && qc.supportsFiber) try {
ha = qc.inject(Uc), pa = qc
} catch (ut) {
}
}
Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = jc, Y.createPortal = Kc, Y.findDOMNode = function (e) {
if (null == e) return null;
if (1 === e.nodeType) return e;
var t = e._reactInternals;
if (void 0 === t) {
if ("function" == typeof e.render) throw Error(ee(188));
throw Error(ee(268, Object.keys(e)))
}
return e = null === (e = qt(t)) ? null : e.stateNode
}, Y.flushSync = function (e, t) {
var n = bl;
if (0 != (48 & n)) return e(t);
bl |= 1;
try {
if (e) return Na(99, e.bind(null, t))
} finally {
bl = n, Wa()
}
}, Y.hydrate = function (e, t, n) {
if (!Gc(t)) throw Error(ee(200));
return Bc(null, e, t, !0, n)
}, Y.render = function (e, t, n) {
if (!Gc(t)) throw Error(ee(200));
return Bc(null, e, t, !1, n)
}, Y.unmountComponentAtNode = function (e) {
if (!Gc(e)) throw Error(ee(40));
return !!e._reactRootContainer && (sc(function () {
Bc(null, null, e, !1, function () {
e._reactRootContainer = null, e[ji] = null
})
}), !0)
}, Y.unstable_batchedUpdates = oc, Y.unstable_createPortal = function (e, t) {
return Kc(e, t, 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null)
}, Y.unstable_renderSubtreeIntoContainer = function (e, t, n, r) {
if (!Gc(n)) throw Error(ee(200));
if (null == e || void 0 === e._reactInternals) throw Error(ee(38));
return Bc(e, t, n, !1, r)
}, Y.version = "17.0.2", function e() {
if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE) try {
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)
} catch (e) {
console.error(e)
}
}(), H.exports = Y;
var Hc = H.exports;
function Yc(e) {
var t, n, r = "";
if ("string" == typeof e || "number" == typeof e) r += e; else if ("object" === c(e)) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = Yc(e[t])) && (r && (r += " "), r += n); else for (t in e) e[t] && (r && (r += " "), r += t);
return r
}
function Xc() {
for (var e, t, n = 0, r = ""; n < arguments.length;) (e = arguments[n++]) && (t = Yc(e)) && (r && (r += " "), r += t);
return r
}
function Jc() {
return (Jc = Object.assign ? Object.assign.bind() : function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}).apply(this, arguments)
}
function Qc(e, t) {
if (null == e) return {};
var n, r, i = {}, a = Object.keys(e);
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) >= 0 || (i[n] = e[n]);
return i
}
function $c(e, t) {
if (null == e) return {};
var n, r, i = Qc(e, t);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) >= 0 || Object.prototype.propertyIsEnumerable.call(e, n) && (i[n] = e[n])
}
return i
}
function Zc(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
var eu = {exports: {}}, tu = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
function nu() {
}
function ru() {
}
ru.resetWarningCache = nu;
eu.exports = function () {
function e(e, t, n, r, i, a) {
if (a !== tu) {
var o = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
throw o.name = "Invariant Violation", o
}
}
function t() {
return e
}
e.isRequired = e;
var n = {
array: e,
bigint: e,
bool: e,
func: e,
number: e,
object: e,
string: e,
symbol: e,
any: e,
arrayOf: t,
element: e,
elementType: e,
instanceOf: t,
node: e,
objectOf: t,
oneOf: t,
oneOfType: t,
shape: t,
exact: t,
checkPropTypes: ru,
resetWarningCache: nu
};
return n.PropTypes = n, n
}();
var iu = eu.exports;
function au(e) {
"@babel/helpers - typeof";
return (au = "function" == typeof Symbol && "symbol" == n(Symbol.iterator) ? function (e) {
return void 0 === e ? "undefined" : n(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : n(e)
})(e)
}
function ou(e) {
return e && "object" === au(e) && e.constructor === Object
}
function su(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {clone: !0}, r = n.clone ? Jc({}, e) : e;
return ou(e) && ou(t) && Object.keys(t).forEach(function (i) {
"__proto__" !== i && (ou(t[i]) && i in e ? r[i] = su(e[i], t[i], n) : r[i] = t[i])
}), r
}
function lu(e) {
for (var t = "https://mui.com/production-error/?code=" + e, n = 1; n < arguments.length; n += 1) t += "&args[]=" + encodeURIComponent(arguments[n]);
return "Minified Material-UI error #" + e + "; visit " + t + " for the full message."
}
var cu = {}, uu = 60103, du = 60106, hu = 60107, pu = 60108, fu = 60114, mu = 60109, vu = 60110, gu = 60112,
yu = 60113, bu = 60120, wu = 60115, Su = 60116, _u = 60121, ku = 60122, xu = 60117, Pu = 60129, Cu = 60131;
if ("function" == typeof Symbol && Symbol.for) {
var Au = Symbol.for;
uu = Au("react.element"), du = Au("react.portal"), hu = Au("react.fragment"), pu = Au("react.strict_mode"), fu = Au("react.profiler"), mu = Au("react.provider"), vu = Au("react.context"), gu = Au("react.forward_ref"), yu = Au("react.suspense"), bu = Au("react.suspense_list"), wu = Au("react.memo"), Su = Au("react.lazy"), _u = Au("react.block"), ku = Au("react.server.block"), xu = Au("react.fundamental"), Pu = Au("react.debug_trace_mode"), Cu = Au("react.legacy_hidden")
}
function Tu(e) {
if ("object" === c(e) && null !== e) {
var t = e.$$typeof;
switch (t) {
case uu:
switch (e = e.type) {
case hu:
case fu:
case pu:
case yu:
case bu:
return e;
default:
switch (e = e && e.$$typeof) {
case vu:
case gu:
case Su:
case wu:
case mu:
return e;
default:
return t
}
}
case du:
return t
}
}
}
var Eu = mu, Du = uu, Iu = gu, Lu = hu, Ou = Su, Mu = wu, Nu = du, Ru = fu, Wu = pu, Vu = yu;
cu.ContextConsumer = vu, cu.ContextProvider = Eu, cu.Element = Du, cu.ForwardRef = Iu, cu.Fragment = Lu, cu.Lazy = Ou, cu.Memo = Mu, cu.Portal = Nu, cu.Profiler = Ru, cu.StrictMode = Wu, cu.Suspense = Vu, cu.isAsyncMode = function () {
return !1
}, cu.isConcurrentMode = function () {
return !1
}, cu.isContextConsumer = function (e) {
return Tu(e) === vu
}, cu.isContextProvider = function (e) {
return Tu(e) === mu
}, cu.isElement = function (e) {
return "object" === c(e) && null !== e && e.$$typeof === uu
}, cu.isForwardRef = function (e) {
return Tu(e) === gu
}, cu.isFragment = function (e) {
return Tu(e) === hu
}, cu.isLazy = function (e) {
return Tu(e) === Su
}, cu.isMemo = function (e) {
return Tu(e) === wu
}, cu.isPortal = function (e) {
return Tu(e) === du
}, cu.isProfiler = function (e) {
return Tu(e) === fu
}, cu.isStrictMode = function (e) {
return Tu(e) === pu
}, cu.isSuspense = function (e) {
return Tu(e) === yu
}, cu.isValidElementType = function (e) {
return "string" == typeof e || "function" == typeof e || e === hu || e === fu || e === Pu || e === pu || e === yu || e === bu || e === Cu || "object" === c(e) && null !== e && (e.$$typeof === Su || e.$$typeof === wu || e.$$typeof === mu || e.$$typeof === vu || e.$$typeof === gu || e.$$typeof === xu || e.$$typeof === _u || e[0] === ku)
}, cu.typeOf = Tu;
var Fu = "function" == typeof Symbol && Symbol.for ? Symbol.for("mui.nested") : "__THEME_NESTED__",
Gu = ["checked", "disabled", "error", "focused", "focusVisible", "required", "expanded", "selected"];
function Bu() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.disableGlobal,
n = void 0 !== t && t, r = e.productionPrefix, i = void 0 === r ? "jss" : r, a = e.seed,
o = void 0 === a ? "" : a, s = "" === o ? "" : "".concat(o, "-"), l = 0, c = function () {
return l += 1
};
return function (e, t) {
var r = t.options.name;
if (r && 0 === r.indexOf("Mui") && !t.options.link && !n) {
if (-1 !== Gu.indexOf(e.key)) return "Mui-".concat(e.key);
var a = "".concat(s).concat(r, "-").concat(e.key);
return t.options.theme[Fu] && "" === o ? "".concat(a, "-").concat(c()) : a
}
return "".concat(s).concat(i).concat(c())
}
}
function Ku(e) {
var t = e.theme, n = e.name, r = e.props;
if (!t || !t.props || !t.props[n]) return r;
var i, a = t.props[n];
for (i in a) void 0 === r[i] && (r[i] = a[i]);
return r
}
var ju = !0;
var zu = "function" == typeof Symbol && "symbol" === c(Symbol.iterator) ? function (e) {
return c(e)
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : c(e)
},
Uu = "object" === ("undefined" == typeof window ? "undefined" : zu(window)) && "object" === ("undefined" == typeof document ? "undefined" : zu(document)) && 9 === document.nodeType;
function qu(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
function Hu(e, t, n) {
return t && qu(e.prototype, t), n && qu(e, n), Object.defineProperty(e, "prototype", {writable: !1}), e
}
function Yu(e, t) {
return (Yu = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
return e.__proto__ = t, e
})(e, t)
}
function Xu(e, t) {
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, Yu(e, t)
}
function Ju(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
var Qu = {}.constructor;
function $u(e) {
if (null == e || "object" !== c(e)) return e;
if (Array.isArray(e)) return e.map($u);
if (e.constructor !== Qu) return e;
var t = {};
for (var n in e) t[n] = $u(e[n]);
return t
}
function Zu(e, t, n) {
void 0 === e && (e = "unnamed");
var r = n.jss, i = $u(t), a = r.plugins.onCreateRule(e, i, n);
return a || (e[0], null)
}
var ed = function (e, t) {
for (var n = "", r = 0; r < e.length && "!important" !== e[r]; r++) n && (n += t), n += e[r];
return n
}, td = function (e, t) {
if (void 0 === t && (t = !1), !Array.isArray(e)) return e;
var n = "";
if (Array.isArray(e[0])) for (var r = 0; r < e.length && "!important" !== e[r]; r++) n && (n += ", "), n += ed(e[r], " "); else n = ed(e, ", ");
return t || "!important" !== e[e.length - 1] || (n += " !important"), n
};
function nd(e) {
return e && !1 === e.format ? {linebreak: "", space: ""} : {linebreak: "\n", space: " "}
}
function rd(e, t) {
for (var n = "", r = 0; r < t; r++) n += " ";
return n + e
}
function id(e, t, n) {
void 0 === n && (n = {});
var r = "";
if (!t) return r;
var i = n.indent, a = void 0 === i ? 0 : i, o = t.fallbacks;
!1 === n.format && (a = -1 / 0);
var s = nd(n), l = s.linebreak, c = s.space;
if (e && a++, o) if (Array.isArray(o)) for (var u = 0; u < o.length; u++) {
var d = o[u];
for (var h in d) {
var p = d[h];
null != p && (r && (r += l), r += rd(h + ":" + c + td(p) + ";", a))
}
} else for (var f in o) {
var m = o[f];
null != m && (r && (r += l), r += rd(f + ":" + c + td(m) + ";", a))
}
for (var v in t) {
var g = t[v];
null != g && "fallbacks" !== v && (r && (r += l), r += rd(v + ":" + c + td(g) + ";", a))
}
return (r || n.allowEmpty) && e ? (a--, r && (r = "" + l + r + l), rd("" + e + c + "{" + r, a) + rd("}", a)) : r
}
var ad = /([[\].#*$><+~=|^:(),"'`\s])/g, od = "undefined" != typeof CSS && CSS.escape, sd = function (e) {
return od ? od(e) : e.replace(ad, "\\$1")
}, ld = function () {
function e(e, t, n) {
this.type = "style", this.isProcessed = !1;
var r = n.sheet, i = n.Renderer;
this.key = e, this.options = n, this.style = t, r ? this.renderer = r.renderer : i && (this.renderer = new i)
}
return e.prototype.prop = function (e, t, n) {
if (void 0 === t) return this.style[e];
var r = !!n && n.force;
if (!r && this.style[e] === t) return this;
var i = t;
n && !1 === n.process || (i = this.options.jss.plugins.onChangeValue(t, e, this));
var a = null == i || !1 === i, o = e in this.style;
if (a && !o && !r) return this;
var s = a && o;
if (s ? delete this.style[e] : this.style[e] = i, this.renderable && this.renderer) return s ? this.renderer.removeProperty(this.renderable, e) : this.renderer.setProperty(this.renderable, e, i), this;
var l = this.options.sheet;
return l && l.attached, this
}, e
}(), cd = function (e) {
function t(t, n, r) {
var i;
i = e.call(this, t, n, r) || this;
var a = r.selector, o = r.scoped, s = r.sheet, l = r.generateId;
return a ? i.selectorText = a : !1 !== o && (i.id = l(Ju(Ju(i)), s), i.selectorText = "." + sd(i.id)), i
}
Xu(t, e);
var n = t.prototype;
return n.applyTo = function (e) {
var t = this.renderer;
if (t) {
var n = this.toJSON();
for (var r in n) t.setProperty(e, r, n[r])
}
return this
}, n.toJSON = function () {
var e = {};
for (var t in this.style) {
var n = this.style[t];
"object" !== c(n) ? e[t] = n : Array.isArray(n) && (e[t] = td(n))
}
return e
}, n.toString = function (e) {
var t = this.options.sheet, n = !!t && t.options.link ? Jc({}, e, {allowEmpty: !0}) : e;
return id(this.selectorText, this.style, n)
}, Hu(t, [{
key: "selector", set: function (e) {
if (e !== this.selectorText) {
this.selectorText = e;
var t = this.renderer, n = this.renderable;
if (n && t) t.setSelector(n, e) || t.replaceRule(n, this)
}
}, get: function () {
return this.selectorText
}
}]), t
}(ld), ud = {
onCreateRule: function (e, t, n) {
return "@" === e[0] || n.parent && "keyframes" === n.parent.type ? null : new cd(e, t, n)
}
}, dd = {indent: 1, children: !0}, hd = /@([\w-]+)/, pd = function () {
function e(e, t, n) {
this.type = "conditional", this.isProcessed = !1, this.key = e;
var r = e.match(hd);
for (var i in this.at = r ? r[1] : "unknown", this.query = n.name || "@" + this.at, this.options = n, this.rules = new Rd(Jc({}, n, {parent: this})), t) this.rules.add(i, t[i]);
this.rules.process()
}
var t = e.prototype;
return t.getRule = function (e) {
return this.rules.get(e)
}, t.indexOf = function (e) {
return this.rules.indexOf(e)
}, t.addRule = function (e, t, n) {
var r = this.rules.add(e, t, n);
return r ? (this.options.jss.plugins.onProcessRule(r), r) : null
}, t.replaceRule = function (e, t, n) {
var r = this.rules.replace(e, t, n);
return r && this.options.jss.plugins.onProcessRule(r), r
}, t.toString = function (e) {
void 0 === e && (e = dd);
var t = nd(e).linebreak;
if (null == e.indent && (e.indent = dd.indent), null == e.children && (e.children = dd.children), !1 === e.children) return this.query + " {}";
var n = this.rules.toString(e);
return n ? this.query + " {" + t + n + t + "}" : ""
}, e
}(), fd = /@media|@supports\s+/, md = {
onCreateRule: function (e, t, n) {
return fd.test(e) ? new pd(e, t, n) : null
}
}, vd = {indent: 1, children: !0}, gd = /@keyframes\s+([\w-]+)/, yd = function () {
function e(e, t, n) {
this.type = "keyframes", this.at = "@keyframes", this.isProcessed = !1;
var r = e.match(gd);
r && r[1] ? this.name = r[1] : this.name = "noname", this.key = this.type + "-" + this.name, this.options = n;
var i = n.scoped, a = n.sheet, o = n.generateId;
for (var s in this.id = !1 === i ? this.name : sd(o(this, a)), this.rules = new Rd(Jc({}, n, {parent: this})), t) this.rules.add(s, t[s], Jc({}, n, {parent: this}));
this.rules.process()
}
return e.prototype.toString = function (e) {
void 0 === e && (e = vd);
var t = nd(e).linebreak;
if (null == e.indent && (e.indent = vd.indent), null == e.children && (e.children = vd.children), !1 === e.children) return this.at + " " + this.id + " {}";
var n = this.rules.toString(e);
return n && (n = "" + t + n + t), this.at + " " + this.id + " {" + n + "}"
}, e
}(), bd = /@keyframes\s+/, wd = /\$([\w-]+)/g, Sd = function (e, t) {
return "string" == typeof e ? e.replace(wd, function (e, n) {
return n in t ? t[n] : e
}) : e
}, _d = function (e, t, n) {
var r = e[t], i = Sd(r, n);
i !== r && (e[t] = i)
}, kd = {
onCreateRule: function (e, t, n) {
return "string" == typeof e && bd.test(e) ? new yd(e, t, n) : null
}, onProcessStyle: function (e, t, n) {
return "style" === t.type && n ? ("animation-name" in e && _d(e, "animation-name", n.keyframes), "animation" in e && _d(e, "animation", n.keyframes), e) : e
}, onChangeValue: function (e, t, n) {
var r = n.options.sheet;
if (!r) return e;
switch (t) {
case"animation":
case"animation-name":
return Sd(e, r.keyframes);
default:
return e
}
}
}, xd = function (e) {
function t() {
return e.apply(this, arguments) || this
}
return Xu(t, e), t.prototype.toString = function (e) {
var t = this.options.sheet, n = !!t && t.options.link ? Jc({}, e, {allowEmpty: !0}) : e;
return id(this.key, this.style, n)
}, t
}(ld), Pd = {
onCreateRule: function (e, t, n) {
return n.parent && "keyframes" === n.parent.type ? new xd(e, t, n) : null
}
}, Cd = function () {
function e(e, t, n) {
this.type = "font-face", this.at = "@font-face", this.isProcessed = !1, this.key = e, this.style = t, this.options = n
}
return e.prototype.toString = function (e) {
var t = nd(e).linebreak;
if (Array.isArray(this.style)) {
for (var n = "", r = 0; r < this.style.length; r++) n += id(this.at, this.style[r]), this.style[r + 1] && (n += t);
return n
}
return id(this.at, this.style, e)
}, e
}(), Ad = /@font-face/, Td = {
onCreateRule: function (e, t, n) {
return Ad.test(e) ? new Cd(e, t, n) : null
}
}, Ed = function () {
function e(e, t, n) {
this.type = "viewport", this.at = "@viewport", this.isProcessed = !1, this.key = e, this.style = t, this.options = n
}
return e.prototype.toString = function (e) {
return id(this.key, this.style, e)
}, e
}(), Dd = {
onCreateRule: function (e, t, n) {
return "@viewport" === e || "@-ms-viewport" === e ? new Ed(e, t, n) : null
}
}, Id = function () {
function e(e, t, n) {
this.type = "simple", this.isProcessed = !1, this.key = e, this.value = t, this.options = n
}
return e.prototype.toString = function (e) {
if (Array.isArray(this.value)) {
for (var t = "", n = 0; n < this.value.length; n++) t += this.key + " " + this.value[n] + ";", this.value[n + 1] && (t += "\n");
return t
}
return this.key + " " + this.value + ";"
}, e
}(), Ld = {"@charset": !0, "@import": !0, "@namespace": !0}, Od = [ud, md, kd, Pd, Td, Dd, {
onCreateRule: function (e, t, n) {
return e in Ld ? new Id(e, t, n) : null
}
}], Md = {process: !0}, Nd = {force: !0, process: !0}, Rd = function () {
function e(e) {
this.map = {}, this.raw = {}, this.index = [], this.counter = 0, this.options = e, this.classes = e.classes, this.keyframes = e.keyframes
}
var t = e.prototype;
return t.add = function (e, t, n) {
var r = this.options, i = r.parent, a = r.sheet, o = r.jss, s = r.Renderer, l = r.generateId, c = r.scoped,
u = Jc({
classes: this.classes,
parent: i,
sheet: a,
jss: o,
Renderer: s,
generateId: l,
scoped: c,
name: e,
keyframes: this.keyframes,
selector: void 0
}, n), d = e;
e in this.raw && (d = e + "-d" + this.counter++), this.raw[d] = t, d in this.classes && (u.selector = "." + sd(this.classes[d]));
var h = Zu(d, t, u);
if (!h) return null;
this.register(h);
var p = void 0 === u.index ? this.index.length : u.index;
return this.index.splice(p, 0, h), h
}, t.replace = function (e, t, n) {
var r = this.get(e), i = this.index.indexOf(r);
r && this.remove(r);
var a = n;
return -1 !== i && (a = Jc({}, n, {index: i})), this.add(e, t, a)
}, t.get = function (e) {
return this.map[e]
}, t.remove = function (e) {
this.unregister(e), delete this.raw[e.key], this.index.splice(this.index.indexOf(e), 1)
}, t.indexOf = function (e) {
return this.index.indexOf(e)
}, t.process = function () {
var e = this.options.jss.plugins;
this.index.slice(0).forEach(e.onProcessRule, e)
}, t.register = function (e) {
this.map[e.key] = e, e instanceof cd ? (this.map[e.selector] = e, e.id && (this.classes[e.key] = e.id)) : e instanceof yd && this.keyframes && (this.keyframes[e.name] = e.id)
}, t.unregister = function (e) {
delete this.map[e.key], e instanceof cd ? (delete this.map[e.selector], delete this.classes[e.key]) : e instanceof yd && delete this.keyframes[e.name]
}, t.update = function () {
var e, t, n;
if ("string" == typeof (arguments.length <= 0 ? void 0 : arguments[0]) ? (e = arguments.length <= 0 ? void 0 : arguments[0], t = arguments.length <= 1 ? void 0 : arguments[1], n = arguments.length <= 2 ? void 0 : arguments[2]) : (t = arguments.length <= 0 ? void 0 : arguments[0], n = arguments.length <= 1 ? void 0 : arguments[1], e = null), e) this.updateOne(this.get(e), t, n); else for (var r = 0; r < this.index.length; r++) this.updateOne(this.index[r], t, n)
}, t.updateOne = function (t, n, r) {
void 0 === r && (r = Md);
var i = this.options, a = i.jss.plugins, o = i.sheet;
if (t.rules instanceof e) t.rules.update(n, r); else {
var s = t.style;
if (a.onUpdate(n, t, o, r), r.process && s && s !== t.style) {
for (var l in a.onProcessStyle(t.style, t, o), t.style) {
var c = t.style[l];
c !== s[l] && t.prop(l, c, Nd)
}
for (var u in s) {
var d = t.style[u], h = s[u];
null == d && d !== h && t.prop(u, null, Nd)
}
}
}
}, t.toString = function (e) {
for (var t = "", n = this.options.sheet, r = !!n && n.options.link, i = nd(e).linebreak, a = 0; a < this.index.length; a++) {
var o = this.index[a].toString(e);
(o || r) && (t && (t += i), t += o)
}
return t
}, e
}(), Wd = function () {
function e(e, t) {
for (var n in this.attached = !1, this.deployed = !1, this.classes = {}, this.keyframes = {}, this.options = Jc({}, t, {
sheet: this,
parent: this,
classes: this.classes,
keyframes: this.keyframes
}), t.Renderer && (this.renderer = new t.Renderer(this)), this.rules = new Rd(this.options), e) this.rules.add(n, e[n]);
this.rules.process()
}
var t = e.prototype;
return t.attach = function () {
return this.attached ? this : (this.renderer && this.renderer.attach(), this.attached = !0, this.deployed || this.deploy(), this)
}, t.detach = function () {
return this.attached ? (this.renderer && this.renderer.detach(), this.attached = !1, this) : this
}, t.addRule = function (e, t, n) {
var r = this.queue;
this.attached && !r && (this.queue = []);
var i = this.rules.add(e, t, n);
return i ? (this.options.jss.plugins.onProcessRule(i), this.attached ? this.deployed ? (r ? r.push(i) : (this.insertRule(i), this.queue && (this.queue.forEach(this.insertRule, this), this.queue = void 0)), i) : i : (this.deployed = !1, i)) : null
}, t.replaceRule = function (e, t, n) {
var r = this.rules.get(e);
if (!r) return this.addRule(e, t, n);
var i = this.rules.replace(e, t, n);
return i && this.options.jss.plugins.onProcessRule(i), this.attached ? this.deployed ? (this.renderer && (i ? r.renderable && this.renderer.replaceRule(r.renderable, i) : this.renderer.deleteRule(r)), i) : i : (this.deployed = !1, i)
}, t.insertRule = function (e) {
this.renderer && this.renderer.insertRule(e)
}, t.addRules = function (e, t) {
var n = [];
for (var r in e) {
var i = this.addRule(r, e[r], t);
i && n.push(i)
}
return n
}, t.getRule = function (e) {
return this.rules.get(e)
}, t.deleteRule = function (e) {
var t = "object" === c(e) ? e : this.rules.get(e);
return !(!t || this.attached && !t.renderable) && (this.rules.remove(t), !(this.attached && t.renderable && this.renderer) || this.renderer.deleteRule(t.renderable))
}, t.indexOf = function (e) {
return this.rules.indexOf(e)
}, t.deploy = function () {
return this.renderer && this.renderer.deploy(), this.deployed = !0, this
}, t.update = function () {
var e;
return (e = this.rules).update.apply(e, arguments), this
}, t.updateOne = function (e, t, n) {
return this.rules.updateOne(e, t, n), this
}, t.toString = function (e) {
return this.rules.toString(e)
}, e
}(), Vd = function () {
function e() {
this.plugins = {internal: [], external: []}, this.registry = {}
}
var t = e.prototype;
return t.onCreateRule = function (e, t, n) {
for (var r = 0; r < this.registry.onCreateRule.length; r++) {
var i = this.registry.onCreateRule[r](e, t, n);
if (i) return i
}
return null
}, t.onProcessRule = function (e) {
if (!e.isProcessed) {
for (var t = e.options.sheet, n = 0; n < this.registry.onProcessRule.length; n++) this.registry.onProcessRule[n](e, t);
e.style && this.onProcessStyle(e.style, e, t), e.isProcessed = !0
}
}, t.onProcessStyle = function (e, t, n) {
for (var r = 0; r < this.registry.onProcessStyle.length; r++) t.style = this.registry.onProcessStyle[r](t.style, t, n)
}, t.onProcessSheet = function (e) {
for (var t = 0; t < this.registry.onProcessSheet.length; t++) this.registry.onProcessSheet[t](e)
}, t.onUpdate = function (e, t, n, r) {
for (var i = 0; i < this.registry.onUpdate.length; i++) this.registry.onUpdate[i](e, t, n, r)
}, t.onChangeValue = function (e, t, n) {
for (var r = e, i = 0; i < this.registry.onChangeValue.length; i++) r = this.registry.onChangeValue[i](r, t, n);
return r
}, t.use = function (e, t) {
void 0 === t && (t = {queue: "external"});
var n = this.plugins[t.queue];
-1 === n.indexOf(e) && (n.push(e), this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (e, t) {
for (var n in t) n in e && e[n].push(t[n]);
return e
}, {
onCreateRule: [],
onProcessRule: [],
onProcessStyle: [],
onProcessSheet: [],
onChangeValue: [],
onUpdate: []
}))
}, e
}(), Fd = new (function () {
function e() {
this.registry = []
}
var t = e.prototype;
return t.add = function (e) {
var t = this.registry, n = e.options.index;
if (-1 === t.indexOf(e)) if (0 === t.length || n >= this.index) t.push(e); else for (var r = 0; r < t.length; r++) if (t[r].options.index > n) return void t.splice(r, 0, e)
}, t.reset = function () {
this.registry = []
}, t.remove = function (e) {
var t = this.registry.indexOf(e);
this.registry.splice(t, 1)
}, t.toString = function (e) {
for (var t = void 0 === e ? {} : e, n = t.attached, r = Qc(t, ["attached"]), i = nd(r).linebreak, a = "", o = 0; o < this.registry.length; o++) {
var s = this.registry[o];
null != n && s.attached !== n || (a && (a += i), a += s.toString(r))
}
return a
}, Hu(e, [{
key: "index", get: function () {
return 0 === this.registry.length ? 0 : this.registry[this.registry.length - 1].options.index
}
}]), e
}()),
Gd = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window && window.Math === Math ? window : "undefined" != typeof self && self.Math === Math ? self : Function("return this")(),
Bd = "2f1acc6c3a606b082e5eef5e54414ffb";
null == Gd[Bd] && (Gd[Bd] = 0);
var Kd = Gd[Bd]++, jd = function (e) {
void 0 === e && (e = {});
var t = 0;
return function (n, r) {
t += 1;
var i = "", a = "";
return r && (r.options.classNamePrefix && (a = r.options.classNamePrefix), null != r.options.jss.id && (i = String(r.options.jss.id))), e.minify ? "" + (a || "c") + Kd + i + t : a + n.key + "-" + Kd + (i ? "-" + i : "") + "-" + t
}
}, zd = function (e) {
var t;
return function () {
return t || (t = e()), t
}
}, Ud = function (e, t) {
try {
return e.attributeStyleMap ? e.attributeStyleMap.get(t) : e.style.getPropertyValue(t)
} catch (e) {
return ""
}
}, qd = function (e, t, n) {
try {
var r = n;
if (Array.isArray(n) && (r = td(n, !0), "!important" === n[n.length - 1])) return e.style.setProperty(t, r, "important"), !0;
e.attributeStyleMap ? e.attributeStyleMap.set(t, r) : e.style.setProperty(t, r)
} catch (e) {
return !1
}
return !0
}, Hd = function (e, t) {
try {
e.attributeStyleMap ? e.attributeStyleMap.delete(t) : e.style.removeProperty(t)
} catch (e) {
}
}, Yd = function (e, t) {
return e.selectorText = t, e.selectorText === t
}, Xd = zd(function () {
return document.querySelector("head")
});
function Jd(e) {
var t = Fd.registry;
if (t.length > 0) {
var n = function (e, t) {
for (var n = 0; n < e.length; n++) {
var r = e[n];
if (r.attached && r.options.index > t.index && r.options.insertionPoint === t.insertionPoint) return r
}
return null
}(t, e);
if (n && n.renderer) return {parent: n.renderer.element.parentNode, node: n.renderer.element};
if ((n = function (e, t) {
for (var n = e.length - 1; n >= 0; n--) {
var r = e[n];
if (r.attached && r.options.insertionPoint === t.insertionPoint) return r
}
return null
}(t, e)) && n.renderer) return {parent: n.renderer.element.parentNode, node: n.renderer.element.nextSibling}
}
var r = e.insertionPoint;
if (r && "string" == typeof r) {
var i = function (e) {
for (var t = Xd(), n = 0; n < t.childNodes.length; n++) {
var r = t.childNodes[n];
if (8 === r.nodeType && r.nodeValue.trim() === e) return r
}
return null
}(r);
if (i) return {parent: i.parentNode, node: i.nextSibling}
}
return !1
}
var Qd = zd(function () {
var e = document.querySelector('meta[property="csp-nonce"]');
return e ? e.getAttribute("content") : null
}), $d = function (e, t, n) {
try {
"insertRule" in e ? e.insertRule(t, n) : "appendRule" in e && e.appendRule(t)
} catch (e) {
return !1
}
return e.cssRules[n]
}, Zd = function (e, t) {
var n = e.cssRules.length;
return void 0 === t || t > n ? n : t
}, eh = function () {
var e = document.createElement("style");
return e.textContent = "\n", e
}, th = function () {
function e(e) {
this.getPropertyValue = Ud, this.setProperty = qd, this.removeProperty = Hd, this.setSelector = Yd, this.hasInsertedRules = !1, this.cssRules = [], e && Fd.add(e), this.sheet = e;
var t = this.sheet ? this.sheet.options : {}, n = t.media, r = t.meta, i = t.element;
this.element = i || eh(), this.element.setAttribute("data-jss", ""), n && this.element.setAttribute("media", n), r && this.element.setAttribute("data-meta", r);
var a = Qd();
a && this.element.setAttribute("nonce", a)
}
var t = e.prototype;
return t.attach = function () {
if (!this.element.parentNode && this.sheet) {
!function (e, t) {
var n = t.insertionPoint, r = Jd(t);
if (!1 !== r && r.parent) r.parent.insertBefore(e, r.node); else if (n && "number" == typeof n.nodeType) {
var i = n, a = i.parentNode;
a && a.insertBefore(e, i.nextSibling)
} else Xd().appendChild(e)
}(this.element, this.sheet.options);
var e = Boolean(this.sheet && this.sheet.deployed);
this.hasInsertedRules && e && (this.hasInsertedRules = !1, this.deploy())
}
}, t.detach = function () {
if (this.sheet) {
var e = this.element.parentNode;
e && e.removeChild(this.element), this.sheet.options.link && (this.cssRules = [], this.element.textContent = "\n")
}
}, t.deploy = function () {
var e = this.sheet;
e && (e.options.link ? this.insertRules(e.rules) : this.element.textContent = "\n" + e.toString() + "\n")
}, t.insertRules = function (e, t) {
for (var n = 0; n < e.index.length; n++) this.insertRule(e.index[n], n, t)
}, t.insertRule = function (e, t, n) {
if (void 0 === n && (n = this.element.sheet), e.rules) {
var r = e, i = n;
if ("conditional" === e.type || "keyframes" === e.type) {
var a = Zd(n, t);
if (!1 === (i = $d(n, r.toString({children: !1}), a))) return !1;
this.refCssRule(e, a, i)
}
return this.insertRules(r.rules, i), i
}
var o = e.toString();
if (!o) return !1;
var s = Zd(n, t), l = $d(n, o, s);
return !1 !== l && (this.hasInsertedRules = !0, this.refCssRule(e, s, l), l)
}, t.refCssRule = function (e, t, n) {
e.renderable = n, e.options.parent instanceof Wd && this.cssRules.splice(t, 0, n)
}, t.deleteRule = function (e) {
var t = this.element.sheet, n = this.indexOf(e);
return -1 !== n && (t.deleteRule(n), this.cssRules.splice(n, 1), !0)
}, t.indexOf = function (e) {
return this.cssRules.indexOf(e)
}, t.replaceRule = function (e, t) {
var n = this.indexOf(e);
return -1 !== n && (this.element.sheet.deleteRule(n), this.cssRules.splice(n, 1), this.insertRule(t, n))
}, t.getRules = function () {
return this.element.sheet.cssRules
}, e
}(), nh = 0, rh = function () {
function e(e) {
this.id = nh++, this.version = "10.9.0", this.plugins = new Vd, this.options = {
id: {minify: !1},
createGenerateId: jd,
Renderer: Uu ? th : null,
plugins: []
}, this.generateId = jd({minify: !1});
for (var t = 0; t < Od.length; t++) this.plugins.use(Od[t], {queue: "internal"});
this.setup(e)
}
var t = e.prototype;
return t.setup = function (e) {
return void 0 === e && (e = {}), e.createGenerateId && (this.options.createGenerateId = e.createGenerateId), e.id && (this.options.id = Jc({}, this.options.id, e.id)), (e.createGenerateId || e.id) && (this.generateId = this.options.createGenerateId(this.options.id)), null != e.insertionPoint && (this.options.insertionPoint = e.insertionPoint), "Renderer" in e && (this.options.Renderer = e.Renderer), e.plugins && this.use.apply(this, e.plugins), this
}, t.createStyleSheet = function (e, t) {
void 0 === t && (t = {});
var n = t.index;
"number" != typeof n && (n = 0 === Fd.index ? 0 : Fd.index + 1);
var r = new Wd(e, Jc({}, t, {
jss: this,
generateId: t.generateId || this.generateId,
insertionPoint: this.options.insertionPoint,
Renderer: this.options.Renderer,
index: n
}));
return this.plugins.onProcessSheet(r), r
}, t.removeStyleSheet = function (e) {
return e.detach(), Fd.remove(e), this
}, t.createRule = function (e, t, n) {
if (void 0 === t && (t = {}), void 0 === n && (n = {}), "object" === c(e)) return this.createRule(void 0, e, t);
var r = Jc({}, n, {name: e, jss: this, Renderer: this.options.Renderer});
r.generateId || (r.generateId = this.generateId), r.classes || (r.classes = {}), r.keyframes || (r.keyframes = {});
var i = Zu(e, t, r);
return i && this.plugins.onProcessRule(i), i
}, t.use = function () {
for (var e = this, t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
return n.forEach(function (t) {
e.plugins.use(t)
}), this
}, e
}(), ih = function (e) {
return new rh(e)
}, ah = "object" === ("undefined" == typeof CSS ? "undefined" : c(CSS)) && null != CSS && "number" in CSS;
ih();
var oh = Date.now(), sh = "fnValues" + oh, lh = "fnStyle" + ++oh, ch = function () {
return {
onCreateRule: function (e, t, n) {
if ("function" != typeof t) return null;
var r = Zu(e, {}, n);
return r[lh] = t, r
}, onProcessStyle: function (e, t) {
if (sh in t || lh in t) return e;
var n = {};
for (var r in e) {
var i = e[r];
"function" == typeof i && (delete e[r], n[r] = i)
}
return t[sh] = n, e
}, onUpdate: function (e, t, n, r) {
var i = t, a = i[lh];
a && (i.style = a(e) || {});
var o = i[sh];
if (o) for (var s in o) i.prop(s, o[s](e), r)
}
}
}, uh = "@global", dh = "@global ", hh = function () {
function e(e, t, n) {
for (var r in this.type = "global", this.at = uh, this.isProcessed = !1, this.key = e, this.options = n, this.rules = new Rd(Jc({}, n, {parent: this})), t) this.rules.add(r, t[r]);
this.rules.process()
}
var t = e.prototype;
return t.getRule = function (e) {
return this.rules.get(e)
}, t.addRule = function (e, t, n) {
var r = this.rules.add(e, t, n);
return r && this.options.jss.plugins.onProcessRule(r), r
}, t.replaceRule = function (e, t, n) {
var r = this.rules.replace(e, t, n);
return r && this.options.jss.plugins.onProcessRule(r), r
}, t.indexOf = function (e) {
return this.rules.indexOf(e)
}, t.toString = function (e) {
return this.rules.toString(e)
}, e
}(), ph = function () {
function e(e, t, n) {
this.type = "global", this.at = uh, this.isProcessed = !1, this.key = e, this.options = n;
var r = e.substr(dh.length);
this.rule = n.jss.createRule(r, t, Jc({}, n, {parent: this}))
}
return e.prototype.toString = function (e) {
return this.rule ? this.rule.toString(e) : ""
}, e
}(), fh = /\s*,\s*/g;
function mh(e, t) {
for (var n = e.split(fh), r = "", i = 0; i < n.length; i++) r += t + " " + n[i].trim(), n[i + 1] && (r += ", ");
return r
}
function vh() {
return {
onCreateRule: function (e, t, n) {
if (!e) return null;
if (e === uh) return new hh(e, t, n);
if ("@" === e[0] && e.substr(0, dh.length) === dh) return new ph(e, t, n);
var r = n.parent;
return r && ("global" === r.type || r.options.parent && "global" === r.options.parent.type) && (n.scoped = !1), n.selector || !1 !== n.scoped || (n.selector = e), null
}, onProcessRule: function (e, t) {
"style" === e.type && t && (function (e, t) {
var n = e.options, r = e.style, i = r ? r[uh] : null;
if (i) {
for (var a in i) t.addRule(a, i[a], Jc({}, n, {selector: mh(a, e.selector)}));
delete r[uh]
}
}(e, t), function (e, t) {
var n = e.options, r = e.style;
for (var i in r) if ("@" === i[0] && i.substr(0, uh.length) === uh) {
var a = mh(i.substr(uh.length), e.selector);
t.addRule(a, r[i], Jc({}, n, {selector: a})), delete r[i]
}
}(e, t))
}
}
}
var gh = /\s*,\s*/g, yh = /&/g, bh = /\$([\w-]+)/g;
var wh = /[A-Z]/g, Sh = /^ms-/, _h = {};
function kh(e) {
return "-" + e.toLowerCase()
}
function xh(e) {
if (_h.hasOwnProperty(e)) return _h[e];
var t = e.replace(wh, kh);
return _h[e] = Sh.test(t) ? "-" + t : t
}
function Ph(e) {
var t = {};
for (var n in e) {
t[0 === n.indexOf("--") ? n : xh(n)] = e[n]
}
return e.fallbacks && (Array.isArray(e.fallbacks) ? t.fallbacks = e.fallbacks.map(Ph) : t.fallbacks = Ph(e.fallbacks)), t
}
var Ch = ah && CSS ? CSS.px : "px", Ah = ah && CSS ? CSS.ms : "ms", Th = ah && CSS ? CSS.percent : "%";
function Eh(e) {
var t = /(-[a-z])/g, n = function (e) {
return e[1].toUpperCase()
}, r = {};
for (var i in e) r[i] = e[i], r[i.replace(t, n)] = e[i];
return r
}
var Dh = Eh({
"animation-delay": Ah,
"animation-duration": Ah,
"background-position": Ch,
"background-position-x": Ch,
"background-position-y": Ch,
"background-size": Ch,
border: Ch,
"border-bottom": Ch,
"border-bottom-left-radius": Ch,
"border-bottom-right-radius": Ch,
"border-bottom-width": Ch,
"border-left": Ch,
"border-left-width": Ch,
"border-radius": Ch,
"border-right": Ch,
"border-right-width": Ch,
"border-top": Ch,
"border-top-left-radius": Ch,
"border-top-right-radius": Ch,
"border-top-width": Ch,
"border-width": Ch,
"border-block": Ch,
"border-block-end": Ch,
"border-block-end-width": Ch,
"border-block-start": Ch,
"border-block-start-width": Ch,
"border-block-width": Ch,
"border-inline": Ch,
"border-inline-end": Ch,
"border-inline-end-width": Ch,
"border-inline-start": Ch,
"border-inline-start-width": Ch,
"border-inline-width": Ch,
"border-start-start-radius": Ch,
"border-start-end-radius": Ch,
"border-end-start-radius": Ch,
"border-end-end-radius": Ch,
margin: Ch,
"margin-bottom": Ch,
"margin-left": Ch,
"margin-right": Ch,
"margin-top": Ch,
"margin-block": Ch,
"margin-block-end": Ch,
"margin-block-start": Ch,
"margin-inline": Ch,
"margin-inline-end": Ch,
"margin-inline-start": Ch,
padding: Ch,
"padding-bottom": Ch,
"padding-left": Ch,
"padding-right": Ch,
"padding-top": Ch,
"padding-block": Ch,
"padding-block-end": Ch,
"padding-block-start": Ch,
"padding-inline": Ch,
"padding-inline-end": Ch,
"padding-inline-start": Ch,
"mask-position-x": Ch,
"mask-position-y": Ch,
"mask-size": Ch,
height: Ch,
width: Ch,
"min-height": Ch,
"max-height": Ch,
"min-width": Ch,
"max-width": Ch,
bottom: Ch,
left: Ch,
top: Ch,
right: Ch,
inset: Ch,
"inset-block": Ch,
"inset-block-end": Ch,
"inset-block-start": Ch,
"inset-inline": Ch,
"inset-inline-end": Ch,
"inset-inline-start": Ch,
"box-shadow": Ch,
"text-shadow": Ch,
"column-gap": Ch,
"column-rule": Ch,
"column-rule-width": Ch,
"column-width": Ch,
"font-size": Ch,
"font-size-delta": Ch,
"letter-spacing": Ch,
"text-decoration-thickness": Ch,
"text-indent": Ch,
"text-stroke": Ch,
"text-stroke-width": Ch,
"word-spacing": Ch,
motion: Ch,
"motion-offset": Ch,
outline: Ch,
"outline-offset": Ch,
"outline-width": Ch,
perspective: Ch,
"perspective-origin-x": Th,
"perspective-origin-y": Th,
"transform-origin": Th,
"transform-origin-x": Th,
"transform-origin-y": Th,
"transform-origin-z": Th,
"transition-delay": Ah,
"transition-duration": Ah,
"vertical-align": Ch,
"flex-basis": Ch,
"shape-margin": Ch,
size: Ch,
gap: Ch,
grid: Ch,
"grid-gap": Ch,
"row-gap": Ch,
"grid-row-gap": Ch,
"grid-column-gap": Ch,
"grid-template-rows": Ch,
"grid-template-columns": Ch,
"grid-auto-rows": Ch,
"grid-auto-columns": Ch,
"box-shadow-x": Ch,
"box-shadow-y": Ch,
"box-shadow-blur": Ch,
"box-shadow-spread": Ch,
"font-line-height": Ch,
"text-shadow-x": Ch,
"text-shadow-y": Ch,
"text-shadow-blur": Ch
});
function Ih(e, t, n) {
if (null == t) return t;
if (Array.isArray(t)) for (var r = 0; r < t.length; r++) t[r] = Ih(e, t[r], n); else if ("object" === c(t)) if ("fallbacks" === e) for (var i in t) t[i] = Ih(i, t[i], n); else for (var a in t) t[a] = Ih(e + "-" + a, t[a], n); else if ("number" == typeof t && !1 === isNaN(t)) {
var o = n[e] || Dh[e];
return !o || 0 === t && o === Ch ? t.toString() : "function" == typeof o ? o(t).toString() : "" + t + o
}
return t
}
function Lh(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
return r
}
function Oh(e, t) {
if (e) {
if ("string" == typeof e) return Lh(e, t);
var n = Object.prototype.toString.call(e).slice(8, -1);
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Lh(e, t) : void 0
}
}
function Mh(e) {
return function (e) {
if (Array.isArray(e)) return Lh(e)
}(e) || function (e) {
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e)
}(e) || Oh(e) || function () {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()
}
var Nh = "", Rh = "", Wh = "", Vh = "", Fh = Uu && "ontouchstart" in document.documentElement;
if (Uu) {
var Gh = {Moz: "-moz-", ms: "-ms-", O: "-o-", Webkit: "-webkit-"}, Bh = document.createElement("p").style;
for (var Kh in Gh) if (Kh + "Transform" in Bh) {
Nh = Kh, Rh = Gh[Kh];
break
}
"Webkit" === Nh && "msHyphens" in Bh && (Nh = "ms", Rh = Gh.ms, Vh = "edge"), "Webkit" === Nh && "-apple-trailing-word" in Bh && (Wh = "apple")
}
var jh = {js: Nh, css: Rh, vendor: Wh, browser: Vh, isTouch: Fh};
var zh = {
noPrefill: ["appearance"], supportedProperty: function (e) {
return "appearance" === e && ("ms" === jh.js ? "-webkit-" + e : jh.css + e)
}
}, Uh = {
noPrefill: ["color-adjust"], supportedProperty: function (e) {
return "color-adjust" === e && ("Webkit" === jh.js ? jh.css + "print-" + e : e)
}
}, qh = /[-\s]+(.)?/g;
function Hh(e, t) {
return t ? t.toUpperCase() : ""
}
function Yh(e) {
return e.replace(qh, Hh)
}
function Xh(e) {
return Yh("-" + e)
}
var Jh, Qh = {
noPrefill: ["mask"], supportedProperty: function (e, t) {
if (!/^mask/.test(e)) return !1;
if ("Webkit" === jh.js) {
if (Yh("mask-image") in t) return e;
if (jh.js + Xh("mask-image") in t) return jh.css + e
}
return e
}
}, $h = {
noPrefill: ["text-orientation"], supportedProperty: function (e) {
return "text-orientation" === e && ("apple" !== jh.vendor || jh.isTouch ? e : jh.css + e)
}
}, Zh = {
noPrefill: ["transform"], supportedProperty: function (e, t, n) {
return "transform" === e && (n.transform ? e : jh.css + e)
}
}, ep = {
noPrefill: ["transition"], supportedProperty: function (e, t, n) {
return "transition" === e && (n.transition ? e : jh.css + e)
}
}, tp = {
noPrefill: ["writing-mode"], supportedProperty: function (e) {
return "writing-mode" === e && ("Webkit" === jh.js || "ms" === jh.js && "edge" !== jh.browser ? jh.css + e : e)
}
}, np = {
noPrefill: ["user-select"], supportedProperty: function (e) {
return "user-select" === e && ("Moz" === jh.js || "ms" === jh.js || "apple" === jh.vendor ? jh.css + e : e)
}
}, rp = {
supportedProperty: function (e, t) {
return !!/^break-/.test(e) && ("Webkit" === jh.js ? "WebkitColumn" + Xh(e) in t && jh.css + "column-" + e : "Moz" === jh.js && ("page" + Xh(e) in t && "page-" + e))
}
}, ip = {
supportedProperty: function (e, t) {
if (!/^(border|margin|padding)-inline/.test(e)) return !1;
if ("Moz" === jh.js) return e;
var n = e.replace("-inline", "");
return jh.js + Xh(n) in t && jh.css + n
}
}, ap = {
supportedProperty: function (e, t) {
return Yh(e) in t && e
}
}, op = {
supportedProperty: function (e, t) {
var n = Xh(e);
return "-" === e[0] ? e : "-" === e[0] && "-" === e[1] ? e : jh.js + n in t ? jh.css + e : "Webkit" !== jh.js && "Webkit" + n in t && "-webkit-" + e
}
}, sp = {
supportedProperty: function (e) {
return "scroll-snap" === e.substring(0, 11) && ("ms" === jh.js ? "" + jh.css + e : e)
}
}, lp = {
supportedProperty: function (e) {
return "overscroll-behavior" === e && ("ms" === jh.js ? jh.css + "scroll-chaining" : e)
}
}, cp = {
"flex-grow": "flex-positive",
"flex-shrink": "flex-negative",
"flex-basis": "flex-preferred-size",
"justify-content": "flex-pack",
order: "flex-order",
"align-items": "flex-align",
"align-content": "flex-line-pack"
}, up = {
supportedProperty: function (e, t) {
var n = cp[e];
return !!n && (jh.js + Xh(n) in t && jh.css + n)
}
}, dp = {
flex: "box-flex",
"flex-grow": "box-flex",
"flex-direction": ["box-orient", "box-direction"],
order: "box-ordinal-group",
"align-items": "box-align",
"flex-flow": ["box-orient", "box-direction"],
"justify-content": "box-pack"
}, hp = Object.keys(dp), pp = function (e) {
return jh.css + e
}, fp = [zh, Uh, Qh, $h, Zh, ep, tp, np, rp, ip, ap, op, sp, lp, up, {
supportedProperty: function (e, t, n) {
var r = n.multiple;
if (hp.indexOf(e) > -1) {
var i = dp[e];
if (!Array.isArray(i)) return jh.js + Xh(i) in t && jh.css + i;
if (!r) return !1;
for (var a = 0; a < i.length; a++) if (!(jh.js + Xh(i[0]) in t)) return !1;
return i.map(pp)
}
return !1
}
}], mp = fp.filter(function (e) {
return e.supportedProperty
}).map(function (e) {
return e.supportedProperty
}), vp = fp.filter(function (e) {
return e.noPrefill
}).reduce(function (e, t) {
return e.push.apply(e, Mh(t.noPrefill)), e
}, []), gp = {};
if (Uu) {
Jh = document.createElement("p");
var yp = window.getComputedStyle(document.documentElement, "");
for (var bp in yp) isNaN(bp) || (gp[yp[bp]] = yp[bp]);
vp.forEach(function (e) {
return delete gp[e]
})
}
function wp(e, t) {
if (void 0 === t && (t = {}), !Jh) return e;
if (null != gp[e]) return gp[e];
"transition" !== e && "transform" !== e || (t[e] = e in Jh.style);
for (var n = 0; n < mp.length && (gp[e] = mp[n](e, Jh.style, t), !gp[e]); n++) ;
try {
Jh.style[e] = ""
} catch (e) {
return !1
}
return gp[e]
}
var Sp, _p = {},
kp = {transition: 1, "transition-property": 1, "-webkit-transition": 1, "-webkit-transition-property": 1},
xp = /(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;
function Pp(e, t, n) {
if ("var" === t) return "var";
if ("all" === t) return "all";
if ("all" === n) return ", all";
var r = t ? wp(t) : ", " + wp(n);
return r || (t || n)
}
function Cp(e, t) {
var n = t;
if (!Sp || "content" === e) return t;
if ("string" != typeof n || !isNaN(parseInt(n, 10))) return n;
var r = e + n;
if (null != _p[r]) return _p[r];
try {
Sp.style[e] = n
} catch (e) {
return _p[r] = !1, !1
}
if (kp[e]) n = n.replace(xp, Pp); else if ("" === Sp.style[e] && ("-ms-flex" === (n = jh.css + n) && (Sp.style[e] = "-ms-flexbox"), Sp.style[e] = n, "" === Sp.style[e])) return _p[r] = !1, !1;
return Sp.style[e] = "", _p[r] = n, _p[r]
}
function Ap() {
function e(t) {
for (var n in t) {
var r = t[n];
if ("fallbacks" === n && Array.isArray(r)) t[n] = r.map(e); else {
var i = !1, a = wp(n);
a && a !== n && (i = !0);
var o = !1, s = Cp(a, td(r));
s && s !== r && (o = !0), (i || o) && (i && delete t[n], t[a || n] = s || r)
}
}
return t
}
return {
onProcessRule: function (e) {
if ("keyframes" === e.type) {
var t = e;
t.at = "-" === (n = t.at)[1] ? n : "ms" === jh.js ? n : "@" + jh.css + "keyframes" + n.substr(10)
}
var n
}, onProcessStyle: function (t, n) {
return "style" !== n.type ? t : e(t)
}, onChangeValue: function (e, t) {
return Cp(t, td(e)) || e
}
}
}
function Tp() {
return {
plugins: [ch(), vh(), function () {
function e(e, t) {
return function (n, r) {
var i = e.getRule(r) || t && t.getRule(r);
return i ? i.selector : r
}
}
function t(e, t) {
for (var n = t.split(gh), r = e.split(gh), i = "", a = 0; a < n.length; a++) for (var o = n[a], s = 0; s < r.length; s++) {
var l = r[s];
i && (i += ", "), i += -1 !== l.indexOf("&") ? l.replace(yh, o) : o + " " + l
}
return i
}
function n(e, t, n) {
if (n) return Jc({}, n, {index: n.index + 1});
var r = e.options.nestingLevel;
r = void 0 === r ? 1 : r + 1;
var i = Jc({}, e.options, {nestingLevel: r, index: t.indexOf(e) + 1});
return delete i.name, i
}
return {
onProcessStyle: function (r, i, a) {
if ("style" !== i.type) return r;
var o, s, l = i, c = l.options.parent;
for (var u in r) {
var d = -1 !== u.indexOf("&"), h = "@" === u[0];
if (d || h) {
if (o = n(l, c, o), d) {
var p = t(u, l.selector);
s || (s = e(c, a)), p = p.replace(bh, s);
var f = l.key + "-" + u;
"replaceRule" in c ? c.replaceRule(f, r[u], Jc({}, o, {selector: p})) : c.addRule(f, r[u], Jc({}, o, {selector: p}))
} else h && c.addRule(u, {}, o).addRule(l.key, r[u], {selector: l.selector});
delete r[u]
}
}
return r
}
}
}(), {
onProcessStyle: function (e) {
if (Array.isArray(e)) {
for (var t = 0; t < e.length; t++) e[t] = Ph(e[t]);
return e
}
return Ph(e)
}, onChangeValue: function (e, t, n) {
if (0 === t.indexOf("--")) return e;
var r = xh(t);
return t === r ? e : (n.prop(r, e), null)
}
}, function (e) {
void 0 === e && (e = {});
var t = Eh(e);
return {
onProcessStyle: function (e, n) {
if ("style" !== n.type) return e;
for (var r in e) e[r] = Ih(r, e[r], t);
return e
}, onChangeValue: function (e, n) {
return Ih(n, e, t)
}
}
}(), "undefined" == typeof window ? null : Ap(), (e = function (e, t) {
return e.length === t.length ? e > t ? 1 : -1 : e.length - t.length
}, {
onProcessStyle: function (t, n) {
if ("style" !== n.type) return t;
for (var r = {}, i = Object.keys(t).sort(e), a = 0; a < i.length; a++) r[i[a]] = t[i[a]];
return r
}
})]
};
var e
}
function Ep() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.baseClasses, n = e.newClasses;
if (e.Component, !n) return t;
var r = Jc({}, t);
return Object.keys(n).forEach(function (e) {
n[e] && (r[e] = "".concat(t[e], " ").concat(n[e]))
}), r
}
Uu && (Sp = document.createElement("p"));
var Dp = {
set: function (e, t, n, r) {
var i = e.get(t);
i || (i = new Map, e.set(t, i)), i.set(n, r)
}, get: function (e, t, n) {
var r = e.get(t);
return r ? r.get(n) : void 0
}, delete: function (e, t, n) {
e.get(t).delete(n)
}
}, Ip = q.createContext(null);
function Lp() {
return q.useContext(Ip)
}
var Op, Mp = ih(Tp()), Np = {
disableGeneration: !1,
generateClassName: Bu(),
jss: Mp,
sheetsCache: null,
sheetsManager: new Map,
sheetsRegistry: null
}, Rp = q.createContext(Np);
function Wp(e) {
var t = e.children, n = e.injectFirst, r = void 0 !== n && n, i = e.disableGeneration, a = void 0 !== i && i,
o = $c(e, ["children", "injectFirst", "disableGeneration"]),
s = Jc({}, q.useContext(Rp), {disableGeneration: a}, o);
if (!s.jss.options.insertionPoint && r && "undefined" != typeof window) {
if (!Op) {
var l = document.head;
Op = document.createComment("mui-inject-first"), l.insertBefore(Op, l.firstChild)
}
s.jss = ih({plugins: Tp().plugins, insertionPoint: Op})
}
return q.createElement(Rp.Provider, {value: s}, t)
}
var Vp = -1e9;
var Fp = {};
function Gp(e, t) {
var n = e.state, r = e.theme, i = e.stylesOptions, a = e.stylesCreator, o = e.name;
if (!i.disableGeneration) {
var s = Dp.get(i.sheetsManager, a, r);
s || (s = {refs: 0, staticSheet: null, dynamicStyles: null}, Dp.set(i.sheetsManager, a, r, s));
var l = Jc({}, a.options, i, {theme: r, flip: "boolean" == typeof i.flip ? i.flip : "rtl" === r.direction});
l.generateId = l.serverGenerateClassName || l.generateClassName;
var u = i.sheetsRegistry;
if (0 === s.refs) {
var d;
i.sheetsCache && (d = Dp.get(i.sheetsCache, a, r));
var h = a.create(r, o);
d || ((d = i.jss.createStyleSheet(h, Jc({link: !1}, l))).attach(), i.sheetsCache && Dp.set(i.sheetsCache, a, r, d)), u && u.add(d), s.staticSheet = d, s.dynamicStyles = function e(t) {
var n = null;
for (var r in t) {
var i = t[r], a = c(i);
if ("function" === a) n || (n = {}), n[r] = i; else if ("object" === a && null !== i && !Array.isArray(i)) {
var o = e(i);
o && (n || (n = {}), n[r] = o)
}
}
return n
}(h)
}
if (s.dynamicStyles) {
var p = i.jss.createStyleSheet(s.dynamicStyles, Jc({link: !0}, l));
p.update(t), p.attach(), n.dynamicSheet = p, n.classes = Ep({
baseClasses: s.staticSheet.classes,
newClasses: p.classes
}), u && u.add(p)
} else n.classes = s.staticSheet.classes;
s.refs += 1
}
}
function Bp(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = t.name, r = t.classNamePrefix,
i = t.Component, a = t.defaultTheme, o = void 0 === a ? Fp : a,
s = $c(t, ["name", "classNamePrefix", "Component", "defaultTheme"]), l = function (e) {
var t = "function" == typeof e;
return {
create: function (n, r) {
var i;
try {
i = t ? e(n) : e
} catch (e) {
throw e
}
if (!r || !n.overrides || !n.overrides[r]) return i;
var a = n.overrides[r], o = Jc({}, i);
return Object.keys(a).forEach(function (e) {
o[e] = su(o[e], a[e])
}), o
}, options: {}
}
}(e), c = n || r || "makeStyles";
l.options = {index: Vp += 1, name: n, meta: c, classNamePrefix: c};
return function () {
var e, t, r, a, c, u = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, d = Lp() || o,
h = Jc({}, q.useContext(Rp), s), p = q.useRef(), f = q.useRef();
return e = function () {
var e = {name: n, state: {}, stylesCreator: l, stylesOptions: h, theme: d};
return Gp(e, u), f.current = !1, p.current = e, function () {
!function (e) {
var t = e.state, n = e.theme, r = e.stylesOptions, i = e.stylesCreator;
if (!r.disableGeneration) {
var a = Dp.get(r.sheetsManager, i, n);
a.refs -= 1;
var o = r.sheetsRegistry;
0 === a.refs && (Dp.delete(r.sheetsManager, i, n), r.jss.removeStyleSheet(a.staticSheet), o && o.remove(a.staticSheet)), t.dynamicSheet && (r.jss.removeStyleSheet(t.dynamicSheet), o && o.remove(t.dynamicSheet))
}
}(e)
}
}, t = [d, l], a = q.useRef([]), c = q.useMemo(function () {
return {}
}, t), a.current !== c && (a.current = c, r = e()), q.useEffect(function () {
return function () {
r && r()
}
}, [c]), q.useEffect(function () {
f.current && function (e, t) {
var n = e.state;
n.dynamicSheet && n.dynamicSheet.update(t)
}(p.current, u), f.current = !0
}), function (e, t, n) {
var r = e.state;
if (e.stylesOptions.disableGeneration) return t || {};
r.cacheClasses || (r.cacheClasses = {value: null, lastProp: null, lastJSS: {}});
var i = !1;
return r.classes !== r.cacheClasses.lastJSS && (r.cacheClasses.lastJSS = r.classes, i = !0), t !== r.cacheClasses.lastProp && (r.cacheClasses.lastProp = t, i = !0), i && (r.cacheClasses.value = Ep({
baseClasses: r.cacheClasses.lastJSS,
newClasses: t,
Component: n
})), r.cacheClasses.value
}(p.current, u.classes, i)
}
}
var Kp = {exports: {}}, jp = {}, zp = "function" == typeof Symbol && Symbol.for,
Up = zp ? Symbol.for("react.element") : 60103, qp = zp ? Symbol.for("react.portal") : 60106,
Hp = zp ? Symbol.for("react.fragment") : 60107, Yp = zp ? Symbol.for("react.strict_mode") : 60108,
Xp = zp ? Symbol.for("react.profiler") : 60114, Jp = zp ? Symbol.for("react.provider") : 60109,
Qp = zp ? Symbol.for("react.context") : 60110, $p = zp ? Symbol.for("react.async_mode") : 60111,
Zp = zp ? Symbol.for("react.concurrent_mode") : 60111, ef = zp ? Symbol.for("react.forward_ref") : 60112,
tf = zp ? Symbol.for("react.suspense") : 60113, nf = zp ? Symbol.for("react.suspense_list") : 60120,
rf = zp ? Symbol.for("react.memo") : 60115, af = zp ? Symbol.for("react.lazy") : 60116,
of = zp ? Symbol.for("react.block") : 60121, sf = zp ? Symbol.for("react.fundamental") : 60117,
lf = zp ? Symbol.for("react.responder") : 60118, cf = zp ? Symbol.for("react.scope") : 60119;
function uf(e) {
if ("object" === c(e) && null !== e) {
var t = e.$$typeof;
switch (t) {
case Up:
switch (e = e.type) {
case $p:
case Zp:
case Hp:
case Xp:
case Yp:
case tf:
return e;
default:
switch (e = e && e.$$typeof) {
case Qp:
case ef:
case af:
case rf:
case Jp:
return e;
default:
return t
}
}
case qp:
return t
}
}
}
function df(e) {
return uf(e) === Zp
}
jp.AsyncMode = $p, jp.ConcurrentMode = Zp, jp.ContextConsumer = Qp, jp.ContextProvider = Jp, jp.Element = Up, jp.ForwardRef = ef, jp.Fragment = Hp, jp.Lazy = af, jp.Memo = rf, jp.Portal = qp, jp.Profiler = Xp, jp.StrictMode = Yp, jp.Suspense = tf, jp.isAsyncMode = function (e) {
return df(e) || uf(e) === $p
}, jp.isConcurrentMode = df, jp.isContextConsumer = function (e) {
return uf(e) === Qp
}, jp.isContextProvider = function (e) {
return uf(e) === Jp
}, jp.isElement = function (e) {
return "object" === c(e) && null !== e && e.$$typeof === Up
}, jp.isForwardRef = function (e) {
return uf(e) === ef
}, jp.isFragment = function (e) {
return uf(e) === Hp
}, jp.isLazy = function (e) {
return uf(e) === af
}, jp.isMemo = function (e) {
return uf(e) === rf
}, jp.isPortal = function (e) {
return uf(e) === qp
}, jp.isProfiler = function (e) {
return uf(e) === Xp
}, jp.isStrictMode = function (e) {
return uf(e) === Yp
}, jp.isSuspense = function (e) {
return uf(e) === tf
}, jp.isValidElementType = function (e) {
return "string" == typeof e || "function" == typeof e || e === Hp || e === Zp || e === Xp || e === Yp || e === tf || e === nf || "object" === c(e) && null !== e && (e.$$typeof === af || e.$$typeof === rf || e.$$typeof === Jp || e.$$typeof === Qp || e.$$typeof === ef || e.$$typeof === sf || e.$$typeof === lf || e.$$typeof === cf || e.$$typeof === of)
}, jp.typeOf = uf, Kp.exports = jp;
var hf = Kp.exports, pf = {
childContextTypes: !0,
contextType: !0,
contextTypes: !0,
defaultProps: !0,
displayName: !0,
getDefaultProps: !0,
getDerivedStateFromError: !0,
getDerivedStateFromProps: !0,
mixins: !0,
propTypes: !0,
type: !0
}, ff = {name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0},
mf = {$$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0}, vf = {};
function gf(e) {
return hf.isMemo(e) ? mf : vf[e.$$typeof] || pf
}
vf[hf.ForwardRef] = {$$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0}, vf[hf.Memo] = mf;
var yf = Object.defineProperty, bf = Object.getOwnPropertyNames, wf = Object.getOwnPropertySymbols,
Sf = Object.getOwnPropertyDescriptor, _f = Object.getPrototypeOf, kf = Object.prototype;
var xf = function e(t, n, r) {
if ("string" != typeof n) {
if (kf) {
var i = _f(n);
i && i !== kf && e(t, i, r)
}
var a = bf(n);
wf && (a = a.concat(wf(n)));
for (var o = gf(t), s = gf(n), l = 0; l < a.length; ++l) {
var c = a[l];
if (!(ff[c] || r && r[c] || s && s[c] || o && o[c])) {
var u = Sf(n, c);
try {
yf(t, c, u)
} catch (e) {
}
}
}
}
return t
};
function Pf(e) {
return function (t) {
var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, i = r.name, a = $c(r, ["name"]),
o = i, s = Bp("function" == typeof t ? function (e) {
return {
root: function (n) {
return t(Jc({theme: e}, n))
}
}
} : {root: t}, Jc({Component: e, name: i || e.displayName, classNamePrefix: o}, a));
t.filterProps && (n = t.filterProps, delete t.filterProps), t.propTypes && (t.propTypes, delete t.propTypes);
var l = q.forwardRef(function (t, r) {
var i, a, o, l = t.children, c = t.className, u = t.clone, d = t.component,
h = $c(t, ["children", "className", "clone", "component"]), p = Xc(s(t).root, c), f = h;
if (n && (i = f, a = n, o = {}, Object.keys(i).forEach(function (e) {
-1 === a.indexOf(e) && (o[e] = i[e])
}), f = o), u) return q.cloneElement(l, Jc({className: Xc(l.props.className, p)}, f));
if ("function" == typeof l) return l(Jc({className: p}, f));
var m = d || e;
return q.createElement(m, Jc({ref: r, className: p}, f), l)
});
return xf(l, e), l
}
}
var Cf = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return function (n) {
var r = t.defaultTheme, i = t.withTheme, a = void 0 !== i && i, o = t.name,
s = $c(t, ["defaultTheme", "withTheme", "name"]), l = o,
c = Bp(e, Jc({defaultTheme: r, Component: n, name: o || n.displayName, classNamePrefix: l}, s)),
u = q.forwardRef(function (e, t) {
e.classes;
var i, s = e.innerRef, l = $c(e, ["classes", "innerRef"]), u = c(Jc({}, n.defaultProps, e)), d = l;
return ("string" == typeof o || a) && (i = Lp() || r, o && (d = Ku({
theme: i,
name: o,
props: l
})), a && !d.theme && (d.theme = i)), q.createElement(n, Jc({ref: s || t, classes: u}, d))
});
return xf(u, n), u
}
}, Af = ["xs", "sm", "md", "lg", "xl"];
var Tf = {black: "#000", white: "#fff"}, Ef = {
50: "#fafafa",
100: "#f5f5f5",
200: "#eeeeee",
300: "#e0e0e0",
400: "#bdbdbd",
500: "#9e9e9e",
600: "#757575",
700: "#616161",
800: "#424242",
900: "#212121",
A100: "#d5d5d5",
A200: "#aaaaaa",
A400: "#303030",
A700: "#616161"
}, Df = {
50: "#e8eaf6",
100: "#c5cae9",
200: "#9fa8da",
300: "#7986cb",
400: "#5c6bc0",
500: "#3f51b5",
600: "#3949ab",
700: "#303f9f",
800: "#283593",
900: "#1a237e",
A100: "#8c9eff",
A200: "#536dfe",
A400: "#3d5afe",
A700: "#304ffe"
}, If = {
50: "#fce4ec",
100: "#f8bbd0",
200: "#f48fb1",
300: "#f06292",
400: "#ec407a",
500: "#e91e63",
600: "#d81b60",
700: "#c2185b",
800: "#ad1457",
900: "#880e4f",
A100: "#ff80ab",
A200: "#ff4081",
A400: "#f50057",
A700: "#c51162"
}, Lf = {
50: "#ffebee",
100: "#ffcdd2",
200: "#ef9a9a",
300: "#e57373",
400: "#ef5350",
500: "#f44336",
600: "#e53935",
700: "#d32f2f",
800: "#c62828",
900: "#b71c1c",
A100: "#ff8a80",
A200: "#ff5252",
A400: "#ff1744",
A700: "#d50000"
}, Of = {
50: "#fff3e0",
100: "#ffe0b2",
200: "#ffcc80",
300: "#ffb74d",
400: "#ffa726",
500: "#ff9800",
600: "#fb8c00",
700: "#f57c00",
800: "#ef6c00",
900: "#e65100",
A100: "#ffd180",
A200: "#ffab40",
A400: "#ff9100",
A700: "#ff6d00"
}, Mf = {
50: "#e3f2fd",
100: "#bbdefb",
200: "#90caf9",
300: "#64b5f6",
400: "#42a5f5",
500: "#2196f3",
600: "#1e88e5",
700: "#1976d2",
800: "#1565c0",
900: "#0d47a1",
A100: "#82b1ff",
A200: "#448aff",
A400: "#2979ff",
A700: "#2962ff"
}, Nf = {
50: "#e8f5e9",
100: "#c8e6c9",
200: "#a5d6a7",
300: "#81c784",
400: "#66bb6a",
500: "#4caf50",
600: "#43a047",
700: "#388e3c",
800: "#2e7d32",
900: "#1b5e20",
A100: "#b9f6ca",
A200: "#69f0ae",
A400: "#00e676",
A700: "#00c853"
};
function Rf(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;
return Math.min(Math.max(t, e), n)
}
function Wf(e) {
if (e.type) return e;
if ("#" === e.charAt(0)) return Wf(function (e) {
e = e.substr(1);
var t = new RegExp(".{1,".concat(e.length >= 6 ? 2 : 1, "}"), "g"), n = e.match(t);
return n && 1 === n[0].length && (n = n.map(function (e) {
return e + e
})), n ? "rgb".concat(4 === n.length ? "a" : "", "(").concat(n.map(function (e, t) {
return t < 3 ? parseInt(e, 16) : Math.round(parseInt(e, 16) / 255 * 1e3) / 1e3
}).join(", "), ")") : ""
}(e));
var t = e.indexOf("("), n = e.substring(0, t);
if (-1 === ["rgb", "rgba", "hsl", "hsla"].indexOf(n)) throw new Error(lu(3, e));
var r = e.substring(t + 1, e.length - 1).split(",");
return {
type: n, values: r = r.map(function (e) {
return parseFloat(e)
})
}
}
function Vf(e) {
var t = e.type, n = e.values;
return -1 !== t.indexOf("rgb") ? n = n.map(function (e, t) {
return t < 3 ? parseInt(e, 10) : e
}) : -1 !== t.indexOf("hsl") && (n[1] = "".concat(n[1], "%"), n[2] = "".concat(n[2], "%")), "".concat(t, "(").concat(n.join(", "), ")")
}
function Ff(e) {
var t = "hsl" === (e = Wf(e)).type ? Wf(function (e) {
var t = (e = Wf(e)).values, n = t[0], r = t[1] / 100, i = t[2] / 100, a = r * Math.min(i, 1 - i),
o = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : (e + n / 30) % 12;
return i - a * Math.max(Math.min(t - 3, 9 - t, 1), -1)
}, s = "rgb", l = [Math.round(255 * o(0)), Math.round(255 * o(8)), Math.round(255 * o(4))];
return "hsla" === e.type && (s += "a", l.push(t[3])), Vf({type: s, values: l})
}(e)).values : e.values;
return t = t.map(function (e) {
return (e /= 255) <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4)
}), Number((.2126 * t[0] + .7152 * t[1] + .0722 * t[2]).toFixed(3))
}
function Gf(e, t) {
return e = Wf(e), t = Rf(t), "rgb" !== e.type && "hsl" !== e.type || (e.type += "a"), e.values[3] = t, Vf(e)
}
function Bf(e, t) {
if (e = Wf(e), t = Rf(t), -1 !== e.type.indexOf("hsl")) e.values[2] *= 1 - t; else if (-1 !== e.type.indexOf("rgb")) for (var n = 0; n < 3; n += 1) e.values[n] *= 1 - t;
return Vf(e)
}
function Kf(e, t) {
if (e = Wf(e), t = Rf(t), -1 !== e.type.indexOf("hsl")) e.values[2] += (100 - e.values[2]) * t; else if (-1 !== e.type.indexOf("rgb")) for (var n = 0; n < 3; n += 1) e.values[n] += (255 - e.values[n]) * t;
return Vf(e)
}
var jf = {
text: {
primary: "rgba(0, 0, 0, 0.87)",
secondary: "rgba(0, 0, 0, 0.54)",
disabled: "rgba(0, 0, 0, 0.38)",
hint: "rgba(0, 0, 0, 0.38)"
},
divider: "rgba(0, 0, 0, 0.12)",
background: {paper: Tf.white, default: Ef[50]},
action: {
active: "rgba(0, 0, 0, 0.54)",
hover: "rgba(0, 0, 0, 0.04)",
hoverOpacity: .04,
selected: "rgba(0, 0, 0, 0.08)",
selectedOpacity: .08,
disabled: "rgba(0, 0, 0, 0.26)",
disabledBackground: "rgba(0, 0, 0, 0.12)",
disabledOpacity: .38,
focus: "rgba(0, 0, 0, 0.12)",
focusOpacity: .12,
activatedOpacity: .12
}
}, zf = {
text: {
primary: Tf.white,
secondary: "rgba(255, 255, 255, 0.7)",
disabled: "rgba(255, 255, 255, 0.5)",
hint: "rgba(255, 255, 255, 0.5)",
icon: "rgba(255, 255, 255, 0.5)"
},
divider: "rgba(255, 255, 255, 0.12)",
background: {paper: Ef[800], default: "#303030"},
action: {
active: Tf.white,
hover: "rgba(255, 255, 255, 0.08)",
hoverOpacity: .08,
selected: "rgba(255, 255, 255, 0.16)",
selectedOpacity: .16,
disabled: "rgba(255, 255, 255, 0.3)",
disabledBackground: "rgba(255, 255, 255, 0.12)",
disabledOpacity: .38,
focus: "rgba(255, 255, 255, 0.12)",
focusOpacity: .12,
activatedOpacity: .24
}
};
function Uf(e, t, n, r) {
var i = r.light || r, a = r.dark || 1.5 * r;
e[t] || (e.hasOwnProperty(n) ? e[t] = e[n] : "light" === t ? e.light = Kf(e.main, i) : "dark" === t && (e.dark = Bf(e.main, a)))
}
function qf(e) {
var t = e.primary, n = void 0 === t ? {light: Df[300], main: Df[500], dark: Df[700]} : t, r = e.secondary,
i = void 0 === r ? {light: If.A200, main: If.A400, dark: If.A700} : r, a = e.error,
o = void 0 === a ? {light: Lf[300], main: Lf[500], dark: Lf[700]} : a, s = e.warning,
l = void 0 === s ? {light: Of[300], main: Of[500], dark: Of[700]} : s, c = e.info,
u = void 0 === c ? {light: Mf[300], main: Mf[500], dark: Mf[700]} : c, d = e.success,
h = void 0 === d ? {light: Nf[300], main: Nf[500], dark: Nf[700]} : d, p = e.type,
f = void 0 === p ? "light" : p, m = e.contrastThreshold, v = void 0 === m ? 3 : m, g = e.tonalOffset,
y = void 0 === g ? .2 : g,
b = $c(e, ["primary", "secondary", "error", "warning", "info", "success", "type", "contrastThreshold", "tonalOffset"]);
function w(e) {
return function (e, t) {
var n = Ff(e), r = Ff(t);
return (Math.max(n, r) + .05) / (Math.min(n, r) + .05)
}(e, zf.text.primary) >= v ? zf.text.primary : jf.text.primary
}
var S = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 500,
n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 300,
r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 700;
if (!(e = Jc({}, e)).main && e[t] && (e.main = e[t]), !e.main) throw new Error(lu(4, t));
if ("string" != typeof e.main) throw new Error(lu(5, JSON.stringify(e.main)));
return Uf(e, "light", n, y), Uf(e, "dark", r, y), e.contrastText || (e.contrastText = w(e.main)), e
}, _ = {dark: zf, light: jf};
return su(Jc({
common: Tf,
type: f,
primary: S(n),
secondary: S(i, "A400", "A200", "A700"),
error: S(o),
warning: S(l),
info: S(u),
success: S(h),
grey: Ef,
contrastThreshold: v,
getContrastText: w,
augmentColor: S,
tonalOffset: y
}, _[f]), b)
}
function Hf(e) {
return Math.round(1e5 * e) / 1e5
}
function Yf(e) {
return Hf(e)
}
var Xf = {textTransform: "uppercase"}, Jf = '"Roboto", "Helvetica", "Arial", sans-serif';
var Qf = .2, $f = .14, Zf = .12;
function em() {
return ["".concat(arguments.length <= 0 ? void 0 : arguments[0], "px ").concat(arguments.length <= 1 ? void 0 : arguments[1], "px ").concat(arguments.length <= 2 ? void 0 : arguments[2], "px ").concat(arguments.length <= 3 ? void 0 : arguments[3], "px rgba(0,0,0,").concat(Qf, ")"), "".concat(arguments.length <= 4 ? void 0 : arguments[4], "px ").concat(arguments.length <= 5 ? void 0 : arguments[5], "px ").concat(arguments.length <= 6 ? void 0 : arguments[6], "px ").concat(arguments.length <= 7 ? void 0 : arguments[7], "px rgba(0,0,0,").concat($f, ")"), "".concat(arguments.length <= 8 ? void 0 : arguments[8], "px ").concat(arguments.length <= 9 ? void 0 : arguments[9], "px ").concat(arguments.length <= 10 ? void 0 : arguments[10], "px ").concat(arguments.length <= 11 ? void 0 : arguments[11], "px rgba(0,0,0,").concat(Zf, ")")].join(",")
}
var tm = ["none", em(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), em(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), em(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), em(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), em(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), em(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), em(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), em(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), em(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), em(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), em(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), em(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), em(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), em(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), em(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), em(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), em(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), em(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), em(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), em(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), em(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), em(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), em(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), em(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)],
nm = {borderRadius: 4};
function rm(e, t) {
return t ? su(e, t, {clone: !1}) : e
}
var im = {xs: 0, sm: 600, md: 960, lg: 1280, xl: 1920}, am = {
keys: ["xs", "sm", "md", "lg", "xl"], up: function (e) {
return "@media (min-width:".concat(im[e], "px)")
}
};
function om(e, t, n) {
if (Array.isArray(t)) {
var r = e.theme.breakpoints || am;
return t.reduce(function (e, i, a) {
return e[r.up(r.keys[a])] = n(t[a]), e
}, {})
}
if ("object" === au(t)) {
var i = e.theme.breakpoints || am;
return Object.keys(t).reduce(function (e, r) {
return e[i.up(r)] = n(t[r]), e
}, {})
}
return n(t)
}
function sm(e, t) {
return t && "string" == typeof t ? t.split(".").reduce(function (e, t) {
return e && e[t] ? e[t] : null
}, e) : null
}
function lm(e) {
var t = e.prop, n = e.cssProperty, r = void 0 === n ? e.prop : n, i = e.themeKey, a = e.transform,
o = function (e) {
if (null == e[t]) return null;
var n = e[t], o = sm(e.theme, i) || {};
return om(e, n, function (e) {
var t;
return "function" == typeof o ? t = o(e) : Array.isArray(o) ? t = o[e] || e : (t = sm(o, e) || e, a && (t = a(t))), !1 === r ? t : Zc({}, r, t)
})
};
return o.propTypes = {}, o.filterProps = [t], o
}
function cm() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
var r = function (e) {
return t.reduce(function (t, n) {
var r = n(e);
return r ? rm(t, r) : t
}, {})
};
return r.propTypes = {}, r.filterProps = t.reduce(function (e, t) {
return e.concat(t.filterProps)
}, []), r
}
function um(e) {
return "number" != typeof e ? e : "".concat(e, "px solid")
}
var dm = cm(lm({prop: "border", themeKey: "borders", transform: um}), lm({
prop: "borderTop",
themeKey: "borders",
transform: um
}), lm({prop: "borderRight", themeKey: "borders", transform: um}), lm({
prop: "borderBottom",
themeKey: "borders",
transform: um
}), lm({prop: "borderLeft", themeKey: "borders", transform: um}), lm({
prop: "borderColor",
themeKey: "palette"
}), lm({prop: "borderRadius", themeKey: "shape"}));
function hm(e, t) {
var n = {};
return Object.keys(e).forEach(function (r) {
-1 === t.indexOf(r) && (n[r] = e[r])
}), n
}
var pm = cm(lm({
prop: "displayPrint", cssProperty: !1, transform: function (e) {
return {"@media print": {display: e}}
}
}), lm({prop: "display"}), lm({prop: "overflow"}), lm({prop: "textOverflow"}), lm({prop: "visibility"}), lm({prop: "whiteSpace"})),
fm = cm(lm({prop: "flexBasis"}), lm({prop: "flexDirection"}), lm({prop: "flexWrap"}), lm({prop: "justifyContent"}), lm({prop: "alignItems"}), lm({prop: "alignContent"}), lm({prop: "order"}), lm({prop: "flex"}), lm({prop: "flexGrow"}), lm({prop: "flexShrink"}), lm({prop: "alignSelf"}), lm({prop: "justifyItems"}), lm({prop: "justifySelf"})),
mm = cm(lm({prop: "gridGap"}), lm({prop: "gridColumnGap"}), lm({prop: "gridRowGap"}), lm({prop: "gridColumn"}), lm({prop: "gridRow"}), lm({prop: "gridAutoFlow"}), lm({prop: "gridAutoColumns"}), lm({prop: "gridAutoRows"}), lm({prop: "gridTemplateColumns"}), lm({prop: "gridTemplateRows"}), lm({prop: "gridTemplateAreas"}), lm({prop: "gridArea"})),
vm = cm(lm({prop: "color", themeKey: "palette"}), lm({
prop: "bgcolor",
cssProperty: "backgroundColor",
themeKey: "palette"
})), gm = cm(lm({prop: "position"}), lm({
prop: "zIndex",
themeKey: "zIndex"
}), lm({prop: "top"}), lm({prop: "right"}), lm({prop: "bottom"}), lm({prop: "left"})),
ym = lm({prop: "boxShadow", themeKey: "shadows"});
function bm(e) {
return e <= 1 ? "".concat(100 * e, "%") : e
}
var wm = lm({prop: "width", transform: bm}), Sm = lm({prop: "maxWidth", transform: bm}),
_m = lm({prop: "minWidth", transform: bm}), km = lm({prop: "height", transform: bm}),
xm = lm({prop: "maxHeight", transform: bm}), Pm = lm({prop: "minHeight", transform: bm});
lm({prop: "size", cssProperty: "width", transform: bm}), lm({prop: "size", cssProperty: "height", transform: bm});
var Cm = cm(wm, Sm, _m, km, xm, Pm, lm({prop: "boxSizing"}));
function Am(e, t) {
return function (e) {
if (Array.isArray(e)) return e
}(e) || function (e, t) {
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
if (null != n) {
var r, i, a = [], o = !0, s = !1;
try {
for (n = n.call(e); !(o = (r = n.next()).done) && (a.push(r.value), !t || a.length !== t); o = !0) ;
} catch (e) {
s = !0, i = e
} finally {
try {
o || null == n.return || n.return()
} finally {
if (s) throw i
}
}
return a
}
}(e, t) || Oh(e, t) || function () {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()
}
var Tm, Em, Dm = {m: "margin", p: "padding"},
Im = {t: "Top", r: "Right", b: "Bottom", l: "Left", x: ["Left", "Right"], y: ["Top", "Bottom"]},
Lm = {marginX: "mx", marginY: "my", paddingX: "px", paddingY: "py"}, Om = (Tm = function (e) {
if (e.length > 2) {
if (!Lm[e]) return [e];
e = Lm[e]
}
var t = Am(e.split(""), 2), n = t[0], r = t[1], i = Dm[n], a = Im[r] || "";
return Array.isArray(a) ? a.map(function (e) {
return i + e
}) : [i + a]
}, Em = {}, function (e) {
return void 0 === Em[e] && (Em[e] = Tm(e)), Em[e]
}),
Mm = ["m", "mt", "mr", "mb", "ml", "mx", "my", "p", "pt", "pr", "pb", "pl", "px", "py", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY"];
function Nm(e) {
var t = e.spacing || 8;
return "number" == typeof t ? function (e) {
return t * e
} : Array.isArray(t) ? function (e) {
return t[e]
} : "function" == typeof t ? t : function () {
}
}
function Rm(e, t) {
return function (n) {
return e.reduce(function (e, r) {
return e[r] = function (e, t) {
if ("string" == typeof t || null == t) return t;
var n = e(Math.abs(t));
return t >= 0 ? n : "number" == typeof n ? -n : "-".concat(n)
}(t, n), e
}, {})
}
}
function Wm(e) {
var t = Nm(e.theme);
return Object.keys(e).map(function (n) {
if (-1 === Mm.indexOf(n)) return null;
var r = Rm(Om(n), t), i = e[n];
return om(e, i, r)
}).reduce(rm, {})
}
Wm.propTypes = {}, Wm.filterProps = Mm;
var Vm = cm(lm({prop: "fontFamily", themeKey: "typography"}), lm({
prop: "fontSize",
themeKey: "typography"
}), lm({prop: "fontStyle", themeKey: "typography"}), lm({
prop: "fontWeight",
themeKey: "typography"
}), lm({prop: "letterSpacing"}), lm({prop: "lineHeight"}), lm({prop: "textAlign"}));
var Fm = {
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
}, Gm = {
shortest: 150,
shorter: 200,
short: 250,
standard: 300,
complex: 375,
enteringScreen: 225,
leavingScreen: 195
};
function Bm(e) {
return "".concat(Math.round(e), "ms")
}
var Km = {
easing: Fm, duration: Gm, create: function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ["all"],
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = t.duration,
r = void 0 === n ? Gm.standard : n, i = t.easing, a = void 0 === i ? Fm.easeInOut : i, o = t.delay,
s = void 0 === o ? 0 : o;
return $c(t, ["duration", "easing", "delay"]), (Array.isArray(e) ? e : [e]).map(function (e) {
return "".concat(e, " ").concat("string" == typeof r ? r : Bm(r), " ").concat(a, " ").concat("string" == typeof s ? s : Bm(s))
}).join(",")
}, getAutoHeightDuration: function (e) {
if (!e) return 0;
var t = e / 36;
return Math.round(10 * (4 + 15 * Math.pow(t, .25) + t / 5))
}
}, jm = {
mobileStepper: 1e3,
speedDial: 1050,
appBar: 1100,
drawer: 1200,
modal: 1300,
snackbar: 1400,
tooltip: 1500
};
var zm = function () {
for (var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.breakpoints, n = void 0 === t ? {} : t, r = e.mixins, i = void 0 === r ? {} : r, a = e.palette, o = void 0 === a ? {} : a, s = e.spacing, l = e.typography, c = void 0 === l ? {} : l, u = $c(e, ["breakpoints", "mixins", "palette", "spacing", "typography"]), d = qf(o), h = function (e) {
var t = e.values, n = void 0 === t ? {xs: 0, sm: 600, md: 960, lg: 1280, xl: 1920} : t, r = e.unit,
i = void 0 === r ? "px" : r, a = e.step, o = void 0 === a ? 5 : a, s = $c(e, ["values", "unit", "step"]);
function l(e) {
var t = "number" == typeof n[e] ? n[e] : e;
return "@media (min-width:".concat(t).concat(i, ")")
}
function c(e, t) {
var r = Af.indexOf(t);
return r === Af.length - 1 ? l(e) : "@media (min-width:".concat("number" == typeof n[e] ? n[e] : e).concat(i, ") and ") + "(max-width:".concat((-1 !== r && "number" == typeof n[Af[r + 1]] ? n[Af[r + 1]] : t) - o / 100).concat(i, ")")
}
return Jc({
keys: Af, values: n, up: l, down: function (e) {
var t = Af.indexOf(e) + 1, r = n[Af[t]];
return t === Af.length ? l("xs") : "@media (max-width:".concat(("number" == typeof r && t > 0 ? r : e) - o / 100).concat(i, ")")
}, between: c, only: function (e) {
return c(e, e)
}, width: function (e) {
return n[e]
}
}, s)
}(n), p = function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 8;
if (e.mui) return e;
var t = Nm({spacing: e}), n = function () {
for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
return 0 === n.length ? t(1) : 1 === n.length ? t(n[0]) : n.map(function (e) {
if ("string" == typeof e) return e;
var n = t(e);
return "number" == typeof n ? "".concat(n, "px") : n
}).join(" ")
};
return Object.defineProperty(n, "unit", {
get: function () {
return e
}
}), n.mui = !0, n
}(s), f = su({
breakpoints: h, direction: "ltr", mixins: function (e, t, n) {
var r;
return Jc({
gutters: function () {
var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.", "You can use the source of the mixin directly:", "\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")), Jc({
paddingLeft: t(2),
paddingRight: t(2)
}, n, Zc({}, e.up("sm"), Jc({paddingLeft: t(3), paddingRight: t(3)}, n[e.up("sm")])))
},
toolbar: (r = {minHeight: 56}, Zc(r, "".concat(e.up("xs"), " and (orientation: landscape)"), {minHeight: 48}), Zc(r, e.up("sm"), {minHeight: 64}), r)
}, n)
}(h, p, i), overrides: {}, palette: d, props: {}, shadows: tm, typography: function (e, t) {
var n = "function" == typeof t ? t(e) : t, r = n.fontFamily, i = void 0 === r ? Jf : r, a = n.fontSize,
o = void 0 === a ? 14 : a, s = n.fontWeightLight, l = void 0 === s ? 300 : s, c = n.fontWeightRegular,
u = void 0 === c ? 400 : c, d = n.fontWeightMedium, h = void 0 === d ? 500 : d, p = n.fontWeightBold,
f = void 0 === p ? 700 : p, m = n.htmlFontSize, v = void 0 === m ? 16 : m, g = n.allVariants, y = n.pxToRem,
b = $c(n, ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"]),
w = o / 14, S = y || function (e) {
return "".concat(e / v * w, "rem")
}, _ = function (e, t, n, r, a) {
return Jc({
fontFamily: i,
fontWeight: e,
fontSize: S(t),
lineHeight: n
}, i === Jf ? {letterSpacing: "".concat(Hf(r / t), "em")} : {}, a, g)
}, k = {
h1: _(l, 96, 1.167, -1.5),
h2: _(l, 60, 1.2, -.5),
h3: _(u, 48, 1.167, 0),
h4: _(u, 34, 1.235, .25),
h5: _(u, 24, 1.334, 0),
h6: _(h, 20, 1.6, .15),
subtitle1: _(u, 16, 1.75, .15),
subtitle2: _(h, 14, 1.57, .1),
body1: _(u, 16, 1.5, .15),
body2: _(u, 14, 1.43, .15),
button: _(h, 14, 1.75, .4, Xf),
caption: _(u, 12, 1.66, .4),
overline: _(u, 12, 2.66, 1, Xf)
};
return su(Jc({
htmlFontSize: v,
pxToRem: S,
round: Yf,
fontFamily: i,
fontSize: o,
fontWeightLight: l,
fontWeightRegular: u,
fontWeightMedium: h,
fontWeightBold: f
}, k), b, {clone: !1})
}(d, c), spacing: p, shape: nm, transitions: Km, zIndex: jm
}, u), m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), g = 1; g < m; g++) v[g - 1] = arguments[g];
return f = v.reduce(function (e, t) {
return su(e, t)
}, f)
}();
function Um(e, t) {
return Cf(e, Jc({defaultTheme: zm}, t))
}
function qm(e) {
if ("string" != typeof e) throw new Error(lu(7));
return e.charAt(0).toUpperCase() + e.slice(1)
}
function Hm(e) {
return e && e.ownerDocument || document
}
function Ym(e, t) {
"function" == typeof e ? e(t) : e && (e.current = t)
}
function Xm(e, t) {
return u.exports.useMemo(function () {
return null == e && null == t ? null : function (n) {
Ym(e, n), Ym(t, n)
}
}, [e, t])
}
var Jm = "undefined" != typeof window ? u.exports.useLayoutEffect : u.exports.useEffect,
Qm = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.container, i = e.disablePortal, a = void 0 !== i && i, o = e.onRendered,
s = u.exports.useState(null), l = s[0], c = s[1], d = Xm(u.exports.isValidElement(n) ? n.ref : null, t);
return Jm(function () {
a || c(function (e) {
return e = "function" == typeof e ? e() : e, H.exports.findDOMNode(e)
}(r) || document.body)
}, [r, a]), Jm(function () {
if (l && !a) return Ym(t, l), function () {
Ym(t, null)
}
}, [t, l, a]), Jm(function () {
o && (l || a) && o()
}, [o, l, a]), a ? u.exports.isValidElement(n) ? u.exports.cloneElement(n, {ref: d}) : n : l ? H.exports.createPortal(n, l) : l
});
function $m() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
return t.reduce(function (e, t) {
return null == t ? e : function () {
for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
e.apply(this, r), t.apply(this, r)
}
}, function () {
})
}
var Zm = "undefined" != typeof window ? u.exports.useLayoutEffect : u.exports.useEffect;
function ev(e) {
var t = u.exports.useRef(e);
return Zm(function () {
t.current = e
}), u.exports.useCallback(function () {
return t.current.apply(void 0, arguments)
}, [])
}
function tv() {
var e = document.createElement("div");
e.style.width = "99px", e.style.height = "99px", e.style.position = "absolute", e.style.top = "-9999px", e.style.overflow = "scroll", document.body.appendChild(e);
var t = e.offsetWidth - e.clientWidth;
return document.body.removeChild(e), t
}
function nv(e) {
return Hm(e).defaultView || window
}
function rv(e, t) {
t ? e.setAttribute("aria-hidden", "true") : e.removeAttribute("aria-hidden")
}
function iv(e) {
return parseInt(window.getComputedStyle(e)["padding-right"], 10) || 0
}
function av(e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : [],
i = arguments.length > 4 ? arguments[4] : void 0, a = [t, n].concat(Mh(r)), o = ["TEMPLATE", "SCRIPT", "STYLE"];
[].forEach.call(e.children, function (e) {
1 === e.nodeType && -1 === a.indexOf(e) && -1 === o.indexOf(e.tagName) && rv(e, i)
})
}
function ov(e, t) {
var n = -1;
return e.some(function (e, r) {
return !!t(e) && (n = r, !0)
}), n
}
function sv(e, t) {
var n, r = [], i = [], a = e.container;
if (!t.disableScrollLock) {
if (function (e) {
var t = Hm(e);
return t.body === e ? nv(t).innerWidth > t.documentElement.clientWidth : e.scrollHeight > e.clientHeight
}(a)) {
var o = tv();
r.push({
value: a.style.paddingRight,
key: "padding-right",
el: a
}), a.style["padding-right"] = "".concat(iv(a) + o, "px"), n = Hm(a).querySelectorAll(".mui-fixed"), [].forEach.call(n, function (e) {
i.push(e.style.paddingRight), e.style.paddingRight = "".concat(iv(e) + o, "px")
})
}
var s = a.parentElement,
l = "HTML" === s.nodeName && "scroll" === window.getComputedStyle(s)["overflow-y"] ? s : a;
r.push({value: l.style.overflow, key: "overflow", el: l}), l.style.overflow = "hidden"
}
return function () {
n && [].forEach.call(n, function (e, t) {
i[t] ? e.style.paddingRight = i[t] : e.style.removeProperty("padding-right")
}), r.forEach(function (e) {
var t = e.value, n = e.el, r = e.key;
t ? n.style.setProperty(r, t) : n.style.removeProperty(r)
})
}
}
var lv = function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.modals = [], this.containers = []
}
return Hu(e, [{
key: "add", value: function (e, t) {
var n = this.modals.indexOf(e);
if (-1 !== n) return n;
n = this.modals.length, this.modals.push(e), e.modalRef && rv(e.modalRef, !1);
var r = function (e) {
var t = [];
return [].forEach.call(e.children, function (e) {
e.getAttribute && "true" === e.getAttribute("aria-hidden") && t.push(e)
}), t
}(t);
av(t, e.mountNode, e.modalRef, r, !0);
var i = ov(this.containers, function (e) {
return e.container === t
});
return -1 !== i ? (this.containers[i].modals.push(e), n) : (this.containers.push({
modals: [e],
container: t,
restore: null,
hiddenSiblingNodes: r
}), n)
}
}, {
key: "mount", value: function (e, t) {
var n = ov(this.containers, function (t) {
return -1 !== t.modals.indexOf(e)
}), r = this.containers[n];
r.restore || (r.restore = sv(r, t))
}
}, {
key: "remove", value: function (e) {
var t = this.modals.indexOf(e);
if (-1 === t) return t;
var n = ov(this.containers, function (t) {
return -1 !== t.modals.indexOf(e)
}), r = this.containers[n];
if (r.modals.splice(r.modals.indexOf(e), 1), this.modals.splice(t, 1), 0 === r.modals.length) r.restore && r.restore(), e.modalRef && rv(e.modalRef, !0), av(r.container, e.mountNode, e.modalRef, r.hiddenSiblingNodes, !1), this.containers.splice(n, 1); else {
var i = r.modals[r.modals.length - 1];
i.modalRef && rv(i.modalRef, !1)
}
return t
}
}, {
key: "isTopModal", value: function (e) {
return this.modals.length > 0 && this.modals[this.modals.length - 1] === e
}
}]), e
}();
function cv(e) {
var t = e.children, n = e.disableAutoFocus, r = void 0 !== n && n, i = e.disableEnforceFocus,
a = void 0 !== i && i, o = e.disableRestoreFocus, s = void 0 !== o && o, l = e.getDoc, c = e.isEnabled,
d = e.open, h = u.exports.useRef(), p = u.exports.useRef(null), f = u.exports.useRef(null),
m = u.exports.useRef(), v = u.exports.useRef(null), g = u.exports.useCallback(function (e) {
v.current = H.exports.findDOMNode(e)
}, []), y = Xm(t.ref, g), b = u.exports.useRef();
return u.exports.useEffect(function () {
b.current = d
}, [d]), !b.current && d && "undefined" != typeof window && (m.current = l().activeElement), u.exports.useEffect(function () {
if (d) {
var e = Hm(v.current);
r || !v.current || v.current.contains(e.activeElement) || (v.current.hasAttribute("tabIndex") || v.current.setAttribute("tabIndex", -1), v.current.focus());
var t = function () {
null !== v.current && (e.hasFocus() && !a && c() && !h.current ? v.current && !v.current.contains(e.activeElement) && v.current.focus() : h.current = !1)
}, n = function (t) {
!a && c() && 9 === t.keyCode && e.activeElement === v.current && (h.current = !0, t.shiftKey ? f.current.focus() : p.current.focus())
};
e.addEventListener("focus", t, !0), e.addEventListener("keydown", n, !0);
var i = setInterval(function () {
t()
}, 50);
return function () {
clearInterval(i), e.removeEventListener("focus", t, !0), e.removeEventListener("keydown", n, !0), s || (m.current && m.current.focus && m.current.focus(), m.current = null)
}
}
}, [r, a, s, c, d]), u.exports.createElement(u.exports.Fragment, null, u.exports.createElement("div", {
tabIndex: 0,
ref: p,
"data-test": "sentinelStart"
}), u.exports.cloneElement(t, {ref: y}), u.exports.createElement("div", {
tabIndex: 0,
ref: f,
"data-test": "sentinelEnd"
}))
}
var uv = {
root: {
zIndex: -1,
position: "fixed",
right: 0,
bottom: 0,
top: 0,
left: 0,
backgroundColor: "rgba(0, 0, 0, 0.5)",
WebkitTapHighlightColor: "transparent"
}, invisible: {backgroundColor: "transparent"}
}, dv = u.exports.forwardRef(function (e, t) {
var n = e.invisible, r = void 0 !== n && n, i = e.open, a = $c(e, ["invisible", "open"]);
return i ? u.exports.createElement("div", Jc({
"aria-hidden": !0,
ref: t
}, a, {style: Jc({}, uv.root, r ? uv.invisible : {}, a.style)})) : null
});
var hv = new lv, pv = u.exports.forwardRef(function (e, t) {
var n = Lp(), r = Ku({name: "MuiModal", props: Jc({}, e), theme: n}), i = r.BackdropComponent,
a = void 0 === i ? dv : i, o = r.BackdropProps, s = r.children, l = r.closeAfterTransition,
c = void 0 !== l && l, d = r.container, h = r.disableAutoFocus, p = void 0 !== h && h,
f = r.disableBackdropClick, m = void 0 !== f && f, v = r.disableEnforceFocus, g = void 0 !== v && v,
y = r.disableEscapeKeyDown, b = void 0 !== y && y, w = r.disablePortal, S = void 0 !== w && w,
_ = r.disableRestoreFocus, k = void 0 !== _ && _, x = r.disableScrollLock, P = void 0 !== x && x,
C = r.hideBackdrop, A = void 0 !== C && C, T = r.keepMounted, E = void 0 !== T && T, D = r.manager,
I = void 0 === D ? hv : D, L = r.onBackdropClick, O = r.onClose, M = r.onEscapeKeyDown, N = r.onRendered,
R = r.open,
W = $c(r, ["BackdropComponent", "BackdropProps", "children", "closeAfterTransition", "container", "disableAutoFocus", "disableBackdropClick", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onEscapeKeyDown", "onRendered", "open"]),
V = u.exports.useState(!0), F = V[0], G = V[1], B = u.exports.useRef({}), K = u.exports.useRef(null),
j = u.exports.useRef(null), z = Xm(j, t), U = function (e) {
return !!e.children && e.children.props.hasOwnProperty("in")
}(r), q = function () {
return Hm(K.current)
}, Y = function () {
return B.current.modalRef = j.current, B.current.mountNode = K.current, B.current
}, X = function () {
I.mount(Y(), {disableScrollLock: P}), j.current.scrollTop = 0
}, J = ev(function () {
var e = function (e) {
return e = "function" == typeof e ? e() : e, H.exports.findDOMNode(e)
}(d) || q().body;
I.add(Y(), e), j.current && X()
}), Q = u.exports.useCallback(function () {
return I.isTopModal(Y())
}, [I]), $ = ev(function (e) {
K.current = e, e && (N && N(), R && Q() ? X() : rv(j.current, !0))
}), Z = u.exports.useCallback(function () {
I.remove(Y())
}, [I]);
if (u.exports.useEffect(function () {
return function () {
Z()
}
}, [Z]), u.exports.useEffect(function () {
R ? J() : U && c || Z()
}, [R, Z, U, c, J]), !E && !R && (!U || F)) return null;
var ee = function (e) {
return {
root: {position: "fixed", zIndex: e.zIndex.modal, right: 0, bottom: 0, top: 0, left: 0},
hidden: {visibility: "hidden"}
}
}(n || {zIndex: jm}), te = {};
return void 0 === s.props.tabIndex && (te.tabIndex = s.props.tabIndex || "-1"), U && (te.onEnter = $m(function () {
G(!1)
}, s.props.onEnter), te.onExited = $m(function () {
G(!0), c && Z()
}, s.props.onExited)), u.exports.createElement(Qm, {
ref: $,
container: d,
disablePortal: S
}, u.exports.createElement("div", Jc({
ref: z, onKeyDown: function (e) {
"Escape" === e.key && Q() && (M && M(e), b || (e.stopPropagation(), O && O(e, "escapeKeyDown")))
}, role: "presentation"
}, W, {style: Jc({}, ee.root, !R && F ? ee.hidden : {}, W.style)}), A ? null : u.exports.createElement(a, Jc({
open: R,
onClick: function (e) {
e.target === e.currentTarget && (L && L(e), !m && O && O(e, "backdropClick"))
}
}, o)), u.exports.createElement(cv, {
disableEnforceFocus: g,
disableAutoFocus: p,
disableRestoreFocus: k,
getDoc: q,
isEnabled: Q,
open: R
}, u.exports.cloneElement(s, te))))
}), fv = !1, mv = q.createContext(null), vv = "unmounted", gv = "exited", yv = "entering", bv = "entered",
wv = function (e) {
function t(t, n) {
var r;
r = e.call(this, t, n) || this;
var i, a = n && !n.isMounting ? t.enter : t.appear;
return r.appearStatus = null, t.in ? a ? (i = gv, r.appearStatus = yv) : i = bv : i = t.unmountOnExit || t.mountOnEnter ? vv : gv, r.state = {status: i}, r.nextCallback = null, r
}
Xu(t, e), t.getDerivedStateFromProps = function (e, t) {
return e.in && t.status === vv ? {status: gv} : null
};
var n = t.prototype;
return n.componentDidMount = function () {
this.updateStatus(!0, this.appearStatus)
}, n.componentDidUpdate = function (e) {
var t = null;
if (e !== this.props) {
var n = this.state.status;
this.props.in ? n !== yv && n !== bv && (t = yv) : n !== yv && n !== bv || (t = "exiting")
}
this.updateStatus(!1, t)
}, n.componentWillUnmount = function () {
this.cancelNextCallback()
}, n.getTimeouts = function () {
var e, t, n, r = this.props.timeout;
return e = t = n = r, null != r && "number" != typeof r && (e = r.exit, t = r.enter, n = void 0 !== r.appear ? r.appear : t), {
exit: e,
enter: t,
appear: n
}
}, n.updateStatus = function (e, t) {
void 0 === e && (e = !1), null !== t ? (this.cancelNextCallback(), t === yv ? this.performEnter(e) : this.performExit()) : this.props.unmountOnExit && this.state.status === gv && this.setState({status: vv})
}, n.performEnter = function (e) {
var t = this, n = this.props.enter, r = this.context ? this.context.isMounting : e,
i = this.props.nodeRef ? [r] : [Hc.findDOMNode(this), r], a = i[0], o = i[1], s = this.getTimeouts(),
l = r ? s.appear : s.enter;
!e && !n || fv ? this.safeSetState({status: bv}, function () {
t.props.onEntered(a)
}) : (this.props.onEnter(a, o), this.safeSetState({status: yv}, function () {
t.props.onEntering(a, o), t.onTransitionEnd(l, function () {
t.safeSetState({status: bv}, function () {
t.props.onEntered(a, o)
})
})
}))
}, n.performExit = function () {
var e = this, t = this.props.exit, n = this.getTimeouts(),
r = this.props.nodeRef ? void 0 : Hc.findDOMNode(this);
t && !fv ? (this.props.onExit(r), this.safeSetState({status: "exiting"}, function () {
e.props.onExiting(r), e.onTransitionEnd(n.exit, function () {
e.safeSetState({status: gv}, function () {
e.props.onExited(r)
})
})
})) : this.safeSetState({status: gv}, function () {
e.props.onExited(r)
})
}, n.cancelNextCallback = function () {
null !== this.nextCallback && (this.nextCallback.cancel(), this.nextCallback = null)
}, n.safeSetState = function (e, t) {
t = this.setNextCallback(t), this.setState(e, t)
}, n.setNextCallback = function (e) {
var t = this, n = !0;
return this.nextCallback = function (r) {
n && (n = !1, t.nextCallback = null, e(r))
}, this.nextCallback.cancel = function () {
n = !1
}, this.nextCallback
}, n.onTransitionEnd = function (e, t) {
this.setNextCallback(t);
var n = this.props.nodeRef ? this.props.nodeRef.current : Hc.findDOMNode(this),
r = null == e && !this.props.addEndListener;
if (n && !r) {
if (this.props.addEndListener) {
var i = this.props.nodeRef ? [this.nextCallback] : [n, this.nextCallback], a = i[0], o = i[1];
this.props.addEndListener(a, o)
}
null != e && setTimeout(this.nextCallback, e)
} else setTimeout(this.nextCallback, 0)
}, n.render = function () {
var e = this.state.status;
if (e === vv) return null;
var t = this.props, n = t.children;
t.in, t.mountOnEnter, t.unmountOnExit, t.appear, t.enter, t.exit, t.timeout, t.addEndListener, t.onEnter, t.onEntering, t.onEntered, t.onExit, t.onExiting, t.onExited, t.nodeRef;
var r = Qc(t, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
return q.createElement(mv.Provider, {value: null}, "function" == typeof n ? n(e, r) : q.cloneElement(q.Children.only(n), r))
}, t
}(q.Component);
function Sv() {
}
wv.contextType = mv, wv.propTypes = {}, wv.defaultProps = {
in: !1,
mountOnEnter: !1,
unmountOnExit: !1,
appear: !1,
enter: !0,
exit: !0,
onEnter: Sv,
onEntering: Sv,
onEntered: Sv,
onExit: Sv,
onExiting: Sv,
onExited: Sv
}, wv.UNMOUNTED = vv, wv.EXITED = gv, wv.ENTERING = yv, wv.ENTERED = bv, wv.EXITING = "exiting";
var _v = wv;
function kv(e, t) {
var n = Object.create(null);
return e && u.exports.Children.map(e, function (e) {
return e
}).forEach(function (e) {
n[e.key] = function (e) {
return t && u.exports.isValidElement(e) ? t(e) : e
}(e)
}), n
}
function xv(e, t, n) {
return null != n[t] ? n[t] : e.props[t]
}
function Pv(e, t, n) {
var r = kv(e.children), i = function (e, t) {
function n(n) {
return n in t ? t[n] : e[n]
}
e = e || {}, t = t || {};
var r, i = Object.create(null), a = [];
for (var o in e) o in t ? a.length && (i[o] = a, a = []) : a.push(o);
var s = {};
for (var l in t) {
if (i[l]) for (r = 0; r < i[l].length; r++) {
var c = i[l][r];
s[i[l][r]] = n(c)
}
s[l] = n(l)
}
for (r = 0; r < a.length; r++) s[a[r]] = n(a[r]);
return s
}(t, r);
return Object.keys(i).forEach(function (a) {
var o = i[a];
if (u.exports.isValidElement(o)) {
var s = a in t, l = a in r, c = t[a], d = u.exports.isValidElement(c) && !c.props.in;
!l || s && !d ? l || !s || d ? l && s && u.exports.isValidElement(c) && (i[a] = u.exports.cloneElement(o, {
onExited: n.bind(null, o),
in: c.props.in,
exit: xv(o, "exit", e),
enter: xv(o, "enter", e)
})) : i[a] = u.exports.cloneElement(o, {in: !1}) : i[a] = u.exports.cloneElement(o, {
onExited: n.bind(null, o),
in: !0,
exit: xv(o, "exit", e),
enter: xv(o, "enter", e)
})
}
}), i
}
var Cv = Object.values || function (e) {
return Object.keys(e).map(function (t) {
return e[t]
})
}, Av = function (e) {
function t(t, n) {
var r, i = (r = e.call(this, t, n) || this).handleExited.bind(Ju(r));
return r.state = {contextValue: {isMounting: !0}, handleExited: i, firstRender: !0}, r
}
Xu(t, e);
var n = t.prototype;
return n.componentDidMount = function () {
this.mounted = !0, this.setState({contextValue: {isMounting: !1}})
}, n.componentWillUnmount = function () {
this.mounted = !1
}, t.getDerivedStateFromProps = function (e, t) {
var n, r, i = t.children, a = t.handleExited;
return {
children: t.firstRender ? (n = e, r = a, kv(n.children, function (e) {
return u.exports.cloneElement(e, {
onExited: r.bind(null, e),
in: !0,
appear: xv(e, "appear", n),
enter: xv(e, "enter", n),
exit: xv(e, "exit", n)
})
})) : Pv(e, i, a), firstRender: !1
}
}, n.handleExited = function (e, t) {
var n = kv(this.props.children);
e.key in n || (e.props.onExited && e.props.onExited(t), this.mounted && this.setState(function (t) {
var n = Jc({}, t.children);
return delete n[e.key], {children: n}
}))
}, n.render = function () {
var e = this.props, t = e.component, n = e.childFactory, r = Qc(e, ["component", "childFactory"]),
i = this.state.contextValue, a = Cv(this.state.children).map(n);
return delete r.appear, delete r.enter, delete r.exit, null === t ? q.createElement(mv.Provider, {value: i}, a) : q.createElement(mv.Provider, {value: i}, q.createElement(t, r, a))
}, t
}(q.Component);
Av.propTypes = {}, Av.defaultProps = {
component: "div", childFactory: function (e) {
return e
}
};
var Tv = Av;
function Ev() {
return Lp() || zm
}
var Dv = function (e) {
return e.scrollTop
};
function Iv(e, t) {
var n = e.timeout, r = e.style, i = void 0 === r ? {} : r;
return {duration: i.transitionDuration || "number" == typeof n ? n : n[t.mode] || 0, delay: i.transitionDelay}
}
var Lv = {entering: {opacity: 1}, entered: {opacity: 1}}, Ov = {enter: Gm.enteringScreen, exit: Gm.leavingScreen},
Mv = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.disableStrictModeCompat, i = void 0 !== r && r, a = e.in, o = e.onEnter,
s = e.onEntered, l = e.onEntering, c = e.onExit, d = e.onExited, h = e.onExiting, p = e.style,
f = e.TransitionComponent, m = void 0 === f ? _v : f, v = e.timeout, g = void 0 === v ? Ov : v,
y = $c(e, ["children", "disableStrictModeCompat", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "TransitionComponent", "timeout"]),
b = Ev(), w = b.unstable_strictMode && !i, S = u.exports.useRef(null), _ = Xm(n.ref, t),
k = Xm(w ? S : void 0, _), x = function (e) {
return function (t, n) {
if (e) {
var r = Am(w ? [S.current, t] : [t, n], 2), i = r[0], a = r[1];
void 0 === a ? e(i) : e(i, a)
}
}
}, P = x(l), C = x(function (e, t) {
Dv(e);
var n = Iv({style: p, timeout: g}, {mode: "enter"});
e.style.webkitTransition = b.transitions.create("opacity", n), e.style.transition = b.transitions.create("opacity", n), o && o(e, t)
}), A = x(s), T = x(h), E = x(function (e) {
var t = Iv({style: p, timeout: g}, {mode: "exit"});
e.style.webkitTransition = b.transitions.create("opacity", t), e.style.transition = b.transitions.create("opacity", t), c && c(e)
}), D = x(d);
return u.exports.createElement(m, Jc({
appear: !0,
in: a,
nodeRef: w ? S : void 0,
onEnter: C,
onEntered: A,
onEntering: P,
onExit: E,
onExited: D,
onExiting: T,
timeout: g
}, y), function (e, t) {
return u.exports.cloneElement(n, Jc({
style: Jc({
opacity: 0,
visibility: "exited" !== e || a ? void 0 : "hidden"
}, Lv[e], p, n.props.style), ref: k
}, t))
})
}), Nv = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.invisible, o = void 0 !== a && a, s = e.open,
l = e.transitionDuration, c = e.TransitionComponent, d = void 0 === c ? Mv : c,
h = $c(e, ["children", "classes", "className", "invisible", "open", "transitionDuration", "TransitionComponent"]);
return u.exports.createElement(d, Jc({
in: s,
timeout: l
}, h), u.exports.createElement("div", {className: Xc(r.root, i, o && r.invisible), "aria-hidden": !0, ref: t}, n))
}), Rv = Um({
root: {
zIndex: -1,
position: "fixed",
display: "flex",
alignItems: "center",
justifyContent: "center",
right: 0,
bottom: 0,
top: 0,
left: 0,
backgroundColor: "rgba(0, 0, 0, 0.5)",
WebkitTapHighlightColor: "transparent"
}, invisible: {backgroundColor: "transparent"}
}, {name: "MuiBackdrop"})(Nv), Wv = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.component, a = void 0 === i ? "div" : i, o = e.square,
s = void 0 !== o && o, l = e.elevation, c = void 0 === l ? 1 : l, d = e.variant,
h = void 0 === d ? "elevation" : d,
p = $c(e, ["classes", "className", "component", "square", "elevation", "variant"]);
return u.exports.createElement(a, Jc({
className: Xc(n.root, r, "outlined" === h ? n.outlined : n["elevation".concat(c)], !s && n.rounded),
ref: t
}, p))
}), Vv = Um(function (e) {
var t = {};
return e.shadows.forEach(function (e, n) {
t["elevation".concat(n)] = {boxShadow: e}
}), Jc({
root: {
backgroundColor: e.palette.background.paper,
color: e.palette.text.primary,
transition: e.transitions.create("box-shadow")
}, rounded: {borderRadius: e.shape.borderRadius}, outlined: {border: "1px solid ".concat(e.palette.divider)}
}, t)
}, {name: "MuiPaper"})(Wv), Fv = {enter: Gm.enteringScreen, exit: Gm.leavingScreen},
Gv = u.exports.forwardRef(function (e, t) {
var n = e.BackdropProps, r = e.children, i = e.classes, a = e.className, o = e.disableBackdropClick,
s = void 0 !== o && o, l = e.disableEscapeKeyDown, c = void 0 !== l && l, d = e.fullScreen,
h = void 0 !== d && d, p = e.fullWidth, f = void 0 !== p && p, m = e.maxWidth, v = void 0 === m ? "sm" : m,
g = e.onBackdropClick, y = e.onClose, b = e.onEnter, w = e.onEntered, S = e.onEntering, _ = e.onEscapeKeyDown,
k = e.onExit, x = e.onExited, P = e.onExiting, C = e.open, A = e.PaperComponent, T = void 0 === A ? Vv : A,
E = e.PaperProps, D = void 0 === E ? {} : E, I = e.scroll, L = void 0 === I ? "paper" : I,
O = e.TransitionComponent, M = void 0 === O ? Mv : O, N = e.transitionDuration, R = void 0 === N ? Fv : N,
W = e.TransitionProps, V = e["aria-describedby"], F = e["aria-labelledby"],
G = $c(e, ["BackdropProps", "children", "classes", "className", "disableBackdropClick", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClose", "onEnter", "onEntered", "onEntering", "onEscapeKeyDown", "onExit", "onExited", "onExiting", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps", "aria-describedby", "aria-labelledby"]),
B = u.exports.useRef();
return u.exports.createElement(pv, Jc({
className: Xc(i.root, a),
BackdropComponent: Rv,
BackdropProps: Jc({transitionDuration: R}, n),
closeAfterTransition: !0
}, s ? {disableBackdropClick: s} : {}, {
disableEscapeKeyDown: c,
onEscapeKeyDown: _,
onClose: y,
open: C,
ref: t
}, G), u.exports.createElement(M, Jc({
appear: !0,
in: C,
timeout: R,
onEnter: b,
onEntering: S,
onEntered: w,
onExit: k,
onExiting: P,
onExited: x,
role: "none presentation"
}, W), u.exports.createElement("div", {
className: Xc(i.container, i["scroll".concat(qm(L))]),
onMouseUp: function (e) {
e.target === e.currentTarget && e.target === B.current && (B.current = null, g && g(e), !s && y && y(e, "backdropClick"))
},
onMouseDown: function (e) {
B.current = e.target
}
}, u.exports.createElement(T, Jc({
elevation: 24,
role: "dialog",
"aria-describedby": V,
"aria-labelledby": F
}, D, {className: Xc(i.paper, i["paperScroll".concat(qm(L))], i["paperWidth".concat(qm(String(v)))], D.className, h && i.paperFullScreen, f && i.paperFullWidth)}), r))))
}), Bv = Um(function (e) {
return {
root: {"@media print": {position: "absolute !important"}},
scrollPaper: {display: "flex", justifyContent: "center", alignItems: "center"},
scrollBody: {
overflowY: "auto",
overflowX: "hidden",
textAlign: "center",
"&:after": {content: '""', display: "inline-block", verticalAlign: "middle", height: "100%", width: "0"}
},
container: {height: "100%", "@media print": {height: "auto"}, outline: 0},
paper: {
margin: 32,
position: "relative",
overflowY: "auto",
"@media print": {overflowY: "visible", boxShadow: "none"}
},
paperScrollPaper: {display: "flex", flexDirection: "column", maxHeight: "calc(100% - 64px)"},
paperScrollBody: {display: "inline-block", verticalAlign: "middle", textAlign: "left"},
paperWidthFalse: {maxWidth: "calc(100% - 64px)"},
paperWidthXs: {
maxWidth: Math.max(e.breakpoints.values.xs, 444),
"&$paperScrollBody": Zc({}, e.breakpoints.down(Math.max(e.breakpoints.values.xs, 444) + 64), {maxWidth: "calc(100% - 64px)"})
},
paperWidthSm: {
maxWidth: e.breakpoints.values.sm,
"&$paperScrollBody": Zc({}, e.breakpoints.down(e.breakpoints.values.sm + 64), {maxWidth: "calc(100% - 64px)"})
},
paperWidthMd: {
maxWidth: e.breakpoints.values.md,
"&$paperScrollBody": Zc({}, e.breakpoints.down(e.breakpoints.values.md + 64), {maxWidth: "calc(100% - 64px)"})
},
paperWidthLg: {
maxWidth: e.breakpoints.values.lg,
"&$paperScrollBody": Zc({}, e.breakpoints.down(e.breakpoints.values.lg + 64), {maxWidth: "calc(100% - 64px)"})
},
paperWidthXl: {
maxWidth: e.breakpoints.values.xl,
"&$paperScrollBody": Zc({}, e.breakpoints.down(e.breakpoints.values.xl + 64), {maxWidth: "calc(100% - 64px)"})
},
paperFullWidth: {width: "calc(100% - 64px)"},
paperFullScreen: {
margin: 0,
width: "100%",
maxWidth: "100%",
height: "100%",
maxHeight: "none",
borderRadius: 0,
"&$paperScrollBody": {margin: 0, maxWidth: "100%"}
}
}
}, {name: "MuiDialog"})(Gv), Kv = u.exports.forwardRef(function (e, t) {
var n = e.disableSpacing, r = void 0 !== n && n, i = e.classes, a = e.className,
o = $c(e, ["disableSpacing", "classes", "className"]);
return u.exports.createElement("div", Jc({className: Xc(i.root, a, !r && i.spacing), ref: t}, o))
}), jv = Um({
root: {display: "flex", alignItems: "center", padding: 8, justifyContent: "flex-end", flex: "0 0 auto"},
spacing: {"& > :not(:first-child)": {marginLeft: 8}}
}, {name: "MuiDialogActions"})(Kv), zv = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.dividers, a = void 0 !== i && i,
o = $c(e, ["classes", "className", "dividers"]);
return u.exports.createElement("div", Jc({className: Xc(n.root, r, a && n.dividers), ref: t}, o))
}), Uv = Um(function (e) {
return {
root: {
flex: "1 1 auto",
WebkitOverflowScrolling: "touch",
overflowY: "auto",
padding: "8px 24px",
"&:first-child": {paddingTop: 20}
},
dividers: {
padding: "16px 24px",
borderTop: "1px solid ".concat(e.palette.divider),
borderBottom: "1px solid ".concat(e.palette.divider)
}
}
}, {name: "MuiDialogContent"})(zv), qv = {
h1: "h1",
h2: "h2",
h3: "h3",
h4: "h4",
h5: "h5",
h6: "h6",
subtitle1: "h6",
subtitle2: "h6",
body1: "p",
body2: "p"
}, Hv = u.exports.forwardRef(function (e, t) {
var n = e.align, r = void 0 === n ? "inherit" : n, i = e.classes, a = e.className, o = e.color,
s = void 0 === o ? "initial" : o, l = e.component, c = e.display, d = void 0 === c ? "initial" : c,
h = e.gutterBottom, p = void 0 !== h && h, f = e.noWrap, m = void 0 !== f && f, v = e.paragraph,
g = void 0 !== v && v, y = e.variant, b = void 0 === y ? "body1" : y, w = e.variantMapping,
S = void 0 === w ? qv : w,
_ = $c(e, ["align", "classes", "className", "color", "component", "display", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"]),
k = l || (g ? "p" : S[b] || qv[b]) || "span";
return u.exports.createElement(k, Jc({
className: Xc(i.root, a, "inherit" !== b && i[b], "initial" !== s && i["color".concat(qm(s))], m && i.noWrap, p && i.gutterBottom, g && i.paragraph, "inherit" !== r && i["align".concat(qm(r))], "initial" !== d && i["display".concat(qm(d))]),
ref: t
}, _))
}), Yv = Um(function (e) {
return {
root: {margin: 0},
body2: e.typography.body2,
body1: e.typography.body1,
caption: e.typography.caption,
button: e.typography.button,
h1: e.typography.h1,
h2: e.typography.h2,
h3: e.typography.h3,
h4: e.typography.h4,
h5: e.typography.h5,
h6: e.typography.h6,
subtitle1: e.typography.subtitle1,
subtitle2: e.typography.subtitle2,
overline: e.typography.overline,
srOnly: {position: "absolute", height: 1, width: 1, overflow: "hidden"},
alignLeft: {textAlign: "left"},
alignCenter: {textAlign: "center"},
alignRight: {textAlign: "right"},
alignJustify: {textAlign: "justify"},
noWrap: {overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap"},
gutterBottom: {marginBottom: "0.35em"},
paragraph: {marginBottom: 16},
colorInherit: {color: "inherit"},
colorPrimary: {color: e.palette.primary.main},
colorSecondary: {color: e.palette.secondary.main},
colorTextPrimary: {color: e.palette.text.primary},
colorTextSecondary: {color: e.palette.text.secondary},
colorError: {color: e.palette.error.main},
displayInline: {display: "inline"},
displayBlock: {display: "block"}
}
}, {name: "MuiTypography"})(Hv), Xv = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.disableTypography, o = void 0 !== a && a,
s = $c(e, ["children", "classes", "className", "disableTypography"]);
return u.exports.createElement("div", Jc({
className: Xc(r.root, i),
ref: t
}, s), o ? n : u.exports.createElement(Yv, {component: "h2", variant: "h6"}, n))
}), Jv = Um({root: {margin: 0, padding: "16px 24px", flex: "0 0 auto"}}, {name: "MuiDialogTitle"})(Xv);
function Qv(e) {
return function (e) {
return e
}(e)
}
function $v(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return Bp(e, Jc({defaultTheme: zm}, t))
}
var Zv = function (e) {
var t = Pf(e);
return function (e, n) {
return t(e, Jc({defaultTheme: zm}, n))
}
}, eg = $v(function () {
return Qv({
title: {color: "black"},
container: {
"& .MuiTypography-h6": {fontSize: "32px !important"},
"& .ColorPicker-MuiButton-root": {fontSize: "16px !important"},
"& .MuiDialogActions-root": {padding: "24px 32px"}
}
})
}), tg = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.color, o = void 0 === a ? "inherit" : a,
s = e.component, l = void 0 === s ? "svg" : s, c = e.fontSize, d = void 0 === c ? "medium" : c, h = e.htmlColor,
p = e.titleAccess, f = e.viewBox, m = void 0 === f ? "0 0 24 24" : f,
v = $c(e, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
return u.exports.createElement(l, Jc({
className: Xc(r.root, i, "inherit" !== o && r["color".concat(qm(o))], "default" !== d && "medium" !== d && r["fontSize".concat(qm(d))]),
focusable: "false",
viewBox: m,
color: h,
"aria-hidden": !p || void 0,
role: p ? "img" : void 0,
ref: t
}, v), n, p ? u.exports.createElement("title", null, p) : null)
});
tg.muiName = "SvgIcon";
var ng = Um(function (e) {
return {
root: {
userSelect: "none",
width: "1em",
height: "1em",
display: "inline-block",
fill: "currentColor",
flexShrink: 0,
fontSize: e.typography.pxToRem(24),
transition: e.transitions.create("fill", {duration: e.transitions.duration.shorter})
},
colorPrimary: {color: e.palette.primary.main},
colorSecondary: {color: e.palette.secondary.main},
colorAction: {color: e.palette.action.active},
colorError: {color: e.palette.error.main},
colorDisabled: {color: e.palette.action.disabled},
fontSizeInherit: {fontSize: "inherit"},
fontSizeSmall: {fontSize: e.typography.pxToRem(20)},
fontSizeLarge: {fontSize: e.typography.pxToRem(35)}
}
}, {name: "MuiSvgIcon"})(tg);
function rg(e, t) {
var n = function (t, n) {
return q.createElement(ng, Jc({ref: n}, t), e)
};
return n.muiName = ng.muiName, q.memo(q.forwardRef(n))
}
function ig(e) {
var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 166;
function r() {
for (var r = arguments.length, i = new Array(r), a = 0; a < r; a++) i[a] = arguments[a];
var o = this;
clearTimeout(t), t = setTimeout(function () {
e.apply(o, i)
}, n)
}
return r.clear = function () {
clearTimeout(t)
}, r
}
function ag(e, t) {
return u.exports.isValidElement(e) && -1 !== t.indexOf(e.type.muiName)
}
function og(e) {
var t = e.controlled, n = e.default;
e.name, e.state;
var r = u.exports.useRef(void 0 !== t).current, i = u.exports.useState(n), a = i[0], o = i[1];
return [r ? t : a, u.exports.useCallback(function (e) {
r || o(e)
}, [])]
}
function sg(e) {
var t = u.exports.useState(e), n = t[0], r = t[1], i = e || n;
return u.exports.useEffect(function () {
null == n && r("mui-".concat(Math.round(1e5 * Math.random())))
}, [n]), i
}
var lg = !0, cg = !1, ug = null, dg = {
text: !0,
search: !0,
url: !0,
tel: !0,
email: !0,
password: !0,
number: !0,
date: !0,
month: !0,
week: !0,
time: !0,
datetime: !0,
"datetime-local": !0
};
function hg(e) {
e.metaKey || e.altKey || e.ctrlKey || (lg = !0)
}
function pg() {
lg = !1
}
function fg() {
"hidden" === this.visibilityState && cg && (lg = !0)
}
function mg(e) {
var t, n, r, i = e.target;
try {
return i.matches(":focus-visible")
} catch (e) {
}
return lg || (n = (t = i).type, !("INPUT" !== (r = t.tagName) || !dg[n] || t.readOnly) || "TEXTAREA" === r && !t.readOnly || !!t.isContentEditable)
}
function vg() {
cg = !0, window.clearTimeout(ug), ug = window.setTimeout(function () {
cg = !1
}, 100)
}
function gg() {
return {
isFocusVisible: mg, onBlurVisible: vg, ref: u.exports.useCallback(function (e) {
var t, n = H.exports.findDOMNode(e);
null != n && ((t = n.ownerDocument).addEventListener("keydown", hg, !0), t.addEventListener("mousedown", pg, !0), t.addEventListener("pointerdown", pg, !0), t.addEventListener("touchstart", pg, !0), t.addEventListener("visibilitychange", fg, !0))
}, [])
}
}
var yg = "undefined" == typeof window ? u.exports.useEffect : u.exports.useLayoutEffect;
function bg(e) {
var t = e.classes, n = e.pulsate, r = void 0 !== n && n, i = e.rippleX, a = e.rippleY, o = e.rippleSize, s = e.in,
l = e.onExited, c = void 0 === l ? function () {
} : l, d = e.timeout, h = u.exports.useState(!1), p = h[0], f = h[1],
m = Xc(t.ripple, t.rippleVisible, r && t.ripplePulsate),
v = {width: o, height: o, top: -o / 2 + a, left: -o / 2 + i},
g = Xc(t.child, p && t.childLeaving, r && t.childPulsate), y = ev(c);
return yg(function () {
if (!s) {
f(!0);
var e = setTimeout(y, d);
return function () {
clearTimeout(e)
}
}
}, [y, s, d]), u.exports.createElement("span", {
className: m,
style: v
}, u.exports.createElement("span", {className: g}))
}
var wg, Sg, _g = u.exports.forwardRef(function (e, t) {
var n = e.center, r = void 0 !== n && n, i = e.classes, a = e.className,
o = $c(e, ["center", "classes", "className"]), s = u.exports.useState([]), l = s[0], c = s[1],
d = u.exports.useRef(0), h = u.exports.useRef(null);
u.exports.useEffect(function () {
h.current && (h.current(), h.current = null)
}, [l]);
var p = u.exports.useRef(!1), f = u.exports.useRef(null), m = u.exports.useRef(null), v = u.exports.useRef(null);
u.exports.useEffect(function () {
return function () {
clearTimeout(f.current)
}
}, []);
var g = u.exports.useCallback(function (e) {
var t = e.pulsate, n = e.rippleX, r = e.rippleY, a = e.rippleSize, o = e.cb;
c(function (e) {
return [].concat(Mh(e), [u.exports.createElement(bg, {
key: d.current,
classes: i,
timeout: 550,
pulsate: t,
rippleX: n,
rippleY: r,
rippleSize: a
})])
}), d.current += 1, h.current = o
}, [i]), y = u.exports.useCallback(function () {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
n = arguments.length > 2 ? arguments[2] : void 0, i = t.pulsate, a = void 0 !== i && i, o = t.center,
s = void 0 === o ? r || t.pulsate : o, l = t.fakeElement, c = void 0 !== l && l;
if ("mousedown" === e.type && p.current) p.current = !1; else {
"touchstart" === e.type && (p.current = !0);
var u, d, h, y = c ? null : v.current,
b = y ? y.getBoundingClientRect() : {width: 0, height: 0, left: 0, top: 0};
if (s || 0 === e.clientX && 0 === e.clientY || !e.clientX && !e.touches) u = Math.round(b.width / 2), d = Math.round(b.height / 2); else {
var w = e.touches ? e.touches[0] : e, S = w.clientX, _ = w.clientY;
u = Math.round(S - b.left), d = Math.round(_ - b.top)
}
if (s) (h = Math.sqrt((2 * Math.pow(b.width, 2) + Math.pow(b.height, 2)) / 3)) % 2 == 0 && (h += 1); else {
var k = 2 * Math.max(Math.abs((y ? y.clientWidth : 0) - u), u) + 2,
x = 2 * Math.max(Math.abs((y ? y.clientHeight : 0) - d), d) + 2;
h = Math.sqrt(Math.pow(k, 2) + Math.pow(x, 2))
}
e.touches ? null === m.current && (m.current = function () {
g({pulsate: a, rippleX: u, rippleY: d, rippleSize: h, cb: n})
}, f.current = setTimeout(function () {
m.current && (m.current(), m.current = null)
}, 80)) : g({pulsate: a, rippleX: u, rippleY: d, rippleSize: h, cb: n})
}
}, [r, g]), b = u.exports.useCallback(function () {
y({}, {pulsate: !0})
}, [y]), w = u.exports.useCallback(function (e, t) {
if (clearTimeout(f.current), "touchend" === e.type && m.current) return e.persist(), m.current(), m.current = null, void (f.current = setTimeout(function () {
w(e, t)
}));
m.current = null, c(function (e) {
return e.length > 0 ? e.slice(1) : e
}), h.current = t
}, []);
return u.exports.useImperativeHandle(t, function () {
return {pulsate: b, start: y, stop: w}
}, [b, y, w]), u.exports.createElement("span", Jc({
className: Xc(i.root, a),
ref: v
}, o), u.exports.createElement(Tv, {component: null, exit: !0}, l))
}), kg = Um(function (e) {
return {
root: {
overflow: "hidden",
pointerEvents: "none",
position: "absolute",
zIndex: 0,
top: 0,
right: 0,
bottom: 0,
left: 0,
borderRadius: "inherit"
},
ripple: {opacity: 0, position: "absolute"},
rippleVisible: {
opacity: .3,
transform: "scale(1)",
animation: "$enter ".concat(550, "ms ").concat(e.transitions.easing.easeInOut)
},
ripplePulsate: {animationDuration: "".concat(e.transitions.duration.shorter, "ms")},
child: {
opacity: 1,
display: "block",
width: "100%",
height: "100%",
borderRadius: "50%",
backgroundColor: "currentColor"
},
childLeaving: {opacity: 0, animation: "$exit ".concat(550, "ms ").concat(e.transitions.easing.easeInOut)},
childPulsate: {
position: "absolute",
left: 0,
top: 0,
animation: "$pulsate 2500ms ".concat(e.transitions.easing.easeInOut, " 200ms infinite")
},
"@keyframes enter": {"0%": {transform: "scale(0)", opacity: .1}, "100%": {transform: "scale(1)", opacity: .3}},
"@keyframes exit": {"0%": {opacity: 1}, "100%": {opacity: 0}},
"@keyframes pulsate": {
"0%": {transform: "scale(1)"},
"50%": {transform: "scale(0.92)"},
"100%": {transform: "scale(1)"}
}
}
}, {flip: !1, name: "MuiTouchRipple"})(u.exports.memo(_g)), xg = u.exports.forwardRef(function (e, t) {
var n = e.action, r = e.buttonRef, i = e.centerRipple, a = void 0 !== i && i, o = e.children, s = e.classes,
l = e.className, c = e.component, d = void 0 === c ? "button" : c, h = e.disabled, p = void 0 !== h && h,
f = e.disableRipple, m = void 0 !== f && f, v = e.disableTouchRipple, g = void 0 !== v && v, y = e.focusRipple,
b = void 0 !== y && y, w = e.focusVisibleClassName, S = e.onBlur, _ = e.onClick, k = e.onFocus,
x = e.onFocusVisible, P = e.onKeyDown, C = e.onKeyUp, A = e.onMouseDown, T = e.onMouseLeave, E = e.onMouseUp,
D = e.onTouchEnd, I = e.onTouchMove, L = e.onTouchStart, O = e.onDragLeave, M = e.tabIndex,
N = void 0 === M ? 0 : M, R = e.TouchRippleProps, W = e.type, V = void 0 === W ? "button" : W,
F = $c(e, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]),
G = u.exports.useRef(null);
var B = u.exports.useRef(null), K = u.exports.useState(!1), j = K[0], z = K[1];
p && j && z(!1);
var U = gg(), q = U.isFocusVisible, Y = U.onBlurVisible, X = U.ref;
function J(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : g;
return ev(function (r) {
return t && t(r), !n && B.current && B.current[e](r), !0
})
}
u.exports.useImperativeHandle(n, function () {
return {
focusVisible: function () {
z(!0), G.current.focus()
}
}
}, []), u.exports.useEffect(function () {
j && b && !m && B.current.pulsate()
}, [m, b, j]);
var Q = J("start", A), $ = J("stop", O), Z = J("stop", E), ee = J("stop", function (e) {
j && e.preventDefault(), T && T(e)
}), te = J("start", L), ne = J("stop", D), re = J("stop", I), ie = J("stop", function (e) {
j && (Y(e), z(!1)), S && S(e)
}, !1), ae = ev(function (e) {
G.current || (G.current = e.currentTarget), q(e) && (z(!0), x && x(e)), k && k(e)
}), oe = function () {
var e = H.exports.findDOMNode(G.current);
return d && "button" !== d && !("A" === e.tagName && e.href)
}, se = u.exports.useRef(!1), le = ev(function (e) {
b && !se.current && j && B.current && " " === e.key && (se.current = !0, e.persist(), B.current.stop(e, function () {
B.current.start(e)
})), e.target === e.currentTarget && oe() && " " === e.key && e.preventDefault(), P && P(e), e.target === e.currentTarget && oe() && "Enter" === e.key && !p && (e.preventDefault(), _ && _(e))
}), ce = ev(function (e) {
b && " " === e.key && B.current && j && !e.defaultPrevented && (se.current = !1, e.persist(), B.current.stop(e, function () {
B.current.pulsate(e)
})), C && C(e), _ && e.target === e.currentTarget && oe() && " " === e.key && !e.defaultPrevented && _(e)
}), ue = d;
"button" === ue && F.href && (ue = "a");
var de = {};
"button" === ue ? (de.type = V, de.disabled = p) : ("a" === ue && F.href || (de.role = "button"), de["aria-disabled"] = p);
var he = Xm(Xm(r, t), Xm(X, G)), pe = u.exports.useState(!1), fe = pe[0], me = pe[1];
u.exports.useEffect(function () {
me(!0)
}, []);
var ve = fe && !m && !p;
return u.exports.createElement(ue, Jc({
className: Xc(s.root, l, j && [s.focusVisible, w], p && s.disabled),
onBlur: ie,
onClick: _,
onFocus: ae,
onKeyDown: le,
onKeyUp: ce,
onMouseDown: Q,
onMouseLeave: ee,
onMouseUp: Z,
onDragLeave: $,
onTouchEnd: ne,
onTouchMove: re,
onTouchStart: te,
ref: he,
tabIndex: p ? -1 : N
}, de, F), o, ve ? u.exports.createElement(kg, Jc({ref: B, center: a}, R)) : null)
}), Pg = Um({
root: {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
position: "relative",
WebkitTapHighlightColor: "transparent",
backgroundColor: "transparent",
outline: 0,
border: 0,
margin: 0,
borderRadius: 0,
padding: 0,
cursor: "pointer",
userSelect: "none",
verticalAlign: "middle",
"-moz-appearance": "none",
"-webkit-appearance": "none",
textDecoration: "none",
color: "inherit",
"&::-moz-focus-inner": {borderStyle: "none"},
"&$disabled": {pointerEvents: "none", cursor: "default"},
"@media print": {colorAdjust: "exact"}
}, disabled: {}, focusVisible: {}
}, {name: "MuiButtonBase"})(xg), Cg = u.exports.forwardRef(function (e, t) {
var n = e.edge, r = void 0 !== n && n, i = e.children, a = e.classes, o = e.className, s = e.color,
l = void 0 === s ? "default" : s, c = e.disabled, d = void 0 !== c && c, h = e.disableFocusRipple,
p = void 0 !== h && h, f = e.size, m = void 0 === f ? "medium" : f,
v = $c(e, ["edge", "children", "classes", "className", "color", "disabled", "disableFocusRipple", "size"]);
return u.exports.createElement(Pg, Jc({
className: Xc(a.root, o, "default" !== l && a["color".concat(qm(l))], d && a.disabled, "small" === m && a["size".concat(qm(m))], {
start: a.edgeStart,
end: a.edgeEnd
}[r]), centerRipple: !0, focusRipple: !p, disabled: d, ref: t
}, v), u.exports.createElement("span", {className: a.label}, i))
}), Ag = Um(function (e) {
return {
root: {
textAlign: "center",
flex: "0 0 auto",
fontSize: e.typography.pxToRem(24),
padding: 12,
borderRadius: "50%",
overflow: "visible",
color: e.palette.action.active,
transition: e.transitions.create("background-color", {duration: e.transitions.duration.shortest}),
"&:hover": {
backgroundColor: Gf(e.palette.action.active, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
},
"&$disabled": {backgroundColor: "transparent", color: e.palette.action.disabled}
},
edgeStart: {marginLeft: -12, "$sizeSmall&": {marginLeft: -3}},
edgeEnd: {marginRight: -12, "$sizeSmall&": {marginRight: -3}},
colorInherit: {color: "inherit"},
colorPrimary: {
color: e.palette.primary.main,
"&:hover": {
backgroundColor: Gf(e.palette.primary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
}
},
colorSecondary: {
color: e.palette.secondary.main,
"&:hover": {
backgroundColor: Gf(e.palette.secondary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
}
},
disabled: {},
sizeSmall: {padding: 3, fontSize: e.typography.pxToRem(18)},
label: {width: "100%", display: "flex", alignItems: "inherit", justifyContent: "inherit"}
}
}, {name: "MuiIconButton"})(Cg), Tg = (wg = cm(dm, pm, fm, mm, gm, vm, ym, Cm, Wm, Vm), (Sg = function (e) {
var t = wg(e);
return e.css ? Jc({}, rm(t, wg(Jc({theme: e.theme}, e.css))), hm(e.css, [wg.filterProps])) : e.sx ? Jc({}, rm(t, wg(Jc({theme: e.theme}, e.sx))), hm(e.sx, [wg.filterProps])) : t
}).propTypes = {}, Sg.filterProps = ["css", "sx"].concat(Mh(wg.filterProps)), Sg),
Eg = Zv("div")(Tg, {name: "MuiBox"}), Dg = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.color, o = void 0 === a ? "default" : a,
s = e.component, l = void 0 === s ? "button" : s, c = e.disabled, d = void 0 !== c && c, h = e.disableElevation,
p = void 0 !== h && h, f = e.disableFocusRipple, m = void 0 !== f && f, v = e.endIcon,
g = e.focusVisibleClassName, y = e.fullWidth, b = void 0 !== y && y, w = e.size,
S = void 0 === w ? "medium" : w, _ = e.startIcon, k = e.type, x = void 0 === k ? "button" : k, P = e.variant,
C = void 0 === P ? "text" : P,
A = $c(e, ["children", "classes", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"]),
T = _ && u.exports.createElement("span", {className: Xc(r.startIcon, r["iconSize".concat(qm(S))])}, _),
E = v && u.exports.createElement("span", {className: Xc(r.endIcon, r["iconSize".concat(qm(S))])}, v);
return u.exports.createElement(Pg, Jc({
className: Xc(r.root, r[C], i, "inherit" === o ? r.colorInherit : "default" !== o && r["".concat(C).concat(qm(o))], "medium" !== S && [r["".concat(C, "Size").concat(qm(S))], r["size".concat(qm(S))]], p && r.disableElevation, d && r.disabled, b && r.fullWidth),
component: l,
disabled: d,
focusRipple: !m,
focusVisibleClassName: Xc(r.focusVisible, g),
ref: t,
type: x
}, A), u.exports.createElement("span", {className: r.label}, T, n, E))
}), Ig = Um(function (e) {
return {
root: Jc({}, e.typography.button, {
boxSizing: "border-box",
minWidth: 64,
padding: "6px 16px",
borderRadius: e.shape.borderRadius,
color: e.palette.text.primary,
transition: e.transitions.create(["background-color", "box-shadow", "border"], {duration: e.transitions.duration.short}),
"&:hover": {
textDecoration: "none",
backgroundColor: Gf(e.palette.text.primary, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"},
"&$disabled": {backgroundColor: "transparent"}
},
"&$disabled": {color: e.palette.action.disabled}
}),
label: {width: "100%", display: "inherit", alignItems: "inherit", justifyContent: "inherit"},
text: {padding: "6px 8px"},
textPrimary: {
color: e.palette.primary.main,
"&:hover": {
backgroundColor: Gf(e.palette.primary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
}
},
textSecondary: {
color: e.palette.secondary.main,
"&:hover": {
backgroundColor: Gf(e.palette.secondary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
}
},
outlined: {
padding: "5px 15px",
border: "1px solid ".concat("light" === e.palette.type ? "rgba(0, 0, 0, 0.23)" : "rgba(255, 255, 255, 0.23)"),
"&$disabled": {border: "1px solid ".concat(e.palette.action.disabledBackground)}
},
outlinedPrimary: {
color: e.palette.primary.main,
border: "1px solid ".concat(Gf(e.palette.primary.main, .5)),
"&:hover": {
border: "1px solid ".concat(e.palette.primary.main),
backgroundColor: Gf(e.palette.primary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
}
},
outlinedSecondary: {
color: e.palette.secondary.main,
border: "1px solid ".concat(Gf(e.palette.secondary.main, .5)),
"&:hover": {
border: "1px solid ".concat(e.palette.secondary.main),
backgroundColor: Gf(e.palette.secondary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
},
"&$disabled": {border: "1px solid ".concat(e.palette.action.disabled)}
},
contained: {
color: e.palette.getContrastText(e.palette.grey[300]),
backgroundColor: e.palette.grey[300],
boxShadow: e.shadows[2],
"&:hover": {
backgroundColor: e.palette.grey.A100,
boxShadow: e.shadows[4],
"@media (hover: none)": {boxShadow: e.shadows[2], backgroundColor: e.palette.grey[300]},
"&$disabled": {backgroundColor: e.palette.action.disabledBackground}
},
"&$focusVisible": {boxShadow: e.shadows[6]},
"&:active": {boxShadow: e.shadows[8]},
"&$disabled": {
color: e.palette.action.disabled,
boxShadow: e.shadows[0],
backgroundColor: e.palette.action.disabledBackground
}
},
containedPrimary: {
color: e.palette.primary.contrastText,
backgroundColor: e.palette.primary.main,
"&:hover": {
backgroundColor: e.palette.primary.dark,
"@media (hover: none)": {backgroundColor: e.palette.primary.main}
}
},
containedSecondary: {
color: e.palette.secondary.contrastText,
backgroundColor: e.palette.secondary.main,
"&:hover": {
backgroundColor: e.palette.secondary.dark,
"@media (hover: none)": {backgroundColor: e.palette.secondary.main}
}
},
disableElevation: {
boxShadow: "none",
"&:hover": {boxShadow: "none"},
"&$focusVisible": {boxShadow: "none"},
"&:active": {boxShadow: "none"},
"&$disabled": {boxShadow: "none"}
},
focusVisible: {},
disabled: {},
colorInherit: {color: "inherit", borderColor: "currentColor"},
textSizeSmall: {padding: "4px 5px", fontSize: e.typography.pxToRem(13)},
textSizeLarge: {padding: "8px 11px", fontSize: e.typography.pxToRem(15)},
outlinedSizeSmall: {padding: "3px 9px", fontSize: e.typography.pxToRem(13)},
outlinedSizeLarge: {padding: "7px 21px", fontSize: e.typography.pxToRem(15)},
containedSizeSmall: {padding: "4px 10px", fontSize: e.typography.pxToRem(13)},
containedSizeLarge: {padding: "8px 22px", fontSize: e.typography.pxToRem(15)},
sizeSmall: {},
sizeLarge: {},
fullWidth: {width: "100%"},
startIcon: {display: "inherit", marginRight: 8, marginLeft: -4, "&$iconSizeSmall": {marginLeft: -2}},
endIcon: {display: "inherit", marginRight: -4, marginLeft: 8, "&$iconSizeSmall": {marginRight: -2}},
iconSizeSmall: {"& > *:first-child": {fontSize: 18}},
iconSizeMedium: {"& > *:first-child": {fontSize: 20}},
iconSizeLarge: {"& > *:first-child": {fontSize: 22}}
}
}, {name: "MuiButton"})(Dg), Lg = u.exports.createContext();
function Og() {
return u.exports.useContext(Lg)
}
var Mg = Lg;
function Ng() {
return u.exports.useContext(Mg)
}
var Rg = u.exports.forwardRef(function (e, t) {
var n = e.autoFocus, r = e.checked, i = e.checkedIcon, a = e.classes, o = e.className, s = e.defaultChecked,
l = e.disabled, c = e.icon, d = e.id, h = e.inputProps, p = e.inputRef, f = e.name, m = e.onBlur,
v = e.onChange, g = e.onFocus, y = e.readOnly, b = e.required, w = e.tabIndex, S = e.type, _ = e.value,
k = $c(e, ["autoFocus", "checked", "checkedIcon", "classes", "className", "defaultChecked", "disabled", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"]),
x = Am(og({controlled: r, default: Boolean(s), name: "SwitchBase", state: "checked"}), 2), P = x[0], C = x[1],
A = Ng(), T = l;
A && void 0 === T && (T = A.disabled);
var E = "checkbox" === S || "radio" === S;
return u.exports.createElement(Ag, Jc({
component: "span",
className: Xc(a.root, o, P && a.checked, T && a.disabled),
disabled: T,
tabIndex: null,
role: void 0,
onFocus: function (e) {
g && g(e), A && A.onFocus && A.onFocus(e)
},
onBlur: function (e) {
m && m(e), A && A.onBlur && A.onBlur(e)
},
ref: t
}, k), u.exports.createElement("input", Jc({
autoFocus: n,
checked: r,
defaultChecked: s,
className: a.input,
disabled: T,
id: E && d,
name: f,
onChange: function (e) {
var t = e.target.checked;
C(t), v && v(e, t)
},
readOnly: y,
ref: p,
required: b,
tabIndex: w,
type: S,
value: _
}, h)), P ? i : c)
}), Wg = Um({
root: {padding: 9},
checked: {},
disabled: {},
input: {
cursor: "inherit",
position: "absolute",
opacity: 0,
width: "100%",
height: "100%",
top: 0,
left: 0,
margin: 0,
padding: 0,
zIndex: 1
}
}, {name: "PrivateSwitchBase"})(Rg),
Vg = {WebkitFontSmoothing: "antialiased", MozOsxFontSmoothing: "grayscale", boxSizing: "border-box"},
Fg = function (e) {
return Jc({color: e.palette.text.primary}, e.typography.body2, {
backgroundColor: e.palette.background.default,
"@media print": {backgroundColor: e.palette.common.white}
})
};
Um(function (e) {
return {
"@global": {
html: Vg,
"*, *::before, *::after": {boxSizing: "inherit"},
"strong, b": {fontWeight: e.typography.fontWeightBold},
body: Jc({margin: 0}, Fg(e), {"&::backdrop": {backgroundColor: e.palette.background.default}})
}
}
}, {name: "MuiCssBaseline"})(function (e) {
var t = e.children, n = void 0 === t ? null : t;
return e.classes, u.exports.createElement(u.exports.Fragment, null, n)
});
var Gg = u.exports.forwardRef(function (e, t) {
var n = e.absolute, r = void 0 !== n && n, i = e.classes, a = e.className, o = e.component,
s = void 0 === o ? "hr" : o, l = e.flexItem, c = void 0 !== l && l, d = e.light, h = void 0 !== d && d,
p = e.orientation, f = void 0 === p ? "horizontal" : p, m = e.role,
v = void 0 === m ? "hr" !== s ? "separator" : void 0 : m, g = e.variant, y = void 0 === g ? "fullWidth" : g,
b = $c(e, ["absolute", "classes", "className", "component", "flexItem", "light", "orientation", "role", "variant"]);
return u.exports.createElement(s, Jc({
className: Xc(i.root, a, "fullWidth" !== y && i[y], r && i.absolute, c && i.flexItem, h && i.light, "vertical" === f && i.vertical),
role: v,
ref: t
}, b))
}), Bg = Um(function (e) {
return {
root: {height: 1, margin: 0, border: "none", flexShrink: 0, backgroundColor: e.palette.divider},
absolute: {position: "absolute", bottom: 0, left: 0, width: "100%"},
inset: {marginLeft: 72},
light: {backgroundColor: Gf(e.palette.divider, .08)},
middle: {marginLeft: e.spacing(2), marginRight: e.spacing(2)},
vertical: {height: "100%", width: 1},
flexItem: {alignSelf: "stretch", height: "auto"}
}
}, {name: "MuiDivider"})(Gg);
function Kg(e) {
var t = e.props, n = e.states, r = e.muiFormControl;
return n.reduce(function (e, n) {
return e[n] = t[n], r && void 0 === t[n] && (e[n] = r[n]), e
}, {})
}
function jg(e, t) {
return parseInt(e[t], 10) || 0
}
var zg = "undefined" != typeof window ? u.exports.useLayoutEffect : u.exports.useEffect, Ug = {
visibility: "hidden",
position: "absolute",
overflow: "hidden",
height: 0,
top: 0,
left: 0,
transform: "translateZ(0)"
}, qg = u.exports.forwardRef(function (e, t) {
var n = e.onChange, r = e.rows, i = e.rowsMax, a = e.rowsMin, o = e.maxRows, s = e.minRows,
l = void 0 === s ? 1 : s, c = e.style, d = e.value,
h = $c(e, ["onChange", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "style", "value"]), p = o || i,
f = r || a || l, m = u.exports.useRef(null != d).current, v = u.exports.useRef(null), g = Xm(t, v),
y = u.exports.useRef(null), b = u.exports.useRef(0), w = u.exports.useState({}), S = w[0], _ = w[1],
k = u.exports.useCallback(function () {
var t = v.current, n = window.getComputedStyle(t), r = y.current;
r.style.width = n.width, r.value = t.value || e.placeholder || "x", "\n" === r.value.slice(-1) && (r.value += " ");
var i = n["box-sizing"], a = jg(n, "padding-bottom") + jg(n, "padding-top"),
o = jg(n, "border-bottom-width") + jg(n, "border-top-width"), s = r.scrollHeight - a;
r.value = "x";
var l = r.scrollHeight - a, c = s;
f && (c = Math.max(Number(f) * l, c)), p && (c = Math.min(Number(p) * l, c));
var u = (c = Math.max(c, l)) + ("border-box" === i ? a + o : 0), d = Math.abs(c - s) <= 1;
_(function (e) {
return b.current < 20 && (u > 0 && Math.abs((e.outerHeightStyle || 0) - u) > 1 || e.overflow !== d) ? (b.current += 1, {
overflow: d,
outerHeightStyle: u
}) : e
})
}, [p, f, e.placeholder]);
u.exports.useEffect(function () {
var e = ig(function () {
b.current = 0, k()
});
return window.addEventListener("resize", e), function () {
e.clear(), window.removeEventListener("resize", e)
}
}, [k]), zg(function () {
k()
}), u.exports.useEffect(function () {
b.current = 0
}, [d]);
return u.exports.createElement(u.exports.Fragment, null, u.exports.createElement("textarea", Jc({
value: d,
onChange: function (e) {
b.current = 0, m || k(), n && n(e)
},
ref: g,
rows: f,
style: Jc({height: S.outerHeightStyle, overflow: S.overflow ? "hidden" : null}, c)
}, h)), u.exports.createElement("textarea", {
"aria-hidden": !0,
className: e.className,
readOnly: !0,
ref: y,
tabIndex: -1,
style: Jc({}, Ug, c)
}))
});
function Hg(e) {
return null != e && !(Array.isArray(e) && 0 === e.length)
}
function Yg(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return e && (Hg(e.value) && "" !== e.value || t && Hg(e.defaultValue) && "" !== e.defaultValue)
}
var Xg = "undefined" == typeof window ? u.exports.useEffect : u.exports.useLayoutEffect,
Jg = u.exports.forwardRef(function (e, t) {
var n = e["aria-describedby"], r = e.autoComplete, i = e.autoFocus, a = e.classes, o = e.className;
e.color;
var s = e.defaultValue, l = e.disabled, c = e.endAdornment;
e.error;
var d = e.fullWidth, h = void 0 !== d && d, p = e.id, f = e.inputComponent, m = void 0 === f ? "input" : f,
v = e.inputProps, g = void 0 === v ? {} : v, y = e.inputRef;
e.margin;
var b = e.multiline, w = void 0 !== b && b, S = e.name, _ = e.onBlur, k = e.onChange, x = e.onClick,
P = e.onFocus, C = e.onKeyDown, A = e.onKeyUp, T = e.placeholder, E = e.readOnly, D = e.renderSuffix,
I = e.rows, L = e.rowsMax, O = e.rowsMin, M = e.maxRows, N = e.minRows, R = e.startAdornment, W = e.type,
V = void 0 === W ? "text" : W, F = e.value,
G = $c(e, ["aria-describedby", "autoComplete", "autoFocus", "classes", "className", "color", "defaultValue", "disabled", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "startAdornment", "type", "value"]),
B = null != g.value ? g.value : F, K = u.exports.useRef(null != B).current, j = u.exports.useRef(),
z = u.exports.useCallback(function (e) {
}, []), U = Xm(y, Xm(g.ref, z)), q = Xm(j, U), H = u.exports.useState(!1), Y = H[0], X = H[1], J = Og(),
Q = Kg({
props: e,
muiFormControl: J,
states: ["color", "disabled", "error", "hiddenLabel", "margin", "required", "filled"]
});
Q.focused = J ? J.focused : Y, u.exports.useEffect(function () {
!J && l && Y && (X(!1), _ && _())
}, [J, l, Y, _]);
var $ = J && J.onFilled, Z = J && J.onEmpty, ee = u.exports.useCallback(function (e) {
Yg(e) ? $ && $() : Z && Z()
}, [$, Z]);
Xg(function () {
K && ee({value: B})
}, [B, ee, K]);
u.exports.useEffect(function () {
ee(j.current)
}, []);
var te = m, ne = Jc({}, g, {ref: q});
"string" != typeof te ? ne = Jc({
inputRef: q,
type: V
}, ne, {ref: null}) : w ? !I || M || N || L || O ? (ne = Jc({
minRows: I || N,
rowsMax: L,
maxRows: M
}, ne), te = qg) : te = "textarea" : ne = Jc({type: V}, ne);
return u.exports.useEffect(function () {
J && J.setAdornedStart(Boolean(R))
}, [J, R]), u.exports.createElement("div", Jc({
className: Xc(a.root, a["color".concat(qm(Q.color || "primary"))], o, Q.disabled && a.disabled, Q.error && a.error, h && a.fullWidth, Q.focused && a.focused, J && a.formControl, w && a.multiline, R && a.adornedStart, c && a.adornedEnd, "dense" === Q.margin && a.marginDense),
onClick: function (e) {
j.current && e.currentTarget === e.target && j.current.focus(), x && x(e)
},
ref: t
}, G), R, u.exports.createElement(Mg.Provider, {value: null}, u.exports.createElement(te, Jc({
"aria-invalid": Q.error,
"aria-describedby": n,
autoComplete: r,
autoFocus: i,
defaultValue: s,
disabled: Q.disabled,
id: p,
onAnimationStart: function (e) {
ee("mui-auto-fill-cancel" === e.animationName ? j.current : {value: "x"})
},
name: S,
placeholder: T,
readOnly: E,
required: Q.required,
rows: I,
value: B,
onKeyDown: C,
onKeyUp: A
}, ne, {
className: Xc(a.input, g.className, Q.disabled && a.disabled, w && a.inputMultiline, Q.hiddenLabel && a.inputHiddenLabel, R && a.inputAdornedStart, c && a.inputAdornedEnd, "search" === V && a.inputTypeSearch, "dense" === Q.margin && a.inputMarginDense),
onBlur: function (e) {
_ && _(e), g.onBlur && g.onBlur(e), J && J.onBlur ? J.onBlur(e) : X(!1)
},
onChange: function (e) {
if (!K) {
var t = e.target || j.current;
if (null == t) throw new Error(lu(1));
ee({value: t.value})
}
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) r[i - 1] = arguments[i];
g.onChange && g.onChange.apply(g, [e].concat(r)), k && k.apply(void 0, [e].concat(r))
},
onFocus: function (e) {
Q.disabled ? e.stopPropagation() : (P && P(e), g.onFocus && g.onFocus(e), J && J.onFocus ? J.onFocus(e) : X(!0))
}
}))), c, D ? D(Jc({}, Q, {startAdornment: R})) : null)
}), Qg = Um(function (e) {
var t = "light" === e.palette.type, n = {
color: "currentColor",
opacity: t ? .42 : .5,
transition: e.transitions.create("opacity", {duration: e.transitions.duration.shorter})
}, r = {opacity: "0 !important"}, i = {opacity: t ? .42 : .5};
return {
"@global": {"@keyframes mui-auto-fill": {}, "@keyframes mui-auto-fill-cancel": {}},
root: Jc({}, e.typography.body1, {
color: e.palette.text.primary,
lineHeight: "1.1876em",
boxSizing: "border-box",
position: "relative",
cursor: "text",
display: "inline-flex",
alignItems: "center",
"&$disabled": {color: e.palette.text.disabled, cursor: "default"}
}),
formControl: {},
focused: {},
disabled: {},
adornedStart: {},
adornedEnd: {},
error: {},
marginDense: {},
multiline: {padding: "".concat(6, "px 0 ").concat(7, "px"), "&$marginDense": {paddingTop: 3}},
colorSecondary: {},
fullWidth: {width: "100%"},
input: {
font: "inherit",
letterSpacing: "inherit",
color: "currentColor",
padding: "".concat(6, "px 0 ").concat(7, "px"),
border: 0,
boxSizing: "content-box",
background: "none",
height: "1.1876em",
margin: 0,
WebkitTapHighlightColor: "transparent",
display: "block",
minWidth: 0,
width: "100%",
animationName: "mui-auto-fill-cancel",
animationDuration: "10ms",
"&::-webkit-input-placeholder": n,
"&::-moz-placeholder": n,
"&:-ms-input-placeholder": n,
"&::-ms-input-placeholder": n,
"&:focus": {outline: 0},
"&:invalid": {boxShadow: "none"},
"&::-webkit-search-decoration": {"-webkit-appearance": "none"},
"label[data-shrink=false] + $formControl &": {
"&::-webkit-input-placeholder": r,
"&::-moz-placeholder": r,
"&:-ms-input-placeholder": r,
"&::-ms-input-placeholder": r,
"&:focus::-webkit-input-placeholder": i,
"&:focus::-moz-placeholder": i,
"&:focus:-ms-input-placeholder": i,
"&:focus::-ms-input-placeholder": i
},
"&$disabled": {opacity: 1},
"&:-webkit-autofill": {animationDuration: "5000s", animationName: "mui-auto-fill"}
},
inputMarginDense: {paddingTop: 3},
inputMultiline: {height: "auto", resize: "none", padding: 0},
inputTypeSearch: {"-moz-appearance": "textfield", "-webkit-appearance": "textfield"},
inputAdornedStart: {},
inputAdornedEnd: {},
inputHiddenLabel: {}
}
}, {name: "MuiInputBase"})(Jg), $g = u.exports.forwardRef(function (e, t) {
var n = e.disableUnderline, r = e.classes, i = e.fullWidth, a = void 0 !== i && i, o = e.inputComponent,
s = void 0 === o ? "input" : o, l = e.multiline, c = void 0 !== l && l, d = e.type,
h = void 0 === d ? "text" : d,
p = $c(e, ["disableUnderline", "classes", "fullWidth", "inputComponent", "multiline", "type"]);
return u.exports.createElement(Qg, Jc({
classes: Jc({}, r, {root: Xc(r.root, !n && r.underline), underline: null}),
fullWidth: a,
inputComponent: s,
multiline: c,
ref: t,
type: h
}, p))
});
$g.muiName = "Input";
var Zg = Um(function (e) {
var t = "light" === e.palette.type, n = t ? "rgba(0, 0, 0, 0.42)" : "rgba(255, 255, 255, 0.7)",
r = t ? "rgba(0, 0, 0, 0.09)" : "rgba(255, 255, 255, 0.09)";
return {
root: {
position: "relative",
backgroundColor: r,
borderTopLeftRadius: e.shape.borderRadius,
borderTopRightRadius: e.shape.borderRadius,
transition: e.transitions.create("background-color", {
duration: e.transitions.duration.shorter,
easing: e.transitions.easing.easeOut
}),
"&:hover": {
backgroundColor: t ? "rgba(0, 0, 0, 0.13)" : "rgba(255, 255, 255, 0.13)",
"@media (hover: none)": {backgroundColor: r}
},
"&$focused": {backgroundColor: t ? "rgba(0, 0, 0, 0.09)" : "rgba(255, 255, 255, 0.09)"},
"&$disabled": {backgroundColor: t ? "rgba(0, 0, 0, 0.12)" : "rgba(255, 255, 255, 0.12)"}
},
colorSecondary: {"&$underline:after": {borderBottomColor: e.palette.secondary.main}},
underline: {
"&:after": {
borderBottom: "2px solid ".concat(e.palette.primary.main),
left: 0,
bottom: 0,
content: '""',
position: "absolute",
right: 0,
transform: "scaleX(0)",
transition: e.transitions.create("transform", {
duration: e.transitions.duration.shorter,
easing: e.transitions.easing.easeOut
}),
pointerEvents: "none"
},
"&$focused:after": {transform: "scaleX(1)"},
"&$error:after": {borderBottomColor: e.palette.error.main, transform: "scaleX(1)"},
"&:before": {
borderBottom: "1px solid ".concat(n),
left: 0,
bottom: 0,
content: '"\\00a0"',
position: "absolute",
right: 0,
transition: e.transitions.create("border-bottom-color", {duration: e.transitions.duration.shorter}),
pointerEvents: "none"
},
"&:hover:before": {borderBottom: "1px solid ".concat(e.palette.text.primary)},
"&$disabled:before": {borderBottomStyle: "dotted"}
},
focused: {},
disabled: {},
adornedStart: {paddingLeft: 12},
adornedEnd: {paddingRight: 12},
error: {},
marginDense: {},
multiline: {padding: "27px 12px 10px", "&$marginDense": {paddingTop: 23, paddingBottom: 6}},
input: {
padding: "27px 12px 10px",
"&:-webkit-autofill": {
WebkitBoxShadow: "light" === e.palette.type ? null : "0 0 0 100px #266798 inset",
WebkitTextFillColor: "light" === e.palette.type ? null : "#fff",
caretColor: "light" === e.palette.type ? null : "#fff",
borderTopLeftRadius: "inherit",
borderTopRightRadius: "inherit"
}
},
inputMarginDense: {paddingTop: 23, paddingBottom: 6},
inputHiddenLabel: {
paddingTop: 18,
paddingBottom: 19,
"&$inputMarginDense": {paddingTop: 10, paddingBottom: 11}
},
inputMultiline: {padding: 0},
inputAdornedStart: {paddingLeft: 0},
inputAdornedEnd: {paddingRight: 0}
}
}, {name: "MuiFilledInput"})($g), ey = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.color, o = void 0 === a ? "primary" : a,
s = e.component, l = void 0 === s ? "div" : s, c = e.disabled, d = void 0 !== c && c, h = e.error,
p = void 0 !== h && h, f = e.fullWidth, m = void 0 !== f && f, v = e.focused, g = e.hiddenLabel,
y = void 0 !== g && g, b = e.margin, w = void 0 === b ? "none" : b, S = e.required, _ = void 0 !== S && S,
k = e.size, x = e.variant, P = void 0 === x ? "standard" : x,
C = $c(e, ["children", "classes", "className", "color", "component", "disabled", "error", "fullWidth", "focused", "hiddenLabel", "margin", "required", "size", "variant"]),
A = u.exports.useState(function () {
var e = !1;
return n && u.exports.Children.forEach(n, function (t) {
if (ag(t, ["Input", "Select"])) {
var n = ag(t, ["Select"]) ? t.props.input : t;
n && n.props.startAdornment && (e = !0)
}
}), e
}), T = A[0], E = A[1], D = u.exports.useState(function () {
var e = !1;
return n && u.exports.Children.forEach(n, function (t) {
ag(t, ["Input", "Select"]) && Yg(t.props, !0) && (e = !0)
}), e
}), I = D[0], L = D[1], O = u.exports.useState(!1), M = O[0], N = O[1], R = void 0 !== v ? v : M;
d && R && N(!1);
var W = u.exports.useCallback(function () {
L(!0)
}, []), V = u.exports.useCallback(function () {
L(!1)
}, []), F = {
adornedStart: T,
setAdornedStart: E,
color: o,
disabled: d,
error: p,
filled: I,
focused: R,
fullWidth: m,
hiddenLabel: y,
margin: ("small" === k ? "dense" : void 0) || w,
onBlur: function () {
N(!1)
},
onEmpty: V,
onFilled: W,
onFocus: function () {
N(!0)
},
registerEffect: void 0,
required: _,
variant: P
};
return u.exports.createElement(Mg.Provider, {value: F}, u.exports.createElement(l, Jc({
className: Xc(r.root, i, "none" !== w && r["margin".concat(qm(w))], m && r.fullWidth),
ref: t
}, C), n))
}), ty = Um({
root: {
display: "inline-flex",
flexDirection: "column",
position: "relative",
minWidth: 0,
padding: 0,
margin: 0,
border: 0,
verticalAlign: "top"
},
marginNormal: {marginTop: 16, marginBottom: 8},
marginDense: {marginTop: 8, marginBottom: 4},
fullWidth: {width: "100%"}
}, {name: "MuiFormControl"})(ey), ny = u.exports.forwardRef(function (e, t) {
e.checked;
var n = e.classes, r = e.className, i = e.control, a = e.disabled;
e.inputRef;
var o = e.label, s = e.labelPlacement, l = void 0 === s ? "end" : s;
e.name, e.onChange, e.value;
var c = $c(e, ["checked", "classes", "className", "control", "disabled", "inputRef", "label", "labelPlacement", "name", "onChange", "value"]),
d = Ng(), h = a;
void 0 === h && void 0 !== i.props.disabled && (h = i.props.disabled), void 0 === h && d && (h = d.disabled);
var p = {disabled: h};
return ["checked", "name", "onChange", "value", "inputRef"].forEach(function (t) {
void 0 === i.props[t] && void 0 !== e[t] && (p[t] = e[t])
}), u.exports.createElement("label", Jc({
className: Xc(n.root, r, "end" !== l && n["labelPlacement".concat(qm(l))], h && n.disabled),
ref: t
}, c), u.exports.cloneElement(i, p), u.exports.createElement(Yv, {
component: "span",
className: Xc(n.label, h && n.disabled)
}, o))
}), ry = Um(function (e) {
return {
root: {
display: "inline-flex",
alignItems: "center",
cursor: "pointer",
verticalAlign: "middle",
WebkitTapHighlightColor: "transparent",
marginLeft: -11,
marginRight: 16,
"&$disabled": {cursor: "default"}
},
labelPlacementStart: {flexDirection: "row-reverse", marginLeft: 16, marginRight: -11},
labelPlacementTop: {flexDirection: "column-reverse", marginLeft: 16},
labelPlacementBottom: {flexDirection: "column", marginLeft: 16},
disabled: {},
label: {"&$disabled": {color: e.palette.text.disabled}}
}
}, {name: "MuiFormControlLabel"})(ny), iy = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.row, a = void 0 !== i && i, o = $c(e, ["classes", "className", "row"]);
return u.exports.createElement("div", Jc({className: Xc(n.root, r, a && n.row), ref: t}, o))
}), ay = Um({
root: {display: "flex", flexDirection: "column", flexWrap: "wrap"},
row: {flexDirection: "row"}
}, {name: "MuiFormGroup"})(iy), oy = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.component, o = void 0 === a ? "p" : a;
e.disabled, e.error, e.filled, e.focused, e.margin, e.required, e.variant;
var s = $c(e, ["children", "classes", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"]),
l = Kg({
props: e,
muiFormControl: Ng(),
states: ["variant", "margin", "disabled", "error", "filled", "focused", "required"]
});
return u.exports.createElement(o, Jc({
className: Xc(r.root, ("filled" === l.variant || "outlined" === l.variant) && r.contained, i, l.disabled && r.disabled, l.error && r.error, l.filled && r.filled, l.focused && r.focused, l.required && r.required, "dense" === l.margin && r.marginDense),
ref: t
}, s), " " === n ? u.exports.createElement("span", {dangerouslySetInnerHTML: {__html: "&#8203;"}}) : n)
}), sy = Um(function (e) {
return {
root: Jc({color: e.palette.text.secondary}, e.typography.caption, {
textAlign: "left",
marginTop: 3,
margin: 0,
"&$disabled": {color: e.palette.text.disabled},
"&$error": {color: e.palette.error.main}
}),
error: {},
disabled: {},
marginDense: {marginTop: 4},
contained: {marginLeft: 14, marginRight: 14},
focused: {},
filled: {},
required: {}
}
}, {name: "MuiFormHelperText"})(oy), ly = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className;
e.color;
var a = e.component, o = void 0 === a ? "label" : a;
e.disabled, e.error, e.filled, e.focused, e.required;
var s = $c(e, ["children", "classes", "className", "color", "component", "disabled", "error", "filled", "focused", "required"]),
l = Kg({
props: e,
muiFormControl: Ng(),
states: ["color", "required", "focused", "disabled", "error", "filled"]
});
return u.exports.createElement(o, Jc({
className: Xc(r.root, r["color".concat(qm(l.color || "primary"))], i, l.disabled && r.disabled, l.error && r.error, l.filled && r.filled, l.focused && r.focused, l.required && r.required),
ref: t
}, s), n, l.required && u.exports.createElement("span", {
"aria-hidden": !0,
className: Xc(r.asterisk, l.error && r.error)
}, "", "*"))
}), cy = Um(function (e) {
return {
root: Jc({color: e.palette.text.secondary}, e.typography.body1, {
lineHeight: 1,
padding: 0,
"&$focused": {color: e.palette.primary.main},
"&$disabled": {color: e.palette.text.disabled},
"&$error": {color: e.palette.error.main}
}),
colorSecondary: {"&$focused": {color: e.palette.secondary.main}},
focused: {},
disabled: {},
error: {},
filled: {},
required: {},
asterisk: {"&$error": {color: e.palette.error.main}}
}
}, {name: "MuiFormLabel"})(ly), uy = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
dy = ["auto", !0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
function hy(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = parseFloat(e);
return "".concat(n / t).concat(String(e).replace(String(n), "") || "px")
}
var py = u.exports.forwardRef(function (e, t) {
var n = e.alignContent, r = void 0 === n ? "stretch" : n, i = e.alignItems, a = void 0 === i ? "stretch" : i,
o = e.classes, s = e.className, l = e.component, c = void 0 === l ? "div" : l, d = e.container,
h = void 0 !== d && d, p = e.direction, f = void 0 === p ? "row" : p, m = e.item, v = void 0 !== m && m,
g = e.justify, y = e.justifyContent, b = void 0 === y ? "flex-start" : y, w = e.lg, S = void 0 !== w && w,
_ = e.md, k = void 0 !== _ && _, x = e.sm, P = void 0 !== x && x, C = e.spacing, A = void 0 === C ? 0 : C,
T = e.wrap, E = void 0 === T ? "wrap" : T, D = e.xl, I = void 0 !== D && D, L = e.xs, O = void 0 !== L && L,
M = e.zeroMinWidth, N = void 0 !== M && M,
R = $c(e, ["alignContent", "alignItems", "classes", "className", "component", "container", "direction", "item", "justify", "justifyContent", "lg", "md", "sm", "spacing", "wrap", "xl", "xs", "zeroMinWidth"]),
W = Xc(o.root, s, h && [o.container, 0 !== A && o["spacing-xs-".concat(String(A))]], v && o.item, N && o.zeroMinWidth, "row" !== f && o["direction-xs-".concat(String(f))], "wrap" !== E && o["wrap-xs-".concat(String(E))], "stretch" !== a && o["align-items-xs-".concat(String(a))], "stretch" !== r && o["align-content-xs-".concat(String(r))], "flex-start" !== (g || b) && o["justify-content-xs-".concat(String(g || b))], !1 !== O && o["grid-xs-".concat(String(O))], !1 !== P && o["grid-sm-".concat(String(P))], !1 !== k && o["grid-md-".concat(String(k))], !1 !== S && o["grid-lg-".concat(String(S))], !1 !== I && o["grid-xl-".concat(String(I))]);
return u.exports.createElement(c, Jc({className: W, ref: t}, R))
}), fy = Um(function (e) {
return Jc({
root: {},
container: {boxSizing: "border-box", display: "flex", flexWrap: "wrap", width: "100%"},
item: {boxSizing: "border-box", margin: "0"},
zeroMinWidth: {minWidth: 0},
"direction-xs-column": {flexDirection: "column"},
"direction-xs-column-reverse": {flexDirection: "column-reverse"},
"direction-xs-row-reverse": {flexDirection: "row-reverse"},
"wrap-xs-nowrap": {flexWrap: "nowrap"},
"wrap-xs-wrap-reverse": {flexWrap: "wrap-reverse"},
"align-items-xs-center": {alignItems: "center"},
"align-items-xs-flex-start": {alignItems: "flex-start"},
"align-items-xs-flex-end": {alignItems: "flex-end"},
"align-items-xs-baseline": {alignItems: "baseline"},
"align-content-xs-center": {alignContent: "center"},
"align-content-xs-flex-start": {alignContent: "flex-start"},
"align-content-xs-flex-end": {alignContent: "flex-end"},
"align-content-xs-space-between": {alignContent: "space-between"},
"align-content-xs-space-around": {alignContent: "space-around"},
"justify-content-xs-center": {justifyContent: "center"},
"justify-content-xs-flex-end": {justifyContent: "flex-end"},
"justify-content-xs-space-between": {justifyContent: "space-between"},
"justify-content-xs-space-around": {justifyContent: "space-around"},
"justify-content-xs-space-evenly": {justifyContent: "space-evenly"}
}, function (e, t) {
var n = {};
return uy.forEach(function (r) {
var i = e.spacing(r);
0 !== i && (n["spacing-".concat(t, "-").concat(r)] = {
margin: "-".concat(hy(i, 2)),
width: "calc(100% + ".concat(hy(i), ")"),
"& > $item": {padding: hy(i, 2)}
})
}), n
}(e, "xs"), e.breakpoints.keys.reduce(function (t, n) {
return function (e, t, n) {
var r = {};
dy.forEach(function (e) {
var t = "grid-".concat(n, "-").concat(e);
if (!0 !== e) if ("auto" !== e) {
var i = "".concat(Math.round(e / 12 * 1e8) / 1e6, "%");
r[t] = {flexBasis: i, flexGrow: 0, maxWidth: i}
} else r[t] = {flexBasis: "auto", flexGrow: 0, maxWidth: "none"}; else r[t] = {
flexBasis: 0,
flexGrow: 1,
maxWidth: "100%"
}
}), "xs" === n ? Jc(e, r) : e[t.breakpoints.up(n)] = r
}(t, e, n), t
}, {}))
}, {name: "MuiGrid"})(py);
function my(e) {
return "scale(".concat(e, ", ").concat(Math.pow(e, 2), ")")
}
var vy = {entering: {opacity: 1, transform: my(1)}, entered: {opacity: 1, transform: "none"}},
gy = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.disableStrictModeCompat, i = void 0 !== r && r, a = e.in, o = e.onEnter,
s = e.onEntered, l = e.onEntering, c = e.onExit, d = e.onExited, h = e.onExiting, p = e.style, f = e.timeout,
m = void 0 === f ? "auto" : f, v = e.TransitionComponent, g = void 0 === v ? _v : v,
y = $c(e, ["children", "disableStrictModeCompat", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]),
b = u.exports.useRef(), w = u.exports.useRef(), S = Ev(), _ = S.unstable_strictMode && !i,
k = u.exports.useRef(null), x = Xm(n.ref, t), P = Xm(_ ? k : void 0, x), C = function (e) {
return function (t, n) {
if (e) {
var r = Am(_ ? [k.current, t] : [t, n], 2), i = r[0], a = r[1];
void 0 === a ? e(i) : e(i, a)
}
}
}, A = C(l), T = C(function (e, t) {
Dv(e);
var n, r = Iv({style: p, timeout: m}, {mode: "enter"}), i = r.duration, a = r.delay;
"auto" === m ? (n = S.transitions.getAutoHeightDuration(e.clientHeight), w.current = n) : n = i, e.style.transition = [S.transitions.create("opacity", {
duration: n,
delay: a
}), S.transitions.create("transform", {duration: .666 * n, delay: a})].join(","), o && o(e, t)
}), E = C(s), D = C(h), I = C(function (e) {
var t, n = Iv({style: p, timeout: m}, {mode: "exit"}), r = n.duration, i = n.delay;
"auto" === m ? (t = S.transitions.getAutoHeightDuration(e.clientHeight), w.current = t) : t = r, e.style.transition = [S.transitions.create("opacity", {
duration: t,
delay: i
}), S.transitions.create("transform", {
duration: .666 * t,
delay: i || .333 * t
})].join(","), e.style.opacity = "0", e.style.transform = my(.75), c && c(e)
}), L = C(d);
return u.exports.useEffect(function () {
return function () {
clearTimeout(b.current)
}
}, []), u.exports.createElement(g, Jc({
appear: !0,
in: a,
nodeRef: _ ? k : void 0,
onEnter: T,
onEntered: E,
onEntering: A,
onExit: I,
onExited: L,
onExiting: D,
addEndListener: function (e, t) {
var n = _ ? e : t;
"auto" === m && (b.current = setTimeout(n, w.current || 0))
},
timeout: "auto" === m ? null : m
}, y), function (e, t) {
return u.exports.cloneElement(n, Jc({
style: Jc({
opacity: 0,
transform: my(.75),
visibility: "exited" !== e || a ? void 0 : "hidden"
}, vy[e], p, n.props.style), ref: P
}, t))
})
});
gy.muiSupportAuto = !0;
var yy = gy, by = u.exports.forwardRef(function (e, t) {
var n = e.disableUnderline, r = e.classes, i = e.fullWidth, a = void 0 !== i && i, o = e.inputComponent,
s = void 0 === o ? "input" : o, l = e.multiline, c = void 0 !== l && l, d = e.type,
h = void 0 === d ? "text" : d,
p = $c(e, ["disableUnderline", "classes", "fullWidth", "inputComponent", "multiline", "type"]);
return u.exports.createElement(Qg, Jc({
classes: Jc({}, r, {root: Xc(r.root, !n && r.underline), underline: null}),
fullWidth: a,
inputComponent: s,
multiline: c,
ref: t,
type: h
}, p))
});
by.muiName = "Input";
var wy = Um(function (e) {
var t = "light" === e.palette.type ? "rgba(0, 0, 0, 0.42)" : "rgba(255, 255, 255, 0.7)";
return {
root: {position: "relative"},
formControl: {"label + &": {marginTop: 16}},
focused: {},
disabled: {},
colorSecondary: {"&$underline:after": {borderBottomColor: e.palette.secondary.main}},
underline: {
"&:after": {
borderBottom: "2px solid ".concat(e.palette.primary.main),
left: 0,
bottom: 0,
content: '""',
position: "absolute",
right: 0,
transform: "scaleX(0)",
transition: e.transitions.create("transform", {
duration: e.transitions.duration.shorter,
easing: e.transitions.easing.easeOut
}),
pointerEvents: "none"
},
"&$focused:after": {transform: "scaleX(1)"},
"&$error:after": {borderBottomColor: e.palette.error.main, transform: "scaleX(1)"},
"&:before": {
borderBottom: "1px solid ".concat(t),
left: 0,
bottom: 0,
content: '"\\00a0"',
position: "absolute",
right: 0,
transition: e.transitions.create("border-bottom-color", {duration: e.transitions.duration.shorter}),
pointerEvents: "none"
},
"&:hover:not($disabled):before": {
borderBottom: "2px solid ".concat(e.palette.text.primary),
"@media (hover: none)": {borderBottom: "1px solid ".concat(t)}
},
"&$disabled:before": {borderBottomStyle: "dotted"}
},
error: {},
marginDense: {},
multiline: {},
fullWidth: {},
input: {},
inputMarginDense: {},
inputMultiline: {},
inputTypeSearch: {}
}
}, {name: "MuiInput"})(by), Sy = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.component, o = void 0 === a ? "div" : a,
s = e.disablePointerEvents, l = void 0 !== s && s, c = e.disableTypography, d = void 0 !== c && c,
h = e.position, p = e.variant,
f = $c(e, ["children", "classes", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"]),
m = Og() || {}, v = p;
return p && m.variant, m && !v && (v = m.variant), u.exports.createElement(Mg.Provider, {value: null}, u.exports.createElement(o, Jc({
className: Xc(r.root, i, "end" === h ? r.positionEnd : r.positionStart, l && r.disablePointerEvents, m.hiddenLabel && r.hiddenLabel, "filled" === v && r.filled, "dense" === m.margin && r.marginDense),
ref: t
}, f), "string" != typeof n || d ? n : u.exports.createElement(Yv, {color: "textSecondary"}, n)))
}), _y = Um({
root: {display: "flex", height: "0.01em", maxHeight: "2em", alignItems: "center", whiteSpace: "nowrap"},
filled: {"&$positionStart:not($hiddenLabel)": {marginTop: 16}},
positionStart: {marginRight: 8},
positionEnd: {marginLeft: 8},
disablePointerEvents: {pointerEvents: "none"},
hiddenLabel: {},
marginDense: {}
}, {name: "MuiInputAdornment"})(Sy), ky = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.disableAnimation, a = void 0 !== i && i;
e.margin;
var o = e.shrink;
e.variant;
var s = $c(e, ["classes", "className", "disableAnimation", "margin", "shrink", "variant"]), l = Ng(), c = o;
void 0 === c && l && (c = l.filled || l.focused || l.adornedStart);
var d = Kg({props: e, muiFormControl: l, states: ["margin", "variant"]});
return u.exports.createElement(cy, Jc({
"data-shrink": c,
className: Xc(n.root, r, l && n.formControl, !a && n.animated, c && n.shrink, "dense" === d.margin && n.marginDense, {
filled: n.filled,
outlined: n.outlined
}[d.variant]),
classes: {focused: n.focused, disabled: n.disabled, error: n.error, required: n.required, asterisk: n.asterisk},
ref: t
}, s))
}), xy = Um(function (e) {
return {
root: {display: "block", transformOrigin: "top left"},
focused: {},
disabled: {},
error: {},
required: {},
asterisk: {},
formControl: {position: "absolute", left: 0, top: 0, transform: "translate(0, 24px) scale(1)"},
marginDense: {transform: "translate(0, 21px) scale(1)"},
shrink: {transform: "translate(0, 1.5px) scale(0.75)", transformOrigin: "top left"},
animated: {
transition: e.transitions.create(["color", "transform"], {
duration: e.transitions.duration.shorter,
easing: e.transitions.easing.easeOut
})
},
filled: {
zIndex: 1,
pointerEvents: "none",
transform: "translate(12px, 20px) scale(1)",
"&$marginDense": {transform: "translate(12px, 17px) scale(1)"},
"&$shrink": {
transform: "translate(12px, 10px) scale(0.75)",
"&$marginDense": {transform: "translate(12px, 7px) scale(0.75)"}
}
},
outlined: {
zIndex: 1,
pointerEvents: "none",
transform: "translate(14px, 20px) scale(1)",
"&$marginDense": {transform: "translate(14px, 12px) scale(1)"},
"&$shrink": {transform: "translate(14px, -6px) scale(0.75)"}
}
}
}, {name: "MuiInputLabel"})(ky), Py = u.exports.createContext({}), Cy = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.className, a = e.component, o = void 0 === a ? "ul" : a, s = e.dense,
l = void 0 !== s && s, c = e.disablePadding, d = void 0 !== c && c, h = e.subheader,
p = $c(e, ["children", "classes", "className", "component", "dense", "disablePadding", "subheader"]),
f = u.exports.useMemo(function () {
return {dense: l}
}, [l]);
return u.exports.createElement(Py.Provider, {value: f}, u.exports.createElement(o, Jc({
className: Xc(r.root, i, l && r.dense, !d && r.padding, h && r.subheader),
ref: t
}, p), h, n))
}), Ay = Um({
root: {listStyle: "none", margin: 0, padding: 0, position: "relative"},
padding: {paddingTop: 8, paddingBottom: 8},
dense: {},
subheader: {paddingTop: 0}
}, {name: "MuiList"})(Cy), Ty = "undefined" == typeof window ? u.exports.useEffect : u.exports.useLayoutEffect,
Ey = u.exports.forwardRef(function (e, t) {
var n = e.alignItems, r = void 0 === n ? "center" : n, i = e.autoFocus, a = void 0 !== i && i, o = e.button,
s = void 0 !== o && o, l = e.children, c = e.classes, d = e.className, h = e.component,
p = e.ContainerComponent, f = void 0 === p ? "li" : p, m = e.ContainerProps,
v = (m = void 0 === m ? {} : m).className, g = $c(m, ["className"]), y = e.dense, b = void 0 !== y && y,
w = e.disabled, S = void 0 !== w && w, _ = e.disableGutters, k = void 0 !== _ && _, x = e.divider,
P = void 0 !== x && x, C = e.focusVisibleClassName, A = e.selected, T = void 0 !== A && A,
E = $c(e, ["alignItems", "autoFocus", "button", "children", "classes", "className", "component", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "divider", "focusVisibleClassName", "selected"]),
D = u.exports.useContext(Py), I = {dense: b || D.dense || !1, alignItems: r}, L = u.exports.useRef(null);
Ty(function () {
a && L.current && L.current.focus()
}, [a]);
var O = u.exports.Children.toArray(l), M = O.length && ag(O[O.length - 1], ["ListItemSecondaryAction"]),
N = Xm(u.exports.useCallback(function (e) {
L.current = H.exports.findDOMNode(e)
}, []), t), R = Jc({
className: Xc(c.root, d, I.dense && c.dense, !k && c.gutters, P && c.divider, S && c.disabled, s && c.button, "center" !== r && c.alignItemsFlexStart, M && c.secondaryAction, T && c.selected),
disabled: S
}, E), W = h || "li";
return s && (R.component = h || "div", R.focusVisibleClassName = Xc(c.focusVisible, C), W = Pg), M ? (W = R.component || h ? W : "div", "li" === f && ("li" === W ? W = "div" : "li" === R.component && (R.component = "div")), u.exports.createElement(Py.Provider, {value: I}, u.exports.createElement(f, Jc({
className: Xc(c.container, v),
ref: N
}, g), u.exports.createElement(W, R, O), O.pop()))) : u.exports.createElement(Py.Provider, {value: I}, u.exports.createElement(W, Jc({ref: N}, R), O))
}), Dy = Um(function (e) {
return {
root: {
display: "flex",
justifyContent: "flex-start",
alignItems: "center",
position: "relative",
textDecoration: "none",
width: "100%",
boxSizing: "border-box",
textAlign: "left",
paddingTop: 8,
paddingBottom: 8,
"&$focusVisible": {backgroundColor: e.palette.action.selected},
"&$selected, &$selected:hover": {backgroundColor: e.palette.action.selected},
"&$disabled": {opacity: .5}
},
container: {position: "relative"},
focusVisible: {},
dense: {paddingTop: 4, paddingBottom: 4},
alignItemsFlexStart: {alignItems: "flex-start"},
disabled: {},
divider: {borderBottom: "1px solid ".concat(e.palette.divider), backgroundClip: "padding-box"},
gutters: {paddingLeft: 16, paddingRight: 16},
button: {
transition: e.transitions.create("background-color", {duration: e.transitions.duration.shortest}),
"&:hover": {
textDecoration: "none",
backgroundColor: e.palette.action.hover,
"@media (hover: none)": {backgroundColor: "transparent"}
}
},
secondaryAction: {paddingRight: 48},
selected: {}
}
}, {name: "MuiListItem"})(Ey);
function Iy(e, t) {
var n = 0;
return "number" == typeof t ? n = t : "center" === t ? n = e.height / 2 : "bottom" === t && (n = e.height), n
}
function Ly(e, t) {
var n = 0;
return "number" == typeof t ? n = t : "center" === t ? n = e.width / 2 : "right" === t && (n = e.width), n
}
function Oy(e) {
return [e.horizontal, e.vertical].map(function (e) {
return "number" == typeof e ? "".concat(e, "px") : e
}).join(" ")
}
function My(e) {
return "function" == typeof e ? e() : e
}
var Ny = u.exports.forwardRef(function (e, t) {
var n = e.action, r = e.anchorEl, i = e.anchorOrigin,
a = void 0 === i ? {vertical: "top", horizontal: "left"} : i, o = e.anchorPosition, s = e.anchorReference,
l = void 0 === s ? "anchorEl" : s, c = e.children, d = e.classes, h = e.className, p = e.container,
f = e.elevation, m = void 0 === f ? 8 : f, v = e.getContentAnchorEl, g = e.marginThreshold,
y = void 0 === g ? 16 : g, b = e.onEnter, w = e.onEntered, S = e.onEntering, _ = e.onExit, k = e.onExited,
x = e.onExiting, P = e.open, C = e.PaperProps, A = void 0 === C ? {} : C, T = e.transformOrigin,
E = void 0 === T ? {vertical: "top", horizontal: "left"} : T, D = e.TransitionComponent,
I = void 0 === D ? yy : D, L = e.transitionDuration, O = void 0 === L ? "auto" : L, M = e.TransitionProps,
N = void 0 === M ? {} : M,
R = $c(e, ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "classes", "className", "container", "elevation", "getContentAnchorEl", "marginThreshold", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "open", "PaperProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"]),
W = u.exports.useRef(), V = u.exports.useCallback(function (e) {
if ("anchorPosition" === l) return o;
var t = My(r), n = (t && 1 === t.nodeType ? t : Hm(W.current).body).getBoundingClientRect(),
i = 0 === e ? a.vertical : "center";
return {top: n.top + Iy(n, i), left: n.left + Ly(n, a.horizontal)}
}, [r, a.horizontal, a.vertical, o, l]), F = u.exports.useCallback(function (e) {
var t = 0;
if (v && "anchorEl" === l) {
var n = v(e);
if (n && e.contains(n)) {
var r = function (e, t) {
for (var n = t, r = 0; n && n !== e;) r += (n = n.parentElement).scrollTop;
return r
}(e, n);
t = n.offsetTop + n.clientHeight / 2 - r || 0
}
}
return t
}, [a.vertical, l, v]), G = u.exports.useCallback(function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return {vertical: Iy(e, E.vertical) + t, horizontal: Ly(e, E.horizontal)}
}, [E.horizontal, E.vertical]), B = u.exports.useCallback(function (e) {
var t = F(e), n = {width: e.offsetWidth, height: e.offsetHeight}, i = G(n, t);
if ("none" === l) return {top: null, left: null, transformOrigin: Oy(i)};
var a = V(t), o = a.top - i.vertical, s = a.left - i.horizontal, c = o + n.height, u = s + n.width,
d = nv(My(r)), h = d.innerHeight - y, p = d.innerWidth - y;
if (o < y) {
var f = o - y;
o -= f, i.vertical += f
} else if (c > h) {
var m = c - h;
o -= m, i.vertical += m
}
if (s < y) {
var v = s - y;
s -= v, i.horizontal += v
} else if (u > p) {
var g = u - p;
s -= g, i.horizontal += g
}
return {top: "".concat(Math.round(o), "px"), left: "".concat(Math.round(s), "px"), transformOrigin: Oy(i)}
}, [r, l, V, F, G, y]), K = u.exports.useCallback(function () {
var e = W.current;
if (e) {
var t = B(e);
null !== t.top && (e.style.top = t.top), null !== t.left && (e.style.left = t.left), e.style.transformOrigin = t.transformOrigin
}
}, [B]), j = u.exports.useCallback(function (e) {
W.current = H.exports.findDOMNode(e)
}, []);
u.exports.useEffect(function () {
P && K()
}), u.exports.useImperativeHandle(n, function () {
return P ? {
updatePosition: function () {
K()
}
} : null
}, [P, K]), u.exports.useEffect(function () {
if (P) {
var e = ig(function () {
K()
});
return window.addEventListener("resize", e), function () {
e.clear(), window.removeEventListener("resize", e)
}
}
}, [P, K]);
var z = O;
"auto" !== O || I.muiSupportAuto || (z = void 0);
var U = p || (r ? Hm(My(r)).body : void 0);
return u.exports.createElement(pv, Jc({
container: U,
open: P,
ref: t,
BackdropProps: {invisible: !0},
className: Xc(d.root, h)
}, R), u.exports.createElement(I, Jc({
appear: !0,
in: P,
onEnter: b,
onEntered: w,
onExit: _,
onExited: k,
onExiting: x,
timeout: z
}, N, {
onEntering: $m(function (e, t) {
S && S(e, t), K()
}, N.onEntering)
}), u.exports.createElement(Vv, Jc({elevation: m, ref: j}, A, {className: Xc(d.paper, A.className)}), c)))
}), Ry = Um({
root: {},
paper: {
position: "absolute",
overflowY: "auto",
overflowX: "hidden",
minWidth: 16,
minHeight: 16,
maxWidth: "calc(100% - 32px)",
maxHeight: "calc(100% - 32px)",
outline: 0
}
}, {name: "MuiPopover"})(Ny);
function Wy(e, t, n) {
return e === t ? e.firstChild : t && t.nextElementSibling ? t.nextElementSibling : n ? null : e.firstChild
}
function Vy(e, t, n) {
return e === t ? n ? e.firstChild : e.lastChild : t && t.previousElementSibling ? t.previousElementSibling : n ? null : e.lastChild
}
function Fy(e, t) {
if (void 0 === t) return !0;
var n = e.innerText;
return void 0 === n && (n = e.textContent), 0 !== (n = n.trim().toLowerCase()).length && (t.repeating ? n[0] === t.keys[0] : 0 === n.indexOf(t.keys.join("")))
}
function Gy(e, t, n, r, i, a) {
for (var o = !1, s = i(e, t, !!t && n); s;) {
if (s === e.firstChild) {
if (o) return;
o = !0
}
var l = !r && (s.disabled || "true" === s.getAttribute("aria-disabled"));
if (s.hasAttribute("tabindex") && Fy(s, a) && !l) return void s.focus();
s = i(e, s, n)
}
}
var By = "undefined" == typeof window ? u.exports.useEffect : u.exports.useLayoutEffect,
Ky = u.exports.forwardRef(function (e, t) {
var n = e.actions, r = e.autoFocus, i = void 0 !== r && r, a = e.autoFocusItem, o = void 0 !== a && a,
s = e.children, l = e.className, c = e.disabledItemsFocusable, d = void 0 !== c && c, h = e.disableListWrap,
p = void 0 !== h && h, f = e.onKeyDown, m = e.variant, v = void 0 === m ? "selectedMenu" : m,
g = $c(e, ["actions", "autoFocus", "autoFocusItem", "children", "className", "disabledItemsFocusable", "disableListWrap", "onKeyDown", "variant"]),
y = u.exports.useRef(null),
b = u.exports.useRef({keys: [], repeating: !0, previousKeyMatched: !0, lastTime: null});
By(function () {
i && y.current.focus()
}, [i]), u.exports.useImperativeHandle(n, function () {
return {
adjustStyleForScrollbar: function (e, t) {
var n = !y.current.style.width;
if (e.clientHeight < y.current.clientHeight && n) {
var r = "".concat(tv(), "px");
y.current.style["rtl" === t.direction ? "paddingLeft" : "paddingRight"] = r, y.current.style.width = "calc(100% + ".concat(r, ")")
}
return y.current
}
}
}, []);
var w = Xm(u.exports.useCallback(function (e) {
y.current = H.exports.findDOMNode(e)
}, []), t), S = -1;
u.exports.Children.forEach(s, function (e, t) {
u.exports.isValidElement(e) && (e.props.disabled || ("selectedMenu" === v && e.props.selected ? S = t : -1 === S && (S = t)))
});
var _ = u.exports.Children.map(s, function (e, t) {
if (t === S) {
var n = {};
return o && (n.autoFocus = !0), void 0 === e.props.tabIndex && "selectedMenu" === v && (n.tabIndex = 0), u.exports.cloneElement(e, n)
}
return e
});
return u.exports.createElement(Ay, Jc({
role: "menu", ref: w, className: l, onKeyDown: function (e) {
var t = y.current, n = e.key, r = Hm(t).activeElement;
if ("ArrowDown" === n) e.preventDefault(), Gy(t, r, p, d, Wy); else if ("ArrowUp" === n) e.preventDefault(), Gy(t, r, p, d, Vy); else if ("Home" === n) e.preventDefault(), Gy(t, null, p, d, Wy); else if ("End" === n) e.preventDefault(), Gy(t, null, p, d, Vy); else if (1 === n.length) {
var i = b.current, a = n.toLowerCase(), o = performance.now();
i.keys.length > 0 && (o - i.lastTime > 500 ? (i.keys = [], i.repeating = !0, i.previousKeyMatched = !0) : i.repeating && a !== i.keys[0] && (i.repeating = !1)), i.lastTime = o, i.keys.push(a);
var s = r && !i.repeating && Fy(r, i);
i.previousKeyMatched && (s || Gy(t, r, !1, d, Wy, i)) ? e.preventDefault() : i.previousKeyMatched = !1
}
f && f(e)
}, tabIndex: i ? 0 : -1
}, g), _)
}), jy = {vertical: "top", horizontal: "right"}, zy = {vertical: "top", horizontal: "left"},
Uy = u.exports.forwardRef(function (e, t) {
var n = e.autoFocus, r = void 0 === n || n, i = e.children, a = e.classes, o = e.disableAutoFocusItem,
s = void 0 !== o && o, l = e.MenuListProps, c = void 0 === l ? {} : l, d = e.onClose, h = e.onEntering,
p = e.open, f = e.PaperProps, m = void 0 === f ? {} : f, v = e.PopoverClasses, g = e.transitionDuration,
y = void 0 === g ? "auto" : g, b = e.TransitionProps, w = (b = void 0 === b ? {} : b).onEntering,
S = $c(b, ["onEntering"]), _ = e.variant, k = void 0 === _ ? "selectedMenu" : _,
x = $c(e, ["autoFocus", "children", "classes", "disableAutoFocusItem", "MenuListProps", "onClose", "onEntering", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"]),
P = Ev(), C = r && !s && p, A = u.exports.useRef(null), T = u.exports.useRef(null), E = -1;
u.exports.Children.map(i, function (e, t) {
u.exports.isValidElement(e) && (e.props.disabled || ("menu" !== k && e.props.selected ? E = t : -1 === E && (E = t)))
});
var D = u.exports.Children.map(i, function (e, t) {
return t === E ? u.exports.cloneElement(e, {
ref: function (t) {
T.current = H.exports.findDOMNode(t), Ym(e.ref, t)
}
}) : e
});
return u.exports.createElement(Ry, Jc({
getContentAnchorEl: function () {
return T.current
},
classes: v,
onClose: d,
TransitionProps: Jc({
onEntering: function (e, t) {
A.current && A.current.adjustStyleForScrollbar(e, P), h && h(e, t), w && w(e, t)
}
}, S),
anchorOrigin: "rtl" === P.direction ? jy : zy,
transformOrigin: "rtl" === P.direction ? jy : zy,
PaperProps: Jc({}, m, {classes: Jc({}, m.classes, {root: a.paper})}),
open: p,
ref: t,
transitionDuration: y
}, x), u.exports.createElement(Ky, Jc({
onKeyDown: function (e) {
"Tab" === e.key && (e.preventDefault(), d && d(e, "tabKeyDown"))
}, actions: A, autoFocus: r && (-1 === E || s), autoFocusItem: C, variant: k
}, c, {className: Xc(a.list, c.className)}), D))
}), qy = Um({
paper: {maxHeight: "calc(100% - 96px)", WebkitOverflowScrolling: "touch"},
list: {outline: 0}
}, {name: "MuiMenu"})(Uy), Hy = u.exports.forwardRef(function (e, t) {
var n, r = e.classes, i = e.className, a = e.component, o = void 0 === a ? "li" : a, s = e.disableGutters,
l = void 0 !== s && s, c = e.ListItemClasses, d = e.role, h = void 0 === d ? "menuitem" : d, p = e.selected,
f = e.tabIndex,
m = $c(e, ["classes", "className", "component", "disableGutters", "ListItemClasses", "role", "selected", "tabIndex"]);
return e.disabled || (n = void 0 !== f ? f : -1), u.exports.createElement(Dy, Jc({
button: !0,
role: h,
tabIndex: n,
component: o,
selected: p,
disableGutters: l,
classes: Jc({dense: r.dense}, c),
className: Xc(r.root, i, p && r.selected, !l && r.gutters),
ref: t
}, m))
}), Yy = Um(function (e) {
return {
root: Jc({}, e.typography.body1, Zc({
minHeight: 48,
paddingTop: 6,
paddingBottom: 6,
boxSizing: "border-box",
width: "auto",
overflow: "hidden",
whiteSpace: "nowrap"
}, e.breakpoints.up("sm"), {minHeight: "auto"})),
gutters: {},
selected: {},
dense: Jc({}, e.typography.body2, {minHeight: "auto"})
}
}, {name: "MuiMenuItem"})(Hy), Xy = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.disabled, a = e.IconComponent, o = e.inputRef, s = e.variant,
l = void 0 === s ? "standard" : s,
c = $c(e, ["classes", "className", "disabled", "IconComponent", "inputRef", "variant"]);
return u.exports.createElement(u.exports.Fragment, null, u.exports.createElement("select", Jc({
className: Xc(n.root, n.select, n[l], r, i && n.disabled),
disabled: i,
ref: o || t
}, c)), e.multiple ? null : u.exports.createElement(a, {className: Xc(n.icon, n["icon".concat(qm(l))], i && n.disabled)}))
}), Jy = rg(u.exports.createElement("path", {d: "M7 10l5 5 5-5z"})), Qy = function (e) {
return {
root: {},
select: {
"-moz-appearance": "none",
"-webkit-appearance": "none",
userSelect: "none",
borderRadius: 0,
minWidth: 16,
cursor: "pointer",
"&:focus": {
backgroundColor: "light" === e.palette.type ? "rgba(0, 0, 0, 0.05)" : "rgba(255, 255, 255, 0.05)",
borderRadius: 0
},
"&::-ms-expand": {display: "none"},
"&$disabled": {cursor: "default"},
"&[multiple]": {height: "auto"},
"&:not([multiple]) option, &:not([multiple]) optgroup": {backgroundColor: e.palette.background.paper},
"&&": {paddingRight: 24}
},
filled: {"&&": {paddingRight: 32}},
outlined: {borderRadius: e.shape.borderRadius, "&&": {paddingRight: 32}},
selectMenu: {
height: "auto",
minHeight: "1.1876em",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
overflow: "hidden"
},
disabled: {},
icon: {
position: "absolute",
right: 0,
top: "calc(50% - 12px)",
pointerEvents: "none",
color: e.palette.action.active,
"&$disabled": {color: e.palette.action.disabled}
},
iconOpen: {transform: "rotate(180deg)"},
iconFilled: {right: 7},
iconOutlined: {right: 7},
nativeInput: {bottom: 0, left: 0, position: "absolute", opacity: 0, pointerEvents: "none", width: "100%"}
}
}, $y = u.exports.createElement(wy, null), Zy = u.exports.forwardRef(function (e, t) {
var n = e.children, r = e.classes, i = e.IconComponent, a = void 0 === i ? Jy : i, o = e.input,
s = void 0 === o ? $y : o, l = e.inputProps;
e.variant;
var c = $c(e, ["children", "classes", "IconComponent", "input", "inputProps", "variant"]),
d = Kg({props: e, muiFormControl: Ng(), states: ["variant"]});
return u.exports.cloneElement(s, Jc({
inputComponent: Xy,
inputProps: Jc({
children: n,
classes: r,
IconComponent: a,
variant: d.variant,
type: void 0
}, l, s ? s.props.inputProps : {}),
ref: t
}, c))
});
Zy.muiName = "Select", Um(Qy, {name: "MuiNativeSelect"})(Zy);
var eb = u.exports.forwardRef(function (e, t) {
e.children;
var n = e.classes, r = e.className, i = e.label, a = e.labelWidth, o = e.notched, s = e.style,
l = $c(e, ["children", "classes", "className", "label", "labelWidth", "notched", "style"]),
c = "rtl" === Ev().direction ? "right" : "left";
if (void 0 !== i) return u.exports.createElement("fieldset", Jc({
"aria-hidden": !0,
className: Xc(n.root, r),
ref: t,
style: s
}, l), u.exports.createElement("legend", {className: Xc(n.legendLabelled, o && n.legendNotched)}, i ? u.exports.createElement("span", null, i) : u.exports.createElement("span", {dangerouslySetInnerHTML: {__html: "&#8203;"}})));
var d = a > 0 ? .75 * a + 8 : .01;
return u.exports.createElement("fieldset", Jc({
"aria-hidden": !0,
style: Jc(Zc({}, "padding".concat(qm(c)), 8), s),
className: Xc(n.root, r),
ref: t
}, l), u.exports.createElement("legend", {
className: n.legend,
style: {width: o ? d : .01}
}, u.exports.createElement("span", {dangerouslySetInnerHTML: {__html: "&#8203;"}})))
}), tb = Um(function (e) {
return {
root: {
position: "absolute",
bottom: 0,
right: 0,
top: -5,
left: 0,
margin: 0,
padding: "0 8px",
pointerEvents: "none",
borderRadius: "inherit",
borderStyle: "solid",
borderWidth: 1,
overflow: "hidden"
},
legend: {
textAlign: "left",
padding: 0,
lineHeight: "11px",
transition: e.transitions.create("width", {duration: 150, easing: e.transitions.easing.easeOut})
},
legendLabelled: {
display: "block",
width: "auto",
textAlign: "left",
padding: 0,
height: 11,
fontSize: "0.75em",
visibility: "hidden",
maxWidth: .01,
transition: e.transitions.create("max-width", {duration: 50, easing: e.transitions.easing.easeOut}),
"& > span": {paddingLeft: 5, paddingRight: 5, display: "inline-block"}
},
legendNotched: {
maxWidth: 1e3,
transition: e.transitions.create("max-width", {
duration: 100,
easing: e.transitions.easing.easeOut,
delay: 50
})
}
}
}, {name: "PrivateNotchedOutline"})(eb), nb = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.fullWidth, i = void 0 !== r && r, a = e.inputComponent, o = void 0 === a ? "input" : a,
s = e.label, l = e.labelWidth, c = void 0 === l ? 0 : l, d = e.multiline, h = void 0 !== d && d, p = e.notched,
f = e.type, m = void 0 === f ? "text" : f,
v = $c(e, ["classes", "fullWidth", "inputComponent", "label", "labelWidth", "multiline", "notched", "type"]);
return u.exports.createElement(Qg, Jc({
renderSuffix: function (e) {
return u.exports.createElement(tb, {
className: n.notchedOutline,
label: s,
labelWidth: c,
notched: void 0 !== p ? p : Boolean(e.startAdornment || e.filled || e.focused)
})
},
classes: Jc({}, n, {root: Xc(n.root, n.underline), notchedOutline: null}),
fullWidth: i,
inputComponent: o,
multiline: h,
ref: t,
type: m
}, v))
});
nb.muiName = "Input";
var rb = Um(function (e) {
var t = "light" === e.palette.type ? "rgba(0, 0, 0, 0.23)" : "rgba(255, 255, 255, 0.23)";
return {
root: {
position: "relative",
borderRadius: e.shape.borderRadius,
"&:hover $notchedOutline": {borderColor: e.palette.text.primary},
"@media (hover: none)": {"&:hover $notchedOutline": {borderColor: t}},
"&$focused $notchedOutline": {borderColor: e.palette.primary.main, borderWidth: 2},
"&$error $notchedOutline": {borderColor: e.palette.error.main},
"&$disabled $notchedOutline": {borderColor: e.palette.action.disabled}
},
colorSecondary: {"&$focused $notchedOutline": {borderColor: e.palette.secondary.main}},
focused: {},
disabled: {},
adornedStart: {paddingLeft: 14},
adornedEnd: {paddingRight: 14},
error: {},
marginDense: {},
multiline: {padding: "18.5px 14px", "&$marginDense": {paddingTop: 10.5, paddingBottom: 10.5}},
notchedOutline: {borderColor: t},
input: {
padding: "18.5px 14px",
"&:-webkit-autofill": {
WebkitBoxShadow: "light" === e.palette.type ? null : "0 0 0 100px #266798 inset",
WebkitTextFillColor: "light" === e.palette.type ? null : "#fff",
caretColor: "light" === e.palette.type ? null : "#fff",
borderRadius: "inherit"
}
},
inputMarginDense: {paddingTop: 10.5, paddingBottom: 10.5},
inputMultiline: {padding: 0},
inputAdornedStart: {paddingLeft: 0},
inputAdornedEnd: {paddingRight: 0}
}
}, {name: "MuiOutlinedInput"})(nb),
ib = "undefined" != typeof window && "undefined" != typeof document && "undefined" != typeof navigator,
ab = function () {
for (var e = ["Edge", "Trident", "Firefox"], t = 0; t < e.length; t += 1) if (ib && navigator.userAgent.indexOf(e[t]) >= 0) return 1;
return 0
}();
var ob = ib && window.Promise ? function (e) {
var t = !1;
return function () {
t || (t = !0, window.Promise.resolve().then(function () {
t = !1, e()
}))
}
} : function (e) {
var t = !1;
return function () {
t || (t = !0, setTimeout(function () {
t = !1, e()
}, ab))
}
};
function sb(e) {
return e && "[object Function]" === {}.toString.call(e)
}
function lb(e, t) {
if (1 !== e.nodeType) return [];
var n = e.ownerDocument.defaultView.getComputedStyle(e, null);
return t ? n[t] : n
}
function cb(e) {
return "HTML" === e.nodeName ? e : e.parentNode || e.host
}
function ub(e) {
if (!e) return document.body;
switch (e.nodeName) {
case"HTML":
case"BODY":
return e.ownerDocument.body;
case"#document":
return e.body
}
var t = lb(e), n = t.overflow, r = t.overflowX, i = t.overflowY;
return /(auto|scroll|overlay)/.test(n + i + r) ? e : ub(cb(e))
}
function db(e) {
return e && e.referenceNode ? e.referenceNode : e
}
var hb = ib && !(!window.MSInputMethodContext || !document.documentMode),
pb = ib && /MSIE 10/.test(navigator.userAgent);
function fb(e) {
return 11 === e ? hb : 10 === e ? pb : hb || pb
}
function mb(e) {
if (!e) return document.documentElement;
for (var t = fb(10) ? document.body : null, n = e.offsetParent || null; n === t && e.nextElementSibling;) n = (e = e.nextElementSibling).offsetParent;
var r = n && n.nodeName;
return r && "BODY" !== r && "HTML" !== r ? -1 !== ["TH", "TD", "TABLE"].indexOf(n.nodeName) && "static" === lb(n, "position") ? mb(n) : n : e ? e.ownerDocument.documentElement : document.documentElement
}
function vb(e) {
return null !== e.parentNode ? vb(e.parentNode) : e
}
function gb(e, t) {
if (!(e && e.nodeType && t && t.nodeType)) return document.documentElement;
var n = e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING, r = n ? e : t, i = n ? t : e,
a = document.createRange();
a.setStart(r, 0), a.setEnd(i, 0);
var o, s, l = a.commonAncestorContainer;
if (e !== l && t !== l || r.contains(i)) return "BODY" === (s = (o = l).nodeName) || "HTML" !== s && mb(o.firstElementChild) !== o ? mb(l) : l;
var c = vb(e);
return c.host ? gb(c.host, t) : gb(e, vb(t).host)
}
function yb(e) {
var t = "top" === (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "top") ? "scrollTop" : "scrollLeft",
n = e.nodeName;
if ("BODY" === n || "HTML" === n) {
var r = e.ownerDocument.documentElement;
return (e.ownerDocument.scrollingElement || r)[t]
}
return e[t]
}
function bb(e, t) {
var n = "x" === t ? "Left" : "Top", r = "Left" === n ? "Right" : "Bottom";
return parseFloat(e["border" + n + "Width"]) + parseFloat(e["border" + r + "Width"])
}
function wb(e, t, n, r) {
return Math.max(t["offset" + e], t["scroll" + e], n["client" + e], n["offset" + e], n["scroll" + e], fb(10) ? parseInt(n["offset" + e]) + parseInt(r["margin" + ("Height" === e ? "Top" : "Left")]) + parseInt(r["margin" + ("Height" === e ? "Bottom" : "Right")]) : 0)
}
function Sb(e) {
var t = e.body, n = e.documentElement, r = fb(10) && getComputedStyle(n);
return {height: wb("Height", t, n, r), width: wb("Width", t, n, r)}
}
var _b = function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}, kb = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), xb = function (e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}, Pb = Object.assign || function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
};
function Cb(e) {
return Pb({}, e, {right: e.left + e.width, bottom: e.top + e.height})
}
function Ab(e) {
var t = {};
try {
if (fb(10)) {
t = e.getBoundingClientRect();
var n = yb(e, "top"), r = yb(e, "left");
t.top += n, t.left += r, t.bottom += n, t.right += r
} else t = e.getBoundingClientRect()
} catch (e) {
}
var i = {left: t.left, top: t.top, width: t.right - t.left, height: t.bottom - t.top},
a = "HTML" === e.nodeName ? Sb(e.ownerDocument) : {}, o = a.width || e.clientWidth || i.width,
s = a.height || e.clientHeight || i.height, l = e.offsetWidth - o, c = e.offsetHeight - s;
if (l || c) {
var u = lb(e);
l -= bb(u, "x"), c -= bb(u, "y"), i.width -= l, i.height -= c
}
return Cb(i)
}
function Tb(e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = fb(10), i = "HTML" === t.nodeName,
a = Ab(e), o = Ab(t), s = ub(e), l = lb(t), c = parseFloat(l.borderTopWidth), u = parseFloat(l.borderLeftWidth);
n && i && (o.top = Math.max(o.top, 0), o.left = Math.max(o.left, 0));
var d = Cb({top: a.top - o.top - c, left: a.left - o.left - u, width: a.width, height: a.height});
if (d.marginTop = 0, d.marginLeft = 0, !r && i) {
var h = parseFloat(l.marginTop), p = parseFloat(l.marginLeft);
d.top -= c - h, d.bottom -= c - h, d.left -= u - p, d.right -= u - p, d.marginTop = h, d.marginLeft = p
}
return (r && !n ? t.contains(s) : t === s && "BODY" !== s.nodeName) && (d = function (e, t) {
var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r = yb(t, "top"), i = yb(t, "left"),
a = n ? -1 : 1;
return e.top += r * a, e.bottom += r * a, e.left += i * a, e.right += i * a, e
}(d, t)), d
}
function Eb(e) {
if (!e || !e.parentElement || fb()) return document.documentElement;
for (var t = e.parentElement; t && "none" === lb(t, "transform");) t = t.parentElement;
return t || document.documentElement
}
function Db(e, t, n, r) {
var i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], a = {top: 0, left: 0},
o = i ? Eb(e) : gb(e, db(t));
if ("viewport" === r) a = function (e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = e.ownerDocument.documentElement,
r = Tb(e, n), i = Math.max(n.clientWidth, window.innerWidth || 0),
a = Math.max(n.clientHeight, window.innerHeight || 0), o = t ? 0 : yb(n), s = t ? 0 : yb(n, "left");
return Cb({top: o - r.top + r.marginTop, left: s - r.left + r.marginLeft, width: i, height: a})
}(o, i); else {
var s = void 0;
"scrollParent" === r ? "BODY" === (s = ub(cb(t))).nodeName && (s = e.ownerDocument.documentElement) : s = "window" === r ? e.ownerDocument.documentElement : r;
var l = Tb(s, o, i);
if ("HTML" !== s.nodeName || function e(t) {
var n = t.nodeName;
if ("BODY" === n || "HTML" === n) return !1;
if ("fixed" === lb(t, "position")) return !0;
var r = cb(t);
return !!r && e(r)
}(o)) a = l; else {
var c = Sb(e.ownerDocument), u = c.height, d = c.width;
a.top += l.top - l.marginTop, a.bottom = u + l.top, a.left += l.left - l.marginLeft, a.right = d + l.left
}
}
var h = "number" == typeof (n = n || 0);
return a.left += h ? n : n.left || 0, a.top += h ? n : n.top || 0, a.right -= h ? n : n.right || 0, a.bottom -= h ? n : n.bottom || 0, a
}
function Ib(e, t, n, r, i) {
var a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0;
if (-1 === e.indexOf("auto")) return e;
var o = Db(n, r, a, i), s = {
top: {width: o.width, height: t.top - o.top},
right: {width: o.right - t.right, height: o.height},
bottom: {width: o.width, height: o.bottom - t.bottom},
left: {width: t.left - o.left, height: o.height}
}, l = Object.keys(s).map(function (e) {
return Pb({key: e}, s[e], {area: (t = s[e], t.width * t.height)});
var t
}).sort(function (e, t) {
return t.area - e.area
}), c = l.filter(function (e) {
var t = e.width, r = e.height;
return t >= n.clientWidth && r >= n.clientHeight
}), u = c.length > 0 ? c[0].key : l[0].key, d = e.split("-")[1];
return u + (d ? "-" + d : "")
}
function Lb(e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null;
return Tb(n, r ? Eb(t) : gb(t, db(n)), r)
}
function Ob(e) {
var t = e.ownerDocument.defaultView.getComputedStyle(e),
n = parseFloat(t.marginTop || 0) + parseFloat(t.marginBottom || 0),
r = parseFloat(t.marginLeft || 0) + parseFloat(t.marginRight || 0);
return {width: e.offsetWidth + r, height: e.offsetHeight + n}
}
function Mb(e) {
var t = {left: "right", right: "left", bottom: "top", top: "bottom"};
return e.replace(/left|right|bottom|top/g, function (e) {
return t[e]
})
}
function Nb(e, t, n) {
n = n.split("-")[0];
var r = Ob(e), i = {width: r.width, height: r.height}, a = -1 !== ["right", "left"].indexOf(n),
o = a ? "top" : "left", s = a ? "left" : "top", l = a ? "height" : "width", c = a ? "width" : "height";
return i[o] = t[o] + t[l] / 2 - r[l] / 2, i[s] = n === s ? t[s] - r[c] : t[Mb(s)], i
}
function Rb(e, t) {
return Array.prototype.find ? e.find(t) : e.filter(t)[0]
}
function Wb(e, t, n) {
return (void 0 === n ? e : e.slice(0, function (e, t, n) {
if (Array.prototype.findIndex) return e.findIndex(function (e) {
return e[t] === n
});
var r = Rb(e, function (e) {
return e[t] === n
});
return e.indexOf(r)
}(e, "name", n))).forEach(function (e) {
e.function && console.warn("`modifier.function` is deprecated, use `modifier.fn`!");
var n = e.function || e.fn;
e.enabled && sb(n) && (t.offsets.popper = Cb(t.offsets.popper), t.offsets.reference = Cb(t.offsets.reference), t = n(t, e))
}), t
}
function Vb(e, t) {
return e.some(function (e) {
var n = e.name;
return e.enabled && n === t
})
}
function Fb(e) {
for (var t = [!1, "ms", "Webkit", "Moz", "O"], n = e.charAt(0).toUpperCase() + e.slice(1), r = 0; r < t.length; r++) {
var i = t[r], a = i ? "" + i + n : e;
if (void 0 !== document.body.style[a]) return a
}
return null
}
function Gb(e) {
var t = e.ownerDocument;
return t ? t.defaultView : window
}
function Bb(e, t, n, r) {
n.updateBound = r, Gb(e).addEventListener("resize", n.updateBound, {passive: !0});
var i = ub(e);
return function e(t, n, r, i) {
var a = "BODY" === t.nodeName, o = a ? t.ownerDocument.defaultView : t;
o.addEventListener(n, r, {passive: !0}), a || e(ub(o.parentNode), n, r, i), i.push(o)
}(i, "scroll", n.updateBound, n.scrollParents), n.scrollElement = i, n.eventsEnabled = !0, n
}
function Kb() {
var e, t;
this.state.eventsEnabled && (cancelAnimationFrame(this.scheduleUpdate), this.state = (e = this.reference, t = this.state, Gb(e).removeEventListener("resize", t.updateBound), t.scrollParents.forEach(function (e) {
e.removeEventListener("scroll", t.updateBound)
}), t.updateBound = null, t.scrollParents = [], t.scrollElement = null, t.eventsEnabled = !1, t))
}
function jb(e) {
return "" !== e && !isNaN(parseFloat(e)) && isFinite(e)
}
function zb(e, t) {
Object.keys(t).forEach(function (n) {
var r = "";
-1 !== ["width", "height", "top", "right", "bottom", "left"].indexOf(n) && jb(t[n]) && (r = "px"), e.style[n] = t[n] + r
})
}
var Ub = ib && /Firefox/i.test(navigator.userAgent);
function qb(e, t, n) {
var r = Rb(e, function (e) {
return e.name === t
}), i = !!r && e.some(function (e) {
return e.name === n && e.enabled && e.order < r.order
});
if (!i) {
var a = "`" + t + "`", o = "`" + n + "`";
console.warn(o + " modifier is required by " + a + " modifier in order to work, be sure to include it before " + a + "!")
}
return i
}
var Hb = ["auto-start", "auto", "auto-end", "top-start", "top", "top-end", "right-start", "right", "right-end", "bottom-end", "bottom", "bottom-start", "left-end", "left", "left-start"],
Yb = Hb.slice(3);
function Xb(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = Yb.indexOf(e),
r = Yb.slice(n + 1).concat(Yb.slice(0, n));
return t ? r.reverse() : r
}
var Jb = {FLIP: "flip", CLOCKWISE: "clockwise", COUNTERCLOCKWISE: "counterclockwise"};
function Qb(e, t, n, r) {
var i = [0, 0], a = -1 !== ["right", "left"].indexOf(r), o = e.split(/(\+|\-)/).map(function (e) {
return e.trim()
}), s = o.indexOf(Rb(o, function (e) {
return -1 !== e.search(/,|\s/)
}));
o[s] && -1 === o[s].indexOf(",") && console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");
var l = /\s*,\s*|\s+/,
c = -1 !== s ? [o.slice(0, s).concat([o[s].split(l)[0]]), [o[s].split(l)[1]].concat(o.slice(s + 1))] : [o];
return (c = c.map(function (e, r) {
var i = (1 === r ? !a : a) ? "height" : "width", o = !1;
return e.reduce(function (e, t) {
return "" === e[e.length - 1] && -1 !== ["+", "-"].indexOf(t) ? (e[e.length - 1] = t, o = !0, e) : o ? (e[e.length - 1] += t, o = !1, e) : e.concat(t)
}, []).map(function (e) {
return function (e, t, n, r) {
var i = e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/), a = +i[1], o = i[2];
if (!a) return e;
if (0 === o.indexOf("%")) {
var s = void 0;
switch (o) {
case"%p":
s = n;
break;
case"%":
case"%r":
default:
s = r
}
return Cb(s)[t] / 100 * a
}
if ("vh" === o || "vw" === o) return ("vh" === o ? Math.max(document.documentElement.clientHeight, window.innerHeight || 0) : Math.max(document.documentElement.clientWidth, window.innerWidth || 0)) / 100 * a;
return a
}(e, i, t, n)
})
})).forEach(function (e, t) {
e.forEach(function (n, r) {
jb(n) && (i[t] += n * ("-" === e[r - 1] ? -1 : 1))
})
}), i
}
var $b = {
placement: "bottom", positionFixed: !1, eventsEnabled: !0, removeOnDestroy: !1, onCreate: function () {
}, onUpdate: function () {
}, modifiers: {
shift: {
order: 100, enabled: !0, fn: function (e) {
var t = e.placement, n = t.split("-")[0], r = t.split("-")[1];
if (r) {
var i = e.offsets, a = i.reference, o = i.popper, s = -1 !== ["bottom", "top"].indexOf(n),
l = s ? "left" : "top", c = s ? "width" : "height",
u = {start: xb({}, l, a[l]), end: xb({}, l, a[l] + a[c] - o[c])};
e.offsets.popper = Pb({}, o, u[r])
}
return e
}
}, offset: {
order: 200, enabled: !0, fn: function (e, t) {
var n = t.offset, r = e.placement, i = e.offsets, a = i.popper, o = i.reference, s = r.split("-")[0],
l = void 0;
return l = jb(+n) ? [+n, 0] : Qb(n, a, o, s), "left" === s ? (a.top += l[0], a.left -= l[1]) : "right" === s ? (a.top += l[0], a.left += l[1]) : "top" === s ? (a.left += l[0], a.top -= l[1]) : "bottom" === s && (a.left += l[0], a.top += l[1]), e.popper = a, e
}, offset: 0
}, preventOverflow: {
order: 300, enabled: !0, fn: function (e, t) {
var n = t.boundariesElement || mb(e.instance.popper);
e.instance.reference === n && (n = mb(n));
var r = Fb("transform"), i = e.instance.popper.style, a = i.top, o = i.left, s = i[r];
i.top = "", i.left = "", i[r] = "";
var l = Db(e.instance.popper, e.instance.reference, t.padding, n, e.positionFixed);
i.top = a, i.left = o, i[r] = s, t.boundaries = l;
var c = t.priority, u = e.offsets.popper, d = {
primary: function (e) {
var n = u[e];
return u[e] < l[e] && !t.escapeWithReference && (n = Math.max(u[e], l[e])), xb({}, e, n)
}, secondary: function (e) {
var n = "right" === e ? "left" : "top", r = u[n];
return u[e] > l[e] && !t.escapeWithReference && (r = Math.min(u[n], l[e] - ("right" === e ? u.width : u.height))), xb({}, n, r)
}
};
return c.forEach(function (e) {
var t = -1 !== ["left", "top"].indexOf(e) ? "primary" : "secondary";
u = Pb({}, u, d[t](e))
}), e.offsets.popper = u, e
}, priority: ["left", "right", "top", "bottom"], padding: 5, boundariesElement: "scrollParent"
}, keepTogether: {
order: 400, enabled: !0, fn: function (e) {
var t = e.offsets, n = t.popper, r = t.reference, i = e.placement.split("-")[0], a = Math.floor,
o = -1 !== ["top", "bottom"].indexOf(i), s = o ? "right" : "bottom", l = o ? "left" : "top",
c = o ? "width" : "height";
return n[s] < a(r[l]) && (e.offsets.popper[l] = a(r[l]) - n[c]), n[l] > a(r[s]) && (e.offsets.popper[l] = a(r[s])), e
}
}, arrow: {
order: 500, enabled: !0, fn: function (e, t) {
var n;
if (!qb(e.instance.modifiers, "arrow", "keepTogether")) return e;
var r = t.element;
if ("string" == typeof r) {
if (!(r = e.instance.popper.querySelector(r))) return e
} else if (!e.instance.popper.contains(r)) return console.warn("WARNING: `arrow.element` must be child of its popper element!"), e;
var i = e.placement.split("-")[0], a = e.offsets, o = a.popper, s = a.reference,
l = -1 !== ["left", "right"].indexOf(i), c = l ? "height" : "width", u = l ? "Top" : "Left",
d = u.toLowerCase(), h = l ? "left" : "top", p = l ? "bottom" : "right", f = Ob(r)[c];
s[p] - f < o[d] && (e.offsets.popper[d] -= o[d] - (s[p] - f)), s[d] + f > o[p] && (e.offsets.popper[d] += s[d] + f - o[p]), e.offsets.popper = Cb(e.offsets.popper);
var m = s[d] + s[c] / 2 - f / 2, v = lb(e.instance.popper), g = parseFloat(v["margin" + u]),
y = parseFloat(v["border" + u + "Width"]), b = m - e.offsets.popper[d] - g - y;
return b = Math.max(Math.min(o[c] - f, b), 0), e.arrowElement = r, e.offsets.arrow = (xb(n = {}, d, Math.round(b)), xb(n, h, ""), n), e
}, element: "[x-arrow]"
}, flip: {
order: 600,
enabled: !0,
fn: function (e, t) {
if (Vb(e.instance.modifiers, "inner")) return e;
if (e.flipped && e.placement === e.originalPlacement) return e;
var n = Db(e.instance.popper, e.instance.reference, t.padding, t.boundariesElement, e.positionFixed),
r = e.placement.split("-")[0], i = Mb(r), a = e.placement.split("-")[1] || "", o = [];
switch (t.behavior) {
case Jb.FLIP:
o = [r, i];
break;
case Jb.CLOCKWISE:
o = Xb(r);
break;
case Jb.COUNTERCLOCKWISE:
o = Xb(r, !0);
break;
default:
o = t.behavior
}
return o.forEach(function (s, l) {
if (r !== s || o.length === l + 1) return e;
r = e.placement.split("-")[0], i = Mb(r);
var c = e.offsets.popper, u = e.offsets.reference, d = Math.floor,
h = "left" === r && d(c.right) > d(u.left) || "right" === r && d(c.left) < d(u.right) || "top" === r && d(c.bottom) > d(u.top) || "bottom" === r && d(c.top) < d(u.bottom),
p = d(c.left) < d(n.left), f = d(c.right) > d(n.right), m = d(c.top) < d(n.top),
v = d(c.bottom) > d(n.bottom),
g = "left" === r && p || "right" === r && f || "top" === r && m || "bottom" === r && v,
y = -1 !== ["top", "bottom"].indexOf(r),
b = !!t.flipVariations && (y && "start" === a && p || y && "end" === a && f || !y && "start" === a && m || !y && "end" === a && v),
w = !!t.flipVariationsByContent && (y && "start" === a && f || y && "end" === a && p || !y && "start" === a && v || !y && "end" === a && m),
S = b || w;
(h || g || S) && (e.flipped = !0, (h || g) && (r = o[l + 1]), S && (a = function (e) {
return "end" === e ? "start" : "start" === e ? "end" : e
}(a)), e.placement = r + (a ? "-" + a : ""), e.offsets.popper = Pb({}, e.offsets.popper, Nb(e.instance.popper, e.offsets.reference, e.placement)), e = Wb(e.instance.modifiers, e, "flip"))
}), e
},
behavior: "flip",
padding: 5,
boundariesElement: "viewport",
flipVariations: !1,
flipVariationsByContent: !1
}, inner: {
order: 700, enabled: !1, fn: function (e) {
var t = e.placement, n = t.split("-")[0], r = e.offsets, i = r.popper, a = r.reference,
o = -1 !== ["left", "right"].indexOf(n), s = -1 === ["top", "left"].indexOf(n);
return i[o ? "left" : "top"] = a[n] - (s ? i[o ? "width" : "height"] : 0), e.placement = Mb(t), e.offsets.popper = Cb(i), e
}
}, hide: {
order: 800, enabled: !0, fn: function (e) {
if (!qb(e.instance.modifiers, "hide", "preventOverflow")) return e;
var t = e.offsets.reference, n = Rb(e.instance.modifiers, function (e) {
return "preventOverflow" === e.name
}).boundaries;
if (t.bottom < n.top || t.left > n.right || t.top > n.bottom || t.right < n.left) {
if (!0 === e.hide) return e;
e.hide = !0, e.attributes["x-out-of-boundaries"] = ""
} else {
if (!1 === e.hide) return e;
e.hide = !1, e.attributes["x-out-of-boundaries"] = !1
}
return e
}
}, computeStyle: {
order: 850, enabled: !0, fn: function (e, t) {
var n = t.x, r = t.y, i = e.offsets.popper, a = Rb(e.instance.modifiers, function (e) {
return "applyStyle" === e.name
}).gpuAcceleration;
void 0 !== a && console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");
var o = void 0 !== a ? a : t.gpuAcceleration, s = mb(e.instance.popper), l = Ab(s),
c = {position: i.position}, u = function (e, t) {
var n = e.offsets, r = n.popper, i = n.reference, a = Math.round, o = Math.floor, s = function (e) {
return e
}, l = a(i.width), c = a(r.width), u = -1 !== ["left", "right"].indexOf(e.placement),
d = -1 !== e.placement.indexOf("-"), h = t ? u || d || l % 2 == c % 2 ? a : o : s, p = t ? a : s;
return {
left: h(l % 2 == 1 && c % 2 == 1 && !d && t ? r.left - 1 : r.left),
top: p(r.top),
bottom: p(r.bottom),
right: h(r.right)
}
}(e, window.devicePixelRatio < 2 || !Ub), d = "bottom" === n ? "top" : "bottom",
h = "right" === r ? "left" : "right", p = Fb("transform"), f = void 0, m = void 0;
if (m = "bottom" === d ? "HTML" === s.nodeName ? -s.clientHeight + u.bottom : -l.height + u.bottom : u.top, f = "right" === h ? "HTML" === s.nodeName ? -s.clientWidth + u.right : -l.width + u.right : u.left, o && p) c[p] = "translate3d(" + f + "px, " + m + "px, 0)", c[d] = 0, c[h] = 0, c.willChange = "transform"; else {
var v = "bottom" === d ? -1 : 1, g = "right" === h ? -1 : 1;
c[d] = m * v, c[h] = f * g, c.willChange = d + ", " + h
}
var y = {"x-placement": e.placement};
return e.attributes = Pb({}, y, e.attributes), e.styles = Pb({}, c, e.styles), e.arrowStyles = Pb({}, e.offsets.arrow, e.arrowStyles), e
}, gpuAcceleration: !0, x: "bottom", y: "right"
}, applyStyle: {
order: 900, enabled: !0, fn: function (e) {
var t, n;
return zb(e.instance.popper, e.styles), t = e.instance.popper, n = e.attributes, Object.keys(n).forEach(function (e) {
!1 !== n[e] ? t.setAttribute(e, n[e]) : t.removeAttribute(e)
}), e.arrowElement && Object.keys(e.arrowStyles).length && zb(e.arrowElement, e.arrowStyles), e
}, onLoad: function (e, t, n, r, i) {
var a = Lb(i, t, e, n.positionFixed),
o = Ib(n.placement, a, t, e, n.modifiers.flip.boundariesElement, n.modifiers.flip.padding);
return t.setAttribute("x-placement", o), zb(t, {position: n.positionFixed ? "fixed" : "absolute"}), n
}, gpuAcceleration: void 0
}
}
}, Zb = function () {
function e(t, n) {
var r = this, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
_b(this, e), this.scheduleUpdate = function () {
return requestAnimationFrame(r.update)
}, this.update = ob(this.update.bind(this)), this.options = Pb({}, e.Defaults, i), this.state = {
isDestroyed: !1,
isCreated: !1,
scrollParents: []
}, this.reference = t && t.jquery ? t[0] : t, this.popper = n && n.jquery ? n[0] : n, this.options.modifiers = {}, Object.keys(Pb({}, e.Defaults.modifiers, i.modifiers)).forEach(function (t) {
r.options.modifiers[t] = Pb({}, e.Defaults.modifiers[t] || {}, i.modifiers ? i.modifiers[t] : {})
}), this.modifiers = Object.keys(this.options.modifiers).map(function (e) {
return Pb({name: e}, r.options.modifiers[e])
}).sort(function (e, t) {
return e.order - t.order
}), this.modifiers.forEach(function (e) {
e.enabled && sb(e.onLoad) && e.onLoad(r.reference, r.popper, r.options, e, r.state)
}), this.update();
var a = this.options.eventsEnabled;
a && this.enableEventListeners(), this.state.eventsEnabled = a
}
return kb(e, [{
key: "update", value: function () {
return function () {
if (!this.state.isDestroyed) {
var e = {instance: this, styles: {}, arrowStyles: {}, attributes: {}, flipped: !1, offsets: {}};
e.offsets.reference = Lb(this.state, this.popper, this.reference, this.options.positionFixed), e.placement = Ib(this.options.placement, e.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding), e.originalPlacement = e.placement, e.positionFixed = this.options.positionFixed, e.offsets.popper = Nb(this.popper, e.offsets.reference, e.placement), e.offsets.popper.position = this.options.positionFixed ? "fixed" : "absolute", e = Wb(this.modifiers, e), this.state.isCreated ? this.options.onUpdate(e) : (this.state.isCreated = !0, this.options.onCreate(e))
}
}.call(this)
}
}, {
key: "destroy", value: function () {
return function () {
return this.state.isDestroyed = !0, Vb(this.modifiers, "applyStyle") && (this.popper.removeAttribute("x-placement"), this.popper.style.position = "", this.popper.style.top = "", this.popper.style.left = "", this.popper.style.right = "", this.popper.style.bottom = "", this.popper.style.willChange = "", this.popper.style[Fb("transform")] = ""), this.disableEventListeners(), this.options.removeOnDestroy && this.popper.parentNode.removeChild(this.popper), this
}.call(this)
}
}, {
key: "enableEventListeners", value: function () {
return function () {
this.state.eventsEnabled || (this.state = Bb(this.reference, this.options, this.state, this.scheduleUpdate))
}.call(this)
}
}, {
key: "disableEventListeners", value: function () {
return Kb.call(this)
}
}]), e
}();
Zb.Utils = ("undefined" != typeof window ? window : global).PopperUtils, Zb.placements = Hb, Zb.Defaults = $b;
var ew = Zb;
function tw(e) {
return "function" == typeof e ? e() : e
}
var nw = "undefined" != typeof window ? u.exports.useLayoutEffect : u.exports.useEffect, rw = {},
iw = u.exports.forwardRef(function (e, t) {
var n = e.anchorEl, r = e.children, i = e.container, a = e.disablePortal, o = void 0 !== a && a,
s = e.keepMounted, l = void 0 !== s && s, c = e.modifiers, d = e.open, h = e.placement,
p = void 0 === h ? "bottom" : h, f = e.popperOptions, m = void 0 === f ? rw : f, v = e.popperRef, g = e.style,
y = e.transition, b = void 0 !== y && y,
w = $c(e, ["anchorEl", "children", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition"]),
S = u.exports.useRef(null), _ = Xm(S, t), k = u.exports.useRef(null), x = Xm(k, v), P = u.exports.useRef(x);
nw(function () {
P.current = x
}, [x]), u.exports.useImperativeHandle(v, function () {
return k.current
}, []);
var C = u.exports.useState(!0), A = C[0], T = C[1], E = function (e, t) {
if ("ltr" === (t && t.direction || "ltr")) return e;
switch (e) {
case"bottom-end":
return "bottom-start";
case"bottom-start":
return "bottom-end";
case"top-end":
return "top-start";
case"top-start":
return "top-end";
default:
return e
}
}(p, Lp()), D = u.exports.useState(E), I = D[0], L = D[1];
u.exports.useEffect(function () {
k.current && k.current.update()
});
var O = u.exports.useCallback(function () {
if (S.current && n && d) {
k.current && (k.current.destroy(), P.current(null));
var e = function (e) {
L(e.placement)
};
tw(n);
var t = new ew(tw(n), S.current, Jc({placement: E}, m, {
modifiers: Jc({}, o ? {} : {preventOverflow: {boundariesElement: "window"}}, c, m.modifiers),
onCreate: $m(e, m.onCreate),
onUpdate: $m(e, m.onUpdate)
}));
P.current(t)
}
}, [n, o, c, d, E, m]), M = u.exports.useCallback(function (e) {
Ym(_, e), O()
}, [_, O]), N = function () {
k.current && (k.current.destroy(), P.current(null))
};
if (u.exports.useEffect(function () {
return function () {
N()
}
}, []), u.exports.useEffect(function () {
d || b || N()
}, [d, b]), !l && !d && (!b || A)) return null;
var R = {placement: I};
return b && (R.TransitionProps = {
in: d, onEnter: function () {
T(!1)
}, onExited: function () {
T(!0), N()
}
}), u.exports.createElement(Qm, {disablePortal: o, container: i}, u.exports.createElement("div", Jc({
ref: M,
role: "tooltip"
}, w, {
style: Jc({
position: "fixed",
top: 0,
left: 0,
display: d || !l || b ? null : "none"
}, g)
}), "function" == typeof r ? r(R) : r))
}),
aw = rg(u.exports.createElement("path", {d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),
ow = rg(u.exports.createElement("path", {d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}));
var sw = Um(function (e) {
return {
root: {
position: "relative",
display: "flex",
"&$checked $layer": {
transform: "scale(1)",
transition: e.transitions.create("transform", {
easing: e.transitions.easing.easeOut,
duration: e.transitions.duration.shortest
})
}
},
layer: {
left: 0,
position: "absolute",
transform: "scale(0)",
transition: e.transitions.create("transform", {
easing: e.transitions.easing.easeIn,
duration: e.transitions.duration.shortest
})
},
checked: {}
}
}, {name: "PrivateRadioButtonIcon"})(function (e) {
var t = e.checked, n = e.classes, r = e.fontSize;
return u.exports.createElement("div", {className: Xc(n.root, t && n.checked)}, u.exports.createElement(aw, {fontSize: r}), u.exports.createElement(ow, {
fontSize: r,
className: n.layer
}))
}), lw = u.exports.createContext();
var cw = u.exports.createElement(sw, {checked: !0}), uw = u.exports.createElement(sw, null),
dw = u.exports.forwardRef(function (e, t) {
var n = e.checked, r = e.classes, i = e.color, a = void 0 === i ? "secondary" : i, o = e.name, s = e.onChange,
l = e.size, c = void 0 === l ? "medium" : l,
d = $c(e, ["checked", "classes", "color", "name", "onChange", "size"]), h = u.exports.useContext(lw), p = n,
f = $m(s, h && h.onChange), m = o;
return h && (void 0 === p && (p = h.value === e.value), void 0 === m && (m = h.name)), u.exports.createElement(Wg, Jc({
color: a,
type: "radio",
icon: u.exports.cloneElement(uw, {fontSize: "small" === c ? "small" : "medium"}),
checkedIcon: u.exports.cloneElement(cw, {fontSize: "small" === c ? "small" : "medium"}),
classes: {root: Xc(r.root, r["color".concat(qm(a))]), checked: r.checked, disabled: r.disabled},
name: m,
checked: p,
onChange: f,
ref: t
}, d))
}), hw = Um(function (e) {
return {
root: {color: e.palette.text.secondary},
checked: {},
disabled: {},
colorPrimary: {
"&$checked": {
color: e.palette.primary.main,
"&:hover": {
backgroundColor: Gf(e.palette.primary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
}
}, "&$disabled": {color: e.palette.action.disabled}
},
colorSecondary: {
"&$checked": {
color: e.palette.secondary.main,
"&:hover": {
backgroundColor: Gf(e.palette.secondary.main, e.palette.action.hoverOpacity),
"@media (hover: none)": {backgroundColor: "transparent"}
}
}, "&$disabled": {color: e.palette.action.disabled}
}
}
}, {name: "MuiRadio"})(dw), pw = u.exports.forwardRef(function (e, t) {
var n = e.actions, r = e.children, i = e.name, a = e.value, o = e.onChange,
s = $c(e, ["actions", "children", "name", "value", "onChange"]), l = u.exports.useRef(null),
c = Am(og({controlled: a, default: e.defaultValue, name: "RadioGroup"}), 2), d = c[0], h = c[1];
u.exports.useImperativeHandle(n, function () {
return {
focus: function () {
var e = l.current.querySelector("input:not(:disabled):checked");
e || (e = l.current.querySelector("input:not(:disabled)")), e && e.focus()
}
}
}, []);
var p = Xm(t, l), f = sg(i);
return u.exports.createElement(lw.Provider, {
value: {
name: f, onChange: function (e) {
h(e.target.value), o && o(e, e.target.value)
}, value: d
}
}, u.exports.createElement(ay, Jc({role: "radiogroup", ref: p}, s), r))
});
function fw(e, t) {
return "object" === au(t) && null !== t ? e === t : String(e) === String(t)
}
var mw = u.exports.forwardRef(function (e, t) {
var n = e["aria-label"], r = e.autoFocus, i = e.autoWidth, a = e.children, o = e.classes, s = e.className,
l = e.defaultValue, c = e.disabled, d = e.displayEmpty, h = e.IconComponent, p = e.inputRef, f = e.labelId,
m = e.MenuProps, v = void 0 === m ? {} : m, g = e.multiple, y = e.name, b = e.onBlur, w = e.onChange,
S = e.onClose, _ = e.onFocus, k = e.onOpen, x = e.open, P = e.readOnly, C = e.renderValue,
A = e.SelectDisplayProps, T = void 0 === A ? {} : A, E = e.tabIndex;
e.type;
var D = e.value, I = e.variant, L = void 0 === I ? "standard" : I,
O = $c(e, ["aria-label", "autoFocus", "autoWidth", "children", "classes", "className", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]),
M = Am(og({controlled: D, default: l, name: "Select"}), 2), N = M[0], R = M[1], W = u.exports.useRef(null),
V = u.exports.useState(null), F = V[0], G = V[1], B = u.exports.useRef(null != x).current,
K = u.exports.useState(), j = K[0], z = K[1], U = u.exports.useState(!1), q = U[0], H = U[1], Y = Xm(t, p);
u.exports.useImperativeHandle(Y, function () {
return {
focus: function () {
F.focus()
}, node: W.current, value: N
}
}, [F, N]), u.exports.useEffect(function () {
r && F && F.focus()
}, [r, F]), u.exports.useEffect(function () {
if (F) {
var e = Hm(F).getElementById(f);
if (e) {
var t = function () {
getSelection().isCollapsed && F.focus()
};
return e.addEventListener("click", t), function () {
e.removeEventListener("click", t)
}
}
}
}, [f, F]);
var X, J, Q = function (e, t) {
e ? k && k(t) : S && S(t), B || (z(i ? null : F.clientWidth), H(e))
}, $ = u.exports.Children.toArray(a), Z = null !== F && (B ? x : q);
delete O["aria-invalid"];
var ee = [], te = !1;
(Yg({value: N}) || d) && (C ? X = C(N) : te = !0);
var ne = $.map(function (e) {
if (!u.exports.isValidElement(e)) return null;
var t;
if (g) {
if (!Array.isArray(N)) throw new Error(lu(2));
(t = N.some(function (t) {
return fw(t, e.props.value)
})) && te && ee.push(e.props.children)
} else (t = fw(N, e.props.value)) && te && (J = e.props.children);
return u.exports.cloneElement(e, {
"aria-selected": t ? "true" : void 0, onClick: function (e) {
return function (t) {
var n;
if (g || Q(!1, t), g) {
n = Array.isArray(N) ? N.slice() : [];
var r = N.indexOf(e.props.value);
-1 === r ? n.push(e.props.value) : n.splice(r, 1)
} else n = e.props.value;
e.props.onClick && e.props.onClick(t), N !== n && (R(n), w && (t.persist(), Object.defineProperty(t, "target", {
writable: !0,
value: {value: n, name: y}
}), w(t, e)))
}
}(e), onKeyUp: function (t) {
" " === t.key && t.preventDefault(), e.props.onKeyUp && e.props.onKeyUp(t)
}, role: "option", selected: t, value: void 0, "data-value": e.props.value
})
});
te && (X = g ? ee.join(", ") : J);
var re, ie = j;
!i && B && F && (ie = F.clientWidth), re = void 0 !== E ? E : c ? null : 0;
var ae = T.id || (y ? "mui-component-select-".concat(y) : void 0);
return u.exports.createElement(u.exports.Fragment, null, u.exports.createElement("div", Jc({
className: Xc(o.root, o.select, o.selectMenu, o[L], s, c && o.disabled),
ref: G,
tabIndex: re,
role: "button",
"aria-disabled": c ? "true" : void 0,
"aria-expanded": Z ? "true" : void 0,
"aria-haspopup": "listbox",
"aria-label": n,
"aria-labelledby": [f, ae].filter(Boolean).join(" ") || void 0,
onKeyDown: function (e) {
P || -1 !== [" ", "ArrowUp", "ArrowDown", "Enter"].indexOf(e.key) && (e.preventDefault(), Q(!0, e))
},
onMouseDown: c || P ? null : function (e) {
0 === e.button && (e.preventDefault(), F.focus(), Q(!0, e))
},
onBlur: function (e) {
!Z && b && (e.persist(), Object.defineProperty(e, "target", {writable: !0, value: {value: N, name: y}}), b(e))
},
onFocus: _
}, T, {id: ae}), function (e) {
return null == e || "string" == typeof e && !e.trim()
}(X) ? u.exports.createElement("span", {dangerouslySetInnerHTML: {__html: "&#8203;"}}) : X), u.exports.createElement("input", Jc({
value: Array.isArray(N) ? N.join(",") : N,
name: y,
ref: W,
"aria-hidden": !0,
onChange: function (e) {
var t = $.map(function (e) {
return e.props.value
}).indexOf(e.target.value);
if (-1 !== t) {
var n = $[t];
R(n.props.value), w && w(e, n)
}
},
tabIndex: -1,
className: o.nativeInput,
autoFocus: r
}, O)), u.exports.createElement(h, {className: Xc(o.icon, o["icon".concat(qm(L))], Z && o.iconOpen, c && o.disabled)}), u.exports.createElement(qy, Jc({
id: "menu-".concat(y || ""),
anchorEl: F,
open: Z,
onClose: function (e) {
Q(!1, e)
}
}, v, {
MenuListProps: Jc({"aria-labelledby": f, role: "listbox", disableListWrap: !0}, v.MenuListProps),
PaperProps: Jc({}, v.PaperProps, {style: Jc({minWidth: ie}, null != v.PaperProps ? v.PaperProps.style : null)})
}), ne))
}), vw = Qy, gw = u.exports.createElement(wy, null), yw = u.exports.createElement(Zg, null),
bw = u.exports.forwardRef(function e(t, n) {
var r = t.autoWidth, i = void 0 !== r && r, a = t.children, o = t.classes, s = t.displayEmpty,
l = void 0 !== s && s, c = t.IconComponent, d = void 0 === c ? Jy : c, h = t.id, p = t.input,
f = t.inputProps, m = t.label, v = t.labelId, g = t.labelWidth, y = void 0 === g ? 0 : g, b = t.MenuProps,
w = t.multiple, S = void 0 !== w && w, _ = t.native, k = void 0 !== _ && _, x = t.onClose, P = t.onOpen,
C = t.open, A = t.renderValue, T = t.SelectDisplayProps, E = t.variant, D = void 0 === E ? "standard" : E,
I = $c(t, ["autoWidth", "children", "classes", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "labelWidth", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]),
L = k ? Xy : mw, O = Kg({props: t, muiFormControl: Ng(), states: ["variant"]}).variant || D,
M = p || {standard: gw, outlined: u.exports.createElement(rb, {label: m, labelWidth: y}), filled: yw}[O];
return u.exports.cloneElement(M, Jc({
inputComponent: L,
inputProps: Jc({
children: a,
IconComponent: d,
variant: O,
type: void 0,
multiple: S
}, k ? {id: h} : {
autoWidth: i,
displayEmpty: l,
labelId: v,
MenuProps: b,
onClose: x,
onOpen: P,
open: C,
renderValue: A,
SelectDisplayProps: Jc({id: h}, T)
}, f, {
classes: f ? Ep({
baseClasses: o,
newClasses: f.classes,
Component: e
}) : o
}, p ? p.props.inputProps : {}),
ref: n
}, I))
});
bw.muiName = "Select";
var ww = Um(vw, {name: "MuiSelect"})(bw);
var Sw = Um(function (e) {
return {
thumb: {"&$open": {"& $offset": {transform: "scale(1) translateY(-10px)"}}},
open: {},
offset: Jc({zIndex: 1}, e.typography.body2, {
fontSize: e.typography.pxToRem(12),
lineHeight: 1.2,
transition: e.transitions.create(["transform"], {duration: e.transitions.duration.shortest}),
top: -34,
transformOrigin: "bottom center",
transform: "scale(0)",
position: "absolute"
}),
circle: {
display: "flex",
alignItems: "center",
justifyContent: "center",
width: 32,
height: 32,
borderRadius: "50% 50% 50% 0",
backgroundColor: "currentColor",
transform: "rotate(-45deg)"
},
label: {color: e.palette.primary.contrastText, transform: "rotate(45deg)"}
}
}, {name: "PrivateValueLabel"})(function (e) {
var t = e.children, n = e.classes, r = e.className, i = e.open, a = e.value, o = e.valueLabelDisplay;
return "off" === o ? t : u.exports.cloneElement(t, {className: Xc(t.props.className, (i || "on" === o) && n.open, n.thumb)}, u.exports.createElement("span", {className: Xc(n.offset, r)}, u.exports.createElement("span", {className: n.circle}, u.exports.createElement("span", {className: n.label}, a))))
});
function _w(e, t) {
return e - t
}
function kw(e, t, n) {
return Math.min(Math.max(t, e), n)
}
function xw(e, t) {
return e.reduce(function (e, n, r) {
var i = Math.abs(t - n);
return null === e || i < e.distance || i === e.distance ? {distance: i, index: r} : e
}, null).index
}
function Pw(e, t) {
console.log(123124)
if (void 0 !== t.current && e.changedTouches) {
for (var n = 0; n < e.changedTouches.length; n += 1) {
var r = e.changedTouches[n];
if (r.identifier === t.current) return {x: r.clientX, y: r.clientY}
}
return !1
}
return {x: e.clientX, y: e.clientY}
}
function Cw(e, t, n) {
return 100 * (e - t) / (n - t)
}
function Aw(e, t, n) {
var r = Math.round((e - n) / t) * t + n;
return Number(r.toFixed(function (e) {
if (Math.abs(e) < 1) {
var t = e.toExponential().split("e-"), n = t[0].split(".")[1];
return (n ? n.length : 0) + parseInt(t[1], 10)
}
var r = e.toString().split(".")[1];
return r ? r.length : 0
}(t)))
}
function Tw(e) {
var t = e.values, n = e.source, r = e.newValue, i = e.index;
if (t[i] === r) return n;
var a = t.slice();
return a[i] = r, a
}
function Ew(e) {
var t = e.sliderRef, n = e.activeIndex, r = e.setActive;
t.current.contains(document.activeElement) && Number(document.activeElement.getAttribute("data-index")) === n || t.current.querySelector('[role="slider"][data-index="'.concat(n, '"]')).focus(), r && r(n)
}
var Dw, Iw = {
horizontal: {
offset: function (e) {
return {left: "".concat(e, "%")}
}, leap: function (e) {
return {width: "".concat(e, "%")}
}
}, "horizontal-reverse": {
offset: function (e) {
return {right: "".concat(e, "%")}
}, leap: function (e) {
return {width: "".concat(e, "%")}
}
}, vertical: {
offset: function (e) {
return {bottom: "".concat(e, "%")}
}, leap: function (e) {
return {height: "".concat(e, "%")}
}
}
}, Lw = function (e) {
return e
}, Ow = u.exports.forwardRef(function (e, t) {
var n = e["aria-label"], r = e["aria-labelledby"], i = e["aria-valuetext"], a = e.classes, o = e.className,
s = e.color, l = void 0 === s ? "primary" : s, c = e.component, d = void 0 === c ? "span" : c,
h = e.defaultValue, p = e.disabled, f = void 0 !== p && p, m = e.getAriaLabel, v = e.getAriaValueText,
g = e.marks, y = void 0 !== g && g, b = e.max, w = void 0 === b ? 100 : b, S = e.min, _ = void 0 === S ? 0 : S,
k = e.name, x = e.onChange, P = e.onChangeCommitted, C = e.onMouseDown, A = e.orientation,
T = void 0 === A ? "horizontal" : A, E = e.scale, D = void 0 === E ? Lw : E, I = e.step,
L = void 0 === I ? 1 : I, O = e.ThumbComponent, M = void 0 === O ? "span" : O, N = e.track,
R = void 0 === N ? "normal" : N, W = e.value, V = e.ValueLabelComponent, F = void 0 === V ? Sw : V,
G = e.valueLabelDisplay, B = void 0 === G ? "off" : G, K = e.valueLabelFormat, j = void 0 === K ? Lw : K,
z = $c(e, ["aria-label", "aria-labelledby", "aria-valuetext", "classes", "className", "color", "component", "defaultValue", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "ThumbComponent", "track", "value", "ValueLabelComponent", "valueLabelDisplay", "valueLabelFormat"]),
U = Ev(), q = u.exports.useRef(), H = u.exports.useState(-1), Y = H[0], X = H[1], J = u.exports.useState(-1),
Q = J[0], $ = J[1], Z = Am(og({controlled: W, default: h, name: "Slider"}), 2), ee = Z[0], te = Z[1],
ne = Array.isArray(ee), re = ne ? ee.slice().sort(_w) : [ee];
re = re.map(function (e) {
return kw(e, _, w)
});
var ie = !0 === y && null !== L ? Mh(Array(Math.floor((w - _) / L) + 1)).map(function (e, t) {
return {value: _ + L * t}
}) : y || [], ae = gg(), oe = ae.isFocusVisible, se = ae.onBlurVisible, le = ae.ref, ce = u.exports.useState(-1),
ue = ce[0], de = ce[1], he = u.exports.useRef(), pe = Xm(t, Xm(le, he)), fe = ev(function (e) {
var t = Number(e.currentTarget.getAttribute("data-index"));
oe(e) && de(t), $(t)
}), me = ev(function () {
-1 !== ue && (de(-1), se()), $(-1)
}), ve = ev(function (e) {
var t = Number(e.currentTarget.getAttribute("data-index"));
$(t)
}), ge = ev(function () {
$(-1)
}), ye = "rtl" === U.direction, be = ev(function (e) {
var t, n = Number(e.currentTarget.getAttribute("data-index")), r = re[n], i = (w - _) / 10,
a = ie.map(function (e) {
return e.value
}), o = a.indexOf(r), s = ye ? "ArrowLeft" : "ArrowRight", l = ye ? "ArrowRight" : "ArrowLeft";
switch (e.key) {
case"Home":
t = _;
break;
case"End":
t = w;
break;
case"PageUp":
L && (t = r + i);
break;
case"PageDown":
L && (t = r - i);
break;
case s:
case"ArrowUp":
t = L ? r + L : a[o + 1] || a[a.length - 1];
break;
case l:
case"ArrowDown":
t = L ? r - L : a[o - 1] || a[0];
break;
default:
return
}
if (e.preventDefault(), L && (t = Aw(t, L, _)), t = kw(t, _, w), ne) {
var c = t;
t = Tw({values: re, source: ee, newValue: t, index: n}).sort(_w), Ew({
sliderRef: he,
activeIndex: t.indexOf(c)
})
}
te(t), de(n), x && x(e, t), P && P(e, t)
}), we = u.exports.useRef(), Se = T;
ye && "vertical" !== T && (Se += "-reverse");
var _e = function (e) {
var t, n, r = e.finger, i = e.move, a = void 0 !== i && i, o = e.values, s = e.source,
l = he.current.getBoundingClientRect(), c = l.width, u = l.height, d = l.bottom, h = l.left;
if (t = 0 === Se.indexOf("vertical") ? (d - r.y) / u : (r.x - h) / c, -1 !== Se.indexOf("-reverse") && (t = 1 - t), n = function (e, t, n) {
return (n - t) * e + t
}(t, _, w), L) n = Aw(n, L, _); else {
var p = ie.map(function (e) {
return e.value
});
n = p[xw(p, n)]
}
n = kw(n, _, w);
var f = 0;
if (ne) {
var m = n;
f = (n = Tw({
values: o,
source: s,
newValue: n,
index: f = a ? we.current : xw(o, n)
}).sort(_w)).indexOf(m), we.current = f
}
return {newValue: n, activeIndex: f}
}, ke = ev(function (e) {
var t = Pw(e, q);
if (t) {
var n = _e({finger: t, move: !0, values: re, source: ee}), r = n.newValue, i = n.activeIndex;
Ew({sliderRef: he, activeIndex: i, setActive: X}), te(r), x && x(e, r)
}
}), xe = ev(function (e) {
var t = Pw(e, q);
if (t) {
var n = _e({finger: t, values: re, source: ee}).newValue;
X(-1), "touchend" === e.type && $(-1), P && P(e, n), q.current = void 0;
var r = Hm(he.current);
r.removeEventListener("mousemove", ke), r.removeEventListener("mouseup", xe), r.removeEventListener("touchmove", ke), r.removeEventListener("touchend", xe)
}
}), Pe = ev(function (e) {
e.preventDefault();
var t = e.changedTouches[0];
null != t && (q.current = t.identifier);
var n = Pw(e, q), r = _e({finger: n, values: re, source: ee}), i = r.newValue, a = r.activeIndex;
Ew({sliderRef: he, activeIndex: a, setActive: X}), te(i), x && x(e, i);
var o = Hm(he.current);
o.addEventListener("touchmove", ke), o.addEventListener("touchend", xe)
});
u.exports.useEffect(function () {
var e = he.current;
e.addEventListener("touchstart", Pe);
var t = Hm(e);
return function () {
e.removeEventListener("touchstart", Pe), t.removeEventListener("mousemove", ke), t.removeEventListener("mouseup", xe), t.removeEventListener("touchmove", ke), t.removeEventListener("touchend", xe)
}
}, [xe, ke, Pe]);
var Ce = ev(function (e) {
C && C(e), e.preventDefault();
var t = Pw(e, q), n = _e({finger: t, values: re, source: ee}), r = n.newValue, i = n.activeIndex;
Ew({sliderRef: he, activeIndex: i, setActive: X}), te(r), x && x(e, r);
var a = Hm(he.current);
a.addEventListener("mousemove", ke), a.addEventListener("mouseup", xe)
}), Ae = Cw(ne ? re[0] : _, _, w), Te = Cw(re[re.length - 1], _, w) - Ae,
Ee = Jc({}, Iw[Se].offset(Ae), Iw[Se].leap(Te));
return u.exports.createElement(d, Jc({
ref: pe,
className: Xc(a.root, a["color".concat(qm(l))], o, f && a.disabled, ie.length > 0 && ie.some(function (e) {
return e.label
}) && a.marked, !1 === R && a.trackFalse, "vertical" === T && a.vertical, "inverted" === R && a.trackInverted),
onMouseDown: Ce
}, z), u.exports.createElement("span", {className: a.rail}), u.exports.createElement("span", {
className: a.track,
style: Ee
}), u.exports.createElement("input", {value: re.join(","), name: k, type: "hidden"}), ie.map(function (e, t) {
var n, r = Cw(e.value, _, w), i = Iw[Se].offset(r);
return n = !1 === R ? -1 !== re.indexOf(e.value) : "normal" === R && (ne ? e.value >= re[0] && e.value <= re[re.length - 1] : e.value <= re[0]) || "inverted" === R && (ne ? e.value <= re[0] || e.value >= re[re.length - 1] : e.value >= re[0]), u.exports.createElement(u.exports.Fragment, {key: e.value}, u.exports.createElement("span", {
style: i,
"data-index": t,
className: Xc(a.mark, n && a.markActive)
}), null != e.label ? u.exports.createElement("span", {
"aria-hidden": !0,
"data-index": t,
style: i,
className: Xc(a.markLabel, n && a.markLabelActive)
}, e.label) : null)
}), re.map(function (e, t) {
var o = Cw(e, _, w), s = Iw[Se].offset(o);
return u.exports.createElement(F, {
key: t,
valueLabelFormat: j,
valueLabelDisplay: B,
className: a.valueLabel,
value: "function" == typeof j ? j(D(e), t) : j,
index: t,
open: Q === t || Y === t || "on" === B,
disabled: f
}, u.exports.createElement(M, {
className: Xc(a.thumb, a["thumbColor".concat(qm(l))], Y === t && a.active, f && a.disabled, ue === t && a.focusVisible),
tabIndex: f ? null : 0,
role: "slider",
style: s,
"data-index": t,
"aria-label": m ? m(t) : n,
"aria-labelledby": r,
"aria-orientation": T,
"aria-valuemax": D(w),
"aria-valuemin": D(_),
"aria-valuenow": D(e),
"aria-valuetext": v ? v(D(e), t) : i,
onKeyDown: be,
onFocus: fe,
onBlur: me,
onMouseOver: ve,
onMouseLeave: ge
}))
}))
}), Mw = Um(function (e) {
return {
root: {
height: 2,
width: "100%",
boxSizing: "content-box",
padding: "13px 0",
display: "inline-block",
position: "relative",
cursor: "pointer",
touchAction: "none",
color: e.palette.primary.main,
WebkitTapHighlightColor: "transparent",
"&$disabled": {pointerEvents: "none", cursor: "default", color: e.palette.grey[400]},
"&$vertical": {width: 2, height: "100%", padding: "0 13px"},
"@media (pointer: coarse)": {padding: "20px 0", "&$vertical": {padding: "0 20px"}},
"@media print": {colorAdjust: "exact"}
},
colorPrimary: {},
colorSecondary: {color: e.palette.secondary.main},
marked: {marginBottom: 20, "&$vertical": {marginBottom: "auto", marginRight: 20}},
vertical: {},
disabled: {},
rail: {
display: "block",
position: "absolute",
width: "100%",
height: 2,
borderRadius: 1,
backgroundColor: "currentColor",
opacity: .38,
"$vertical &": {height: "100%", width: 2}
},
track: {
display: "block",
position: "absolute",
height: 2,
borderRadius: 1,
backgroundColor: "currentColor",
"$vertical &": {width: 2}
},
trackFalse: {"& $track": {display: "none"}},
trackInverted: {
"& $track": {backgroundColor: "light" === e.palette.type ? Kf(e.palette.primary.main, .62) : Bf(e.palette.primary.main, .5)},
"& $rail": {opacity: 1}
},
thumb: {
position: "absolute",
width: 12,
height: 12,
marginLeft: -6,
marginTop: -5,
boxSizing: "border-box",
borderRadius: "50%",
outline: 0,
backgroundColor: "currentColor",
display: "flex",
alignItems: "center",
justifyContent: "center",
transition: e.transitions.create(["box-shadow"], {duration: e.transitions.duration.shortest}),
"&::after": {
position: "absolute",
content: '""',
borderRadius: "50%",
left: -15,
top: -15,
right: -15,
bottom: -15
},
"&$focusVisible,&:hover": {
boxShadow: "0px 0px 0px 8px ".concat(Gf(e.palette.primary.main, .16)),
"@media (hover: none)": {boxShadow: "none"}
},
"&$active": {boxShadow: "0px 0px 0px 14px ".concat(Gf(e.palette.primary.main, .16))},
"&$disabled": {width: 8, height: 8, marginLeft: -4, marginTop: -3, "&:hover": {boxShadow: "none"}},
"$vertical &": {marginLeft: -5, marginBottom: -6},
"$vertical &$disabled": {marginLeft: -3, marginBottom: -4}
},
thumbColorPrimary: {},
thumbColorSecondary: {
"&$focusVisible,&:hover": {boxShadow: "0px 0px 0px 8px ".concat(Gf(e.palette.secondary.main, .16))},
"&$active": {boxShadow: "0px 0px 0px 14px ".concat(Gf(e.palette.secondary.main, .16))}
},
active: {},
focusVisible: {},
valueLabel: {left: "calc(-50% - 4px)"},
mark: {position: "absolute", width: 2, height: 2, borderRadius: 1, backgroundColor: "currentColor"},
markActive: {backgroundColor: e.palette.background.paper, opacity: .8},
markLabel: Jc({}, e.typography.body2, {
color: e.palette.text.secondary,
position: "absolute",
top: 26,
transform: "translateX(-50%)",
whiteSpace: "nowrap",
"$vertical &": {top: "auto", left: 26, transform: "translateY(50%)"},
"@media (pointer: coarse)": {top: 40, "$vertical &": {left: 31}}
}),
markLabelActive: {color: e.palette.text.primary}
}
}, {name: "MuiSlider"})(Ow), Nw = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.disabled, a = void 0 !== i && i, o = e.disableFocusRipple,
s = void 0 !== o && o, l = e.fullWidth, c = e.icon, d = e.indicator, h = e.label, p = e.onChange, f = e.onClick,
m = e.onFocus, v = e.selected, g = e.selectionFollowsFocus, y = e.textColor, b = void 0 === y ? "inherit" : y,
w = e.value, S = e.wrapped, _ = void 0 !== S && S,
k = $c(e, ["classes", "className", "disabled", "disableFocusRipple", "fullWidth", "icon", "indicator", "label", "onChange", "onClick", "onFocus", "selected", "selectionFollowsFocus", "textColor", "value", "wrapped"]);
return u.exports.createElement(Pg, Jc({
focusRipple: !s,
className: Xc(n.root, n["textColor".concat(qm(b))], r, a && n.disabled, v && n.selected, h && c && n.labelIcon, l && n.fullWidth, _ && n.wrapped),
ref: t,
role: "tab",
"aria-selected": v,
disabled: a,
onClick: function (e) {
p && p(e, w), f && f(e)
},
onFocus: function (e) {
g && !v && p && p(e, w), m && m(e)
},
tabIndex: v ? 0 : -1
}, k), u.exports.createElement("span", {className: n.wrapper}, c, h), d)
}), Rw = Um(function (e) {
var t;
return {
root: Jc({}, e.typography.button, (t = {
maxWidth: 264,
minWidth: 72,
position: "relative",
boxSizing: "border-box",
minHeight: 48,
flexShrink: 0,
padding: "6px 12px"
}, Zc(t, e.breakpoints.up("sm"), {padding: "6px 24px"}), Zc(t, "overflow", "hidden"), Zc(t, "whiteSpace", "normal"), Zc(t, "textAlign", "center"), Zc(t, e.breakpoints.up("sm"), {minWidth: 160}), t)),
labelIcon: {minHeight: 72, paddingTop: 9, "& $wrapper > *:first-child": {marginBottom: 6}},
textColorInherit: {color: "inherit", opacity: .7, "&$selected": {opacity: 1}, "&$disabled": {opacity: .5}},
textColorPrimary: {
color: e.palette.text.secondary,
"&$selected": {color: e.palette.primary.main},
"&$disabled": {color: e.palette.text.disabled}
},
textColorSecondary: {
color: e.palette.text.secondary,
"&$selected": {color: e.palette.secondary.main},
"&$disabled": {color: e.palette.text.disabled}
},
selected: {},
disabled: {},
fullWidth: {flexShrink: 1, flexGrow: 1, flexBasis: 0, maxWidth: "none"},
wrapped: {fontSize: e.typography.pxToRem(12), lineHeight: 1.5},
wrapper: {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
width: "100%",
flexDirection: "column"
}
}
}, {name: "MuiTab"})(Nw),
Ww = rg(u.exports.createElement("path", {d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),
Vw = rg(u.exports.createElement("path", {d: "M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));
function Fw() {
if (Dw) return Dw;
var e = document.createElement("div"), t = document.createElement("div");
return t.style.width = "10px", t.style.height = "1px", e.appendChild(t), e.dir = "rtl", e.style.fontSize = "14px", e.style.width = "4px", e.style.height = "1px", e.style.position = "absolute", e.style.top = "-1000px", e.style.overflow = "scroll", document.body.appendChild(e), Dw = "reverse", e.scrollLeft > 0 ? Dw = "default" : (e.scrollLeft = 1, 0 === e.scrollLeft && (Dw = "negative")), document.body.removeChild(e), Dw
}
function Gw(e, t) {
var n = e.scrollLeft;
if ("rtl" !== t) return n;
switch (Fw()) {
case"negative":
return e.scrollWidth - e.clientWidth + n;
case"reverse":
return e.scrollWidth - e.clientWidth - n;
default:
return n
}
}
function Bw(e) {
return (1 + Math.sin(Math.PI * e - Math.PI / 2)) / 2
}
var Kw = {width: 99, height: 99, position: "absolute", top: -9999, overflow: "scroll"};
function jw(e) {
var t = e.onChange, n = $c(e, ["onChange"]), r = u.exports.useRef(), i = u.exports.useRef(null), a = function () {
r.current = i.current.offsetHeight - i.current.clientHeight
};
return u.exports.useEffect(function () {
var e = ig(function () {
var e = r.current;
a(), e !== r.current && t(r.current)
});
return window.addEventListener("resize", e), function () {
e.clear(), window.removeEventListener("resize", e)
}
}, [t]), u.exports.useEffect(function () {
a(), t(r.current)
}, [t]), u.exports.createElement("div", Jc({style: Kw, ref: i}, n))
}
var zw = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.color, a = e.orientation,
o = $c(e, ["classes", "className", "color", "orientation"]);
return u.exports.createElement("span", Jc({
className: Xc(n.root, n["color".concat(qm(i))], r, "vertical" === a && n.vertical),
ref: t
}, o))
}), Uw = Um(function (e) {
return {
root: {position: "absolute", height: 2, bottom: 0, width: "100%", transition: e.transitions.create()},
colorPrimary: {backgroundColor: e.palette.primary.main},
colorSecondary: {backgroundColor: e.palette.secondary.main},
vertical: {height: "100%", width: 2, right: 0}
}
}, {name: "PrivateTabIndicator"})(zw), qw = u.exports.createElement(Ww, {fontSize: "small"}),
Hw = u.exports.createElement(Vw, {fontSize: "small"}), Yw = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = e.direction, a = e.orientation, o = e.disabled,
s = $c(e, ["classes", "className", "direction", "orientation", "disabled"]);
return u.exports.createElement(Pg, Jc({
component: "div",
className: Xc(n.root, r, o && n.disabled, "vertical" === a && n.vertical),
ref: t,
role: null,
tabIndex: null
}, s), "left" === i ? qw : Hw)
}), Xw = Um({
root: {width: 40, flexShrink: 0, opacity: .8, "&$disabled": {opacity: 0}},
vertical: {width: "100%", height: 40, "& svg": {transform: "rotate(90deg)"}},
disabled: {}
}, {name: "MuiTabScrollButton"})(Yw), Jw = u.exports.forwardRef(function (e, t) {
var n = e["aria-label"], r = e["aria-labelledby"], i = e.action, a = e.centered, o = void 0 !== a && a,
s = e.children, l = e.classes, c = e.className, d = e.component, h = void 0 === d ? "div" : d,
p = e.indicatorColor, f = void 0 === p ? "secondary" : p, m = e.onChange, v = e.orientation,
g = void 0 === v ? "horizontal" : v, y = e.ScrollButtonComponent, b = void 0 === y ? Xw : y,
w = e.scrollButtons, S = void 0 === w ? "auto" : w, _ = e.selectionFollowsFocus, k = e.TabIndicatorProps,
x = void 0 === k ? {} : k, P = e.TabScrollButtonProps, C = e.textColor, A = void 0 === C ? "inherit" : C,
T = e.value, E = e.variant, D = void 0 === E ? "standard" : E,
I = $c(e, ["aria-label", "aria-labelledby", "action", "centered", "children", "classes", "className", "component", "indicatorColor", "onChange", "orientation", "ScrollButtonComponent", "scrollButtons", "selectionFollowsFocus", "TabIndicatorProps", "TabScrollButtonProps", "textColor", "value", "variant"]),
L = Ev(), O = "scrollable" === D, M = "rtl" === L.direction, N = "vertical" === g,
R = N ? "scrollTop" : "scrollLeft", W = N ? "top" : "left", V = N ? "bottom" : "right",
F = N ? "clientHeight" : "clientWidth", G = N ? "height" : "width", B = u.exports.useState(!1), K = B[0],
j = B[1], z = u.exports.useState({}), U = z[0], q = z[1], H = u.exports.useState({start: !1, end: !1}),
Y = H[0], X = H[1], J = u.exports.useState({overflow: "hidden", marginBottom: null}), Q = J[0], $ = J[1],
Z = new Map, ee = u.exports.useRef(null), te = u.exports.useRef(null), ne = function () {
var e, t, n = ee.current;
if (n) {
var r = n.getBoundingClientRect();
e = {
clientWidth: n.clientWidth,
scrollLeft: n.scrollLeft,
scrollTop: n.scrollTop,
scrollLeftNormalized: Gw(n, L.direction),
scrollWidth: n.scrollWidth,
top: r.top,
bottom: r.bottom,
left: r.left,
right: r.right
}
}
if (n && !1 !== T) {
var i = te.current.children;
if (i.length > 0) {
var a = i[Z.get(T)];
t = a ? a.getBoundingClientRect() : null
}
}
return {tabsMeta: e, tabMeta: t}
}, re = ev(function () {
var e, t = ne(), n = t.tabsMeta, r = t.tabMeta, i = 0;
if (r && n) if (N) i = r.top - n.top + n.scrollTop; else {
var a = M ? n.scrollLeftNormalized + n.clientWidth - n.scrollWidth : n.scrollLeft;
i = r.left - n.left + a
}
var o = (Zc(e = {}, W, i), Zc(e, G, r ? r[G] : 0), e);
if (isNaN(U[W]) || isNaN(U[G])) q(o); else {
var s = Math.abs(U[W] - o[W]), l = Math.abs(U[G] - o[G]);
(s >= 1 || l >= 1) && q(o)
}
}), ie = function (e) {
!function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},
i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function () {
}, a = r.ease, o = void 0 === a ? Bw : a, s = r.duration, l = void 0 === s ? 300 : s, c = null, u = t[e],
d = !1, h = function () {
d = !0
};
u === n ? i(new Error("Element already at target position")) : requestAnimationFrame(function r(a) {
if (d) i(new Error("Animation cancelled")); else {
null === c && (c = a);
var s = Math.min(1, (a - c) / l);
t[e] = o(s) * (n - u) + u, s >= 1 ? requestAnimationFrame(function () {
i(null)
}) : requestAnimationFrame(r)
}
})
}(R, ee.current, e)
}, ae = function (e) {
var t = ee.current[R];
N ? t += e : (t += e * (M ? -1 : 1), t *= M && "reverse" === Fw() ? -1 : 1), ie(t)
}, oe = function () {
ae(-ee.current[F])
}, se = function () {
ae(ee.current[F])
}, le = u.exports.useCallback(function (e) {
$({overflow: null, marginBottom: -e})
}, []), ce = ev(function () {
var e = ne(), t = e.tabsMeta, n = e.tabMeta;
if (n && t) if (n[W] < t[W]) {
var r = t[R] + (n[W] - t[W]);
ie(r)
} else if (n[V] > t[V]) {
var i = t[R] + (n[V] - t[V]);
ie(i)
}
}), ue = ev(function () {
if (O && "off" !== S) {
var e, t, n = ee.current, r = n.scrollTop, i = n.scrollHeight, a = n.clientHeight, o = n.scrollWidth,
s = n.clientWidth;
if (N) e = r > 1, t = r < i - a - 1; else {
var l = Gw(ee.current, L.direction);
e = M ? l < o - s - 1 : l > 1, t = M ? l > 1 : l < o - s - 1
}
e === Y.start && t === Y.end || X({start: e, end: t})
}
});
u.exports.useEffect(function () {
var e = ig(function () {
re(), ue()
}), t = nv(ee.current);
return t.addEventListener("resize", e), function () {
e.clear(), t.removeEventListener("resize", e)
}
}, [re, ue]);
var de = u.exports.useCallback(ig(function () {
ue()
}));
u.exports.useEffect(function () {
return function () {
de.clear()
}
}, [de]), u.exports.useEffect(function () {
j(!0)
}, []), u.exports.useEffect(function () {
re(), ue()
}), u.exports.useEffect(function () {
ce()
}, [ce, U]), u.exports.useImperativeHandle(i, function () {
return {updateIndicator: re, updateScrollButtons: ue}
}, [re, ue]);
var he = u.exports.createElement(Uw, Jc({
className: l.indicator,
orientation: g,
color: f
}, x, {style: Jc({}, U, x.style)})), pe = 0, fe = u.exports.Children.map(s, function (e) {
if (!u.exports.isValidElement(e)) return null;
var t = void 0 === e.props.value ? pe : e.props.value;
Z.set(t, pe);
var n = t === T;
return pe += 1, u.exports.cloneElement(e, {
fullWidth: "fullWidth" === D,
indicator: n && !K && he,
selected: n,
selectionFollowsFocus: _,
onChange: m,
textColor: A,
value: t
})
}), me = function () {
var e = {};
e.scrollbarSizeListener = O ? u.exports.createElement(jw, {className: l.scrollable, onChange: le}) : null;
var t = Y.start || Y.end, n = O && ("auto" === S && t || "desktop" === S || "on" === S);
return e.scrollButtonStart = n ? u.exports.createElement(b, Jc({
orientation: g,
direction: M ? "right" : "left",
onClick: oe,
disabled: !Y.start,
className: Xc(l.scrollButtons, "on" !== S && l.scrollButtonsDesktop)
}, P)) : null, e.scrollButtonEnd = n ? u.exports.createElement(b, Jc({
orientation: g,
direction: M ? "left" : "right",
onClick: se,
disabled: !Y.end,
className: Xc(l.scrollButtons, "on" !== S && l.scrollButtonsDesktop)
}, P)) : null, e
}();
return u.exports.createElement(h, Jc({
className: Xc(l.root, c, N && l.vertical),
ref: t
}, I), me.scrollButtonStart, me.scrollbarSizeListener, u.exports.createElement("div", {
className: Xc(l.scroller, O ? l.scrollable : l.fixed),
style: Q,
ref: ee,
onScroll: de
}, u.exports.createElement("div", {
"aria-label": n,
"aria-labelledby": r,
className: Xc(l.flexContainer, N && l.flexContainerVertical, o && !O && l.centered),
onKeyDown: function (e) {
var t = e.target;
if ("tab" === t.getAttribute("role")) {
var n = null, r = "vertical" !== g ? "ArrowLeft" : "ArrowUp",
i = "vertical" !== g ? "ArrowRight" : "ArrowDown";
switch ("vertical" !== g && "rtl" === L.direction && (r = "ArrowRight", i = "ArrowLeft"), e.key) {
case r:
n = t.previousElementSibling || te.current.lastChild;
break;
case i:
n = t.nextElementSibling || te.current.firstChild;
break;
case"Home":
n = te.current.firstChild;
break;
case"End":
n = te.current.lastChild
}
null !== n && (n.focus(), e.preventDefault())
}
},
ref: te,
role: "tablist"
}, fe), K && he), me.scrollButtonEnd)
}), Qw = Um(function (e) {
return {
root: {overflow: "hidden", minHeight: 48, WebkitOverflowScrolling: "touch", display: "flex"},
vertical: {flexDirection: "column"},
flexContainer: {display: "flex"},
flexContainerVertical: {flexDirection: "column"},
centered: {justifyContent: "center"},
scroller: {position: "relative", display: "inline-block", flex: "1 1 auto", whiteSpace: "nowrap"},
fixed: {overflowX: "hidden", width: "100%"},
scrollable: {overflowX: "scroll", scrollbarWidth: "none", "&::-webkit-scrollbar": {display: "none"}},
scrollButtons: {},
scrollButtonsDesktop: Zc({}, e.breakpoints.down("xs"), {display: "none"}),
indicator: {}
}
}, {name: "MuiTabs"})(Jw), $w = {standard: wy, filled: Zg, outlined: rb},
Zw = u.exports.forwardRef(function (e, t) {
var n = e.autoComplete, r = e.autoFocus, i = void 0 !== r && r, a = e.children, o = e.classes, s = e.className,
l = e.color, c = void 0 === l ? "primary" : l, d = e.defaultValue, h = e.disabled, p = void 0 !== h && h,
f = e.error, m = void 0 !== f && f, v = e.FormHelperTextProps, g = e.fullWidth, y = void 0 !== g && g,
b = e.helperText, w = e.hiddenLabel, S = e.id, _ = e.InputLabelProps, k = e.inputProps, x = e.InputProps,
P = e.inputRef, C = e.label, A = e.multiline, T = void 0 !== A && A, E = e.name, D = e.onBlur, I = e.onChange,
L = e.onFocus, O = e.placeholder, M = e.required, N = void 0 !== M && M, R = e.rows, W = e.rowsMax,
V = e.maxRows, F = e.minRows, G = e.select, B = void 0 !== G && G, K = e.SelectProps, j = e.type, z = e.value,
U = e.variant, q = void 0 === U ? "standard" : U,
H = $c(e, ["autoComplete", "autoFocus", "children", "classes", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "hiddenLabel", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "rowsMax", "maxRows", "minRows", "select", "SelectProps", "type", "value", "variant"]),
Y = {};
if ("outlined" === q && (_ && void 0 !== _.shrink && (Y.notched = _.shrink), C)) {
var X, J = null !== (X = null === _ || void 0 === _ ? void 0 : _.required) && void 0 !== X ? X : N;
Y.label = u.exports.createElement(u.exports.Fragment, null, C, J && " *")
}
B && (K && K.native || (Y.id = void 0), Y["aria-describedby"] = void 0);
var Q = b && S ? "".concat(S, "-helper-text") : void 0, $ = C && S ? "".concat(S, "-label") : void 0, Z = $w[q],
ee = u.exports.createElement(Z, Jc({
"aria-describedby": Q,
autoComplete: n,
autoFocus: i,
defaultValue: d,
fullWidth: y,
multiline: T,
name: E,
rows: R,
rowsMax: W,
maxRows: V,
minRows: F,
type: j,
value: z,
id: S,
inputRef: P,
onBlur: D,
onChange: I,
onFocus: L,
placeholder: O,
inputProps: k
}, Y, x));
return u.exports.createElement(ty, Jc({
className: Xc(o.root, s),
disabled: p,
error: m,
fullWidth: y,
hiddenLabel: w,
ref: t,
required: N,
color: c,
variant: q
}, H), C && u.exports.createElement(xy, Jc({
htmlFor: S,
id: $
}, _), C), B ? u.exports.createElement(ww, Jc({
"aria-describedby": Q,
id: S,
labelId: $,
value: z,
input: ee
}, K), a) : ee, b && u.exports.createElement(sy, Jc({id: Q}, v), b))
}), eS = Um({root: {}}, {name: "MuiTextField"})(Zw);
function tS(e) {
return Math.round(1e5 * e) / 1e5
}
var nS = !1, rS = null, iS = u.exports.forwardRef(function (e, t) {
var n = e.arrow, r = void 0 !== n && n, i = e.children, a = e.classes, o = e.disableFocusListener,
s = void 0 !== o && o, l = e.disableHoverListener, c = void 0 !== l && l, d = e.disableTouchListener,
h = void 0 !== d && d, p = e.enterDelay, f = void 0 === p ? 100 : p, m = e.enterNextDelay,
v = void 0 === m ? 0 : m, g = e.enterTouchDelay, y = void 0 === g ? 700 : g, b = e.id, w = e.interactive,
S = void 0 !== w && w, _ = e.leaveDelay, k = void 0 === _ ? 0 : _, x = e.leaveTouchDelay,
P = void 0 === x ? 1500 : x, C = e.onClose, A = e.onOpen, T = e.open, E = e.placement,
D = void 0 === E ? "bottom" : E, I = e.PopperComponent, L = void 0 === I ? iw : I, O = e.PopperProps,
M = e.title, N = e.TransitionComponent, R = void 0 === N ? yy : N, W = e.TransitionProps,
V = $c(e, ["arrow", "children", "classes", "disableFocusListener", "disableHoverListener", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "id", "interactive", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "title", "TransitionComponent", "TransitionProps"]),
F = Ev(), G = u.exports.useState(), B = G[0], K = G[1], j = u.exports.useState(null), z = j[0], U = j[1],
q = u.exports.useRef(!1), Y = u.exports.useRef(), X = u.exports.useRef(), J = u.exports.useRef(),
Q = u.exports.useRef(), $ = Am(og({controlled: T, default: !1, name: "Tooltip", state: "open"}), 2), Z = $[0],
ee = $[1], te = Z, ne = sg(b);
u.exports.useEffect(function () {
return function () {
clearTimeout(Y.current), clearTimeout(X.current), clearTimeout(J.current), clearTimeout(Q.current)
}
}, []);
var re = function (e) {
clearTimeout(rS), nS = !0, ee(!0), A && A(e)
}, ie = function () {
var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
return function (t) {
var n = i.props;
"mouseover" === t.type && n.onMouseOver && e && n.onMouseOver(t), q.current && "touchstart" !== t.type || (B && B.removeAttribute("title"), clearTimeout(X.current), clearTimeout(J.current), f || nS && v ? (t.persist(), X.current = setTimeout(function () {
re(t)
}, nS ? v : f)) : re(t))
}
}, ae = gg(), oe = ae.isFocusVisible, se = ae.onBlurVisible, le = ae.ref, ce = u.exports.useState(!1), ue = ce[0],
de = ce[1], he = function () {
var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
return function (t) {
B || K(t.currentTarget), oe(t) && (de(!0), ie()(t));
var n = i.props;
n.onFocus && e && n.onFocus(t)
}
}, pe = function (e) {
clearTimeout(rS), rS = setTimeout(function () {
nS = !1
}, 800 + k), ee(!1), C && C(e), clearTimeout(Y.current), Y.current = setTimeout(function () {
q.current = !1
}, F.transitions.duration.shortest)
}, fe = function () {
var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
return function (t) {
var n = i.props;
"blur" === t.type && (n.onBlur && e && n.onBlur(t), ue && (de(!1), se())), "mouseleave" === t.type && n.onMouseLeave && t.currentTarget === B && n.onMouseLeave(t), clearTimeout(X.current), clearTimeout(J.current), t.persist(), J.current = setTimeout(function () {
pe(t)
}, k)
}
}, me = function (e) {
q.current = !0;
var t = i.props;
t.onTouchStart && t.onTouchStart(e)
}, ve = Xm(le, Xm(K, t)), ge = u.exports.useCallback(function (e) {
Ym(ve, H.exports.findDOMNode(e))
}, [ve]), ye = Xm(i.ref, ge);
"" === M && (te = !1);
var be = Jc({
"aria-describedby": te ? ne : null,
title: !te && !c && "string" == typeof M ? M : null
}, V, i.props, {className: Xc(V.className, i.props.className), onTouchStart: me, ref: ye}), we = {};
h || (be.onTouchStart = function (e) {
me(e), clearTimeout(J.current), clearTimeout(Y.current), clearTimeout(Q.current), e.persist(), Q.current = setTimeout(function () {
ie()(e)
}, y)
}, be.onTouchEnd = function (e) {
i.props.onTouchEnd && i.props.onTouchEnd(e), clearTimeout(Q.current), clearTimeout(J.current), e.persist(), J.current = setTimeout(function () {
pe(e)
}, P)
}), c || (be.onMouseOver = ie(), be.onMouseLeave = fe(), S && (we.onMouseOver = ie(!1), we.onMouseLeave = fe(!1))), s || (be.onFocus = he(), be.onBlur = fe(), S && (we.onFocus = he(!1), we.onBlur = fe(!1)));
var Se = u.exports.useMemo(function () {
return su({popperOptions: {modifiers: {arrow: {enabled: Boolean(z), element: z}}}}, O)
}, [z, O]);
return u.exports.createElement(u.exports.Fragment, null, u.exports.cloneElement(i, be), u.exports.createElement(L, Jc({
className: Xc(a.popper, S && a.popperInteractive, r && a.popperArrow),
placement: D,
anchorEl: B,
open: !!B && te,
id: be["aria-describedby"],
transition: !0
}, we, Se), function (e) {
var t = e.placement, n = e.TransitionProps;
return u.exports.createElement(R, Jc({timeout: F.transitions.duration.shorter}, n, W), u.exports.createElement("div", {className: Xc(a.tooltip, a["tooltipPlacement".concat(qm(t.split("-")[0]))], q.current && a.touch, r && a.tooltipArrow)}, M, r ? u.exports.createElement("span", {
className: a.arrow,
ref: U
}) : null))
}))
}), aS = Um(function (e) {
return {
popper: {zIndex: e.zIndex.tooltip, pointerEvents: "none"},
popperInteractive: {pointerEvents: "auto"},
popperArrow: {
'&[x-placement*="bottom"] $arrow': {
top: 0,
left: 0,
marginTop: "-0.71em",
marginLeft: 4,
marginRight: 4,
"&::before": {transformOrigin: "0 100%"}
},
'&[x-placement*="top"] $arrow': {
bottom: 0,
left: 0,
marginBottom: "-0.71em",
marginLeft: 4,
marginRight: 4,
"&::before": {transformOrigin: "100% 0"}
},
'&[x-placement*="right"] $arrow': {
left: 0,
marginLeft: "-0.71em",
height: "1em",
width: "0.71em",
marginTop: 4,
marginBottom: 4,
"&::before": {transformOrigin: "100% 100%"}
},
'&[x-placement*="left"] $arrow': {
right: 0,
marginRight: "-0.71em",
height: "1em",
width: "0.71em",
marginTop: 4,
marginBottom: 4,
"&::before": {transformOrigin: "0 0"}
}
},
tooltip: {
backgroundColor: Gf(e.palette.grey[700], .9),
borderRadius: e.shape.borderRadius,
color: e.palette.common.white,
fontFamily: e.typography.fontFamily,
padding: "4px 8px",
fontSize: e.typography.pxToRem(10),
lineHeight: "".concat(tS(1.4), "em"),
maxWidth: 300,
wordWrap: "break-word",
fontWeight: e.typography.fontWeightMedium
},
tooltipArrow: {position: "relative", margin: "0"},
arrow: {
overflow: "hidden",
position: "absolute",
width: "1em",
height: "0.71em",
boxSizing: "border-box",
color: Gf(e.palette.grey[700], .9),
"&::before": {
content: '""',
margin: "auto",
display: "block",
width: "100%",
height: "100%",
backgroundColor: "currentColor",
transform: "rotate(45deg)"
}
},
touch: {
padding: "8px 16px",
fontSize: e.typography.pxToRem(14),
lineHeight: "".concat(tS(16 / 14), "em"),
fontWeight: e.typography.fontWeightRegular
},
tooltipPlacementLeft: Zc({
transformOrigin: "right center",
margin: "0 24px "
}, e.breakpoints.up("sm"), {margin: "0 14px"}),
tooltipPlacementRight: Zc({
transformOrigin: "left center",
margin: "0 24px"
}, e.breakpoints.up("sm"), {margin: "0 14px"}),
tooltipPlacementTop: Zc({
transformOrigin: "center bottom",
margin: "24px 0"
}, e.breakpoints.up("sm"), {margin: "14px 0"}),
tooltipPlacementBottom: Zc({
transformOrigin: "center top",
margin: "24px 0"
}, e.breakpoints.up("sm"), {margin: "14px 0"})
}
}, {name: "MuiTooltip", flip: !1})(iS), oS = {exports: {}}, sS = {}, lS = u.exports, cS = 60103;
if (sS.Fragment = 60107, "function" == typeof Symbol && Symbol.for) {
var uS = Symbol.for;
cS = uS("react.element"), sS.Fragment = uS("react.fragment")
}
var dS = lS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
hS = Object.prototype.hasOwnProperty, pS = {key: !0, ref: !0, __self: !0, __source: !0};
function fS(e, t, n) {
var r, i = {}, a = null, o = null;
for (r in void 0 !== n && (a = "" + n), void 0 !== t.key && (a = "" + t.key), void 0 !== t.ref && (o = t.ref), t) hS.call(t, r) && !pS.hasOwnProperty(r) && (i[r] = t[r]);
if (e && e.defaultProps) for (r in t = e.defaultProps) void 0 === i[r] && (i[r] = t[r]);
return {$$typeof: cS, type: e, key: a, ref: o, props: i, _owner: dS.current}
}
sS.jsx = fS, sS.jsxs = fS, oS.exports = sS;
var mS = oS.exports.jsx, vS = oS.exports.jsxs, gS = function (e) {
var t, n, r = eg();
return vS(Bv, {
open: e.open,
keepMounted: !0,
onClose: e.handleClose,
"aria-labelledby": "alert-dialog-slide-title",
"aria-describedby": "alert-dialog-slide-description",
fullWidth: !0,
maxWidth: null !== (t = e.maxWidth) && void 0 !== t ? t : "md",
className: r.container,
children: [mS(Jv, {
className: r.title,
id: "alert-dialog-slide-title",
children: null !== (n = e.titleLabel) && void 0 !== n ? n : "Dialog"
}), mS(Uv, {children: e.children}), vS(jv, {
children: [mS(Ig, {
"aria-label": "base-dialog-close",
onClick: e.handleClose,
color: "primary",
children: "取消"
}), mS(Ig, {
"aria-label": "base-dialog-submit",
variant: "contained",
onClick: e.handleOK,
color: "primary",
type: "submit",
children: e.rightButtonLabel
})]
})]
})
}, yS = Array.isArray, bS = Object.keys, wS = Object.prototype.hasOwnProperty, SS = "undefined" != typeof Element;
var _S = function (e, t) {
try {
return function e(t, n) {
if (t === n) return !0;
if (t && n && "object" == c(t) && "object" == c(n)) {
var r, i, a, o = yS(t), s = yS(n);
if (o && s) {
if ((i = t.length) != n.length) return !1;
for (r = i; 0 != r--;) if (!e(t[r], n[r])) return !1;
return !0
}
if (o != s) return !1;
var l = t instanceof Date, u = n instanceof Date;
if (l != u) return !1;
if (l && u) return t.getTime() == n.getTime();
var d = t instanceof RegExp, h = n instanceof RegExp;
if (d != h) return !1;
if (d && h) return t.toString() == n.toString();
var p = bS(t);
if ((i = p.length) !== bS(n).length) return !1;
for (r = i; 0 != r--;) if (!wS.call(n, p[r])) return !1;
if (SS && t instanceof Element && n instanceof Element) return t === n;
for (r = i; 0 != r--;) if (!("_owner" === (a = p[r]) && t.$$typeof || e(t[a], n[a]))) return !1;
return !0
}
return t != t && n != n
}(e, t)
} catch (e) {
if (e.message && e.message.match(/stack|recursion/i) || -2146828260 === e.number) return console.warn("Warning: react-fast-compare does not handle circular references.", e.name, e.message), !1;
throw e
}
}, kS = function (e) {
return function (e) {
return !!e && "object" === c(e)
}(e) && !function (e) {
var t = Object.prototype.toString.call(e);
return "[object RegExp]" === t || "[object Date]" === t || function (e) {
return e.$$typeof === xS
}(e)
}(e)
};
var xS = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103;
function PS(e, t) {
return !1 !== t.clone && t.isMergeableObject(e) ? AS((n = e, Array.isArray(n) ? [] : {}), e, t) : e;
var n
}
function CS(e, t, n) {
return e.concat(t).map(function (e) {
return PS(e, n)
})
}
function AS(e, t, n) {
(n = n || {}).arrayMerge = n.arrayMerge || CS, n.isMergeableObject = n.isMergeableObject || kS;
var r = Array.isArray(t);
return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : function (e, t, n) {
var r = {};
return n.isMergeableObject(e) && Object.keys(e).forEach(function (t) {
r[t] = PS(e[t], n)
}), Object.keys(t).forEach(function (i) {
n.isMergeableObject(t[i]) && e[i] ? r[i] = AS(e[i], t[i], n) : r[i] = PS(t[i], n)
}), r
}(e, t, n) : PS(t, n)
}
AS.all = function (e, t) {
if (!Array.isArray(e)) throw new Error("first argument should be an array");
return e.reduce(function (e, n) {
return AS(e, n, t)
}, {})
};
var TS = AS,
ES = "object" == ("undefined" == typeof global ? "undefined" : c(global)) && global && global.Object === Object && global,
DS = "object" == ("undefined" == typeof self ? "undefined" : c(self)) && self && self.Object === Object && self,
IS = ES || DS || Function("return this")(), LS = IS.Symbol, OS = Object.prototype, MS = OS.hasOwnProperty,
NS = OS.toString, RS = LS ? LS.toStringTag : void 0;
var WS = Object.prototype.toString;
var VS = "[object Null]", FS = "[object Undefined]", GS = LS ? LS.toStringTag : void 0;
function BS(e) {
return null == e ? void 0 === e ? FS : VS : GS && GS in Object(e) ? function (e) {
var t = MS.call(e, RS), n = e[RS];
try {
e[RS] = void 0;
var r = !0
} catch (e) {
}
var i = NS.call(e);
return r && (t ? e[RS] = n : delete e[RS]), i
}(e) : function (e) {
return WS.call(e)
}(e)
}
function KS(e, t) {
return function (n) {
return e(t(n))
}
}
var jS = KS(Object.getPrototypeOf, Object);
function zS(e) {
return null != e && "object" == c(e)
}
var US = "[object Object]", qS = Function.prototype, HS = Object.prototype, YS = qS.toString,
XS = HS.hasOwnProperty, JS = YS.call(Object);
function QS(e) {
if (!zS(e) || BS(e) != US) return !1;
var t = jS(e);
if (null === t) return !0;
var n = XS.call(t, "constructor") && t.constructor;
return "function" == typeof n && n instanceof n && YS.call(n) == JS
}
function $S(e, t) {
return e === t || e != e && t != t
}
function ZS(e, t) {
for (var n = e.length; n--;) if ($S(e[n][0], t)) return n;
return -1
}
var e_ = Array.prototype.splice;
function t_(e) {
var t = -1, n = null == e ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1])
}
}
function n_(e) {
var t = c(e);
return null != e && ("object" == t || "function" == t)
}
t_.prototype.clear = function () {
this.__data__ = [], this.size = 0
}, t_.prototype.delete = function (e) {
var t = this.__data__, n = ZS(t, e);
return !(n < 0 || (n == t.length - 1 ? t.pop() : e_.call(t, n, 1), --this.size, 0))
}, t_.prototype.get = function (e) {
var t = this.__data__, n = ZS(t, e);
return n < 0 ? void 0 : t[n][1]
}, t_.prototype.has = function (e) {
return ZS(this.__data__, e) > -1
}, t_.prototype.set = function (e, t) {
var n = this.__data__, r = ZS(n, e);
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this
};
var r_ = "[object AsyncFunction]", i_ = "[object Function]", a_ = "[object GeneratorFunction]",
o_ = "[object Proxy]";
function s_(e) {
if (!n_(e)) return !1;
var t = BS(e);
return t == i_ || t == a_ || t == r_ || t == o_
}
var l_, c_ = IS["__core-js_shared__"],
u_ = (l_ = /[^.]+$/.exec(c_ && c_.keys && c_.keys.IE_PROTO || "")) ? "Symbol(src)_1." + l_ : "";
var d_ = Function.prototype.toString;
function h_(e) {
if (null != e) {
try {
return d_.call(e)
} catch (e) {
}
try {
return e + ""
} catch (e) {
}
}
return ""
}
var p_ = /^\[object .+?Constructor\]$/, f_ = Function.prototype, m_ = Object.prototype, v_ = f_.toString,
g_ = m_.hasOwnProperty,
y_ = RegExp("^" + v_.call(g_).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
function b_(e) {
return !(!n_(e) || u_ && u_ in e) && (s_(e) ? y_ : p_).test(h_(e))
}
function w_(e, t) {
var n = function (e, t) {
return null == e ? void 0 : e[t]
}(e, t);
return b_(n) ? n : void 0
}
var S_ = w_(IS, "Map"), __ = w_(Object, "create");
var k_ = "__lodash_hash_undefined__", x_ = Object.prototype.hasOwnProperty;
var P_ = Object.prototype.hasOwnProperty;
var C_ = "__lodash_hash_undefined__";
function A_(e) {
var t = -1, n = null == e ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1])
}
}
function T_(e, t) {
var n, r, i = e.__data__;
return ("string" == (r = c(n = t)) || "number" == r || "symbol" == r || "boolean" == r ? "__proto__" !== n : null === n) ? i["string" == typeof t ? "string" : "hash"] : i.map
}
function E_(e) {
var t = -1, n = null == e ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1])
}
}
A_.prototype.clear = function () {
this.__data__ = __ ? __(null) : {}, this.size = 0
}, A_.prototype.delete = function (e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0, t
}, A_.prototype.get = function (e) {
var t = this.__data__;
if (__) {
var n = t[e];
return n === k_ ? void 0 : n
}
return x_.call(t, e) ? t[e] : void 0
}, A_.prototype.has = function (e) {
var t = this.__data__;
return __ ? void 0 !== t[e] : P_.call(t, e)
}, A_.prototype.set = function (e, t) {
var n = this.__data__;
return this.size += this.has(e) ? 0 : 1, n[e] = __ && void 0 === t ? C_ : t, this
}, E_.prototype.clear = function () {
this.size = 0, this.__data__ = {hash: new A_, map: new (S_ || t_), string: new A_}
}, E_.prototype.delete = function (e) {
var t = T_(this, e).delete(e);
return this.size -= t ? 1 : 0, t
}, E_.prototype.get = function (e) {
return T_(this, e).get(e)
}, E_.prototype.has = function (e) {
return T_(this, e).has(e)
}, E_.prototype.set = function (e, t) {
var n = T_(this, e), r = n.size;
return n.set(e, t), this.size += n.size == r ? 0 : 1, this
};
var D_ = 200;
function I_(e) {
var t = this.__data__ = new t_(e);
this.size = t.size
}
I_.prototype.clear = function () {
this.__data__ = new t_, this.size = 0
}, I_.prototype.delete = function (e) {
var t = this.__data__, n = t.delete(e);
return this.size = t.size, n
}, I_.prototype.get = function (e) {
return this.__data__.get(e)
}, I_.prototype.has = function (e) {
return this.__data__.has(e)
}, I_.prototype.set = function (e, t) {
var n = this.__data__;
if (n instanceof t_) {
var r = n.__data__;
if (!S_ || r.length < D_ - 1) return r.push([e, t]), this.size = ++n.size, this;
n = this.__data__ = new E_(r)
}
return n.set(e, t), this.size = n.size, this
};
var L_ = function () {
try {
var e = w_(Object, "defineProperty");
return e({}, "", {}), e
} catch (e) {
}
}();
function O_(e, t, n) {
"__proto__" == t && L_ ? L_(e, t, {configurable: !0, enumerable: !0, value: n, writable: !0}) : e[t] = n
}
var M_ = Object.prototype.hasOwnProperty;
function N_(e, t, n) {
var r = e[t];
M_.call(e, t) && $S(r, n) && (void 0 !== n || t in e) || O_(e, t, n)
}
function R_(e, t, n, r) {
var i = !n;
n || (n = {});
for (var a = -1, o = t.length; ++a < o;) {
var s = t[a], l = r ? r(n[s], e[s], s, n, e) : void 0;
void 0 === l && (l = e[s]), i ? O_(n, s, l) : N_(n, s, l)
}
return n
}
var W_ = "[object Arguments]";
function V_(e) {
return zS(e) && BS(e) == W_
}
var F_ = Object.prototype, G_ = F_.hasOwnProperty, B_ = F_.propertyIsEnumerable, K_ = V_(function () {
return arguments
}()) ? V_ : function (e) {
return zS(e) && G_.call(e, "callee") && !B_.call(e, "callee")
}, j_ = Array.isArray;
var z_ = "object" == c(t) && t && !t.nodeType && t, U_ = z_ && "object" == c(e) && e && !e.nodeType && e,
q_ = U_ && U_.exports === z_ ? IS.Buffer : void 0, H_ = (q_ ? q_.isBuffer : void 0) || function () {
return !1
}, Y_ = 9007199254740991, X_ = /^(?:0|[1-9]\d*)$/;
function J_(e, t) {
var n = c(e);
return !!(t = null == t ? Y_ : t) && ("number" == n || "symbol" != n && X_.test(e)) && e > -1 && e % 1 == 0 && e < t
}
var Q_ = 9007199254740991;
function $_(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <= Q_
}
var Z_ = {};
function ek(e) {
return function (t) {
return e(t)
}
}
Z_["[object Float32Array]"] = Z_["[object Float64Array]"] = Z_["[object Int8Array]"] = Z_["[object Int16Array]"] = Z_["[object Int32Array]"] = Z_["[object Uint8Array]"] = Z_["[object Uint8ClampedArray]"] = Z_["[object Uint16Array]"] = Z_["[object Uint32Array]"] = !0, Z_["[object Arguments]"] = Z_["[object Array]"] = Z_["[object ArrayBuffer]"] = Z_["[object Boolean]"] = Z_["[object DataView]"] = Z_["[object Date]"] = Z_["[object Error]"] = Z_["[object Function]"] = Z_["[object Map]"] = Z_["[object Number]"] = Z_["[object Object]"] = Z_["[object RegExp]"] = Z_["[object Set]"] = Z_["[object String]"] = Z_["[object WeakMap]"] = !1;
var tk = "object" == c(t) && t && !t.nodeType && t, nk = tk && "object" == c(e) && e && !e.nodeType && e,
rk = nk && nk.exports === tk && ES.process, ik = function () {
try {
var e = nk && nk.require && nk.require("util").types;
return e || rk && rk.binding && rk.binding("util")
} catch (e) {
}
}(), ak = ik && ik.isTypedArray, ok = ak ? ek(ak) : function (e) {
return zS(e) && $_(e.length) && !!Z_[BS(e)]
}, sk = Object.prototype.hasOwnProperty;
function lk(e, t) {
var n = j_(e), r = !n && K_(e), i = !n && !r && H_(e), a = !n && !r && !i && ok(e), o = n || r || i || a,
s = o ? function (e, t) {
for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
return r
}(e.length, String) : [], l = s.length;
for (var c in e) !t && !sk.call(e, c) || o && ("length" == c || i && ("offset" == c || "parent" == c) || a && ("buffer" == c || "byteLength" == c || "byteOffset" == c) || J_(c, l)) || s.push(c);
return s
}
var ck = Object.prototype;
function uk(e) {
var t = e && e.constructor;
return e === ("function" == typeof t && t.prototype || ck)
}
var dk = KS(Object.keys, Object), hk = Object.prototype.hasOwnProperty;
function pk(e) {
return null != e && $_(e.length) && !s_(e)
}
function fk(e) {
return pk(e) ? lk(e) : function (e) {
if (!uk(e)) return dk(e);
var t = [];
for (var n in Object(e)) hk.call(e, n) && "constructor" != n && t.push(n);
return t
}(e)
}
var mk = Object.prototype.hasOwnProperty;
function vk(e) {
if (!n_(e)) return function (e) {
var t = [];
if (null != e) for (var n in Object(e)) t.push(n);
return t
}(e);
var t = uk(e), n = [];
for (var r in e) ("constructor" != r || !t && mk.call(e, r)) && n.push(r);
return n
}
function gk(e) {
return pk(e) ? lk(e, !0) : vk(e)
}
var yk = "object" == c(t) && t && !t.nodeType && t, bk = yk && "object" == c(e) && e && !e.nodeType && e,
wk = bk && bk.exports === yk ? IS.Buffer : void 0, Sk = wk ? wk.allocUnsafe : void 0;
function _k(e, t) {
var n = -1, r = e.length;
for (t || (t = Array(r)); ++n < r;) t[n] = e[n];
return t
}
function kk() {
return []
}
var xk = Object.prototype.propertyIsEnumerable, Pk = Object.getOwnPropertySymbols, Ck = Pk ? function (e) {
return null == e ? [] : (e = Object(e), function (e, t) {
for (var n = -1, r = null == e ? 0 : e.length, i = 0, a = []; ++n < r;) {
var o = e[n];
t(o, n, e) && (a[i++] = o)
}
return a
}(Pk(e), function (t) {
return xk.call(e, t)
}))
} : kk;
function Ak(e, t) {
for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
return e
}
var Tk = Object.getOwnPropertySymbols ? function (e) {
for (var t = []; e;) Ak(t, Ck(e)), e = jS(e);
return t
} : kk;
function Ek(e, t, n) {
var r = t(e);
return j_(e) ? r : Ak(r, n(e))
}
function Dk(e) {
return Ek(e, fk, Ck)
}
function Ik(e) {
return Ek(e, gk, Tk)
}
var Lk = w_(IS, "DataView"), Ok = w_(IS, "Promise"), Mk = w_(IS, "Set"), Nk = w_(IS, "WeakMap"), Rk = h_(Lk),
Wk = h_(S_), Vk = h_(Ok), Fk = h_(Mk), Gk = h_(Nk), Bk = BS;
(Lk && "[object DataView]" != Bk(new Lk(new ArrayBuffer(1))) || S_ && "[object Map]" != Bk(new S_) || Ok && "[object Promise]" != Bk(Ok.resolve()) || Mk && "[object Set]" != Bk(new Mk) || Nk && "[object WeakMap]" != Bk(new Nk)) && (Bk = function (e) {
var t = BS(e), n = "[object Object]" == t ? e.constructor : void 0, r = n ? h_(n) : "";
if (r) switch (r) {
case Rk:
return "[object DataView]";
case Wk:
return "[object Map]";
case Vk:
return "[object Promise]";
case Fk:
return "[object Set]";
case Gk:
return "[object WeakMap]"
}
return t
});
var Kk = Bk, jk = Object.prototype.hasOwnProperty;
var zk = IS.Uint8Array;
function Uk(e) {
var t = new e.constructor(e.byteLength);
return new zk(t).set(new zk(e)), t
}
var qk = /\w*$/;
var Hk = LS ? LS.prototype : void 0, Yk = Hk ? Hk.valueOf : void 0;
var Xk = "[object Boolean]", Jk = "[object Date]", Qk = "[object Map]", $k = "[object Number]",
Zk = "[object RegExp]", ex = "[object Set]", tx = "[object String]", nx = "[object Symbol]",
rx = "[object ArrayBuffer]", ix = "[object DataView]", ax = "[object Float32Array]", ox = "[object Float64Array]",
sx = "[object Int8Array]", lx = "[object Int16Array]", cx = "[object Int32Array]", ux = "[object Uint8Array]",
dx = "[object Uint8ClampedArray]", hx = "[object Uint16Array]", px = "[object Uint32Array]";
function fx(e, t, n) {
var r, i, a, o = e.constructor;
switch (t) {
case rx:
return Uk(e);
case Xk:
case Jk:
return new o(+e);
case ix:
return function (e, t) {
var n = t ? Uk(e.buffer) : e.buffer;
return new e.constructor(n, e.byteOffset, e.byteLength)
}(e, n);
case ax:
case ox:
case sx:
case lx:
case cx:
case ux:
case dx:
case hx:
case px:
return function (e, t) {
var n = t ? Uk(e.buffer) : e.buffer;
return new e.constructor(n, e.byteOffset, e.length)
}(e, n);
case Qk:
return new o;
case $k:
case tx:
return new o(e);
case Zk:
return (a = new (i = e).constructor(i.source, qk.exec(i))).lastIndex = i.lastIndex, a;
case ex:
return new o;
case nx:
return r = e, Yk ? Object(Yk.call(r)) : {}
}
}
var mx = Object.create, vx = function () {
function e() {
}
return function (t) {
if (!n_(t)) return {};
if (mx) return mx(t);
e.prototype = t;
var n = new e;
return e.prototype = void 0, n
}
}();
var gx = "[object Map]";
var yx = ik && ik.isMap, bx = yx ? ek(yx) : function (e) {
return zS(e) && Kk(e) == gx
}, wx = "[object Set]";
var Sx = ik && ik.isSet, _x = Sx ? ek(Sx) : function (e) {
return zS(e) && Kk(e) == wx
}, kx = 1, xx = 2, Px = 4, Cx = "[object Arguments]", Ax = "[object Function]", Tx = "[object GeneratorFunction]",
Ex = "[object Object]", Dx = {};
function Ix(e, t, n, r, i, a) {
var o, s = t & kx, l = t & xx, c = t & Px;
if (n && (o = i ? n(e, r, i, a) : n(e)), void 0 !== o) return o;
if (!n_(e)) return e;
var u = j_(e);
if (u) {
if (o = function (e) {
var t = e.length, n = new e.constructor(t);
return t && "string" == typeof e[0] && jk.call(e, "index") && (n.index = e.index, n.input = e.input), n
}(e), !s) return _k(e, o)
} else {
var d = Kk(e), h = d == Ax || d == Tx;
if (H_(e)) return function (e, t) {
if (t) return e.slice();
var n = e.length, r = Sk ? Sk(n) : new e.constructor(n);
return e.copy(r), r
}(e, s);
if (d == Ex || d == Cx || h && !i) {
if (o = l || h ? {} : function (e) {
return "function" != typeof e.constructor || uk(e) ? {} : vx(jS(e))
}(e), !s) return l ? function (e, t) {
return R_(e, Tk(e), t)
}(e, function (e, t) {
return e && R_(t, gk(t), e)
}(o, e)) : function (e, t) {
return R_(e, Ck(e), t)
}(e, function (e, t) {
return e && R_(t, fk(t), e)
}(o, e))
} else {
if (!Dx[d]) return i ? e : {};
o = fx(e, d, s)
}
}
a || (a = new I_);
var p = a.get(e);
if (p) return p;
a.set(e, o), _x(e) ? e.forEach(function (r) {
o.add(Ix(r, t, n, r, e, a))
}) : bx(e) && e.forEach(function (r, i) {
o.set(i, Ix(r, t, n, i, e, a))
});
var f = u ? void 0 : (c ? l ? Ik : Dk : l ? gk : fk)(e);
return function (e, t) {
for (var n = -1, r = null == e ? 0 : e.length; ++n < r && !1 !== t(e[n], n, e);) ;
}(f || e, function (r, i) {
f && (r = e[i = r]), N_(o, i, Ix(r, t, n, i, e, a))
}), o
}
Dx[Cx] = Dx["[object Array]"] = Dx["[object ArrayBuffer]"] = Dx["[object DataView]"] = Dx["[object Boolean]"] = Dx["[object Date]"] = Dx["[object Float32Array]"] = Dx["[object Float64Array]"] = Dx["[object Int8Array]"] = Dx["[object Int16Array]"] = Dx["[object Int32Array]"] = Dx["[object Map]"] = Dx["[object Number]"] = Dx[Ex] = Dx["[object RegExp]"] = Dx["[object Set]"] = Dx["[object String]"] = Dx["[object Symbol]"] = Dx["[object Uint8Array]"] = Dx["[object Uint8ClampedArray]"] = Dx["[object Uint16Array]"] = Dx["[object Uint32Array]"] = !0, Dx["[object Error]"] = Dx[Ax] = Dx["[object WeakMap]"] = !1;
var Lx = 4;
function Ox(e) {
return Ix(e, Lx)
}
function Mx(e, t) {
for (var n = -1, r = null == e ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
return i
}
var Nx = "[object Symbol]";
function Rx(e) {
return "symbol" == c(e) || zS(e) && BS(e) == Nx
}
var Wx = "Expected a function";
function Vx(e, t) {
if ("function" != typeof e || null != t && "function" != typeof t) throw new TypeError(Wx);
var n = function n() {
var r = arguments, i = t ? t.apply(this, r) : r[0], a = n.cache;
if (a.has(i)) return a.get(i);
var o = e.apply(this, r);
return n.cache = a.set(i, o) || a, o
};
return n.cache = new (Vx.Cache || E_), n
}
Vx.Cache = E_;
var Fx = 500;
var Gx = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
Bx = /\\(\\)?/g, Kx = function (e) {
var t = Vx(e, function (e) {
return n.size === Fx && n.clear(), e
}), n = t.cache;
return t
}(function (e) {
var t = [];
return 46 === e.charCodeAt(0) && t.push(""), e.replace(Gx, function (e, n, r, i) {
t.push(r ? i.replace(Bx, "$1") : n || e)
}), t
}), jx = 1 / 0;
function zx(e) {
if ("string" == typeof e || Rx(e)) return e;
var t = e + "";
return "0" == t && 1 / e == -jx ? "-0" : t
}
var Ux = 1 / 0, qx = LS ? LS.prototype : void 0, Hx = qx ? qx.toString : void 0;
function Yx(e) {
if ("string" == typeof e) return e;
if (j_(e)) return Mx(e, Yx) + "";
if (Rx(e)) return Hx ? Hx.call(e) : "";
var t = e + "";
return "0" == t && 1 / e == -Ux ? "-0" : t
}
function Xx(e) {
return j_(e) ? Mx(e, zx) : Rx(e) ? [e] : _k(Kx(function (e) {
return null == e ? "" : Yx(e)
}(e)))
}
var Jx = 1, Qx = 4;
function $x() {
return ($x = Object.assign || function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}).apply(this, arguments)
}
function Zx(e, t) {
if (null == e) return {};
var n, r, i = {}, a = Object.keys(e);
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) >= 0 || (i[n] = e[n]);
return i
}
function eP(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
var tP = function (e) {
return Array.isArray(e) && 0 === e.length
}, nP = function (e) {
return "function" == typeof e
}, rP = function (e) {
return null !== e && "object" === c(e)
}, iP = function (e) {
return String(Math.floor(Number(e))) === e
}, aP = function (e) {
return "[object String]" === Object.prototype.toString.call(e)
}, oP = function (e) {
return rP(e) && nP(e.then)
};
function sP(e, t, n, r) {
void 0 === r && (r = 0);
for (var i = Xx(t); e && r < i.length;) e = e[i[r++]];
return void 0 === e ? n : e
}
function lP(e, t, n) {
for (var r = Ox(e), i = r, a = 0, o = Xx(t); a < o.length - 1; a++) {
var s = o[a], l = sP(e, o.slice(0, a + 1));
if (l && (rP(l) || Array.isArray(l))) i = i[s] = Ox(l); else {
var c = o[a + 1];
i = i[s] = iP(c) && Number(c) >= 0 ? [] : {}
}
}
return (0 === a ? e : i)[o[a]] === n ? e : (void 0 === n ? delete i[o[a]] : i[o[a]] = n, 0 === a && void 0 === n && delete r[o[a]], r)
}
var cP = u.exports.createContext(void 0);
function uP() {
var e = u.exports.useContext(cP);
return e || function (e, t) {
if (!ju) {
if (e) return;
var n = "Warning: " + t;
"undefined" != typeof console && console.warn(n);
try {
throw Error(n)
} catch (e) {
}
}
}(!1), e
}
function dP(e, t) {
switch (t.type) {
case"SET_VALUES":
return $x({}, e, {values: t.payload});
case"SET_TOUCHED":
return $x({}, e, {touched: t.payload});
case"SET_ERRORS":
return _S(e.errors, t.payload) ? e : $x({}, e, {errors: t.payload});
case"SET_STATUS":
return $x({}, e, {status: t.payload});
case"SET_ISSUBMITTING":
return $x({}, e, {isSubmitting: t.payload});
case"SET_ISVALIDATING":
return $x({}, e, {isValidating: t.payload});
case"SET_FIELD_VALUE":
return $x({}, e, {values: lP(e.values, t.payload.field, t.payload.value)});
case"SET_FIELD_TOUCHED":
return $x({}, e, {touched: lP(e.touched, t.payload.field, t.payload.value)});
case"SET_FIELD_ERROR":
return $x({}, e, {errors: lP(e.errors, t.payload.field, t.payload.value)});
case"RESET_FORM":
return $x({}, e, t.payload);
case"SET_FORMIK_STATE":
return t.payload(e);
case"SUBMIT_ATTEMPT":
return $x({}, e, {
touched: function e(t, n, r, i) {
void 0 === r && (r = new WeakMap), void 0 === i && (i = {});
for (var a = 0, o = Object.keys(t); a < o.length; a++) {
var s = o[a], l = t[s];
rP(l) ? r.get(l) || (r.set(l, !0), i[s] = Array.isArray(l) ? [] : {}, e(l, n, r, i[s])) : i[s] = n
}
return i
}(e.values, !0), isSubmitting: !0, submitCount: e.submitCount + 1
});
case"SUBMIT_FAILURE":
case"SUBMIT_SUCCESS":
return $x({}, e, {isSubmitting: !1});
default:
return e
}
}
cP.displayName = "FormikContext", cP.Provider, cP.Consumer;
var hP = {}, pP = {};
function fP(e) {
var t = e.validateOnChange, n = void 0 === t || t, r = e.validateOnBlur, i = void 0 === r || r,
a = e.validateOnMount, o = void 0 !== a && a, s = e.isInitialValid, l = e.enableReinitialize,
c = void 0 !== l && l, d = e.onSubmit,
h = Zx(e, ["validateOnChange", "validateOnBlur", "validateOnMount", "isInitialValid", "enableReinitialize", "onSubmit"]),
p = $x({validateOnChange: n, validateOnBlur: i, validateOnMount: o, onSubmit: d}, h),
f = u.exports.useRef(p.initialValues), m = u.exports.useRef(p.initialErrors || hP),
v = u.exports.useRef(p.initialTouched || pP), g = u.exports.useRef(p.initialStatus), y = u.exports.useRef(!1),
b = u.exports.useRef({});
u.exports.useEffect(function () {
return y.current = !0, function () {
y.current = !1
}
}, []);
var w = u.exports.useReducer(dP, {
values: p.initialValues,
errors: p.initialErrors || hP,
touched: p.initialTouched || pP,
status: p.initialStatus,
isSubmitting: !1,
isValidating: !1,
submitCount: 0
}), S = w[0], _ = w[1], k = u.exports.useCallback(function (e, t) {
return new Promise(function (n, r) {
var i = p.validate(e, t);
null == i ? n(hP) : oP(i) ? i.then(function (e) {
n(e || hP)
}, function (e) {
r(e)
}) : n(i)
})
}, [p.validate]), x = u.exports.useCallback(function (e, t) {
var n = p.validationSchema, r = nP(n) ? n(t) : n,
i = t && r.validateAt ? r.validateAt(t, e) : function (e, t, n, r) {
void 0 === n && (n = !1);
void 0 === r && (r = {});
var i = function e(t) {
var n = Array.isArray(t) ? [] : {};
for (var r in t) if (Object.prototype.hasOwnProperty.call(t, r)) {
var i = String(r);
!0 === Array.isArray(t[i]) ? n[i] = t[i].map(function (t) {
return !0 === Array.isArray(t) || QS(t) ? e(t) : "" !== t ? t : void 0
}) : QS(t[i]) ? n[i] = e(t[i]) : n[i] = "" !== t[i] ? t[i] : void 0
}
return n
}(e);
return t[n ? "validateSync" : "validate"](i, {abortEarly: !1, context: r})
}(e, r);
return new Promise(function (e, t) {
i.then(function () {
e(hP)
}, function (n) {
"ValidationError" === n.name ? e(function (e) {
var t = {};
if (e.inner) {
if (0 === e.inner.length) return lP(t, e.path, e.message);
for (var n = e.inner, r = Array.isArray(n), i = 0, n = r ? n : n[Symbol.iterator](); ;) {
var a;
if (r) {
if (i >= n.length) break;
a = n[i++]
} else {
if ((i = n.next()).done) break;
a = i.value
}
var o = a;
sP(t, o.path) || (t = lP(t, o.path, o.message))
}
}
return t
}(n)) : t(n)
})
})
}, [p.validationSchema]), P = u.exports.useCallback(function (e, t) {
return new Promise(function (n) {
return n(b.current[e].validate(t))
})
}, []), C = u.exports.useCallback(function (e) {
var t = Object.keys(b.current).filter(function (e) {
return nP(b.current[e].validate)
}), n = t.length > 0 ? t.map(function (t) {
return P(t, sP(e, t))
}) : [Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];
return Promise.all(n).then(function (e) {
return e.reduce(function (e, n, r) {
return "DO_NOT_DELETE_YOU_WILL_BE_FIRED" === n ? e : (n && (e = lP(e, t[r], n)), e)
}, {})
})
}, [P]), A = u.exports.useCallback(function (e) {
return Promise.all([C(e), p.validationSchema ? x(e) : {}, p.validate ? k(e) : {}]).then(function (e) {
var t = e[0], n = e[1], r = e[2];
return TS.all([t, n, r], {arrayMerge: mP})
})
}, [p.validate, p.validationSchema, C, k, x]), T = gP(function (e) {
return void 0 === e && (e = S.values), _({type: "SET_ISVALIDATING", payload: !0}), A(e).then(function (e) {
return y.current && (_({type: "SET_ISVALIDATING", payload: !1}), _({type: "SET_ERRORS", payload: e})), e
})
});
u.exports.useEffect(function () {
o && !0 === y.current && _S(f.current, p.initialValues) && T(f.current)
}, [o, T]);
var E = u.exports.useCallback(function (e) {
var t = e && e.values ? e.values : f.current,
n = e && e.errors ? e.errors : m.current ? m.current : p.initialErrors || {},
r = e && e.touched ? e.touched : v.current ? v.current : p.initialTouched || {},
i = e && e.status ? e.status : g.current ? g.current : p.initialStatus;
f.current = t, m.current = n, v.current = r, g.current = i;
var a = function () {
_({
type: "RESET_FORM",
payload: {
isSubmitting: !!e && !!e.isSubmitting,
errors: n,
touched: r,
status: i,
values: t,
isValidating: !!e && !!e.isValidating,
submitCount: e && e.submitCount && "number" == typeof e.submitCount ? e.submitCount : 0
}
})
};
if (p.onReset) {
var o = p.onReset(S.values, Y);
oP(o) ? o.then(a) : a()
} else a()
}, [p.initialErrors, p.initialStatus, p.initialTouched]);
u.exports.useEffect(function () {
!0 !== y.current || _S(f.current, p.initialValues) || (c && (f.current = p.initialValues, E()), o && T(f.current))
}, [c, p.initialValues, E, o, T]), u.exports.useEffect(function () {
c && !0 === y.current && !_S(m.current, p.initialErrors) && (m.current = p.initialErrors || hP, _({
type: "SET_ERRORS",
payload: p.initialErrors || hP
}))
}, [c, p.initialErrors]), u.exports.useEffect(function () {
c && !0 === y.current && !_S(v.current, p.initialTouched) && (v.current = p.initialTouched || pP, _({
type: "SET_TOUCHED",
payload: p.initialTouched || pP
}))
}, [c, p.initialTouched]), u.exports.useEffect(function () {
c && !0 === y.current && !_S(g.current, p.initialStatus) && (g.current = p.initialStatus, _({
type: "SET_STATUS",
payload: p.initialStatus
}))
}, [c, p.initialStatus, p.initialTouched]);
var D = gP(function (e) {
if (b.current[e] && nP(b.current[e].validate)) {
var t = sP(S.values, e), n = b.current[e].validate(t);
return oP(n) ? (_({type: "SET_ISVALIDATING", payload: !0}), n.then(function (e) {
return e
}).then(function (t) {
_({type: "SET_FIELD_ERROR", payload: {field: e, value: t}}), _({type: "SET_ISVALIDATING", payload: !1})
})) : (_({type: "SET_FIELD_ERROR", payload: {field: e, value: n}}), Promise.resolve(n))
}
return p.validationSchema ? (_({type: "SET_ISVALIDATING", payload: !0}), x(S.values, e).then(function (e) {
return e
}).then(function (t) {
_({type: "SET_FIELD_ERROR", payload: {field: e, value: t[e]}}), _({type: "SET_ISVALIDATING", payload: !1})
})) : Promise.resolve()
}), I = u.exports.useCallback(function (e, t) {
var n = t.validate;
b.current[e] = {validate: n}
}, []), L = u.exports.useCallback(function (e) {
delete b.current[e]
}, []), O = gP(function (e, t) {
return _({type: "SET_TOUCHED", payload: e}), (void 0 === t ? i : t) ? T(S.values) : Promise.resolve()
}), M = u.exports.useCallback(function (e) {
_({type: "SET_ERRORS", payload: e})
}, []), N = gP(function (e, t) {
var r = nP(e) ? e(S.values) : e;
return _({type: "SET_VALUES", payload: r}), (void 0 === t ? n : t) ? T(r) : Promise.resolve()
}), R = u.exports.useCallback(function (e, t) {
_({type: "SET_FIELD_ERROR", payload: {field: e, value: t}})
}, []), W = gP(function (e, t, r) {
return _({
type: "SET_FIELD_VALUE",
payload: {field: e, value: t}
}), (void 0 === r ? n : r) ? T(lP(S.values, e, t)) : Promise.resolve()
}), V = u.exports.useCallback(function (e, t) {
var n, r = t, i = e;
if (!aP(e)) {
e.persist && e.persist();
var a = e.target ? e.target : e.currentTarget, o = a.type, s = a.name, l = a.id, c = a.value, u = a.checked,
d = (a.outerHTML, a.options), h = a.multiple;
r = t || (s || l), i = /number|range/.test(o) ? (n = parseFloat(c), isNaN(n) ? "" : n) : /checkbox/.test(o) ? function (e, t, n) {
if ("boolean" == typeof e) return Boolean(t);
var r = [], i = !1, a = -1;
if (Array.isArray(e)) r = e, a = e.indexOf(n), i = a >= 0; else if (!n || "true" == n || "false" == n) return Boolean(t);
if (t && n && !i) return r.concat(n);
if (!i) return r;
return r.slice(0, a).concat(r.slice(a + 1))
}(sP(S.values, r), u, c) : d && h ? function (e) {
return Array.from(e).filter(function (e) {
return e.selected
}).map(function (e) {
return e.value
})
}(d) : c
}
r && W(r, i)
}, [W, S.values]), F = gP(function (e) {
if (aP(e)) return function (t) {
return V(t, e)
};
V(e)
}), G = gP(function (e, t, n) {
return void 0 === t && (t = !0), _({
type: "SET_FIELD_TOUCHED",
payload: {field: e, value: t}
}), (void 0 === n ? i : n) ? T(S.values) : Promise.resolve()
}), B = u.exports.useCallback(function (e, t) {
e.persist && e.persist();
var n = e.target, r = n.name, i = n.id, a = (n.outerHTML, t || (r || i));
G(a, !0)
}, [G]), K = gP(function (e) {
if (aP(e)) return function (t) {
return B(t, e)
};
B(e)
}), j = u.exports.useCallback(function (e) {
nP(e) ? _({type: "SET_FORMIK_STATE", payload: e}) : _({
type: "SET_FORMIK_STATE", payload: function () {
return e
}
})
}, []), z = u.exports.useCallback(function (e) {
_({type: "SET_STATUS", payload: e})
}, []), U = u.exports.useCallback(function (e) {
_({type: "SET_ISSUBMITTING", payload: e})
}, []), q = gP(function () {
return _({type: "SUBMIT_ATTEMPT"}), T().then(function (e) {
var t = e instanceof Error;
if (!t && 0 === Object.keys(e).length) {
var n;
try {
if (void 0 === (n = X())) return
} catch (e) {
throw e
}
return Promise.resolve(n).then(function (e) {
return y.current && _({type: "SUBMIT_SUCCESS"}), e
}).catch(function (e) {
if (y.current) throw _({type: "SUBMIT_FAILURE"}), e
})
}
if (y.current && (_({type: "SUBMIT_FAILURE"}), t)) throw e
})
}), H = gP(function (e) {
e && e.preventDefault && nP(e.preventDefault) && e.preventDefault(), e && e.stopPropagation && nP(e.stopPropagation) && e.stopPropagation(), q().catch(function (e) {
console.warn("Warning: An unhandled error was caught from submitForm()", e)
})
}), Y = {
resetForm: E,
validateForm: T,
validateField: D,
setErrors: M,
setFieldError: R,
setFieldTouched: G,
setFieldValue: W,
setStatus: z,
setSubmitting: U,
setTouched: O,
setValues: N,
setFormikState: j,
submitForm: q
}, X = gP(function () {
return d(S.values, Y)
}), J = gP(function (e) {
e && e.preventDefault && nP(e.preventDefault) && e.preventDefault(), e && e.stopPropagation && nP(e.stopPropagation) && e.stopPropagation(), E()
}), Q = u.exports.useCallback(function (e) {
return {
value: sP(S.values, e),
error: sP(S.errors, e),
touched: !!sP(S.touched, e),
initialValue: sP(f.current, e),
initialTouched: !!sP(v.current, e),
initialError: sP(m.current, e)
}
}, [S.errors, S.touched, S.values]), $ = u.exports.useCallback(function (e) {
return {
setValue: function (t, n) {
return W(e, t, n)
}, setTouched: function (t, n) {
return G(e, t, n)
}, setError: function (t) {
return R(e, t)
}
}
}, [W, G, R]), Z = u.exports.useCallback(function (e) {
var t = rP(e), n = t ? e.name : e, r = sP(S.values, n), i = {name: n, value: r, onChange: F, onBlur: K};
if (t) {
var a = e.type, o = e.value, s = e.as, l = e.multiple;
"checkbox" === a ? void 0 === o ? i.checked = !!r : (i.checked = !(!Array.isArray(r) || !~r.indexOf(o)), i.value = o) : "radio" === a ? (i.checked = r === o, i.value = o) : "select" === s && l && (i.value = i.value || [], i.multiple = !0)
}
return i
}, [K, F, S.values]), ee = u.exports.useMemo(function () {
return !_S(f.current, S.values)
}, [f.current, S.values]), te = u.exports.useMemo(function () {
return void 0 !== s ? ee ? S.errors && 0 === Object.keys(S.errors).length : !1 !== s && nP(s) ? s(p) : s : S.errors && 0 === Object.keys(S.errors).length
}, [s, ee, S.errors, p]);
return $x({}, S, {
initialValues: f.current,
initialErrors: m.current,
initialTouched: v.current,
initialStatus: g.current,
handleBlur: K,
handleChange: F,
handleReset: J,
handleSubmit: H,
resetForm: E,
setErrors: M,
setFormikState: j,
setFieldTouched: G,
setFieldValue: W,
setFieldError: R,
setStatus: z,
setSubmitting: U,
setTouched: O,
setValues: N,
submitForm: q,
validateForm: T,
validateField: D,
isValid: te,
dirty: ee,
unregisterField: L,
registerField: I,
getFieldProps: Z,
getFieldMeta: Q,
getFieldHelpers: $,
validateOnBlur: i,
validateOnChange: n,
validateOnMount: o
})
}
function mP(e, t, n) {
var r = e.slice();
return t.forEach(function (t, i) {
if (void 0 === r[i]) {
var a = !1 !== n.clone && n.isMergeableObject(t);
r[i] = a ? TS(Array.isArray(t) ? [] : {}, t, n) : t
} else n.isMergeableObject(t) ? r[i] = TS(e[i], t, n) : -1 === e.indexOf(t) && r.push(t)
}), r
}
var vP = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement ? u.exports.useLayoutEffect : u.exports.useEffect;
function gP(e) {
var t = u.exports.useRef(e);
return vP(function () {
t.current = e
}), u.exports.useCallback(function () {
for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
return t.current.apply(void 0, n)
}, [])
}
u.exports.forwardRef(function (e, t) {
var n = e.action, r = Zx(e, ["action"]), i = null != n ? n : "#", a = uP(), o = a.handleReset, s = a.handleSubmit;
return u.exports.createElement("form", Object.assign({onSubmit: s, ref: t, onReset: o, action: i}, r))
}).displayName = "Form";
var yP = function (e, t, n) {
var r = _P(e), i = r[t];
return r.splice(t, 1), r.splice(n, 0, i), r
}, bP = function (e, t, n) {
var r = _P(e), i = r[t];
return r[t] = r[n], r[n] = i, r
}, wP = function (e, t, n) {
var r = _P(e);
return r.splice(t, 0, n), r
}, SP = function (e, t, n) {
var r = _P(e);
return r[t] = n, r
}, _P = function (e) {
if (e) {
if (Array.isArray(e)) return [].concat(e);
var t = Object.keys(e).map(function (e) {
return parseInt(e)
}).reduce(function (e, t) {
return t > e ? t : e
}, 0);
return Array.from($x({}, e, {length: t + 1}))
}
return []
};
function kP(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
function xP() {
return (xP = Object.assign || function (e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
}).apply(this, arguments)
}
function PP(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function (t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable
})), n.push.apply(n, r)
}
return n
}
function CP(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? PP(Object(n), !0).forEach(function (t) {
kP(e, t, n[t])
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : PP(Object(n)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
})
}
return e
}
function AP(e, t) {
if (null == e) return {};
var n, r, i = function (e, t) {
if (null == e) return {};
var n, r, i = {}, a = Object.keys(e);
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) >= 0 || (i[n] = e[n]);
return i
}(e, t);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) >= 0 || Object.prototype.propertyIsEnumerable.call(e, n) && (i[n] = e[n])
}
return i
}
((function (e) {
var t, n;
function r(t) {
var n;
return (n = e.call(this, t) || this).updateArrayField = function (e, t, r) {
var i = n.props, a = i.name;
(0, i.formik.setFormikState)(function (n) {
var i = "function" == typeof r ? r : e, o = "function" == typeof t ? t : e,
s = lP(n.values, a, e(sP(n.values, a))), l = r ? i(sP(n.errors, a)) : void 0,
c = t ? o(sP(n.touched, a)) : void 0;
return tP(l) && (l = void 0), tP(c) && (c = void 0), $x({}, n, {
values: s,
errors: r ? lP(n.errors, a, l) : n.errors,
touched: t ? lP(n.touched, a, c) : n.touched
})
})
}, n.push = function (e) {
return n.updateArrayField(function (t) {
return [].concat(_P(t), [function (e) {
return Ix(e, Jx | Qx)
}(e)])
}, !1, !1)
}, n.handlePush = function (e) {
return function () {
return n.push(e)
}
}, n.swap = function (e, t) {
return n.updateArrayField(function (n) {
return bP(n, e, t)
}, !0, !0)
}, n.handleSwap = function (e, t) {
return function () {
return n.swap(e, t)
}
}, n.move = function (e, t) {
return n.updateArrayField(function (n) {
return yP(n, e, t)
}, !0, !0)
}, n.handleMove = function (e, t) {
return function () {
return n.move(e, t)
}
}, n.insert = function (e, t) {
return n.updateArrayField(function (n) {
return wP(n, e, t)
}, function (t) {
return wP(t, e, null)
}, function (t) {
return wP(t, e, null)
})
}, n.handleInsert = function (e, t) {
return function () {
return n.insert(e, t)
}
}, n.replace = function (e, t) {
return n.updateArrayField(function (n) {
return SP(n, e, t)
}, !1, !1)
}, n.handleReplace = function (e, t) {
return function () {
return n.replace(e, t)
}
}, n.unshift = function (e) {
var t = -1;
return n.updateArrayField(function (n) {
var r = n ? [e].concat(n) : [e];
return t < 0 && (t = r.length), r
}, function (e) {
var n = e ? [null].concat(e) : [null];
return t < 0 && (t = n.length), n
}, function (e) {
var n = e ? [null].concat(e) : [null];
return t < 0 && (t = n.length), n
}), t
}, n.handleUnshift = function (e) {
return function () {
return n.unshift(e)
}
}, n.handleRemove = function (e) {
return function () {
return n.remove(e)
}
}, n.handlePop = function () {
return function () {
return n.pop()
}
}, n.remove = n.remove.bind(eP(n)), n.pop = n.pop.bind(eP(n)), n
}
n = e, (t = r).prototype = Object.create(n.prototype), t.prototype.constructor = t, t.__proto__ = n;
var i = r.prototype;
return i.componentDidUpdate = function (e) {
this.props.validateOnChange && this.props.formik.validateOnChange && !_S(sP(e.formik.values, e.name), sP(this.props.formik.values, this.props.name)) && this.props.formik.validateForm(this.props.formik.values)
}, i.remove = function (e) {
var t;
return this.updateArrayField(function (n) {
var r = n ? _P(n) : [];
return t || (t = r[e]), nP(r.splice) && r.splice(e, 1), r
}, !0, !0), t
}, i.pop = function () {
var e;
return this.updateArrayField(function (t) {
var n = t;
return e || (e = n && n.pop && n.pop()), n
}, !0, !0), e
}, i.render = function () {
var e = {
push: this.push,
pop: this.pop,
swap: this.swap,
move: this.move,
insert: this.insert,
replace: this.replace,
unshift: this.unshift,
remove: this.remove,
handlePush: this.handlePush,
handlePop: this.handlePop,
handleSwap: this.handleSwap,
handleMove: this.handleMove,
handleInsert: this.handleInsert,
handleReplace: this.handleReplace,
handleUnshift: this.handleUnshift,
handleRemove: this.handleRemove
}, t = this.props, n = t.component, r = t.render, i = t.children, a = t.name,
o = $x({}, e, {form: Zx(t.formik, ["validate", "validationSchema"]), name: a});
return n ? u.exports.createElement(n, o) : r ? r(o) : i ? "function" == typeof i ? i(o) : function (e) {
return 0 === u.exports.Children.count(e)
}(i) ? null : u.exports.Children.only(i) : null
}, r
})(u.exports.Component)).defaultProps = {validateOnChange: !0};
var TP, EP, DP = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgrey: 11119017,
darkgreen: 25600,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
grey: 8421504,
green: 32768,
greenyellow: 11403055,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgrey: 13882323,
lightgreen: 9498256,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
}, IP = function (e, t) {
var n = "00000000".concat((16777215 & e).toString(16).toUpperCase()).substr(-6);
if (!Number.isNaN(t) && void 0 !== t) {
var r = t.toString(16).toUpperCase();
1 === r.length && (r = "0".concat(r)), n += r
}
return n
}, LP = function (e) {
var t = e.map(function (e) {
var t = e || 0;
return t < 0 && (t = 0), t > 255 && (t = 255), t
});
return t[3] << 24 | t[0] << 16 | t[1] << 8 | t[2]
}, OP = function (e) {
if (!e || e.length < 3 || e.length > 4) return {error: "not valid size"};
var t = e.map(function (e, t) {
return "string" == typeof e ? "%" !== e[e.length - 1] ? Math.round(Number(e) * (3 === t ? 255 : 1)) : Math.round(Number(e.substring(0, e.length - 1)) / 100 * 255) : Math.round(3 === t ? 255 * e : e)
});
return {format: "rgb", value: LP(t), rgb: t, alpha: t[3]}
}, MP = function (e) {
var t, n = Number("0x".concat(e.substring(1)));
if (!Number.isInteger(n) || Number.isNaN(n)) return {error: "Not an hex value"};
var r = [];
if (7 === e.length || 9 === e.length) {
var i = 9 === e.length ? 8 : 0;
r[0] = n >> 16 + i & 255, r[1] = n >> 8 + i & 255, r[2] = n >> i & 255, 9 === e.length && (t = 255 & n, r[3] = t, n = LP(r))
} else {
if (4 !== e.length && 5 !== e.length) return {error: "Wrong format"};
var a = 5 === e.length ? 4 : 0;
r[0] = n >> 8 + a & 15, r[1] = n >> 4 + a & 15, r[2] = n >> a & 15, r[0] |= r[0] << 4, r[1] |= r[1] << 4, r[2] |= r[2] << 4, 5 === e.length && (t = 15 & n, t |= t << 4, r[3] = t), n = LP(r)
}
return {format: "hex", value: n, rgb: r, alpha: t}
}, NP = function (e) {
var t = e;
return "string" == typeof t && (t.indexOf("deg") > -1 ? t = t.substr(0, t.length - 3) : t.indexOf("rad") > -1 ? t = Math.round(t.substr(0, t.length - 3) * (180 / Math.PI)) : t.indexOf("turn") > -1 && (t = Math.round(360 * t.substr(0, t.length - 4))), t = parseFloat(t, 10)), Number.isNaN(t) && (t = 0), t >= 360 && (t %= 360), t < 0 && (t = 0), t
}, RP = function (e) {
var t = e;
return "string" == typeof t && (t = parseFloat(t.indexOf("%") > -1 ? t.substring(0, t.length - 1) : t, 10)), Number.isNaN(t) ? t = 0 : t > 100 ? t = 100 : t < 0 && (t = 0), t
}, WP = function (e) {
if (!e || e.length < 3 || e.length > 4) return {error: "Not a valid size"};
var t, n = e, r = NP(n[0]), i = RP(n[1]), a = RP(n[2]);
n[0] = r, n[1] = i, n[2] = a, a /= 100;
var o = (i /= 100) * (1 - Math.abs(2 * a - 1)), s = o * (1 - Math.abs(r / 60 % 2 - 1)), l = a - o / 2;
0 === i ? (t = [a, a, a], l = 0) : t = r >= 0 && r < 60 ? [o, s, 0] : r >= 60 && r < 120 ? [s, o, 0] : r >= 120 && r < 180 ? [0, o, s] : r >= 180 && r < 240 ? [0, s, o] : r >= 240 && r < 300 ? [s, 0, o] : [o, 0, s], t[0] = Math.round(255 * (t[0] + l)), t[1] = Math.round(255 * (t[1] + l)), t[2] = Math.round(255 * (t[2] + l));
var c = n[3];
return void 0 !== c && ("string" == typeof c && (c = c.indexOf("%") > -1 ? parseFloat(c.substring(0, c.length - 1), 10) / 100 : parseFloat(c, 10)), c = Math.floor(255 * c), t[3] = c), {
format: "hsl",
value: LP(t),
rgb: t,
hsl: n,
alpha: c
}
}, VP = function (e) {
if (!e || e.length < 3 || e.length > 4) return {error: "Not a valid size"};
var t, n = NP(e[0]), r = RP(e[1]), i = RP(e[2]);
if (i *= 2.55, 0 === r) t = [i = Math.round(i), i, i]; else {
n /= 360, r /= 100;
var a = Math.floor(6 * n), o = 6 * n - a, s = Math.round(i * (1 - r)), l = Math.round(i * (1 - r * o)),
c = Math.round(i * (1 - r * (1 - o)));
i = Math.round(i), t = 0 == (a %= 6) ? [i, c, s] : 1 === a ? [l, i, s] : 2 === a ? [s, i, c] : 3 === a ? [s, l, i] : 4 === a ? [c, s, i] : [i, s, l]
}
var u = e[3];
return void 0 !== u && ("string" == typeof u && (u = u.indexOf("%") > -1 ? parseFloat(u.substring(0, u.length - 1), 10) / 100 : parseFloat(u, 10)), u = Math.floor(255 * u), t[3] = u), {
format: "hsl",
value: LP(t),
rgb: t,
hsv: e,
alpha: u
}
}, FP = function (e) {
var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.min(t, n, r), a = Math.max(t, n, r);
return {cmax: a, cmin: i, delta: a - i, r: t, g: n, b: r}
}, GP = function (e) {
var t = e.substring(e.indexOf("(") + 1, e.indexOf(")"));
return t.indexOf(",") > -1 ? t.split(",") : t.indexOf(" ") > -1 ? t.split(" ").filter(function (e) {
return e.length > 0 && "/" !== e
}) : void 0
}, BP = ["plain", "hex", "rgb", "hsl", "hsv"], KP = [function (e) {
return {format: "plain", value: DP[e[0]]}
}, function (e) {
return MP(e[0])
}, function (e) {
return OP(e)
}, function (e) {
return WP(e)
}, function (e) {
return VP(e)
}], jP = [function (e) {
return {format: "plain", value: DP[e]}
}, function (e) {
return MP(e)
}, function (e) {
return OP(GP(e))
}, function (e) {
return WP(GP(e))
}], zP = [function (e) {
return void 0 !== DP[e]
}, function (e) {
return e.startsWith("#")
}, function (e) {
return e.startsWith("rgb(") || e.startsWith("rgba(")
}, function (e) {
return e.startsWith("hsl(") || e.startsWith("hsla(")
}], UP = function (e, t) {
var n, r, i, a, o, s, l, c, u, d, h = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
p = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], f = {raw: e}, m = t || "unknown";
if ("transparent" === e) f.name = e, m = "plain", o = 0; else if ("string" == typeof e) {
var v, g = e.trim().toLocaleLowerCase(), y = zP.findIndex(function (e) {
return e(g)
});
y > -1 && (v = jP[y](g), a = v.value, m = v.format, s = v.rgb, l = v.hsl, o = v.alpha, u = v.error, "plain" === m && (f.name = e), m && (f.css = {backgroundColor: e}))
} else if (Number.isInteger(e)) a = e, m = "number"; else if (Array.isArray(e) && m) {
var b, w = BP.findIndex(function (e) {
return e === m
});
w > -1 ? (b = KP[w](e), a = b.value, m = b.format, s = b.rgb, l = b.hsl, c = b.hsv, o = b.alpha, u = b.error) : u = "unkown format"
} else e && "r" in e && "g" in e && "b" in e ? (s = [e.r, e.g, e.b], e.a && s.push(e.a), n = OP(s), a = n.value, m = n.format, s = n.rgb, o = n.alpha, u = n.error) : e && "h" in e && "s" in e && "l" in e ? (l = [e.h, e.s, e.l], e.a && l.push(e.a), r = WP(l), a = r.value, m = r.format, s = r.rgb, l = r.hsl, o = r.alpha, u = r.error) : e && "h" in e && "s" in e && "v" in e && (c = [e.h, e.s, e.v], e.a && c.push(e.a), i = VP(c), a = i.value, m = i.format, s = i.rgb, c = i.hsv, o = i.alpha, u = i.error);
void 0 === a && (a = 0, o = 0 === o ? o : void 0, f.css = {
backgroundImage: "\n linear-gradient(45deg, #ccc 25%, transparent 25%), \n linear-gradient(135deg, #ccc 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #ccc 75%),\n linear-gradient(135deg, transparent 75%, #ccc 75%)",
backgroundSize: "8px 8px",
backgroundPosition: "0 0, 4px 0, 4px -4px, 0px 4px",
backgroundColor: "white"
}, "transparent" !== e && (m = "unknown", f.name = "none")), u && (f.error = u), f.value = a, f.alpha = Number.isNaN(o) || void 0 === o ? 1 : o / 255, f.format = m, h || 1 === f.alpha ? 1 === f.alpha && -16777216 === f.value && (d = 255) : d = Math.floor(255 * f.alpha);
var S = IP(a, d);
return f.hex = S, s = s || function (e) {
return [(16711680 & e) >> 16, (65280 & e) >> 8, 255 & e]
}(a), f.rgb = s, f.hsv = c || function (e) {
var t = FP(e), n = t.cmax, r = t.delta, i = t.r, a = t.g, o = t.b;
if (0 === r) return [0, 0, Math.round(100 * n)];
var s, l = n, c = r / n, u = (n - i) / r, d = (n - a) / r, h = (n - o) / r;
return (s = (s = i === n ? h - d : a === n ? 2 + u - h : 4 + d - u) / 6 % 1) < 0 && (s += 1), [s = Math.round(360 * s), c = Math.round(100 * c), l = Math.round(100 * l)]
}(s), f.hsl = l || function (e) {
var t = FP(e), n = t.cmin, r = t.cmax, i = t.delta, a = t.r, o = t.g, s = t.b, l = 0, c = 0, u = (n + r) / 2;
0 !== i && (c = i / (1 - Math.abs(2 * u - 1)), c = Math.round(+(100 * c).toFixed(1)), l = r === a ? (o - s) / i % 6 : r === o ? (s - a) / i + 2 : (a - o) / i + 4, (l = Math.round(60 * l)) < 0 && (l += 360));
var d = [l, c, u = Math.round(u + 100 * u)];
return 4 === e.length && (d[3] = e[3] / 255), d
}(s), f.css || (f.css = {backgroundColor: "#".concat(S)}), f.name || (f.name = p && Object.keys(DP).find(function (e) {
return DP[e] === a
}) || "color-".concat(S)), f
}, qP = function (e, t, n) {
var r;
return "hex" === t && (r = "#".concat(IP(e.value, n || 1 === e.alpha ? void 0 : Math.floor(255 * e.alpha)))), r
}, HP = function (e, t, n, r) {
var i = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], a = e, o = !1;
return e && e.format && e.name ? a.error && n && (a.error = n(a.error)) : (a = e, n && "string" == typeof a && (TP && r === EP || (EP = r, TP = {}, Object.keys(DP).forEach(function (e) {
TP[n(e)] = e
})), o = (a = TP[a] || a) !== e), (a = UP(a, null, t, !i)).name && n && (a.translated = n(a.name), o && a.translated && (a.name = a.translated), a.error && (a.error = n(a.error)))), a
}, YP = eu.exports.oneOfType([eu.exports.shape({
css: eu.exports.shape({}),
value: eu.exports.number,
hex: eu.exports.string,
raw: eu.exports.oneOfType([eu.exports.string, eu.exports.array, eu.exports.number, eu.exports.shape]),
name: eu.exports.string,
alpha: eu.exports.number,
rgb: eu.exports.arrayOf(eu.exports.number),
hsv: eu.exports.arrayOf(eu.exports.number),
hsl: eu.exports.arrayOf(eu.exports.number)
}), eu.exports.string, eu.exports.number]), XP = eu.exports.objectOf(eu.exports.string),
JP = eu.exports.arrayOf(eu.exports.string), QP = {
use: function () {
return {
i18n: {language: "us"}, t: function (e) {
return e
}
}
}
}, $P = function (e) {
return e && (QP.use = e), QP.use()
}, ZP = $v({
root: {
backgroundImage: function (e) {
return e.colorError || e.alpha < 1 ? "\n linear-gradient(45deg, #ccc 25%, transparent 25%), \n linear-gradient(135deg, #ccc 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #ccc 75%),\n linear-gradient(135deg, transparent 75%, #ccc 75%)" : "none"
},
backgroundSize: "8px 8px",
backgroundPosition: "0 0, 4px 0, 4px -4px, 0px 4px",
backgroundColor: function (e) {
return e.backgroundColor || "#fff"
},
boxShadow: "0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08)",
borderColor: function (e) {
return e.borderColor || "#767676"
},
borderStyle: "solid",
borderWidth: function (e) {
return e.borderWidth || 0
},
borderRadius: 4,
padding: 0,
width: function (e) {
return e.width
},
minWidth: function (e) {
return e.minWidth
},
height: function (e) {
return e.height
},
"& div": {
content: '" "', background: function (e) {
return e.colorError ? "repeating-linear-gradient(\n 135deg,\n transparent,\n transparent ".concat(e.width / 2 + 2, "px,\n #f44336 ").concat(e.width / 2 + 2, "px,\n #f44336 ").concat(e.width / 2 + 4, "px\n )") : "none"
}, backgroundColor: function (e) {
return e.colorError ? "transparent" : e.backgroundColor || "#fff"
}, width: function (e) {
return e.width
}, minWidth: function (e) {
return e.minWidth
}, height: function (e) {
return e.height
}, border: function (e) {
return e.colorError ? "2px solid #f44336" : "".concat(e.borderWidth || 0, "px solid ").concat(e.borderColor || "#767676")
}, borderRadius: 4, padding: 0
},
"&:hover div": {
backgroundColor: function (e) {
return e.hoverColor
}
},
"&:active": {boxShadow: "none"},
"&:focus": {boxShadow: "0 0 0 0.2rem rgba(0, 123, 255, 0.5)"}
}, tooltip: {width: "min-content"}
}), eC = function (e) {
var t = e.color, n = e.size, r = e.borderWidth, i = e.borderColor, a = e.forwardRef, o = e.tooltip,
s = e.disableAlpha, l = e.className,
c = AP(e, ["color", "size", "borderWidth", "borderColor", "forwardRef", "tooltip", "disableAlpha", "className"]),
u = $P(), d = u.t, h = u.i18n, p = HP(t, s, d, h.language), f = d(o), m = p.css, v = p.hsl[2] - 10;
v < 30 && (v = p.hsl[2] + 50);
var g = p.alpha, y = "hsl(".concat(p.hsl[0], ", ").concat(p.hsl[1], "%, ").concat(v, "%, ").concat(g, ")"),
b = ZP(CP({
width: n,
minWidth: n,
height: n,
hoverColor: y,
borderColor: i,
borderWidth: r,
alpha: g,
colorError: !!p.error
}, m)), w = q.createElement(Ig, xP({
"data-testid": "colorbutton",
className: "".concat(b.root, " ").concat(null != l ? l : ""),
ref: a,
variant: "contained",
"aria-label": p.name
}, c), q.createElement("div", null));
return o ? q.createElement(aS, {title: f}, q.createElement("div", {className: b.tooltip}, w)) : w
};
eC.propTypes = {
color: YP.isRequired,
size: iu.number,
disableAlpha: iu.bool,
borderWidth: iu.number,
borderColor: iu.string,
tooltip: iu.string,
forwardRef: iu.shape({current: iu.elementType})
}, eC.defaultProps = {
size: 24,
borderWidth: 0,
borderColor: void 0,
forwardRef: void 0,
tooltip: void 0,
disableAlpha: !1
};
var tC = "undefined" != typeof window ? u.exports.useLayoutEffect : u.exports.useEffect;
function nC(e) {
var t = u.exports.useRef(e);
return tC(function () {
t.current = e
}), u.exports.useCallback(function () {
return t.current.apply(void 0, arguments)
}, [])
}
var rC = $v({
root: {
position: "absolute", width: "inherit", height: "inherit", background: function (e) {
return "".concat(e.cssRgb, " none repeat scroll 0% 0%")
}, margin: 0
},
gradientPosition: {position: "absolute", width: "100%", height: "100%"},
hsvGradientS: {background: "rgba(0, 0, 0, 0) linear-gradient(to right, rgb(255, 255, 255), rgba(255, 255, 255, 0)) repeat scroll 0% 0%"},
hsvGradientV: {background: "rgba(0, 0, 0, 0) linear-gradient(to top, rgb(0, 0, 0), rgba(0, 0, 0, 0)) repeat scroll 0% 0%"},
hslGradientS: {background: "rgba(0, 0, 0, 0) linear-gradient(to bottom, rgb(128, 128, 128), rgba(255, 255, 255, 0)) repeat scroll 0% 0%"},
hslGradientL: {background: "rgba(0, 0, 0, 0) linear-gradient(to left, rgb(0, 0, 0), rgba(128, 128, 128, 0), rgb(255, 255, 255)) repeat scroll 0% 0%"},
hsvGradientCursor: {
position: "absolute",
top: 0,
left: 0,
borderColor: "#f0f0f0",
borderWidth: 1,
borderStyle: "solid",
boxShadow: "rgba(0, 0, 0, 0.37) 0px 1px 4px 0px",
transition: "box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
borderRadius: 4,
cursor: function (e) {
return !e.pressed && "pointer"
},
zIndex: 100,
transform: "translate(-4px, -4px)",
"&:hover": {boxShadow: "0px 0px 0px 8px rgba(63, 81, 181, 0.16)"},
"&:focus": {outline: "none !important", boxShadow: "0px 0px 0px 8px rgba(63, 81, 181, 0.16)"},
"&:focus > div": {}
},
hsvGradientCursorC: {
width: 8,
height: 8,
borderRadius: 4,
boxShadow: "white 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08)"
}
}), iC = function (e) {
var t = e.className, n = e.color, r = e.onChange, i = e.isHsl,
a = AP(e, ["className", "color", "onChange", "isHsl"]), o = q.useRef(n), l = s(q.useState(!1), 2), c = l[0],
u = l[1], d = q.useRef(!1);
q.useEffect(function () {
o.current = n
});
var h, p, f, m, v, g, y = q.useRef(), b = q.useRef(), w = {x: 0, y: 0},
S = (p = 255, m = 6 * (h = n.hsv[0] / 360) - (f = Math.floor(6 * h)), v = Math.round(p * (1 - m)), g = Math.round(p * m), p = Math.round(p), 0 == (f %= 6) ? [p, g, 0] : 1 === f ? [v, p, 0] : 2 === f ? [0, p, g] : 3 === f ? [0, v, p] : 4 === f ? [g, 0, p] : [p, 0, v]),
_ = "rgb(".concat(S[0], ",").concat(S[1], ",").concat(S[2], ")"), k = rC(CP(CP({}, a), {}, {cssRgb: _})),
x = function (e, t) {
w = e, b.current.style.top = "".concat(e.y, "px"), b.current.style.left = "".concat(e.x, "px"), t && b.current.focus()
}, P = function (e) {
if (e) {
var t = n.hsv, r = n.hsl;
w = {
x: Math.round((i ? 100 - r[2] : t[1]) / 100 * (e.clientWidth - 1)),
y: Math.round((i ? r[1] : 100 - t[2]) / 100 * (e.clientHeight - 1))
}, x(w)
}
};
P(y.current), y.current && (y.current.style.background = "".concat(_, " none repeat scroll 0% 0%"));
var C = function (e, t) {
var n = e.x, a = e.y, s = t.getBoundingClientRect(), l = {x: n - s.left, y: a - s.top};
l.x < 0 && (l.x = 0), l.y < 0 && (l.y = 0), l.x >= t.clientWidth && (l.x = t.clientWidth - 1), l.y >= t.clientHeight && (l.y = t.clientHeight - 1), x(l, !0);
var c = o.current;
if (i) {
var u = l.y / (t.clientHeight - 1) * 100, d = 100 * (1 - l.x / (t.clientWidth - 1));
r([c.hsl[0], u, d])
} else {
var h = l.x / (t.clientWidth - 1) * 100, p = 100 * (1 - l.y / (t.clientHeight - 1));
r([c.hsv[0], h, p])
}
};
q.useEffect(function () {
var e = y.current;
P(e);
var t = function (e) {
u(!0), d.current = !0, e.preventDefault()
}, n = function (t) {
var n = {x: t.pageX - window.scrollX, y: t.pageY - window.scrollY};
C(n, e), d.current = !1, t.preventDefault()
}, r = function (t) {
if (d.current && t.buttons) {
var n = {x: t.pageX - window.scrollX, y: t.pageY - window.scrollY};
C(n, e), t.preventDefault()
}
}, i = function (t) {
var n = {x: t.touches[0].pageX - window.scrollX, y: t.touches[0].pageY - window.scrollY};
C(n, e), t.preventDefault()
};
return e.addEventListener("mousedown", t), e.addEventListener("mouseup", n), e.addEventListener("mousemove", r), e.addEventListener("touchdown", t), e.addEventListener("touchup", n), e.addEventListener("touchmove", i), function () {
e.removeEventListener("mousedown", t), e.removeEventListener("mouseup", n), e.removeEventListener("mousemove", r), e.removeEventListener("touchdown", t), e.removeEventListener("touchup", n), e.removeEventListener("touchmove", i)
}
}, []);
var A = nC(function (e) {
if (c) {
var t = w, n = t.x, r = t.y;
switch (e.key) {
case"ArrowRight":
n += 1;
break;
case"ArrowLeft":
n -= 1;
break;
case"ArrowDown":
r += 1;
break;
case"ArrowUp":
r -= 1;
break;
case"Tab":
return void u(!1);
default:
return
}
e.preventDefault();
var i = y.current.getBoundingClientRect();
C({x: n + i.left, y: r + i.top}, y.current)
}
}), T = nC(function (e) {
u(!0), e.preventDefault()
}), E = nC(function (e) {
u(!1), e.preventDefault()
});
return q.createElement("div", {className: t}, q.createElement("div", xP({className: k.root}, a, {
ref: y,
"data-testid": "hsvgradient-color"
}), q.createElement("div", {className: "muicc-hsvgradient-s ".concat(i ? k.hslGradientS : k.hsvGradientS, " ").concat(k.gradientPosition)}, q.createElement("div", {className: "muicc-hsvgradient-v ".concat(i ? k.hslGradientL : k.hsvGradientV, " ").concat(k.gradientPosition)}, q.createElement("div", {
ref: b,
tabIndex: "0",
role: "slider",
"aria-valuemax": 100,
"aria-valuemin": 0,
"aria-valuenow": n.hsv[1],
pressed: "".concat(d.current),
"data-testid": "hsvgradient-cursor",
className: "muicc-hsvgradient-cursor ".concat(k.hsvGradientCursor),
onKeyDown: A,
onFocus: T,
onBlur: E
}, q.createElement("div", {className: "muicc-hsvgradient-cursor-c ".concat(k.hsvGradientCursorC)}))))))
};
iC.propTypes = {
color: YP.isRequired,
className: iu.string.isRequired,
onChange: iu.func.isRequired,
isHsl: iu.bool
}, iC.defaultProps = {isHsl: !1};
var aC = function (e) {
var t = e.Element, n = e.defaultValue, r = AP(e, ["Element", "defaultValue"]), i = s(q.useState(n), 2), a = i[0],
o = i[1];
return q.createElement(t, CP(CP({}, r), {}, {value: a, onChange: o}))
}, oC = function (e) {
var t = function (t) {
var n = t.defaultValue, r = t.value, i = t.onChange, a = AP(t, ["defaultValue", "value", "onChange"]);
return i || "none" !== r ? q.createElement(e, CP({
value: r || n, onChange: i || function () {
}
}, a)) : q.createElement(aC, CP({Element: e, defaultValue: n}, a))
};
return t.propTypes = CP(CP({}, e.propTypes), {}, {
defaultValue: e.propTypes.value,
onChange: iu.func
}), t.defaultProps = CP(CP({}, e.defaultProps), {}, {defaultValue: void 0, onChange: void 0}), t
}, sC = $v({
root: {display: "flex", flexDirection: "row"},
colorinputRaw: {paddingRight: 4},
formControl: {width: 100}
}), lC = function (e) {
var t, n, r = e.value, i = e.format, a = e.onChange, o = e.disableAlpha, s = e.enableErrorDisplay,
l = e.forwardRef, c = e.disablePlainColor,
u = AP(e, ["value", "format", "onChange", "disableAlpha", "enableErrorDisplay", "forwardRef", "disablePlainColor"]),
d = sC(), h = $P(), p = h.t, f = h.i18n, m = HP(r, o, p, f.language, c), v = function (e) {
if ("plain" === i) a(e.target.value); else if ("hex" === i) a("#".concat(e.target.value)); else {
var t = e.target.id, r = Number(e.target.value), o = {};
Object.keys(n).forEach(function (e) {
var i = n[e].value;
e === t && ((i = r) < n[e].min && (i = n[e].min), i > n[e].max && (i = n[e].max)), o[e] = i
}), a(o)
}
}, g = function (e, t, n, r, i) {
return q.createElement(q.Fragment, null, q.createElement(xy, {
htmlFor: e,
className: "muicc-colorinput-label",
"data-testid": "colorinput-label"
}, t), q.createElement(wy, xP({
id: e,
name: e,
className: "muicc-colorinput-input",
label: t,
value: n,
placeholder: t,
inputProps: {"aria-label": "color-".concat(t), "data-testid": "colorinput-input"},
onChange: v,
startAdornment: i && r && q.createElement(_y, {position: "start"}, r)
}, u)))
};
if ("plain" === i) t = g("color-plain", "Color", m.raw); else {
n = function (e, t, n) {
var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function (e) {
return e
}, i = HP(e, n, r), a = {};
if ("rgb" === t) a.r = {
value: i.rgb[0],
format: "integer",
min: 0,
max: 255,
name: r("R")
}, a.g = {value: i.rgb[1], format: "integer", min: 0, max: 255, name: r("G")}, a.b = {
value: i.rgb[2],
format: "integer",
min: 0,
max: 255,
name: r("B")
}; else if ("hsv" === t) a.h = {
value: i.hsv[0],
format: "integer",
min: 0,
max: 360,
name: r("H"),
unit: "°"
}, a.s = {
value: i.hsv[1],
format: "integer",
min: 0,
max: 100,
name: r("S"),
unit: "%"
}, a.v = {
value: i.hsv[2],
format: "integer",
min: 0,
max: 100,
name: r("V"),
unit: "%"
}; else if ("hsl" === t) a.h = {
value: i.hsl[0],
format: "integer",
min: 0,
max: 360,
name: r("H"),
unit: "°"
}, a.s = {
value: i.hsl[1],
format: "integer",
min: 0,
max: 100,
name: r("S"),
unit: "%"
}, a.l = {
value: i.hsl[2],
format: "integer",
min: 0,
max: 100,
name: r("L"),
unit: "%"
}; else if ("hex" === t) {
var o = i.hex;
i.raw && "string" == typeof i.raw && i.raw.startsWith("#") && (o = i.raw.substring(1)), a.hex = {
value: o,
format: "hex",
name: r("HEX"),
unit: "#"
}
} else a.value = r(i.value), a.format = "unknown";
return a
}(m, i, o, p);
var y = Object.keys(n);
t = q.createElement("div", {ref: l, className: d.root}, y.map(function (e) {
return q.createElement(ty, {
key: e,
className: "muicc-colorinput-raw ".concat(d.colorinputRaw),
error: !!m.error
}, g(e, n[e].name, n[e].value, n[e].unit, 1 === y.length))
}))
}
return q.createElement(ty, {
className: d.formControl,
error: !!m.error,
"data-testid": "colorinput"
}, t, s && m.error && q.createElement(sy, {id: "component-error-text"}, m.error))
};
lC.propTypes = {
value: YP,
format: iu.string,
onChange: iu.func.isRequired,
disableAlpha: iu.bool,
enableErrorDisplay: iu.bool,
forwardRef: iu.shape({current: iu.elementType}),
disablePlainColor: iu.bool
}, lC.defaultProps = {
value: "none",
format: "plain",
forwardRef: void 0,
disableAlpha: !1,
enableErrorDisplay: !0,
disablePlainColor: !1
};
var cC = oC(lC), uC = $v({
root: {display: "flex", flexDirection: "row", flexWrap: "wrap", padding: "8px 0 0 8px"},
paletteButton: {margin: "0 8px 8px 0", padding: 0}
}), dC = function (e) {
var t = e.size, n = e.borderWidth, r = e.palette, i = e.onSelect, a = e.disableAlpha, o = uC(), s = $P().t;
return q.createElement("div", {className: o.root}, Object.keys(r).map(function (e) {
return q.createElement(eC, {
size: t,
key: "".concat(e),
color: r[e],
className: "muicc-palette-button ".concat(o.paletteButton),
borderWidth: n,
tooltip: e,
disableAlpha: a,
onClick: function () {
return n = s(t = e), void (i && i(n, r[t]));
var t, n
}
})
}))
};
dC.propTypes = {
borderWidth: iu.number,
size: iu.number,
palette: XP.isRequired,
forwardRef: iu.shape({current: iu.elementType}),
onSelect: iu.func,
disableAlpha: iu.bool
}, dC.defaultProps = {borderWidth: 0, size: 24, forwardRef: void 0, onSelect: void 0, disableAlpha: !1};
var hC = $v(function () {
return {
root: {width: "100%", height: 16, padding: 0},
rail: {
height: 16,
opacity: 1,
background: "rgba(0, 0, 0, 0) linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100% ) repeat scroll 0% 0%",
borderRadius: 0
},
track: {height: 16, opacity: 0, borderRadius: 4, backgroundColor: "transparent"},
thumb: {
width: 16,
height: 16,
marginTop: 0,
marginLeft: -8,
backgroundColor: "#f0f0f0",
boxShadow: "rgba(0, 0, 0, 0.37) 0px 1px 4px 0px",
"&:focus": {boxShadow: "0px 0px 0px 8px rgba(63, 81, 181, 0.16)"}
}
}
});
function pC(e) {
var t = hC();
return q.createElement(Mw, xP({}, e, {classes: {root: t.root, rail: t.rail, track: t.track, thumb: t.thumb}}))
}
var fC = $v({
root: {
color: "#666",
width: "100%",
height: 16,
padding: 0,
background: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%)",
backgroundSize: "8px 8px",
backgroundColor: "white",
backgroundPosition: "0 0, 4px 0, 4px -4px, 0px 4px"
},
rail: {
height: 16, opacity: 1, background: function (e) {
return "rgba(0, 0, 0, 0) linear-gradient(to right, ".concat(e.color, "00 0%, ").concat(e.color, " 100%) repeat scroll 0% 0%")
}, borderRadius: 0
},
track: {height: 16, opacity: 0, borderRadius: 4},
thumb: {
width: 16,
height: 16,
marginTop: 0,
marginLeft: -8,
backgroundColor: "#f0f0f0",
boxShadow: "rgba(0, 0, 0, 0.37) 0px 1px 4px 0px",
"&:focus": {boxShadow: "0px 0px 0px 8px rgba(63, 81, 181, 0.16)"}
}
});
function mC(e) {
var t = e.color, n = AP(e, ["color"]), r = fC({color: t});
return q.createElement(Mw, xP({}, n, {classes: {root: r.root, rail: r.rail, track: r.track, thumb: r.thumb}}))
}
mC.propTypes = {color: YP.isRequired};
var vC = $v(function (e) {
return {
root: {
backgroundColor: e.palette.background.paper,
position: "relative",
width: "min-content",
height: "min-content",
padding: "0px"
},
container: {
justifyContent: "space-around", overflow: "hidden", width: function (e) {
return e.boxWidth
}, padding: 0
},
colorboxHsvGradient: {
width: function (e) {
return "calc(".concat(e.boxWidth, "px - 16px)")
}, height: "calc(128px - 16px)", margin: 8
},
colorboxSliders: {
width: function (e) {
return e.boxWidth
}, padding: "8px 8px 4px 8px"
},
colorboxInputs: {
display: "flex",
flexDirection: "row",
flexWrap: "wrap",
padding: "8px 4px 8px 8px",
justifyContent: "space-between"
},
colorboxInput: {},
colorboxColorBg: {
width: 48,
height: 48,
background: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%)",
backgroundSize: "8px 8px",
backgroundPosition: "0 0, 4px 0, 4px -4px, 0px 4px",
backgroundColor: "white",
borderRadius: 4
},
colorboxColor: {
width: 48, height: 48, background: function (e) {
return e.colorError ? "repeating-linear-gradient(\n 135deg,\n transparent,\n transparent 29px,\n #f44336 29px,\n #f44336 32px\n )" : "none"
}, backgroundColor: function (e) {
return e.colorError ? "transparent" : e.backgroundColor
}, borderRadius: 4, border: function (e) {
return e.colorError ? "2px solid #f44336" : "none"
}
},
colorboxControls: {
display: "flex",
flexDirection: "row",
flexWrap: "wrap",
padding: 8,
"&> button": {marginLeft: "auto"}
},
colorboxError: {color: "#f44336", lineHeight: "36.5px"}
}
}), gC = function (e) {
var t, n, r = e.value, i = e.palette, a = e.inputFormats, o = e.deferred, l = e.onChange, c = e.disableAlpha,
u = e.hslGradient,
d = AP(e, ["value", "palette", "inputFormats", "deferred", "onChange", "disableAlpha", "hslGradient"]),
h = $P(), p = h.t, f = h.i18n, m = HP(r, c, p, f.language), v = l;
o && (t = s(q.useState(m), 2), m = t[0], v = t[1], n = l);
var g = m, y = g.hsv, b = g.hsl, w = m.alpha;
w = void 0 === w ? 100 : Math.floor(100 * w);
var S = qP(m, "hex", !0), _ = m.css.backgroundColor,
k = vC({boxWidth: 320, backgroundColor: _, colorError: !!m.error}), x = function (e) {
var t = UP(e);
v(t)
};
return q.createElement(Eg, xP({
p: 2,
className: k.root
}, d), q.createElement(Eg, {className: k.container}, q.createElement(iC, {
className: "muicc-colorbox-hsvgradient ".concat(k.colorboxHsvGradient),
color: m,
onChange: function (e) {
var t = UP(e, u ? "hsl" : "hsv");
v(t)
},
isHsl: u
}), q.createElement("div", {className: "muicc-colorbox-sliders ".concat(k.colorboxSliders)}, q.createElement(pC, {
"data-testid": "hueslider",
"aria-label": "color slider",
value: u ? b[0] : y[0],
min: 0,
max: 360,
onChange: function (e, t) {
var n = UP([t, m.hsv[1], m.hsv[2]], "hsv");
v(n)
}
}), !c && q.createElement(mC, {
"data-testid": "alphaslider",
color: S,
valueLabelDisplay: "auto",
"aria-label": "alpha slider",
value: w,
min: 0,
max: 100,
onChange: function (e, t) {
var n = t / 100, r = UP([m.rgb[0], m.rgb[1], m.rgb[2], n], "rgb");
v(r)
}
})), a.length > 0 && q.createElement("div", {className: "muicc-colorbox-inputs ".concat(k.colorboxInputs)}, q.createElement("div", {className: "muicc-colorbox-colorBg ".concat(k.colorboxColorBg)}, q.createElement("div", {className: "muicc-colorbox-color ".concat(k.colorboxColor)})), a.map(function (e) {
return q.createElement(cC, {
key: e,
value: m,
format: e,
disableAlpha: !0,
enableErrorDisplay: !1,
className: "muicc-colorbox-input ".concat(k.colorboxInput),
onChange: x
})
})), i && q.createElement(q.Fragment, null, q.createElement(Bg, null), q.createElement(dC, {
size: 26.65,
palette: i,
onSelect: function (e, t) {
var n = UP(t);
n.name = e, v(n)
},
disableAlpha: c
})), q.createElement("div", {className: "muicc-colorbox-controls ".concat(k.colorboxControls)}, m.error && q.createElement("span", {
className: "muicc-colorbox-error ".concat(k.colorboxError),
"data-testid": "colorbox-error"
}, p(m.error)), o && q.createElement(Ig, {
onClick: function () {
n(m)
}
}, p("Set")))))
};
gC.propTypes = {
value: YP,
deferred: iu.bool,
palette: XP,
inputFormats: JP,
onChange: iu.func.isRequired,
disableAlpha: iu.bool,
hslGradient: iu.bool
}, gC.defaultProps = {
value: void 0,
deferred: !1,
palette: void 0,
inputFormats: ["hex", "rgb"],
disableAlpha: !1,
hslGradient: !1
};
var yC = oC(gC),
bC = $v({root: {display: "flex", flexDirection: "row", width: "max-content"}, colorpickerButton: {margin: 6}}),
wC = Bu({seed: "ColorPicker"}), SC = function (e) {
var t, n, r = e.value, i = e.disableTextfield, a = e.deferred, o = e.palette, l = e.inputFormats,
c = e.openAtStart, d = e.onChange, h = e.onOpen, p = e.doPopup, f = e.disableAlpha, m = e.hslGradient,
v = e.hideTextfield, g = e.disablePlainColor, y = bC(), b = u.exports.useRef(null),
w = s(u.exports.useState(!1), 2), S = w[0], _ = w[1], k = $P(), x = k.t, P = k.i18n,
C = HP(r, f, x, P.language, g),
A = (t = C, (n = g ? "color-".concat(t.hex) : t.name).startsWith("color-") ? n = "string" == typeof t.raw && t.raw.startsWith("#") ? t.raw : qP(t, "hex") : "none" === n && (n = t.raw), n);
u.exports.useEffect(function () {
c && _(!0)
}, [c]);
var T = function () {
var e = Boolean(b.current);
_(e), h && h(e)
}, E = function () {
_(!1), h && h(!1)
}, D = q.createElement(yC, {
value: C,
style: {position: "relative"},
deferred: a,
palette: o,
inputFormats: l,
disableAlpha: f,
hslGradient: m,
onChange: function (e) {
d(e), a && E()
}
});
D = p ? p(D) : q.createElement(Ry, {
id: "color-popover",
open: S,
anchorEl: b.current,
onClose: E,
anchorOrigin: {vertical: "bottom", horizontal: "center"},
transformOrigin: {vertical: "top", horizontal: "center"}
}, D);
var I = null;
return v || (I = i ? q.createElement("div", {
role: "button",
"data-testid": "colorpicker-noinput",
onClick: T
}, C.raw) : q.createElement(eS, {
color: "primary", value: A, onChange: function (e) {
d(e.target.value)
}, "data-testid": "colorpicker-input"
})), q.createElement(Wp, {generateClassName: wC}, q.createElement("div", {
ref: b,
className: y.root
}, q.createElement(eC, {
"data-testid": "colorpicker-button",
className: "muicc-colorpicker-button ".concat(y.colorpickerButton),
color: C,
onClick: T
}), I, D))
};
SC.propTypes = {
value: YP,
disableTextfield: iu.bool,
deferred: iu.bool,
palette: XP,
inputFormats: JP,
onChange: iu.func.isRequired,
onOpen: iu.func,
openAtStart: iu.bool,
doPopup: iu.func,
disableAlpha: iu.bool,
hslGradient: iu.bool,
hideTextfield: iu.bool,
disablePlainColor: iu.bool
}, SC.defaultProps = {
value: "none",
disableTextfield: !1,
deferred: !1,
palette: void 0,
inputFormats: ["hex", "rgb"],
onOpen: void 0,
openAtStart: !1,
doPopup: void 0,
disableAlpha: !1,
hslGradient: !1,
hideTextfield: !1,
disablePlainColor: !1
};
var _C, kC, xC, PC, CC, AC, TC = oC(SC), EC = $v(function () {
return Qv({
title: {color: "black"},
padding5: {padding: "5px"},
longLabel: {width: "100%"},
shortLabel: {width: "150px"},
mt5: {marginTop: "5px"},
littleFont: {width: "100%"},
labelWidth: {width: "25ch"},
fontNameWidth: {width: "100%"},
leftSelectorWidth: {width: "100%"},
gridRoot: {flexGrow: 1},
container: {
"& .MuiTypography-h6": {fontSize: "32px !important"},
"& .ColorPicker-MuiButton-root": {fontSize: "16px !important"},
"& .MuiDialogActions-root": {padding: "24px 32px"}
},
formFont: {
"& .MuiInputBase-root": {fontSize: "16px !important"},
"& .MuiTypography-body1": {fontSize: "16px !important"},
"& .MuiFormLabel-root": {fontSize: "16px !important"},
"& .MuiFormHelperText-root": {fontSize: "10px !important"},
"& .MuiTab-root": {fontSize: "16px !important"}
},
root: {"& .MuiTextField-root": {width: "100%"}}
})
}), DC = ["方正小标宋简体", "仿宋_GB2312", "黑体", "楷体", "宋体"], IC = {printerName: "暂无", pageArea: "", printModel: "0"}, LC = {
rotate: 45,
creator: "KINGGRID",
marker: "江西金格科技有限公司",
fontName: "宋体",
fontSize: 16,
fontColor: "rgb(255,0,0)",
x: 200,
y: 200,
image: "https://www.surread.com/static/2224/_xiangmuguanli.png",
density: .5,
downloadMarker: !0
}, OC = function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e)
}
var t, n, r;
return t = e, r = [{
key: "checkFormat", value: function (e) {
return /^\d+-\d+$/.test(e)
}
}, {
key: "checkNumber", value: function (e) {
return /^\d+$/.test(e)
}
}, {
key: "isUsefulArea", value: function (e, t) {
if (this.checkFormat(e)) {
var n = e.split("-");
if (Number(n[0]) <= t && Number(n[1]) <= t) return !0
}
return !!(this.checkNumber(e) && Number(e) <= t)
}
}], (n = null) && o(t.prototype, n), r && o(t, r), Object.defineProperty(t, "prototype", {writable: !1}), e
}(), MC = OC;
MC.instance = {}, MC.start = function (e) {
return OC.instance = {}, OC.values = e, OC
}, MC.setField = function (e) {
return OC.currentValidateField = e, OC.currentValidateValue = OC.values[e], OC
}, MC.type = function (e) {
return c(OC.currentValidateValue) !== e && (OC.instance[OC.currentValidateField] = "".concat(OC.currentValidateField, " is not ").concat(e)), OC
}, MC.required = function (e) {
return null !== OC.currentValidateValue && void 0 !== OC.currentValidateValue && "" !== OC.currentValidateValue || (OC.instance[OC.currentValidateField] = e || "不能为空"), OC
}, MC.min = function (e, t) {
return "number" == typeof OC.currentValidateValue && OC.currentValidateValue < e && (OC.instance[OC.currentValidateField] = t || "最小值: " + e), OC
}, MC.max = function (e, t) {
return "number" == typeof OC.currentValidateValue && OC.currentValidateValue > e && (OC.instance[OC.currentValidateField] = t || "最大值: " + e), OC
}, MC.customPrintArea = function (e, t) {
if ("string" == typeof OC.currentValidateValue && "current" !== OC.currentValidateValue && "all" !== OC.currentValidateValue) {
var n = OC.currentValidateValue.split(",");
0 === n.length ? OC.isUsefulArea(OC.currentValidateValue, e) || (OC.instance[OC.currentValidateField] = t || "内容格式错误或超出最大页面范围" + e) : n.forEach(function (n) {
OC.isUsefulArea(n, e) || (OC.instance[OC.currentValidateField] = t || "内容格式错误或超出最大页面范围" + e)
})
}
return OC
}, MC.end = function () {
return OC.instance
};
var NC = function () {
var e = EC(), t = s(u.exports.useState(!1), 2), n = t[0], r = t[1];
_C = function () {
return r(!0)
}, kC = function () {
return r(!1)
};
var a = i(i({
maxCopies: -1,
signStatus: "1",
copies: 1,
printType: "0",
collateCopies: "true",
showMarkerPanel: !0
}, IC), LC), o = s(u.exports.useState(-1), 2), l = o[0], c = o[1], d = s(u.exports.useState("rgb(255,0,0)"), 2),
h = d[0], p = d[1], f = s(u.exports.useState(.5), 2), m = f[0], v = f[1], g = s(u.exports.useState(0), 2),
y = g[0], b = g[1], w = s(u.exports.useState(["暂无"]), 2), S = w[0], _ = w[1], k = s(u.exports.useState("1"), 2),
x = k[0], P = k[1], C = s(u.exports.useState(1), 2), A = C[0], T = C[1], E = fP({
initialValues: a, validateOnChange: !0, validate: function (e) {
return MC.start(e).setField("copies").type("number").required("请输入打印份数").min(1, "最少打印1份").max(D(l), "最多打印".concat(l, "份")).setField("printerName").type("string").required("请选择打印机").setField("pageArea").type("string").required("不能为空").setField("rotate").type("number").required("请输入水印旋转角度").min(-45, "不能小于 -45 °").max(45, "不能大于 45 °").setField("creator").type("string").required("请填写创建者").setField("x").type("number").required("请输入水印横坐标").setField("y").type("number").required("请输入水印纵坐标").setField("density").type("number").required("请输入水印密度").min(0, "密度最少为0").max(1, "密度最多为1").setField("pageArea").customPrintArea(A, "格式错误或超出最大打印页").end()
}, onSubmit: function () {
}
});
xC = function () {
var e = E.values;
return {
copies: e.copies,
maxCopies: l,
printerName: e.printerName,
pageArea: I(e.printModel, e.pageArea),
signStatus: parseInt(e.signStatus),
printType: Number(e.printType),
collateCopies: "true" === e.collateCopies,
rotate: e.rotate,
creator: e.creator,
marker: e.marker,
fontName: e.fontName,
fontSize: e.fontSize,
fontColor: e.fontColor,
x: e.x,
y: e.y,
image: e.image,
density: e.density,
showMarkerPanel: e.showMarkerPanel,
downloadMarker: e.downloadMarker
}
}, PC = function (e, t, n) {
var r = ["暂无"].concat(e.printerList);
switch (T(e.pagesCount ? e.pagesCount : 1), _(r), c(e.maxCopies >= 0 ? e.maxCopies : -1), E.setValues(i(i({maxCopies: e.maxCopies >= 0 ? e.maxCopies : -1}, IC), {}, {
rotate: null !== e.rotate ? e.rotate : 45,
creator: null !== e.creator ? e.creator : "KINGGRID",
marker: null !== e.marker ? e.marker : "江西金格科技有限公司",
fontName: -1 === DC.indexOf(e.fontName) ? "宋体" : e.fontName,
fontSize: null !== e.fontSize ? e.fontSize : 16,
fontColor: null !== e.fontColor ? e.fontColor : "rgb(255,0,0)",
x: null !== e.x ? e.x : 200,
y: null !== e.y ? e.y : 200,
image: null !== e.image ? e.image : "https://www.surread.com/static/2224/_xiangmuguanli.png",
density: null !== e.density ? e.density : .5,
showMarkerPanel: !1 !== e.showMarkerPanel,
downloadMarker: !1 !== e.downloadMarker,
printerName: r[1],
signStatus: null !== e.signStatus ? e.signStatus.toString() : "1",
copies: e.copies,
printType: e.printType ? e.printType : "0",
collateCopies: null !== e.collateCopies ? e.collateCopies.toString() : "false"
})), _(e.printerList), p(e.fontColor ? e.fontColor : "rgb(255,0,0)"), e.pageArea) {
case"current":
E.setFieldValue("pageArea", e.pageArea);
break;
case"all":
E.setFieldValue("pageArea", e.pageArea), E.setFieldValue("printModel", "1");
break;
default:
E.setFieldValue("printModel", "2"), P(e.pageArea), E.setFieldValue("pageArea", e.pageArea)
}
CC = t, AC = n, E.submitForm()
}, u.exports.useEffect(function () {
switch (E.values.printModel) {
case"0":
E.setFieldValue("pageArea", "current");
break;
case"1":
E.setFieldValue("pageArea", "all");
break;
default:
E.setFieldValue("pageArea", x)
}
}, [E.values.printModel]), u.exports.useEffect(function () {
"current" !== E.values.pageArea && "all" !== E.values.pageArea && P(E.values.pageArea)
}, [E.values.pageArea]), u.exports.useEffect(function () {
E.values.copies ? E.values.copies <= 0 && E.setFieldValue("copies", 1) : E.setFieldValue("copies", "")
}, [E.values.copies]);
var D = function (e) {
return e <= -1 ? 1 / 0 : Math.ceil(e)
}, I = function (e, t) {
switch (e) {
case"0":
return "current";
case"1":
return "all";
default:
return t
}
};
return mS(gS, {
open: n,
handleClose: function () {
r(!1), AC && AC()
},
handleOK: function () {
if (E.submitForm(), E.isValid) {
kC();
var e = E.values;
CC({
print: {
copies: e.copies,
maxCopies: l,
printerName: e.printerName,
pageArea: I(e.printModel, e.pageArea),
signStatus: parseInt(e.signStatus),
printType: Number(e.printType),
collateCopies: "true" === e.collateCopies
},
watermark: {
showMarkerPanel: e.showMarkerPanel,
downloadMarker: e.downloadMarker,
rotate: e.rotate,
creator: e.creator,
marker: 0 === y ? e.marker : "",
fontName: e.fontName,
fontSize: e.fontSize,
fontColor: e.fontColor,
x: e.x,
y: e.y,
image: 1 === y ? e.image : "",
density: e.density,
opacity: m
}
})
}
},
titleLabel: "打印",
rightButtonLabel: "打印文件",
maxWidth: E.values.showMarkerPanel ? "md" : "sm",
children: mS("form", {
noValidate: !0, autoComplete: "off", onSubmit: E.handleSubmit, className: e.formFont, children: mS(fy, {
container: !0, className: e.padding5, children: vS(fy, {
container: !0, spacing: 3, children: [mS(fy, {
item: !0,
xs: E.values.showMarkerPanel ? 5 : 12,
sm: E.values.showMarkerPanel ? 5 : 12,
children: mS("div", {
className: e.gridRoot, children: vS(fy, {
container: !0,
spacing: 3,
children: [mS(fy, {
item: !0,
xs: 12,
sm: 12,
children: mS(cy, {component: "legend", children: "打印机设置"})
}), mS(fy, {
item: !0, xs: 12, sm: 12, children: vS(fy, {
container: !0,
spacing: 3,
children: [mS(fy, {
item: !0,
xs: 12,
children: vS(ty, {
variant: "outlined",
size: "small",
className: e.leftSelectorWidth,
children: [mS(xy, {
id: "demo-simple-select-outlined-label",
children: "打印机"
}), mS(ww, {
className: Xc(e.leftSelectorWidth, e.littleFont),
labelId: "demo-simple-select-outlined-label",
id: "printerName",
name: "printerName",
value: E.values.printerName,
onChange: E.handleChange,
label: "打印机",
error: E.touched.printerName && Boolean(E.errors.printerName),
children: S.map(function (e, t) {
return mS(Yy, {value: e, children: e}, "p" + t)
})
})]
})
}), mS(fy, {
item: !0,
xs: 12,
children: vS(ty, {
className: e.shortLabel,
children: [mS(eS, {
label: "打印份数",
type: "number",
"aria-describedby": "standard-weight-helper-text",
size: "small",
variant: "outlined",
value: E.values.copies,
id: "copies",
name: "copies",
onChange: E.handleChange,
inputProps: {inputMode: "numeric", pattern: "[0-9]*"},
error: E.touched.copies && Boolean(E.errors.copies),
helperText: E.touched.copies && E.errors.copies
}), vS(sy, {
id: "standard-weight-helper-text",
children: ["可打印份数:", " ", l >= 0 ? l : "无限制"]
})]
})
})]
})
}), vS(fy, {
item: !0,
xs: 12,
sm: 12,
children: [mS(cy, {component: "legend", children: "打印范围设置"}), mS(pw, {
row: !0,
"aria-label": "position",
value: E.values.printModel,
id: "printModel",
name: "printModel",
onChange: E.handleChange,
children: vS(fy, {
container: !0,
spacing: 1,
children: [vS(fy, {
item: !0,
xs: 12,
sm: 12,
children: [mS(ry, {
value: "0",
control: mS(hw, {color: "primary"}),
label: mS("span", {className: e.littleFont, children: "当前页"})
}), mS(ry, {
value: "1",
control: mS(hw, {color: "primary"}),
label: mS("span", {className: e.littleFont, children: "所有页"})
}), mS(ry, {
value: "2",
control: mS(hw, {color: "primary"}),
label: mS("span", {className: e.littleFont, children: "指定范围"})
})]
}), "2" === E.values.printModel ? mS(fy, {
item: !0,
xs: 12,
sm: 12,
children: mS(eS, {
className: e.leftSelectorWidth,
size: "small",
value: E.values.pageArea,
id: "pageArea",
name: "pageArea",
onChange: E.handleChange,
label: "参照格式: 1, 3-5",
variant: "outlined",
error: E.touched.pageArea && Boolean(E.errors.pageArea),
helperText: E.touched.pageArea && E.errors.pageArea
})
}) : null]
})
})]
}), vS(fy, {
item: !0,
xs: 6,
sm: 6,
children: [mS(cy, {component: "legend", children: "打印方式"}), mS(pw, {
row: !0,
"aria-label": "position",
value: E.values.printType,
id: "printType",
name: "printType",
onChange: E.handleChange,
children: mS(fy, {
container: !0,
spacing: 1,
children: vS(fy, {
item: !0,
xs: 12,
sm: 12,
children: [mS(ry, {
value: "0",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "单面"})
}), mS(ry, {
value: "1",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "双面"})
}), mS(ry, {
value: "2",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "手动双面"})
})]
})
})
})]
}), vS(fy, {
item: !0,
xs: 6,
sm: 6,
children: [mS(cy, {component: "legend", children: "打印模式"}), mS(pw, {
row: !0,
"aria-label": "position",
value: E.values.collateCopies,
id: "collateCopies",
name: "collateCopies",
onChange: E.handleChange,
children: mS(fy, {
container: !0,
spacing: 1,
children: vS(fy, {
item: !0,
xs: 12,
sm: 12,
children: [mS(ry, {
value: "false",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "逐页打印"})
}), mS(ry, {
value: "true",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "逐份打印"})
})]
})
})
})]
}), E.values.showMarkerPanel ? vS(fy, {
item: !0,
xs: 6,
sm: 6,
children: [mS(cy, {component: "legend", children: "印章打印设置"}), mS(pw, {
row: !0,
"aria-label": "position",
value: E.values.signStatus,
id: "signStatus",
name: "signStatus",
onChange: E.handleChange,
children: mS(fy, {
container: !0,
spacing: 1,
children: vS(fy, {
item: !0,
xs: 12,
sm: 12,
children: [mS(ry, {
value: "0",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "不打印"})
}), mS(ry, {
value: "1",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "正常打印"})
}), mS(ry, {
value: "2",
control: mS(hw, {size: "small", color: "primary"}),
label: mS("span", {className: e.littleFont, children: "灰度打印"})
})]
})
})
})]
}) : null]
})
})
}), E.values.showMarkerPanel ? mS(fy, {
item: !0, xs: 7, sm: 7, children: mS("div", {
className: Xc(e.gridRoot, e.root), children: vS(fy, {
container: !0,
justifyContent: "space-between",
spacing: 3,
children: [mS(fy, {
item: !0,
xs: 12,
sm: 12,
children: mS(cy, {component: "legend", children: "水印设置"})
}), mS(fy, {
item: !0,
xs: 12,
sm: 6,
children: mS(eS, {
size: "small",
type: "number",
label: "旋转角度(-45° ~ 45°)",
variant: "outlined",
value: E.values.rotate,
id: "rotate",
name: "rotate",
onChange: E.handleChange,
inputProps: {inputMode: "numeric", pattern: "[0-9]*"},
error: E.touched.rotate && Boolean(E.errors.rotate),
helperText: E.touched.rotate && E.errors.rotate
})
}), mS(fy, {
item: !0,
xs: 12,
sm: 6,
children: mS(eS, {
size: "small",
label: "创建者",
value: E.values.creator,
id: "creator",
name: "creator",
onChange: E.handleChange,
variant: "outlined",
error: E.touched.creator && Boolean(E.errors.creator),
helperText: E.touched.creator && E.errors.creator
})
}), mS(fy, {
item: !0,
xs: 12,
sm: 4,
children: mS(eS, {
size: "small",
required: !0,
value: E.values.x,
type: "number",
id: "x",
name: "x",
onChange: E.handleChange,
label: "水印x坐标",
variant: "outlined",
error: E.touched.x && Boolean(E.errors.x),
helperText: E.touched.x && E.errors.x
})
}), mS(fy, {
item: !0,
xs: 12,
sm: 4,
children: mS(eS, {
size: "small",
value: E.values.y,
type: "number",
id: "y",
name: "y",
onChange: E.handleChange,
label: "水印y坐标",
variant: "outlined",
error: E.touched.y && Boolean(E.errors.y),
helperText: E.touched.y && E.errors.y
})
}), mS(fy, {
item: !0,
xs: 12,
sm: 4,
children: mS(eS, {
size: "small",
type: "number",
value: E.values.density,
id: "density",
name: "density",
onChange: E.handleChange,
label: "水印密度( 0 ~ 1 )",
variant: "outlined",
error: E.touched.density && Boolean(E.errors.density),
helperText: E.touched.density && E.errors.density
})
}), mS(fy, {
item: !0, xs: 12, sm: 12, children: vS(Qw, {
value: y,
onChange: function (e, t) {
b(t)
},
indicatorColor: "primary",
centered: !0,
children: [mS(Rw, {label: "文字水印"}), mS(Rw, {label: "图片水印"})]
})
}), vS(fy, {
item: !0, xs: 12, sm: 12, children: [0 === y && mS("div", {
className: e.gridRoot, style: {marginTop: "10px"}, children: vS(fy, {
container: !0,
spacing: 3,
children: [mS(fy, {
item: !0,
xs: 12,
sm: 12,
children: mS(eS, {
className: e.longLabel,
size: "small",
label: "文字水印内容",
value: E.values.marker,
id: "marker",
name: "marker",
onChange: E.handleChange,
variant: "outlined"
})
}), mS(fy, {
item: !0,
xs: 12,
sm: 5,
children: mS(eS, {
size: "small",
type: "number",
value: E.values.fontSize,
id: "fontSize",
name: "fontSize",
onChange: E.handleChange,
inputProps: {inputMode: "numeric", pattern: "[0-9]*"},
label: "文字大小(mm)",
variant: "outlined"
})
}), mS(fy, {
item: !0,
xs: 12,
sm: 6,
children: vS(ty, {
variant: "outlined",
size: "small",
className: e.fontNameWidth,
children: [mS(xy, {
id: "demo-simple-select-outlined-label",
children: "文字字体"
}), mS(ww, {
labelId: "demo-simple-select-outlined-label",
id: "fontName",
name: "fontName",
value: E.values.fontName,
onChange: E.handleChange,
label: "文字字体",
children: DC.map(function (e, t) {
return mS(Yy, {value: e, children: e}, "p" + t)
})
})]
})
}), mS(fy, {
item: !0,
xs: 12,
sm: 1,
children: mS("div", {
style: {width: "100%", display: "flex", justifyContent: "center"},
children: mS(TC, {
hideTextfield: !0, value: h, onChange: function (e) {
p("rgba(".concat(e.rgb[0], ", ").concat(e.rgb[1], ", ").concat(e.rgb[2], ", ").concat(e.alpha, ")")), E.setFieldValue("fontColor", "rgb(".concat(e.rgb[0], ", ").concat(e.rgb[1], ", ").concat(e.rgb[2], ")")), v(e.alpha)
}
})
})
})]
})
}), 1 === y && mS("div", {
className: e.gridRoot,
style: {marginTop: "10px"},
children: mS(fy, {
container: !0,
spacing: 3,
children: mS(fy, {
item: !0,
xs: 12,
sm: 12,
children: mS(eS, {
className: e.longLabel,
size: "small",
multiline: !0,
minRows: 4,
value: E.values.image,
id: "image",
name: "image",
onChange: E.handleChange,
label: "图片URL",
variant: "outlined"
})
})
})
})]
})]
})
})
}) : null]
})
})
})
})
}, RC = u.exports.forwardRef(function (e, t) {
var n = e.classes, r = e.className, i = $c(e, ["classes", "className"]);
return u.exports.createElement("div", Jc({className: Xc(n.root, r), ref: t}, i))
}), WC = Um(function (e) {
return {
root: Jc({}, Vg, Fg(e), {
"& *, & *::before, & *::after": {boxSizing: "inherit"},
"& strong, & b": {fontWeight: e.typography.fontWeightBold}
})
}
}, {name: "MuiScopedCssBaseline"})(RC);
function VC(e) {
var t = e.children;
return mS(WC, {children: t})
}
var FC = "cloud-reader-components_surreadPrint";
var GC = Object.freeze(Object.defineProperty({
__proto__: null, init: function () {
var e = document.getElementById(FC);
e || ((e = document.createElement("div")).id = FC, document.body.appendChild(e), Hc.render(mS(VC, {children: mS(NC, {})}), e))
}, destroy: function () {
var e = document.getElementById(FC);
e && Hc.unmountComponentAtNode(e) && document.body.removeChild(e)
}, get show() {
return _C
}, get hide() {
return kC
}, get set() {
return PC
}, get get() {
return xC
}, SurreadPrint: NC, TestSurreadPrint: function (e) {
var t = s(u.exports.useState(!1), 2), n = t[0], r = t[1], i = function () {
r(!n)
};
return u.exports.useEffect(function () {
PC(e, function () {
console.log(xC())
}, function () {
i(), console.log("cancel print")
})
}, []), u.exports.useEffect(function () {
n && (PC(e, function () {
console.log("成功打印 获得打印参数", xC())
}, function () {
i(), console.log("cancel print")
}), _C())
}, [n]), vS("div", {children: [mS(Ig, {onClick: i, children: "show printLabel"}), mS(NC, {})]})
}
}, Symbol.toStringTag, {value: "Module"}));
t.SurreadPrint = GC
}).call(t, n(61)(e))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.KG_StampMask = void 0;
var r, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(464), o = (r = a) && r.__esModule ? r : {default: r}, s = n(16), l = n(2), c = n(88), u = n(89);
var d = function () {
var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null);
function n() {
}
return n.getProp = function (n, r) {
if (1 === arguments.length && "string" == typeof t[n]) return t[n];
var i, a = (r = r || document.documentElement).style, o = void 0;
if ("string" == typeof a[n]) return t[n] = n;
i = n.charAt(0).toUpperCase() + n.slice(1);
for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof a[o = e[s] + i]) return t[n] = o;
return t[n] = "undefined"
}, n.setProp = function (e, t, n) {
var r = this.getProp(e);
"undefined" !== r && (t.style[r] = n)
}, n
}(), h = function () {
function e(t, n) {
if (function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.app = t, this.stampMask = new o.default({
okCallback: this.okCallback.bind(this),
cancelCallback: this.cancelcaCallback.bind(this)
}), this.open = this.open.bind(this), this.originScale = KGPdfViewerWebApp.PDFViewerApplication.pdfViewer._currentScale, this.banList = [document.getElementById("stamp")], !1 === KGPdfViewerWebApp.disableRotate) {
var r = [document.getElementsByClassName("pageRotateCw")[0], document.getElementsByClassName("pageRotateCcw")[0]];
this.banList = this.banList.concat(r)
}
this.init()
}
return i(e, [{
key: "init", value: function () {
window.KGPdfViewerWebApp.stampMask && (this.app.appConfig.toolbar.kgStampMask.removeAttribute("hidden"), this.app.appConfig.toolbar.kgStampMask.addEventListener("click", this.open), e.clickRightMenu(this.app))
}
}, {
key: "open", value: function () {
window.KGPdfViewerWebApp.PDFViewerApplication.secondaryToolbar.close(), this.stampMask.isOpened || this.stampMask.open(), this.banList.forEach(function (e) {
e.style.pointerEvents = "none"
})
}
}, {
key: "scaleChange", value: function () {
var e = KGPdfViewerWebApp.PDFViewerApplication.pdfViewer._currentScale;
this.stampMask.scaleChange(e / this.originScale), this.originScale = e
}
}, {
key: "getAnnots", value: function (e) {
var t = this, n = c.DEFAULT_AUTHOR, r = [], i = [];
return e.forEach(function (e) {
var a = t.app.pdfViewer.getPageView(e.pageNo - 1).viewport.scale, o = e.width / a, s = e.height / a,
c = e.centerX / a, u = e.centerY / a, d = e.left / a, h = e.top / a, p = document.createElement("canvas");
p.width = o, p.height = s;
var f = p.getContext("2d");
f.fillStyle = e.fillColor, f.fillRect(0, 0, p.width, p.height);
var m = p.toDataURL("image/png").split(","), v = (0, l.hexToRgb)(e.fillColor), g = {
imgData: m[1],
centerX: c,
centerY: u,
page: e.pageNo,
type: "image",
authorName: n,
width: o,
height: s,
color: v.rgbArr
};
r.push(g), i.push({
imgData: m[1],
centerX: c,
centerY: u,
page: e.pageNo,
type: "image",
authorName: n,
width: o,
height: s,
color: v.rgbArr,
imgHeader: m[0],
left: d,
top: h,
rectDom: e.shapeDom.cloneNode(!0)
})
}), {annots: r, annotsMore: i}
}
}, {
key: "okCallback", value: function (e) {
var t = this, n = e.shapeList;
e.mode;
if (!n.length) return this.stampMask.removeDom(), this.recoverBanList(), void this.stampMask.close();
this.addStampMask(n).then(function () {
t.stampMask.close()
})
}
}, {
key: "recoverBanList", value: function () {
this.banList.forEach(function (e) {
e.style.pointerEvents = "all"
})
}
}, {
key: "addStampMask", value: function (e) {
var t = this, n = this.getAnnots(e), r = n.annots, i = n.annotsMore,
a = window.KGPdfViewerWebApp.getTipPrompt();
switch (window.KGPdfViewerWebApp.PDFViewerApplication.l10n._lang) {
case"zh-TW":
a.open("正在添加掩膜...");
break;
case"en-US":
a.open("Adding Stamp Mask...");
break;
default:
a.open("正在添加掩膜...")
}
return window.KGPdfViewerWebApp.addDocSign(r).then(function (e) {
var n = e.data;
n.status ? i.forEach(function (e, n) {
var r = t.app.pdfViewer.getPageView(e.page - 1), i = r.viewport.scale,
a = t._createSection(e, (new Date).getTime() + "-" + n, "stampAnnotation", i), o = r.annotationLayer,
s = document.getElementById("pageContainer" + e.page);
o.div || (o.div = document.createElement("div"), o.div.className = "annotationLayer", s.appendChild(o.div)), o.div.appendChild(a), t.renderSign(r, a, e.page - 1, e.imgHeader + "," + e.imgData)
}) : t.app.KGAlertPrompt.open(n.message), a.close(), t.stampMask.removeDom(), t.recoverBanList()
})
}
}, {
key: "renderSign", value: function (e, t, n, r) {
var i = document.createElement("img"), a = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth),
o = t.offsetTop * a, l = t.offsetLeft * a, c = t.offsetWidth * a, u = t.offsetHeight * a,
d = t.getAttribute("data-annotation-id");
if (void 0 !== e.canvas) {
var h = e.canvas.getContext("2d");
e.pdfPage.newDocSigns[d] = t, i.onload = function () {
h.globalCompositeOperation = "source-over", h.drawImage(i, l, o, c, u), t.style.opacity = 1;
var r = window.KGPdfViewerWebApp.PDFViewerApplication.pdfThumbnailViewer.getThumbnail(n);
r.renderingState = s.RenderingStates.INITIAL, r.setImage(e)
}, i.src = r
}
}
}, {
key: "_createSection", value: function (e, t, n, r) {
var i = e.width, a = e.height, o = e.left, s = e.top;
i = Math.round(i), a = Math.round(a);
var l = document.createElement("section");
l.setAttribute("data-annotation-id", t), l.className = n, l.classList.add("stamp-mask-annotation"), l.style.width = i + "px", l.style.height = a + "px", l.style.opacity = .5, l.setAttribute("data-rgb", e.fillColor), e.authorName && l.setAttribute("data-author", e.authorName), e.rectDom.style.left = "0px", e.rectDom.style.top = "0px", e.rectDom.style.width = i + "px", e.rectDom.style.height = a + "px", e.rectDom.style.backgroundColor = "transparent", l.appendChild(e.rectDom);
var c = document.createElement("img");
return c.src = e.imgHeader + "," + e.imgData, c.style.width = "100%", c.style.height = "100%", c.style.display = "none", l.appendChild(c), l.style.transform = "matrix(" + r + ", 0, 0, " + r + ", 0, 0)", l.style.left = o + "px", l.style.top = s + "px", l.style.zIndex = 100, d.setProp("transform", l, "matrix(" + r + ", 0, 0, " + r + ", 0, 0)"), d.setProp("transformOrigin", l, -1 * o + "px " + -1 * s + "px"), l
}
}, {
key: "cancelcaCallback", value: function () {
this.stampMask.close(), this.recoverBanList()
}
}], [{
key: "clickRightMenu", value: function (e) {
var t = this;
document.oncontextmenu = function (n) {
return t.createRightMenu(n, e), !1
}, document.addEventListener("click", function (n) {
t.removeRightMenu(n, e)
})
}
}, {
key: "getCurPageNo", value: function (e) {
for (var t = (0, u.getEventPath)(e), n = -1, r = 0; r < t.length; r++) t[r].classList && t[r].classList.contains("page") && (n = t[r].getAttribute("data-page-number"), r = t.length + 1);
return n
}
}, {
key: "isRightMenu", value: function (e) {
for (var t = (0, u.getEventPath)(e), n = !1, r = 0; r < t.length; r++) t[r].id && t[r].id.indexOf("menuDeleteStampMask") >= 0 && (n = !0, r = t.length + 1);
return n
}
}, {
key: "createRightMenu", value: function (e, t) {
var n = this, r = document.getElementById("rightMenu");
if (r && r.parentNode.removeChild(r), e.target && (e.target.classList.contains("stampAnnotation") || !e.target.classList.contains("stampAnnotation") && e.target.parentNode && e.target.parentNode.classList.contains("stampAnnotation"))) {
var i = e.target.classList.contains("stampAnnotation") ? e.target : e.target.parentNode,
a = document.createElement("div");
a.setAttribute("id", "rightMenu"), a.innerHTML = '<span data-l10n-id="menuDeleteSeal">删除掩膜</span>';
var o = (0, u.getEventPath)(e).find(function (e) {
return e.getAttribute("data-page-number")
}), s = this.getCurPageNo(e), l = t.pdfViewer.getPageView(s - 1), d = l.viewport.scale,
h = o.getBoundingClientRect(), p = document.documentElement.scrollTop || document.body.scrollTop,
f = document.documentElement.scrollLeft || document.body.scrollLeft, m = e.pageX - h.left - f,
v = e.pageY - h.top - p, g = i.getBoundingClientRect(), y = g.left, b = g.top, w = g.width, S = g.height;
y = y - h.left - f, b = b - h.top - p, m - y <= 2 && (m += 2), y + w - m <= 2 && (m -= 2), v - b <= 2 && (v += 2), b + S - v <= 2 && (v -= 2);
var _ = m / d, k = v / d, x = m, P = v;
l.viewport.width < parseFloat(x) + 94 && (x -= 94), l.viewport.height < parseFloat(P) + 70 && (P -= 70), a.setAttribute("style", "\n position: absolute;\n display: inline-block;\n padding: 5px 8px;\n background-color: white;\n border: 1px solid #999;\n z-index: " + (c.ZINDEX + 1) + ";\n left: " + x + "px;\n top: " + P + "px;\n cursor: default;\n "), this.deleteData = {
pageNo: s,
left: _,
top: k,
section: i,
pdfPageView: l,
author: c.DEFAULT_AUTHOR
}, a.addEventListener("click", function (e) {
n.deleteStampMask(e)
}), o.appendChild(a)
}
}
}, {
key: "removeRightMenu", value: function (e) {
var t = this;
if (!this.isRightMenu(e) || this.deletting) {
var n = document.getElementById("menuDeleteStampMask");
n && (n.removeEventListener("click", function (e) {
t.deleteStampMask(e)
}), n.parentNode.remove(n))
}
}
}, {
key: "deleteStampMask", value: function (e) {
var t = this;
this.deletting = !0;
var n = window.KGPdfViewerWebApp.getTipPrompt();
switch (window.KGPdfViewerWebApp.PDFViewerApplication.l10n._lang) {
case"zh-TW":
n.open("正在删除掩膜...");
break;
case"en-US":
n.open("Delete and Annoting...");
break;
default:
n.open("正在删除掩膜...")
}
this.deleteData && window.KGPdfViewerWebApp.deleteDocSign(this.deleteData.pageNo, this.deleteData.left, this.deleteData.top, this.deleteData.section, this.deleteData.pdfPageView, this.deleteData.author).then(function (r) {
t.removeRightMenu(e), t.deletting = !1, n.close()
})
}
}, {
key: "getInstance", value: function (t, n) {
return this.instance || (this.instance = new e(t, n)), this.instance
}
}]), e
}();
t.KG_StampMask = h
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = u(n(465)), a = u(n(466)), o = u(n(467)), s = u(n(468)), l = n(89), c = n(88);
function u(e) {
return e && e.__esModule ? e : {default: e}
}
var d = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.options = Object.assign({}, t, c.DEFAULT_OPTIONS), this.createPages(), this.resizeWindowBind = this.resizeWindow.bind(this), window.addEventListener("resize", this.resizeWindowBind), this.bottomOperation = new i.default({
okCallback: this.okCallback.bind(this),
cancelCallback: this.cancelCallback.bind(this)
}), this.paramsToolbar = new a.default(null, {paramsChangeCallback: this.paramsChangeCallback.bind(this)}), this.mode = c.CREATE_MODE, this.drawShape = null, this.shapeList = [], this.mouseMoveBind = this.mouseMove.bind(this), this.curDraggableBoxPage = -1, this.isOpened = !1
}
return r(e, [{
key: "createPages", value: function () {
var e = document.getElementById(c.MASK_VIEWER_ID);
e && e.remove(), this.maskViewerDom = document.createElement("div"), this.maskViewerDom.setAttribute("id", c.MASK_VIEWER_ID);
var t = document.getElementById(this.options.viewerDomId), n = t.getBoundingClientRect();
this.setMaskViewerDomStyle(n), document.getElementById(this.options.viewerContainerId).insertBefore(this.maskViewerDom, t);
for (var r = document.getElementsByClassName(this.options.pageClassName), i = 0; i < r.length; i++) {
var a = r.item(i), o = a.getBoundingClientRect(), s = document.createElement("div"),
l = a.getAttribute(this.options.pageNoAttrName);
s.setAttribute(this.options.pageNoAttrName, l), s.setAttribute("id", c.MASK_PAGE_CLASSNAME + l), s.setAttribute("class", c.MASK_PAGE_CLASSNAME), this.setMaskPageDomStyle(s, o, n), this.maskViewerDom.appendChild(s)
}
}
}, {
key: "setMaskViewerDomStyle", value: function (e) {
var t = document.documentElement.scrollTop || document.body.scrollTop,
n = document.documentElement.scrollLeft || document.body.scrollLeft;
document.getElementById(this.options.viewerContainerId).getBoundingClientRect();
this.maskViewerDom.setAttribute("style", "\n position: absolute;\n left: " + (n + e.left) + "px;\n top: " + (t + 12) + "px;\n width: " + e.width + "px;\n height: " + e.height + "px;\n z-index: " + c.ZINDEX + ";\n "), this.isOpened ? this.maskViewerDom.style.display = "block" : this.maskViewerDom.style.display = "none"
}
}, {
key: "setMaskPageDomStyle", value: function (e, t, n) {
e.setAttribute("style", "\n position: absolute;\n top: " + (t.top - n.top) + "px;\n left: " + (t.left - n.left) + "px;\n width: " + t.width + "px;\n height: " + t.height + "px;\n overflow: hidden;\n ")
}
}, {
key: "resizeWindow", value: function () {
var e = this;
this.windowResizeRaf = requestAnimationFrame(function () {
var t = document.getElementById(e.options.viewerDomId).getBoundingClientRect();
e.setMaskViewerDomStyle(t);
for (var n = document.getElementsByClassName(e.options.pageClassName), r = 0; r < n.length; r++) {
var i = n.item(r), a = i.getBoundingClientRect(), o = i.getAttribute(e.options.pageNoAttrName),
s = document.getElementById(c.MASK_PAGE_CLASSNAME + o);
e.setMaskPageDomStyle(s, a, t)
}
})
}
}, {
key: "scaleChange", value: function (e) {
this.resizeWindow(), this.isOpened && (this.shapeList.forEach(function (t) {
t.centerX = t.centerX * e, t.centerY = t.centerY * e, t.left = t.left * e, t.top = t.top * e, t.width = t.width * e, t.height = t.height * e;
var n = t.shapeDom.getBoundingClientRect();
t.shapeDom.style.left = t.left + "px", t.shapeDom.style.top = t.top + "px", t.shapeDom.style.width = n.width * e + "px", t.shapeDom.style.height = n.height * e + "px"
}), this.draggableBox && this.draggableBox.scaleChange(e))
}
}, {
key: "setMode", value: function (e) {
this.mode = e
}
}, {
key: "open", value: function () {
this.isOpened = !0, this.maskViewerDom.style.display = "block", this.mode === c.CREATE_MODE && this.paramsToolbar.open(), this.bottomOperation.open(), this.drawShape = new s.default({
drawParams: {
shape: this.paramsToolbar.curShape,
fillColor: this.paramsToolbar.curFillColor
},
parentDomClassName: c.MASK_PAGE_CLASSNAME,
maskViewerId: c.MASK_VIEWER_ID,
addShapeCallback: this.addShapeCallback.bind(this)
}), document.addEventListener("mousemove", this.mouseMoveBind), document.body.classList.add("user-select-none")
}
}, {
key: "close", value: function () {
this.isOpened = !1, this.maskViewerDom.style.display = "none", this.mode === c.CREATE_MODE ? (this.paramsToolbar.close(), this.bottomOperation.close()) : this.mode === c.EDIT_MODE && this.bottomOperation.close(), this.drawShape.destroy(), document.removeEventListener("mousemove", this.mouseMoveBind), document.body.classList.remove("user-select-none")
}
}, {
key: "mouseMove", value: function (e) {
var t = this.getCurPage(e), n = t.curMousePageNo, r = t.pageX, i = t.pageY;
if (this.curMousePageNo = n, this.curMousePageNo > -1 && this.draggableBox && "dragging" === this.draggableBox.status && this.draggableBox.parentDom && (this.curDraggableBoxPage = this.draggableBox.parentDom.getAttribute(c.DEFAULT_OPTIONS.pageNoAttrName), this.curDraggableBoxPage && this.curDraggableBoxPage !== this.curMousePageNo)) {
var a = document.getElementById(c.MASK_PAGE_CLASSNAME + this.curMousePageNo), o = a.getBoundingClientRect(),
s = document.documentElement.scrollTop || document.body.scrollTop,
l = document.documentElement.scrollLeft || document.body.scrollLeft,
u = r - this.draggableBox.relX - o.left - l, d = i - this.draggableBox.relY - o.top - s;
this.draggableBox.changeParentDom({parentDom: a, x: u, y: d})
}
}
}, {
key: "getCurPage", value: function (e) {
for (var t = -1, n = (0, l.getEventPath)(e), r = 0; r < n.length; r++) n[r].classList && n[r].classList.contains(c.MASK_PAGE_CLASSNAME) && (t = n[r].getAttribute(c.DEFAULT_OPTIONS.pageNoAttrName), r = n.length + 1);
return {curMousePageNo: t, pageX: e.pageX, pageY: e.pageY}
}
}, {
key: "paramsChangeCallback", value: function (e) {
this.drawShape && this.drawShape.setParams(e)
}
}, {
key: "addShapeCallback", value: function (e) {
var t = this;
e.shapeDom.addEventListener("mousedown", function () {
t.shapeClick(e)
}), this.shapeList.push(e)
}
}, {
key: "shapeClick", value: function (e) {
var t = document.getElementById(e.pageId);
this.draggableBox ? this.draggableBox.setContentElem({
contentElem: e.shapeDom,
x: e.left,
y: e.top,
parentDom: document.getElementById(c.MASK_PAGE_CLASSNAME + this.curMousePageNo)
}) : this.draggableBox = new o.default({
contentElem: e.shapeDom,
x: e.left,
y: e.top,
parentDom: t,
dragStopCallback: this.dragStopCallback.bind(this),
delCallback: this.delCallback.bind(this)
}), this.curShapeData = e
}
}, {
key: "dragStartCallback", value: function () {
}
}, {
key: "dragStopCallback", value: function (e) {
var t = document.getElementById(this.draggableBox.contentElemId);
this.curShapeData.shapeDom = t, this.curShapeData.centerX = e.centerX, this.curShapeData.centerY = e.centerY, this.curShapeData.width = e.width, this.curShapeData.height = e.height, this.curShapeData.left = e.left, this.curShapeData.top = e.top, this.curShapeData.pageNo = parseInt(this.curDraggableBoxPage), this.curShapeData.pageId = c.MASK_PAGE_CLASSNAME + this.curDraggableBoxPage
}
}, {
key: "delCallback", value: function () {
var e = this;
this.shapeList.forEach(function (t, n) {
t.id === e.curShapeData.shapeDom.id && e.shapeList.splice(n, 1)
}), this.draggableBox.destroy(), this.draggableBox = null, this.curShapeData.shapeDom.remove()
}
}, {
key: "okCallback", value: function () {
this.draggableBox && (this.draggableBox.destroy(), this.draggableBox = null), this.options.okCallback && this.options.okCallback({
shapeList: this.shapeList,
mode: this.mode
})
}
}, {
key: "cancelCallback", value: function () {
this.draggableBox && (this.draggableBox.destroy(), this.draggableBox = null), this.removeDom(), this.options.cancelCallback && this.options.cancelCallback()
}
}, {
key: "removeDom", value: function () {
this.shapeList.forEach(function (e) {
e.shapeDom.remove()
}), this.shapeList = []
}
}]), e
}();
t.default = d
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
var i = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.okCallback = t.okCallback, this.cancelCallback = t.cancelCallback, this.bottomOperationDom = document.getElementById("stamp-mask-bottom-operation"), this.okBtn = document.getElementById("stamp-mask-ok-btn"), this.cancelBtn = document.getElementById("stamp-mask-cancel-btn"), this.okBtnClickBind = this.okBtnClick.bind(this), this.cancelBtnClickBind = this.cancelBtnClick.bind(this), this.okBtn.addEventListener("click", this.okBtnClickBind), this.cancelBtn.addEventListener("click", this.cancelBtnClickBind)
}
return r(e, [{
key: "open", value: function () {
this.bottomOperationDom.style.display = "block"
}
}, {
key: "close", value: function () {
this.bottomOperationDom.style.display = "none"
}
}, {
key: "okBtnClick", value: function () {
this.okCallback()
}
}, {
key: "cancelBtnClick", value: function () {
this.cancelCallback()
}
}]), e
}();
t.default = i
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(88);
var a = function () {
function e(t, n) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), n && n.config ? this.config = n.config : this.config = {
author: i.DEFAULT_AUTHOR,
subject: "",
shape: "rect"
}, this.shapeList = ["rect"], this.curShape = "rect", window.KGPdfViewerWebApp.stampMask ? this.curFillColor = window.KGPdfViewerWebApp.stampMask.fillColor || "#fff" : this.curFillColor = "#fff", this.setColorBind = this.setColor.bind(this), this.createDom(), n && n.paramsChangeCallback && (this.paramsChangeCallback = n.paramsChangeCallback)
}
return r(e, [{
key: "createDom", value: function () {
this.paramsToolbar = document.createElement("div"), this.paramsToolbar.setAttribute("id", i.PARAMS_TOOLBAR_ID), this.paramsToolbar.setAttribute("style", "\n position: fixed;\n display: none;\n top: 60px;\n left: 0;\n right: 0;\n margin: auto;\n background: white;\n border-radius: 2px;\n z-index: 999;\n width: 130px;\n height: " + i.PARAMS_TOOLBAR_HEIGHT + "px;\n max-width: 375px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);\n padding: 0 0 0 6px;\n box-sizing: border-box;\n user-select: none;\n "), this.createShapeList(), this.createColor(), document.body.appendChild(this.paramsToolbar)
}
}, {
key: "createShapeList", value: function () {
var e = this;
this.shapeListDom = document.createElement("div"), this.shapeListDom.setAttribute("id", i.TOOLBAR_SHAPE_LIST_ID), this.shapeListDom.setAttribute("style", "display: inline-block;"), this.shapeList.forEach(function (t) {
var n = document.createElement("span");
n.setAttribute("id", i.SHAPE_ID_MAP[t]), n.setAttribute("style", "\n display: flex;\n width: " + i.PARAMS_TOOLBAR_HEIGHT + "px;\n height: " + i.PARAMS_TOOLBAR_HEIGHT + "px;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n "), e.shapeListDom.appendChild(n);
var r = void 0;
switch (t) {
case"rect":
(r = document.createElement("span")).setAttribute("id", i.SHAPE_ICON_ID_MAP[t]), r.setAttribute("style", "\n display: inline-block;\n width: 24px;\n height: 18px;\n border: 2px solid " + i.SHAPE_BORDER_COLOR + ";\n transition: all 0.2s;\n "), e.curShape === t && (r.style.borderColor = i.SHAPE_BORDER_ACTIVE_COLOR, r.setAttribute("class", "active")), n.appendChild(r)
}
r.addEventListener("click", e.shapeClickBind), e.paramsToolbar.appendChild(e.shapeListDom)
})
}
}, {
key: "createColor", value: function () {
var e = document.createElement("span");
e.setAttribute("style", "\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n ");
var t = document.createElement("span");
t.setAttribute("style", "\n font-size: 12px;\n text-align: left;\n width: auto;\n margin-left: 4px;\n margin-right: 6px;\n "), t.innerHTML = "颜色", e.appendChild(t), this.colorDom = document.createElement("input"), this.colorDom.setAttribute("id", i.COLOR_ID), this.colorDom.setAttribute("style", "\n display: inline-block;\n width: 28px;\n height: 18px;\n font-size: 12px;\n line-height: 18px;\n cursor: default;\n border: 1px solid #d9d9d9;\n border-radius: 4px;\n transition: all 0.3s;\n overflow: visible;\n "), this.colorDom.jscolor = new window.jscolor(this.colorDom), this.colorDom.jscolor.fromString(this.curFillColor), this.colorDom.addEventListener("change", this.setColorBind), e.appendChild(this.colorDom), this.paramsToolbar.appendChild(e)
}
}, {
key: "setColor", value: function () {
var e = this.colorDom.value;
/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test("#" + e) && (this.colorDom.jscolor.fromString(e), this.curFillColor = "#" + e, this.colorDom.jscolor.hide(), this.setCurParams())
}
}, {
key: "shapeClick", value: function (e) {
var t = this;
this.shapeList.forEach(function (n) {
if (i.SHAPE_ICON_ID_MAP[n] === e.target.id) e.target.classList.contains("active") ? (t.curShape = "", e.target.style.borderColor = i.SHAPE_BORDER_COLOR, e.target.classList.remove("active")) : (t.curShape = n, e.target.style.borderColor = i.SHAPE_BORDER_ACTIVE_COLOR, e.target.classList.add("active")), t.setCurParams(); else {
var r = document.getElementById(i.SHAPE_ICON_ID_MAP[n]);
r.style.borderColor = i.SHAPE_BORDER_COLOR, r.classList.contains("active") && r.classList.remove("active")
}
})
}
}, {
key: "setCurParams", value: function () {
this.paramsChangeCallback && this.paramsChangeCallback({shape: this.curShape, fillColor: this.curFillColor})
}
}, {
key: "open", value: function () {
this.paramsToolbar.style.display = "flex"
}
}, {
key: "close", value: function () {
this.paramsToolbar.style.display = "none"
}
}, {
key: "destroy", value: function () {
var e = this;
this.colorDom.removeEventListener("change", this.setColorBind), this.shapeList.forEach(function (t) {
document.getElementById(i.SHAPE_ICON_ID_MAP[t]).removeEventListener("click", e.shapeClickBind)
}), this.paramsToolbar.remove()
}
}]), e
}();
t.default = a
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(89);
var a = 10, o = 2, s = ["tl", "tm", "tr", "rm", "br", "bm", "bl", "lm"], l = 8, c = 20, u = 201, d = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), null !== t.zIndex && void 0 !== t.zIndex ? this.zIndex = t.zIndex : this.zIndex = u, this.timeStamp = (new Date).getTime(), null !== t.resizable && void 0 !== t.resizable ? this.resizable = t.resizable : this.resizable = !0, this.scale = t.scale || 1, this.padding = a * this.scale, this.dotSize = l * this.scale, this.borderWidth = o * this.scale, this.delBtnWidth = c * this.scale, this.initPosAndSize(t), this.createDom(), this.bindMouseDown = this.mouseDown.bind(this), this.bindMouseMove = this.mouseMove.bind(this), this.bindMouseUp = this.mouseUp.bind(this), t.delCallback && (this.delCallback = t.delCallback), t.dragStartCallback && (this.dragStartCallback = t.dragStartCallback), t.draggingCallback && (this.draggingCallback = t.draggingCallback), t.dragStopCallback && (this.dragStopCallback = t.dragStopCallback), this.status = "wait", document.addEventListener("mousedown", this.bindMouseDown)
}
return r(e, [{
key: "changeParentDom", value: function (e) {
document.getElementById(this.draggableBoxId).remove(), this.parentDom = e.parentDom, this.createDom(), this.x = e.x, this.y = e.y
}
}, {
key: "initPosAndSize", value: function (e) {
if (e.contentElem) this.contentElem = e.contentElem; else {
var t = document.createElement("div");
t.style.width = "100px", t.style.height = "100px", this.contentElem = t
}
var n = this.contentElem.getBoundingClientRect(), r = 100, i = 100;
n && n.width ? (this.w = n.width, r = n.width) : this.contentElem.style.width && (r = Math.ceil(this.contentElem.style.width.replace("px", ""))), n && n.height ? i = n.height : this.contentElem.style.height && (i = Math.ceil(this.contentElem.style.height.replace("px", ""))), this.w = e.w || r, this.h = e.h || i, this.x = e.x || 0, this.y = e.y || 0, this.ow = this.w, this.oh = this.h, this.parentDom = e.parentDom || document.getElementsByTagName("body")[0]
}
}, {
key: "setContentElem", value: function (e) {
this.contentElem.style.display = "block", document.getElementById(this.draggableBoxId).remove(), this.initPosAndSize(e), this.createDom()
}
}, {
key: "createDom", value: function () {
this.createDraggableBox(), this.createHandleBox(), this.createContentBox(), this.bindDel = this.del.bind(this), this.delBtn.addEventListener("click", this.bindDel)
}
}, {
key: "createDraggableBox", value: function () {
this.draggableBox = document.createElement("div"), this.draggableBoxId = "draggable-box-" + this.timeStamp, this.draggableBox.setAttribute("id", this.draggableBoxId), this.draggableBox.setAttribute("style", "\n position: absolute;\n left: " + this.x + "px;\n top: " + this.y + "px;\n width: " + this.w + "px;\n height: " + this.h + "px;\n z-index: " + this.zIndex + ";\n box-sizing: content-box;\n cursor: move;\n user-select: none;\n "), this.parentDom.appendChild(this.draggableBox)
}
}, {
key: "createHandleBox", value: function () {
var e = this;
this.draggableHandleBox = document.createElement("div"), this.draggableHandleBoxId = "draggable-handle-box-" + this.timeStamp, this.draggableHandleBox.setAttribute("id", this.draggableHandleBoxId), this.draggableHandleBox.setAttribute("style", "\n position: absolute;\n left: " + (-this.padding - this.borderWidth) + "px;\n top: " + (-this.padding - this.borderWidth) + "px;\n width: " + (this.w + 2 * this.padding) + "px;\n height: " + (this.h + 2 * this.padding) + "px;\n border: " + this.borderWidth + "px solid #bfbfbf;\n z-index: " + this.zIndex + ";\n box-sizing: content-box;\n user-select: none;\n "), this.handleIdArr = [], s.forEach(function (t) {
var n = document.createElement("div"), r = "draggable-handle-" + t + "-" + e.timeStamp;
n.setAttribute("id", r), e.handleIdArr.push(r), n.setAttribute("style", "\n position: absolute;\n width: " + e.dotSize + "px;\n height: " + e.dotSize + "px;\n background-color: rgb(79, 128, 255);\n cursor: " + (e.resizable ? "crosshair" : "default") + ";\n "), e.setDotStyle(n, t), e.draggableHandleBox.appendChild(n)
}), this.createDelBtn(), this.draggableBox.appendChild(this.draggableHandleBox)
}
}, {
key: "setDotStyle", value: function (e, t) {
switch (t) {
case"tl":
e.style.left = -this.dotSize / 2 - this.borderWidth / 2 + "px", e.style.top = -this.dotSize / 2 - this.borderWidth / 2 + "px";
break;
case"tm":
e.style.left = (this.w + 2 * this.padding) / 2 - this.dotSize / 2 + "px", e.style.top = -this.dotSize / 2 - this.borderWidth / 2 + "px";
break;
case"tr":
e.style.left = this.w + 2 * this.padding + this.borderWidth / 2 - this.dotSize / 2 + "px", e.style.top = -this.dotSize / 2 - this.borderWidth / 2 + "px";
break;
case"rm":
e.style.left = this.w + 2 * this.padding + this.borderWidth / 2 - this.dotSize / 2 + "px", e.style.top = (this.h + 2 * this.padding) / 2 - this.dotSize / 2 + this.borderWidth / 2 + "px";
break;
case"br":
e.style.left = this.w + 2 * this.padding + this.borderWidth / 2 - this.dotSize / 2 + "px", e.style.top = this.h + 2 * this.padding + this.borderWidth / 2 - this.dotSize / 2 + "px";
break;
case"bm":
e.style.left = (this.w + 2 * this.padding) / 2 - this.dotSize / 2 + "px", e.style.top = this.h + 2 * this.padding + this.borderWidth / 2 - this.dotSize / 2 + "px";
break;
case"bl":
e.style.left = -this.dotSize / 2 - this.borderWidth / 2 + "px", e.style.top = this.h + 2 * this.padding + this.borderWidth / 2 - this.dotSize / 2 + "px";
break;
case"lm":
e.style.left = -this.dotSize / 2 - this.borderWidth / 2 + "px", e.style.top = (this.h + 2 * this.padding) / 2 - this.dotSize / 2 + "px"
}
}
}, {
key: "createDelBtn", value: function () {
this.delBtn = document.createElement("img"), this.delBtnId = "draggable-del-btn-" + this.timeStamp, this.delBtn.setAttribute("src", "images/close.png"), this.delBtn.setAttribute("id", this.delBtnId), this.delBtn.setAttribute("style", "\n position: absolute;\n width: " + this.delBtnWidth + "px;\n height: " + this.delBtnWidth + "px;\n right: " + (-this.delBtnWidth - this.borderWidth) / 2 + "px;\n top: " + (-this.delBtnWidth - this.borderWidth) / 2 + "px;\n cursor: pointer;\n user-select: none;\n "), this.draggableHandleBox.appendChild(this.delBtn)
}
}, {
key: "createContentBox", value: function () {
this.draggableContentBox = document.createElement("div"), this.draggableContentBoxId = "draggable-content-box-" + this.timeStamp, this.draggableContentBox.setAttribute("id", this.draggableContentBoxId), this.draggableContentBox.setAttribute("style", "\n position: absolute;\n left: 0px;\n top: 0px;\n width: " + this.w + "px;\n height: " + this.h + "px;\n z-index: " + this.zIndex + ";\n user-select: none;\n "), this.contentElem.style.cursor = "pointer", this.realContentElemId = "copy-" + this.contentElem.id, this.contentElemId = this.contentElem.id;
var e = this.contentElem.cloneNode(!0);
e.setAttribute("id", this.realContentElemId), e.setAttribute("data-draggable-content", !0), e.setAttribute("data-id", this.contentElem.id), e.style.left = "0px", e.style.top = "0px", e.style.display = "block", this.realContentElem = e, this.draggableContentBox.appendChild(e), this.draggableBox.appendChild(this.draggableContentBox)
}
}, {
key: "scaleChange", value: function (e) {
var t = this;
this.x = this.x * e, this.y = this.y * e, this.w = this.w * e, this.h = this.h * e, this.ow = this.ow * e, this.oh = this.oh * e, this.padding = this.padding * e, this.draggableBox.style.left = this.x + "px", this.draggableBox.style.top = this.y + "px", this.draggableBox.style.width = this.w + "px", this.draggableBox.style.height = this.h + "px", this.draggableContentBox.style.width = this.w + "px", this.draggableContentBox.style.height = this.h + "px", this.draggableHandleBox.style.left = -this.padding - this.borderWidth + "px", this.draggableHandleBox.style.top = -this.padding - this.borderWidth + "px", this.draggableHandleBox.style.width = this.w + 2 * this.padding + "px", this.draggableHandleBox.style.height = this.h + 2 * this.padding + "px", s.forEach(function (e) {
var n = "draggable-handle-" + e + "-" + t.timeStamp, r = document.getElementById(n);
r.style.width = t.dotSize + "px", r.style.height = t.dotSize + "px", t.setDotStyle(r, e)
}), this.realContentElem.style.width = this.w + "px", this.realContentElem.style.height = this.h + "px"
}
}, {
key: "isTarget", value: function (e, t) {
var n = this, r = !1;
return this.curDirection = "", e.forEach(function (e) {
if (t.indexOf(e.id) >= 0) {
r = !0;
var i = n.handleIdArr.find(function (t) {
return t === e.id
});
i && (n.curDirection = i.split("-")[2])
}
}), r
}
}, {
key: "isOutOfParent", value: function (e, t, n, r) {
return e.pageX <= n + t.left || e.pageX >= n + t.left + t.width || e.pageY <= r + t.top || e.pageY >= r + t.top + t.height
}
}, {
key: "updatePosition", value: function (e, t) {
this.draggableBox && (this.draggableBox.style.left = e + "px", this.draggableBox.style.top = t + "px")
}
}, {
key: "unfocusDraggable", value: function () {
this.draggableHandleBox.style.display = "none", this.delBtn.style.display = "none"
}
}, {
key: "focusDraggable", value: function () {
this.draggableHandleBox.style.display = "block", this.delBtn.style.display = "block"
}
}, {
key: "mouseDown", value: function (e) {
this.isTargetFlag = !1;
var t = this.handleIdArr.concat([this.draggableContentBoxId, this.contentElemId, this.delBtnId, this.draggableHandleBoxId]);
if (this.isTarget((0, i.getEventPath)(e), t)) {
this.focusDraggable(), this.contentElem.style.display = "none", this.isTargetFlag = !0, this.status = "start", this.draggableBoxRect = this.draggableBox.getBoundingClientRect();
var n = document.documentElement.scrollTop || document.body.scrollTop,
r = document.documentElement.scrollLeft || document.body.scrollLeft;
this.relX = e.pageX - (this.draggableBoxRect.left + r), this.relY = e.pageY - (this.draggableBoxRect.top + n), this.dragStartCallback && this.dragStartCallback(), this.startX = e.pageX, this.startY = e.pageY, document.addEventListener("mousemove", this.bindMouseMove), document.addEventListener("mouseup", this.bindMouseUp)
} else this.unfocusDraggable()
}
}, {
key: "mouseMove", value: function (e) {
var t = this;
this.endX = e.pageX, this.endY = e.pageY;
var n = Math.abs(this.endX - this.startX), r = Math.abs(this.endY - this.startY);
if (!(n < 10 && r < 10)) {
this.status = "dragging", this.parentDomRect = this.parentDom.getBoundingClientRect();
var i = document.documentElement.scrollTop || document.body.scrollTop,
a = document.documentElement.scrollLeft || document.body.scrollLeft;
this.isOutOfParent(e, this.parentDomRect, a, i) || (this.curDirection ? this.resizable && (this.resizeRaf = requestAnimationFrame(function () {
t.resize(e, n, r, t.parentDomRect, a, i)
})) : this.raf = requestAnimationFrame(function () {
t.x = e.pageX - t.relX - t.parentDomRect.left - a, t.y = e.pageY - t.relY - t.parentDomRect.top - i, t.isTargetFlag && t.updatePosition(t.x, t.y)
}))
}
}
}, {
key: "resize", value: function (e, t, n, r, i, a) {
switch (this.curDirection) {
case"tl":
this.calLXW(r, i), this.calTYH(r, a);
break;
case"tm":
this.calTYH(r, a);
break;
case"rm":
this.calRXW(r, i, t);
break;
case"br":
this.calRXW(r, i, t), this.calBYH(r, a, n);
break;
case"bm":
this.calBYH(r, a, n);
break;
case"bl":
this.calLXW(r, i), this.calBYH(r, a, n);
break;
case"lm":
this.calLXW(r, i)
}
this.resizeDom()
}
}, {
key: "calRXW", value: function (e, t, n) {
if (this.endX - (t + e.left) - this.padding > this.ox) this.endX < this.startX ? this.w = this.ow - n : this.w = this.ow + n; else {
var r = this.endX - (t + e.left) + this.padding;
this.ox - r <= 0 ? (this.w = 0, this.x = this.ox) : (this.x = r, this.w = this.ox - r)
}
}
}, {
key: "calLXW", value: function (e, t) {
this.x = this.endX - e.left - t + this.padding, this.x < this.ox + this.ow ? this.w = this.ox + this.ow - this.x : (this.x = this.ox + this.ow, this.w = this.endX - (e.left + t + this.ow + this.ox) - this.padding, this.w < 0 && (this.w = 0))
}
}, {
key: "calTYH", value: function (e, t) {
this.y = this.endY - e.top - t + this.padding, this.y < this.oy + this.oh ? this.h = this.oy + this.oh - this.y : (this.y = this.oy + this.oh, this.h = this.endY - (e.top + t + this.oh + this.oy) - this.padding, this.h <= 0 && (this.h = 0))
}
}, {
key: "calBYH", value: function (e, t, n) {
if (this.endY - (e.top + t) - this.padding > this.oy) this.endY < this.startY ? this.h = this.oh - n : this.h = this.oh + n; else {
var r = this.endY - (e.top + t) + this.padding;
this.oy - r < 0 ? (this.h = 0, this.y = this.oy) : (this.y = r, this.h = this.oy - r)
}
}
}, {
key: "resizeDom", value: function () {
var e = this;
this.draggableBox.style.left = this.x + "px", this.draggableBox.style.top = this.y + "px", this.draggableBox.style.width = this.w + "px", this.draggableBox.style.height = this.h + "px", this.draggableContentBox.style.width = this.w + "px", this.draggableContentBox.style.height = this.h + "px", this.realContentElem.style.width = this.w + "px", this.realContentElem.style.height = this.h + "px", this.draggableHandleBox.style.width = this.w + 2 * this.padding + "px", this.draggableHandleBox.style.height = this.h + 2 * this.padding + "px", s.forEach(function (t) {
var n = document.getElementById("draggable-handle-" + t + "-" + e.timeStamp);
e.setDotStyle(n, t)
})
}
}, {
key: "mouseUp", value: function (e) {
if (this.draggableBox && this.isTargetFlag) {
if (this.raf && cancelAnimationFrame(this.raf), this.resizeRaf && cancelAnimationFrame(this.resizeRaf), this.curDirection = "", this.ow = this.w, this.oh = this.h, this.ox = this.x, this.oy = this.y, document.removeEventListener("mousemove", this.bindMouseMove), this.isTargetFlag = !1, this.dragStopCallback && "dragging" === this.status) {
var t = this.parentDom.getBoundingClientRect(), n = this.draggableBox.getBoundingClientRect();
this.dragStopCallback({
centerX: this.x + n.width / 2,
centerY: t.height - (this.y + n.height / 2),
width: this.w,
height: this.h,
top: this.y,
left: this.x
})
}
var r = this.contentElem.parentNode;
this.contentElem.style.left = this.x + "px", this.contentElem.style.top = this.y + "px", this.contentElem.style.width = this.w + "px", this.contentElem.style.height = this.h + "px", this.contentElem.style.display = "block", this.parentDom != r && (r.removeChild(this.contentElem), this.parentDom.appendChild(this.contentElem)), document.removeEventListener("mousemove", this.bindMouseMove), document.removeEventListener("mouseup", this.bindMouseUp), this.status = "finish"
}
}
}, {
key: "del", value: function () {
this.destroy(), this.delCallback && this.delCallback()
}
}, {
key: "destroy", value: function () {
this.draggableBox && this.draggableBox.remove(), this.raf && cancelAnimationFrame(this.raf), this.resizeRaf && cancelAnimationFrame(this.resizeRaf), this.delBtn && this.delBtn.removeEventListener("click", this.bindDel), document.removeEventListener("mousedown", this.bindMouseDown), document.removeEventListener("mousemove", this.bindMouseMove), document.removeEventListener("mouseup", this.bindMouseUp)
}
}]), e
}();
t.default = d
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0});
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(89), a = n(88);
var o = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.drawParams = t.drawParams, this.parentDomClassName = t.parentDomClassName, this.maskViewerDom = document.getElementById(t.maskViewerId), t.addShapeCallback && (this.addShapeCallback = t.addShapeCallback), this.bindMouseDown = this.mouseDown.bind(this), this.bindMouseMove = this.mouseMove.bind(this), this.bindMouseUp = this.mouseUp.bind(this), document.addEventListener("mousedown", this.bindMouseDown)
}
return r(e, [{
key: "mouseDown", value: function (e) {
this.curPageDom = this.getCurParentDom(e), this.curPageDom ? (this.startX = e.pageX, this.startY = e.pageY, document.onmousemove && document.removeEventListener("mousemove", this.bindMouseMove), this.curPageNo = parseInt(this.curPageDom.getAttribute("data-page-number")), this.pageRect = this.curPageDom.getBoundingClientRect(), document.addEventListener("mousemove", this.bindMouseMove), document.addEventListener("mouseup", this.bindMouseUp)) : document.removeEventListener("mousemove", this.bindMouseMove)
}
}, {
key: "getCurParentDom", value: function (e) {
for (var t = null, n = (0, i.getEventPath)(e), r = 0; r < n.length; r++) {
if (n[r].id && (n[r].id.indexOf("draggable") >= 0 || n[r].id.indexOf("shape") >= 0)) return r = n.length + 1, null;
n[r].classList && n[r].classList.contains(this.parentDomClassName) && (t = n[r])
}
return t
}
}, {
key: "mouseMove", value: function (e) {
var t = this, n = e.pageX, r = e.pageY, i = this.pageRect, o = this.curPageDom.getBoundingClientRect().top,
s = Math.abs(o - this.pageRect.top), l = document.documentElement.scrollTop || document.body.scrollTop,
c = document.documentElement.scrollLeft || document.body.scrollLeft;
n >= this.startX && r < this.startY ? (this.left = this.startX - (c + i.left), this.top = r <= i.top + l ? 0 : r - l - i.top - s, this.width = n >= i.width + i.left + c ? i.width + i.left + c - this.startX : n - this.startX, this.height = r <= i.top + l ? this.startY - (i.top + l) : this.startY - r + s) : n >= this.startX && r >= this.startY ? (this.left = this.startX - (c + i.left), this.top = this.startY - i.top - l, this.width = n >= i.width + i.left + c ? i.width + i.left + c - this.startX : n - this.startX, this.height = r >= i.top + l + i.height ? i.top + l + i.height - this.startY : r - this.startY + s) : n < this.startX && r < this.startY ? (this.left = n < i.left + c ? 0 : n - i.left - c, this.top = r <= i.top + l ? 0 : r - l - i.top - s, this.width = n < i.left + c ? this.startX - c - i.left : this.startX - n, this.height = r <= i.top + l ? this.startY - (i.top + l) : this.startY - r + s) : n < this.startX && r > this.startY && (this.left = n < i.left + c ? 0 : n - i.left - c, this.top = this.startY - i.top - l, this.width = n < i.left + c ? this.startX - c - i.left : this.startX - n, this.height = r > i.top + l + i.height ? i.top + l + i.height - this.startY : r - this.startY + s), !this.rectDom && this.width >= 10 && this.height >= 10 ? (this.rectDom = document.createElement("div"), this.rectDom.setAttribute("id", "shape-" + (new Date).getTime()), this.rectDom.setAttribute("class", "shape"), this.rectDom.setAttribute("style", "\n position: absolute;\n background-color: " + this.drawParams.fillColor + ";\n opacity: 1;\n z-index: " + a.ZINDEX + ";\n "), this.curPageDom.appendChild(this.rectDom)) : this.rectDom && (this.raf = requestAnimationFrame(function () {
t.rectDom && (t.rectDom.style.width = t.width + "px", t.rectDom.style.height = t.height + "px", t.rectDom.style.top = t.top + "px", t.rectDom.style.left = t.left + "px")
}))
}
}, {
key: "mouseUp", value: function () {
if (this.curPageDom && this.rectDom) {
var e = this.curPageDom.getBoundingClientRect(), t = this.rectDom.getBoundingClientRect();
if (this.addShapeCallback) {
var n = t.left - e.left, r = t.top - e.top;
this.addShapeCallback({
pageNo: this.curPageNo,
pageId: this.curPageDom.id,
top: r,
left: n,
centerX: n + t.width / 2,
centerY: e.height - (r + t.height / 2),
width: t.width,
height: t.height,
fillColor: this.drawParams.fillColor,
id: this.rectDom.getAttribute("id"),
shapeDom: this.rectDom,
type: this.drawParams.shape,
zIndex: a.ZINDEX + 1
})
}
this.rectDom = null
}
document.removeEventListener("mousemove", this.bindMouseMove), document.removeEventListener("mouseup", this.bindMouseUp), cancelAnimationFrame(this.raf)
}
}, {
key: "setParams", value: function (e) {
this.drawParams = e
}
}, {
key: "destroy", value: function () {
document.removeEventListener("mousedown", this.bindMouseDown), document.removeEventListener("mousemove", this.bindMouseMove), document.removeEventListener("mouseup", this.bindMouseUp)
}
}]), e
}();
t.default = o
}, function (e, t, n) {
"use strict";
var r, i, a, o, s, l;
window.jscolor || (window.jscolor = ((l = {
register: function () {
l.attachDOMReadyEvent(l.init), l.attachEvent(document, "mousedown", l.onDocumentMouseDown), l.attachEvent(document, "touchstart", l.onDocumentTouchStart), l.attachEvent(window, "resize", l.onWindowResize)
},
init: function () {
l.jscolor.lookupClass && l.jscolor.installByClassName(l.jscolor.lookupClass)
},
tryInstallOnElements: function (e, t) {
for (var n = new RegExp("(^|\\s)(" + t + ")(\\s*(\\{[^}]*\\})|\\s|$)", "i"), r = 0; r < e.length; r += 1) {
var i;
if (void 0 === e[r].type || "color" != e[r].type.toLowerCase() || !l.isColorAttrSupported) if (!e[r].jscolor && e[r].className && (i = e[r].className.match(n))) {
var a = e[r], o = null, s = l.getDataAttr(a, "jscolor");
null !== s ? o = s : i[4] && (o = i[4]);
var c = {};
if (o) try {
c = new Function("return (" + o + ")")()
} catch (e) {
l.warn("Error parsing jscolor options: " + e + ":\n" + o)
}
a.jscolor = new l.jscolor(a, c)
}
}
},
isColorAttrSupported: (s = document.createElement("input"), !(!s.setAttribute || (s.setAttribute("type", "color"), "color" != s.type.toLowerCase()))),
isCanvasSupported: function () {
var e = document.createElement("canvas");
return !(!e.getContext || !e.getContext("2d"))
}(),
fetchElement: function (e) {
return "string" == typeof e ? document.getElementById(e) : e
},
isElementType: function (e, t) {
return e.nodeName.toLowerCase() === t.toLowerCase()
},
getDataAttr: function (e, t) {
var n = "data-" + t, r = e.getAttribute(n);
return null !== r ? r : null
},
attachEvent: function (e, t, n) {
e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent && e.attachEvent("on" + t, n)
},
detachEvent: function (e, t, n) {
e.removeEventListener ? e.removeEventListener(t, n, !1) : e.detachEvent && e.detachEvent("on" + t, n)
},
_attachedGroupEvents: {},
attachGroupEvent: function (e, t, n, r) {
l._attachedGroupEvents.hasOwnProperty(e) || (l._attachedGroupEvents[e] = []), l._attachedGroupEvents[e].push([t, n, r]), l.attachEvent(t, n, r)
},
detachGroupEvents: function (e) {
if (l._attachedGroupEvents.hasOwnProperty(e)) {
for (var t = 0; t < l._attachedGroupEvents[e].length; t += 1) {
var n = l._attachedGroupEvents[e][t];
l.detachEvent(n[0], n[1], n[2])
}
delete l._attachedGroupEvents[e]
}
},
attachDOMReadyEvent: function (e) {
var t = !1, n = function () {
t || (t = !0, e())
};
if ("complete" !== document.readyState) {
if (document.addEventListener) document.addEventListener("DOMContentLoaded", n, !1), window.addEventListener("load", n, !1); else if (document.attachEvent && (document.attachEvent("onreadystatechange", function () {
"complete" === document.readyState && (document.detachEvent("onreadystatechange", arguments.callee), n())
}), window.attachEvent("onload", n), document.documentElement.doScroll && window == window.top)) {
!function e() {
if (document.body) try {
document.documentElement.doScroll("left"), n()
} catch (t) {
setTimeout(e, 1)
}
}()
}
} else setTimeout(n, 1)
},
warn: function (e) {
window.console && window.console.warn && window.console.warn(e)
},
preventDefault: function (e) {
e.preventDefault && e.preventDefault(), e.returnValue = !1
},
captureTarget: function (e) {
e.setCapture && (l._capturedTarget = e, l._capturedTarget.setCapture())
},
releaseTarget: function () {
l._capturedTarget && (l._capturedTarget.releaseCapture(), l._capturedTarget = null)
},
fireEvent: function (e, t) {
if (e) if (document.createEvent) (n = document.createEvent("HTMLEvents")).initEvent(t, !0, !0), e.dispatchEvent(n); else if (document.createEventObject) {
var n = document.createEventObject();
e.fireEvent("on" + t, n)
} else e["on" + t] && e["on" + t]()
},
classNameToList: function (e) {
return e.replace(/^\s+|\s+$/g, "").split(/\s+/)
},
hasClass: function (e, t) {
return !!t && -1 != (" " + e.className.replace(/\s+/g, " ") + " ").indexOf(" " + t + " ")
},
setClass: function (e, t) {
for (var n = l.classNameToList(t), r = 0; r < n.length; r += 1) l.hasClass(e, n[r]) || (e.className += (e.className ? " " : "") + n[r])
},
unsetClass: function (e, t) {
for (var n = l.classNameToList(t), r = 0; r < n.length; r += 1) {
var i = new RegExp("^\\s*" + n[r] + "\\s*|\\s*" + n[r] + "\\s*$|\\s+" + n[r] + "(\\s+)", "g");
e.className = e.className.replace(i, "$1")
}
},
getStyle: function (e) {
return window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle
},
setStyle: (i = document.createElement("div"), a = function (e) {
for (var t = 0; t < e.length; t += 1) if (e[t] in i.style) return e[t]
}, o = {
borderRadius: a(["borderRadius", "MozBorderRadius", "webkitBorderRadius"]),
boxShadow: a(["boxShadow", "MozBoxShadow", "webkitBoxShadow"])
}, function (e, t, n) {
switch (t.toLowerCase()) {
case"opacity":
var r = Math.round(100 * parseFloat(n));
e.style.opacity = n, e.style.filter = "alpha(opacity=" + r + ")";
break;
default:
e.style[o[t]] = n
}
}),
setBorderRadius: function (e, t) {
l.setStyle(e, "borderRadius", t || "0")
},
setBoxShadow: function (e, t) {
l.setStyle(e, "boxShadow", t || "none")
},
getElementPos: function (e, t) {
var n = 0, r = 0, i = e.getBoundingClientRect();
if (n = i.left, r = i.top, !t) {
var a = l.getViewPos();
n += a[0], r += a[1]
}
return [n, r]
},
getElementSize: function (e) {
return [e.offsetWidth, e.offsetHeight]
},
getAbsPointerPos: function (e) {
e || (e = window.event);
var t = 0, n = 0;
return void 0 !== e.changedTouches && e.changedTouches.length ? (t = e.changedTouches[0].clientX, n = e.changedTouches[0].clientY) : "number" == typeof e.clientX && (t = e.clientX, n = e.clientY), {
x: t,
y: n
}
},
getRelPointerPos: function (e) {
e || (e = window.event);
var t = (e.target || e.srcElement).getBoundingClientRect(), n = 0, r = 0;
return void 0 !== e.changedTouches && e.changedTouches.length ? (n = e.changedTouches[0].clientX, r = e.changedTouches[0].clientY) : "number" == typeof e.clientX && (n = e.clientX, r = e.clientY), {
x: n - t.left,
y: r - t.top
}
},
getViewPos: function () {
var e = document.documentElement;
return [(window.pageXOffset || e.scrollLeft) - (e.clientLeft || 0), (window.pageYOffset || e.scrollTop) - (e.clientTop || 0)]
},
getViewSize: function () {
var e = document.documentElement;
return [window.innerWidth || e.clientWidth, window.innerHeight || e.clientHeight]
},
redrawPosition: function () {
if (l.picker && l.picker.owner) {
var e, t, n = l.picker.owner;
n.fixed ? (e = l.getElementPos(n.targetElement, !0), t = [0, 0]) : (e = l.getElementPos(n.targetElement), t = l.getViewPos());
var r, i, a, o = l.getElementSize(n.targetElement), s = l.getViewSize(), c = l.getPickerOuterDims(n);
switch (n.position.toLowerCase()) {
case"left":
r = 1, i = 0, a = -1;
break;
case"right":
r = 1, i = 0, a = 1;
break;
case"top":
r = 0, i = 1, a = -1;
break;
default:
r = 0, i = 1, a = 1
}
var u = (o[i] + c[i]) / 2;
if (n.smartPosition) d = [-t[r] + e[r] + c[r] > s[r] && -t[r] + e[r] + o[r] / 2 > s[r] / 2 && e[r] + o[r] - c[r] >= 0 ? e[r] + o[r] - c[r] : e[r], -t[i] + e[i] + o[i] + c[i] - u + u * a > s[i] ? -t[i] + e[i] + o[i] / 2 > s[i] / 2 && e[i] + o[i] - u - u * a >= 0 ? e[i] + o[i] - u - u * a : e[i] + o[i] - u + u * a : e[i] + o[i] - u + u * a >= 0 ? e[i] + o[i] - u + u * a : e[i] + o[i] - u - u * a]; else var d = [e[r], e[i] + o[i] - u + u * a];
var h = d[r], p = d[i], f = n.fixed ? "fixed" : "absolute",
m = (d[0] + c[0] > e[0] || d[0] < e[0] + o[0]) && d[1] + c[1] < e[1] + o[1];
l._drawPosition(n, h, p, f, m)
}
},
_drawPosition: function (e, t, n, r, i) {
var a = i ? 0 : e.shadowBlur;
l.picker.wrap.style.position = r, l.picker.wrap.style.left = t + "px", l.picker.wrap.style.top = n + "px", l.setBoxShadow(l.picker.boxS, e.shadow ? new l.BoxShadow(0, a, e.shadowBlur, 0, e.shadowColor) : null)
},
getPickerDims: function (e) {
var t = !!l.getSliderComponent(e);
return [2 * e.insetWidth + 2 * e.padding + e.width + (t ? 2 * e.insetWidth + l.getPadToSliderPadding(e) + e.sliderSize : 0), 2 * e.insetWidth + 2 * e.padding + e.height + (e.closable ? 2 * e.insetWidth + e.padding + e.buttonHeight : 0)]
},
getPickerOuterDims: function (e) {
var t = l.getPickerDims(e);
return [t[0] + 2 * e.borderWidth, t[1] + 2 * e.borderWidth]
},
getPadToSliderPadding: function (e) {
return Math.max(e.padding, 1.5 * (2 * e.pointerBorderWidth + e.pointerThickness))
},
getPadYComponent: function (e) {
switch (e.mode.charAt(1).toLowerCase()) {
case"v":
return "v"
}
return "s"
},
getSliderComponent: function (e) {
if (e.mode.length > 2) switch (e.mode.charAt(2).toLowerCase()) {
case"s":
return "s";
case"v":
return "v"
}
return null
},
onDocumentMouseDown: function (e) {
e || (e = window.event);
var t = e.target || e.srcElement;
t._jscLinkedInstance ? t._jscLinkedInstance.showOnClick && t._jscLinkedInstance.show() : t._jscControlName ? l.onControlPointerStart(e, t, t._jscControlName, "mouse") : l.picker && l.picker.owner && l.picker.owner.hide()
},
onDocumentTouchStart: function (e) {
e || (e = window.event);
var t = e.target || e.srcElement;
t._jscLinkedInstance ? t._jscLinkedInstance.showOnClick && t._jscLinkedInstance.show() : t._jscControlName ? l.onControlPointerStart(e, t, t._jscControlName, "touch") : l.picker && l.picker.owner && l.picker.owner.hide()
},
onWindowResize: function (e) {
l.redrawPosition()
},
onParentScroll: function (e) {
l.picker && l.picker.owner && l.picker.owner.hide()
},
_pointerMoveEvent: {mouse: "mousemove", touch: "touchmove"},
_pointerEndEvent: {mouse: "mouseup", touch: "touchend"},
_pointerOrigin: null,
_capturedTarget: null,
onControlPointerStart: function (e, t, n, r) {
var i = t._jscInstance;
l.preventDefault(e), l.captureTarget(t);
var a = function (i, a) {
l.attachGroupEvent("drag", i, l._pointerMoveEvent[r], l.onDocumentPointerMove(e, t, n, r, a)), l.attachGroupEvent("drag", i, l._pointerEndEvent[r], l.onDocumentPointerEnd(e, t, n, r))
};
if (a(document, [0, 0]), window.parent && window.frameElement) {
var o = window.frameElement.getBoundingClientRect(), s = [-o.left, -o.top];
a(window.parent.window.document, s)
}
var c = l.getAbsPointerPos(e), u = l.getRelPointerPos(e);
switch (l._pointerOrigin = {x: c.x - u.x, y: c.y - u.y}, n) {
case"pad":
switch (l.getSliderComponent(i)) {
case"s":
0 === i.hsv[1] && i.fromHSV(null, 100, null);
break;
case"v":
0 === i.hsv[2] && i.fromHSV(null, null, 100)
}
l.setPad(i, e, 0, 0);
break;
case"sld":
l.setSld(i, e, 0)
}
l.dispatchFineChange(i)
},
onDocumentPointerMove: function (e, t, n, r, i) {
return function (e) {
var r = t._jscInstance;
switch (n) {
case"pad":
e || (e = window.event), l.setPad(r, e, i[0], i[1]), l.dispatchFineChange(r);
break;
case"sld":
e || (e = window.event), l.setSld(r, e, i[1]), l.dispatchFineChange(r)
}
}
},
onDocumentPointerEnd: function (e, t, n, r) {
return function (e) {
var n = t._jscInstance;
l.detachGroupEvents("drag"), l.releaseTarget(), l.dispatchChange(n)
}
},
dispatchChange: function (e) {
e.valueElement && l.isElementType(e.valueElement, "input") && l.fireEvent(e.valueElement, "change")
},
dispatchFineChange: function (e) {
e.onFineChange && ("string" == typeof e.onFineChange ? new Function(e.onFineChange) : e.onFineChange).call(e)
},
setPad: function (e, t, n, r) {
var i = l.getAbsPointerPos(t), a = n + i.x - l._pointerOrigin.x - e.padding - e.insetWidth,
o = r + i.y - l._pointerOrigin.y - e.padding - e.insetWidth, s = a * (360 / (e.width - 1)),
c = 100 - o * (100 / (e.height - 1));
switch (l.getPadYComponent(e)) {
case"s":
e.fromHSV(s, c, null, l.leaveSld);
break;
case"v":
e.fromHSV(s, null, c, l.leaveSld)
}
},
setSld: function (e, t, n) {
var r = 100 - (n + l.getAbsPointerPos(t).y - l._pointerOrigin.y - e.padding - e.insetWidth) * (100 / (e.height - 1));
switch (l.getSliderComponent(e)) {
case"s":
e.fromHSV(null, r, null, l.leavePad);
break;
case"v":
e.fromHSV(null, null, r, l.leavePad)
}
},
_vmlNS: "jsc_vml_",
_vmlCSS: "jsc_vml_css_",
_vmlReady: !1,
initVML: function () {
if (!l._vmlReady) {
var e = document;
if (e.namespaces[l._vmlNS] || e.namespaces.add(l._vmlNS, "urn:schemas-microsoft-com:vml"), !e.styleSheets[l._vmlCSS]) {
var t = ["shape", "shapetype", "group", "background", "path", "formulas", "handles", "fill", "stroke", "shadow", "textbox", "textpath", "imagedata", "line", "polyline", "curve", "rect", "roundrect", "oval", "arc", "image"],
n = e.createStyleSheet();
n.owningElement.id = l._vmlCSS;
for (var r = 0; r < t.length; r += 1) n.addRule(l._vmlNS + "\\:" + t[r], "behavior:url(#default#VML);")
}
l._vmlReady = !0
}
},
createPalette: function () {
var e = {elm: null, draw: null};
if (l.isCanvasSupported) {
var t = document.createElement("canvas"), n = t.getContext("2d"), r = function (e, r, i) {
t.width = e, t.height = r, n.clearRect(0, 0, t.width, t.height);
var a = n.createLinearGradient(0, 0, t.width, 0);
a.addColorStop(0, "#F00"), a.addColorStop(1 / 6, "#FF0"), a.addColorStop(2 / 6, "#0F0"), a.addColorStop(.5, "#0FF"), a.addColorStop(4 / 6, "#00F"), a.addColorStop(5 / 6, "#F0F"), a.addColorStop(1, "#F00"), n.fillStyle = a, n.fillRect(0, 0, t.width, t.height);
var o = n.createLinearGradient(0, 0, 0, t.height);
switch (i.toLowerCase()) {
case"s":
o.addColorStop(0, "rgba(255,255,255,0)"), o.addColorStop(1, "rgba(255,255,255,1)");
break;
case"v":
o.addColorStop(0, "rgba(0,0,0,0)"), o.addColorStop(1, "rgba(0,0,0,1)")
}
n.fillStyle = o, n.fillRect(0, 0, t.width, t.height)
};
e.elm = t, e.draw = r
} else {
l.initVML();
var i = document.createElement("div");
i.style.position = "relative", i.style.overflow = "hidden";
var a = document.createElement(l._vmlNS + ":fill");
a.type = "gradient", a.method = "linear", a.angle = "90", a.colors = "16.67% #F0F, 33.33% #00F, 50% #0FF, 66.67% #0F0, 83.33% #FF0";
var o = document.createElement(l._vmlNS + ":rect");
o.style.position = "absolute", o.style.left = "-1px", o.style.top = "-1px", o.stroked = !1, o.appendChild(a), i.appendChild(o);
var s = document.createElement(l._vmlNS + ":fill");
s.type = "gradient", s.method = "linear", s.angle = "180", s.opacity = "0";
var c = document.createElement(l._vmlNS + ":rect");
c.style.position = "absolute", c.style.left = "-1px", c.style.top = "-1px", c.stroked = !1, c.appendChild(s), i.appendChild(c);
r = function (e, t, n) {
switch (i.style.width = e + "px", i.style.height = t + "px", o.style.width = c.style.width = e + 1 + "px", o.style.height = c.style.height = t + 1 + "px", a.color = "#F00", a.color2 = "#F00", n.toLowerCase()) {
case"s":
s.color = s.color2 = "#FFF";
break;
case"v":
s.color = s.color2 = "#000"
}
};
e.elm = i, e.draw = r
}
return e
},
createSliderGradient: function () {
var e = {elm: null, draw: null};
if (l.isCanvasSupported) {
var t = document.createElement("canvas"), n = t.getContext("2d"), r = function (e, r, i, a) {
t.width = e, t.height = r, n.clearRect(0, 0, t.width, t.height);
var o = n.createLinearGradient(0, 0, 0, t.height);
o.addColorStop(0, i), o.addColorStop(1, a), n.fillStyle = o, n.fillRect(0, 0, t.width, t.height)
};
e.elm = t, e.draw = r
} else {
l.initVML();
var i = document.createElement("div");
i.style.position = "relative", i.style.overflow = "hidden";
var a = document.createElement(l._vmlNS + ":fill");
a.type = "gradient", a.method = "linear", a.angle = "180";
var o = document.createElement(l._vmlNS + ":rect");
o.style.position = "absolute", o.style.left = "-1px", o.style.top = "-1px", o.stroked = !1, o.appendChild(a), i.appendChild(o);
r = function (e, t, n, r) {
i.style.width = e + "px", i.style.height = t + "px", o.style.width = e + 1 + "px", o.style.height = t + 1 + "px", a.color = n, a.color2 = r
};
e.elm = i, e.draw = r
}
return e
},
leaveValue: 1,
leaveStyle: 2,
leavePad: 4,
leaveSld: 8,
BoxShadow: (r = function (e, t, n, r, i, a) {
this.hShadow = e, this.vShadow = t, this.blur = n, this.spread = r, this.color = i, this.inset = !!a
}, r.prototype.toString = function () {
var e = [Math.round(this.hShadow) + "px", Math.round(this.vShadow) + "px", Math.round(this.blur) + "px", Math.round(this.spread) + "px", this.color];
return this.inset && e.push("inset"), e.join(" ")
}, r),
jscolor: function (e, t) {
for (var n in this.value = null, this.valueElement = e, this.styleElement = e, this.required = !0, this.refine = !0, this.hash = !1, this.uppercase = !0, this.onFineChange = null, this.activeClass = "jscolor-active", this.overwriteImportant = !1, this.minS = 0, this.maxS = 100, this.minV = 0, this.maxV = 100, this.hsv = [0, 0, 100], this.rgb = [255, 255, 255], this.width = 181, this.height = 101, this.showOnClick = !0, this.mode = "HSV", this.position = "bottom", this.smartPosition = !0, this.sliderSize = 16, this.crossSize = 8, this.closable = !1, this.closeText = "Close", this.buttonColor = "#000000", this.buttonHeight = 18, this.padding = 12, this.backgroundColor = "#FFFFFF", this.borderWidth = 1, this.borderColor = "#BBBBBB", this.borderRadius = 8, this.insetWidth = 1, this.insetColor = "#BBBBBB", this.shadow = !0, this.shadowBlur = 15, this.shadowColor = "rgba(0,0,0,0.2)", this.pointerColor = "#4C4C4C", this.pointerBorderColor = "#FFFFFF", this.pointerBorderWidth = 1, this.pointerThickness = 2, this.zIndex = 5e4, this.container = null, t) t.hasOwnProperty(n) && (this[n] = t[n]);
function r(e, t, n) {
var r = n / 100 * 255;
if (null === e) return [r, r, r];
e /= 60, t /= 100;
var i = Math.floor(e), a = r * (1 - t), o = r * (1 - t * (i % 2 ? e - i : 1 - (e - i)));
switch (i) {
case 6:
case 0:
return [r, o, a];
case 1:
return [o, r, a];
case 2:
return [a, r, o];
case 3:
return [a, o, r];
case 4:
return [o, a, r];
case 5:
return [r, a, o]
}
}
function i() {
d._processParentElementsInDOM(), l.picker || (l.picker = {
owner: null,
wrap: document.createElement("div"),
box: document.createElement("div"),
boxS: document.createElement("div"),
boxB: document.createElement("div"),
pad: document.createElement("div"),
padB: document.createElement("div"),
padM: document.createElement("div"),
padPal: l.createPalette(),
cross: document.createElement("div"),
crossBY: document.createElement("div"),
crossBX: document.createElement("div"),
crossLY: document.createElement("div"),
crossLX: document.createElement("div"),
sld: document.createElement("div"),
sldB: document.createElement("div"),
sldM: document.createElement("div"),
sldGrad: l.createSliderGradient(),
sldPtrS: document.createElement("div"),
sldPtrIB: document.createElement("div"),
sldPtrMB: document.createElement("div"),
sldPtrOB: document.createElement("div"),
btn: document.createElement("div"),
btnT: document.createElement("span")
}, l.picker.pad.appendChild(l.picker.padPal.elm), l.picker.padB.appendChild(l.picker.pad), l.picker.cross.appendChild(l.picker.crossBY), l.picker.cross.appendChild(l.picker.crossBX), l.picker.cross.appendChild(l.picker.crossLY), l.picker.cross.appendChild(l.picker.crossLX), l.picker.padB.appendChild(l.picker.cross), l.picker.box.appendChild(l.picker.padB), l.picker.box.appendChild(l.picker.padM), l.picker.sld.appendChild(l.picker.sldGrad.elm), l.picker.sldB.appendChild(l.picker.sld), l.picker.sldB.appendChild(l.picker.sldPtrOB), l.picker.sldPtrOB.appendChild(l.picker.sldPtrMB), l.picker.sldPtrMB.appendChild(l.picker.sldPtrIB), l.picker.sldPtrIB.appendChild(l.picker.sldPtrS), l.picker.box.appendChild(l.picker.sldB), l.picker.box.appendChild(l.picker.sldM), l.picker.btn.appendChild(l.picker.btnT), l.picker.box.appendChild(l.picker.btn), l.picker.boxB.appendChild(l.picker.box), l.picker.wrap.appendChild(l.picker.boxS), l.picker.wrap.appendChild(l.picker.boxB));
var e, t, n = l.picker, r = !!l.getSliderComponent(d), i = l.getPickerDims(d),
s = 2 * d.pointerBorderWidth + d.pointerThickness + 2 * d.crossSize, c = l.getPadToSliderPadding(d),
u = Math.min(d.borderRadius, Math.round(d.padding * Math.PI));
n.wrap.style.clear = "both", n.wrap.style.width = i[0] + 2 * d.borderWidth + "px", n.wrap.style.height = i[1] + 2 * d.borderWidth + "px", n.wrap.style.zIndex = d.zIndex, n.box.style.width = i[0] + "px", n.box.style.height = i[1] + "px", n.boxS.style.position = "absolute", n.boxS.style.left = "0", n.boxS.style.top = "0", n.boxS.style.width = "100%", n.boxS.style.height = "100%", l.setBorderRadius(n.boxS, u + "px"), n.boxB.style.position = "relative", n.boxB.style.border = d.borderWidth + "px solid", n.boxB.style.borderColor = d.borderColor, n.boxB.style.background = d.backgroundColor, l.setBorderRadius(n.boxB, u + "px"), n.padM.style.background = n.sldM.style.background = "#FFF", l.setStyle(n.padM, "opacity", "0"), l.setStyle(n.sldM, "opacity", "0"), n.pad.style.position = "relative", n.pad.style.width = d.width + "px", n.pad.style.height = d.height + "px", n.padPal.draw(d.width, d.height, l.getPadYComponent(d)), n.padB.style.position = "absolute", n.padB.style.left = d.padding + "px", n.padB.style.top = d.padding + "px", n.padB.style.border = d.insetWidth + "px solid", n.padB.style.borderColor = d.insetColor, n.padM._jscInstance = d, n.padM._jscControlName = "pad", n.padM.style.position = "absolute", n.padM.style.left = "0", n.padM.style.top = "0", n.padM.style.width = d.padding + 2 * d.insetWidth + d.width + c / 2 + "px", n.padM.style.height = i[1] + "px", n.padM.style.cursor = "crosshair", n.cross.style.position = "absolute", n.cross.style.left = n.cross.style.top = "0", n.cross.style.width = n.cross.style.height = s + "px", n.crossBY.style.position = n.crossBX.style.position = "absolute", n.crossBY.style.background = n.crossBX.style.background = d.pointerBorderColor, n.crossBY.style.width = n.crossBX.style.height = 2 * d.pointerBorderWidth + d.pointerThickness + "px", n.crossBY.style.height = n.crossBX.style.width = s + "px", n.crossBY.style.left = n.crossBX.style.top = Math.floor(s / 2) - Math.floor(d.pointerThickness / 2) - d.pointerBorderWidth + "px", n.crossBY.style.top = n.crossBX.style.left = "0", n.crossLY.style.position = n.crossLX.style.position = "absolute", n.crossLY.style.background = n.crossLX.style.background = d.pointerColor, n.crossLY.style.height = n.crossLX.style.width = s - 2 * d.pointerBorderWidth + "px", n.crossLY.style.width = n.crossLX.style.height = d.pointerThickness + "px", n.crossLY.style.left = n.crossLX.style.top = Math.floor(s / 2) - Math.floor(d.pointerThickness / 2) + "px", n.crossLY.style.top = n.crossLX.style.left = d.pointerBorderWidth + "px", n.sld.style.overflow = "hidden", n.sld.style.width = d.sliderSize + "px", n.sld.style.height = d.height + "px", n.sldGrad.draw(d.sliderSize, d.height, "#000", "#000"), n.sldB.style.display = r ? "block" : "none", n.sldB.style.position = "absolute", n.sldB.style.right = d.padding + "px", n.sldB.style.top = d.padding + "px", n.sldB.style.border = d.insetWidth + "px solid", n.sldB.style.borderColor = d.insetColor, n.sldM._jscInstance = d, n.sldM._jscControlName = "sld", n.sldM.style.display = r ? "block" : "none", n.sldM.style.position = "absolute", n.sldM.style.right = "0", n.sldM.style.top = "0", n.sldM.style.width = d.sliderSize + c / 2 + d.padding + 2 * d.insetWidth + "px", n.sldM.style.height = i[1] + "px", n.sldM.style.cursor = "default", n.sldPtrIB.style.border = n.sldPtrOB.style.border = d.pointerBorderWidth + "px solid " + d.pointerBorderColor, n.sldPtrOB.style.position = "absolute", n.sldPtrOB.style.left = -(2 * d.pointerBorderWidth + d.pointerThickness) + "px", n.sldPtrOB.style.top = "0", n.sldPtrMB.style.border = d.pointerThickness + "px solid " + d.pointerColor, n.sldPtrS.style.width = d.sliderSize + "px", n.sldPtrS.style.height = p + "px", n.btn.style.display = d.closable ? "block" : "none", n.btn.style.position = "absolute", n.btn.style.left = d.padding + "px", n.btn.style.bottom = d.padding + "px", n.btn.style.padding = "0 15px", n.btn.style.height = d.buttonHeight + "px", n.btn.style.border = d.insetWidth + "px solid", e = d.insetColor.split(/\s+/), t = e.length < 2 ? e[0] : e[1] + " " + e[0] + " " + e[0] + " " + e[1], n.btn.style.borderColor = t, n.btn.style.color = d.buttonColor, n.btn.style.font = "12px sans-serif", n.btn.style.textAlign = "center";
try {
n.btn.style.cursor = "pointer"
} catch (e) {
n.btn.style.cursor = "hand"
}
n.btn.onmousedown = function () {
d.hide()
}, n.btnT.style.lineHeight = d.buttonHeight + "px", n.btnT.innerHTML = "", n.btnT.appendChild(document.createTextNode(d.closeText)), a(), o(), l.picker.owner && l.picker.owner !== d && l.unsetClass(l.picker.owner.targetElement, d.activeClass), l.picker.owner = d, l.isElementType(h, "body") ? l.redrawPosition() : l._drawPosition(d, 0, 0, "relative", !1), n.wrap.parentNode != h && h.appendChild(n.wrap), l.setClass(d.targetElement, d.activeClass)
}
function a() {
switch (l.getPadYComponent(d)) {
case"s":
var e = 1;
break;
case"v":
e = 2
}
var t = Math.round(d.hsv[0] / 360 * (d.width - 1)), n = Math.round((1 - d.hsv[e] / 100) * (d.height - 1)),
i = 2 * d.pointerBorderWidth + d.pointerThickness + 2 * d.crossSize, a = -Math.floor(i / 2);
switch (l.picker.cross.style.left = t + a + "px", l.picker.cross.style.top = n + a + "px", l.getSliderComponent(d)) {
case"s":
var o = r(d.hsv[0], 100, d.hsv[2]), s = r(d.hsv[0], 0, d.hsv[2]),
c = "rgb(" + Math.round(o[0]) + "," + Math.round(o[1]) + "," + Math.round(o[2]) + ")",
u = "rgb(" + Math.round(s[0]) + "," + Math.round(s[1]) + "," + Math.round(s[2]) + ")";
l.picker.sldGrad.draw(d.sliderSize, d.height, c, u);
break;
case"v":
var h = r(d.hsv[0], d.hsv[1], 100);
c = "rgb(" + Math.round(h[0]) + "," + Math.round(h[1]) + "," + Math.round(h[2]) + ")", u = "#000";
l.picker.sldGrad.draw(d.sliderSize, d.height, c, u)
}
}
function o() {
var e = l.getSliderComponent(d);
if (e) {
switch (e) {
case"s":
var t = 1;
break;
case"v":
t = 2
}
var n = Math.round((1 - d.hsv[t] / 100) * (d.height - 1));
l.picker.sldPtrOB.style.top = n - (2 * d.pointerBorderWidth + d.pointerThickness) - Math.floor(p / 2) + "px"
}
}
function s() {
return l.picker && l.picker.owner === d
}
if (this.hide = function () {
s() && (l.unsetClass(d.targetElement, d.activeClass), l.picker.wrap.parentNode.removeChild(l.picker.wrap), delete l.picker.owner)
}, this.show = function () {
i()
}, this.redraw = function () {
s() && i()
}, this.importColor = function () {
this.valueElement && l.isElementType(this.valueElement, "input") ? this.refine ? !this.required && /^\s*$/.test(this.valueElement.value) ? (this.valueElement.value = "", this.styleElement && (this.styleElement.style.backgroundImage = this.styleElement._jscOrigStyle.backgroundImage, this.styleElement.style.backgroundColor = this.styleElement._jscOrigStyle.backgroundColor, this.styleElement.style.color = this.styleElement._jscOrigStyle.color), this.exportColor(l.leaveValue | l.leaveStyle)) : this.fromString(this.valueElement.value) || this.exportColor() : this.fromString(this.valueElement.value, l.leaveValue) || (this.styleElement && (this.styleElement.style.backgroundImage = this.styleElement._jscOrigStyle.backgroundImage, this.styleElement.style.backgroundColor = this.styleElement._jscOrigStyle.backgroundColor, this.styleElement.style.color = this.styleElement._jscOrigStyle.color), this.exportColor(l.leaveValue | l.leaveStyle)) : this.exportColor()
}, this.exportColor = function (e) {
if (!(e & l.leaveValue) && this.valueElement) {
var t = this.toString();
this.uppercase && (t = t.toUpperCase()), this.hash && (t = "#" + t), l.isElementType(this.valueElement, "input") ? this.valueElement.value = t : this.valueElement.innerHTML = t
}
if (!(e & l.leaveStyle) && this.styleElement) {
var n = "#" + this.toString();
this.styleElement.style.backgroundImage = "none", this.styleElement.style.backgroundColor = n, this.styleElement.style.color = "transparent", this.overwriteImportant && this.styleElement.setAttribute("style", "background: " + n + " !important; color: transparent !important;")
}
e & l.leavePad || !s() || a(), e & l.leaveSld || !s() || o()
}, this.fromHSV = function (e, t, n, i) {
if (null !== e) {
if (isNaN(e)) return !1;
e = Math.max(0, Math.min(360, e))
}
if (null !== t) {
if (isNaN(t)) return !1;
t = Math.max(0, Math.min(100, this.maxS, t), this.minS)
}
if (null !== n) {
if (isNaN(n)) return !1;
n = Math.max(0, Math.min(100, this.maxV, n), this.minV)
}
this.rgb = r(null === e ? this.hsv[0] : this.hsv[0] = e, null === t ? this.hsv[1] : this.hsv[1] = t, null === n ? this.hsv[2] : this.hsv[2] = n), this.exportColor(i)
}, this.fromRGB = function (e, t, n, i) {
if (null !== e) {
if (isNaN(e)) return !1;
e = Math.max(0, Math.min(255, e))
}
if (null !== t) {
if (isNaN(t)) return !1;
t = Math.max(0, Math.min(255, t))
}
if (null !== n) {
if (isNaN(n)) return !1;
n = Math.max(0, Math.min(255, n))
}
var a = function (e, t, n) {
e /= 255, t /= 255, n /= 255;
var r = Math.min(Math.min(e, t), n), i = Math.max(Math.max(e, t), n), a = i - r;
if (0 === a) return [null, 0, 100 * i];
var o = e === r ? 3 + (n - t) / a : t === r ? 5 + (e - n) / a : 1 + (t - e) / a;
return [60 * (6 === o ? 0 : o), a / i * 100, 100 * i]
}(null === e ? this.rgb[0] : e, null === t ? this.rgb[1] : t, null === n ? this.rgb[2] : n);
null !== a[0] && (this.hsv[0] = Math.max(0, Math.min(360, a[0]))), 0 !== a[2] && (this.hsv[1] = null === a[1] ? null : Math.max(0, this.minS, Math.min(100, this.maxS, a[1]))), this.hsv[2] = null === a[2] ? null : Math.max(0, this.minV, Math.min(100, this.maxV, a[2]));
var o = r(this.hsv[0], this.hsv[1], this.hsv[2]);
this.rgb[0] = o[0], this.rgb[1] = o[1], this.rgb[2] = o[2], this.exportColor(i)
}, this.fromString = function (e, t) {
var n;
if (n = e.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i)) return 6 === n[1].length ? this.fromRGB(parseInt(n[1].substr(0, 2), 16), parseInt(n[1].substr(2, 2), 16), parseInt(n[1].substr(4, 2), 16), t) : this.fromRGB(parseInt(n[1].charAt(0) + n[1].charAt(0), 16), parseInt(n[1].charAt(1) + n[1].charAt(1), 16), parseInt(n[1].charAt(2) + n[1].charAt(2), 16), t), !0;
if (n = e.match(/^\W*rgba?\(([^)]*)\)\W*$/i)) {
var r, i, a, o = n[1].split(","), s = /^\s*(\d*)(\.\d+)?\s*$/;
if (o.length >= 3 && (r = o[0].match(s)) && (i = o[1].match(s)) && (a = o[2].match(s))) {
var l = parseFloat((r[1] || "0") + (r[2] || "")), c = parseFloat((i[1] || "0") + (i[2] || "")),
u = parseFloat((a[1] || "0") + (a[2] || ""));
return this.fromRGB(l, c, u, t), !0
}
}
return !1
}, this.toString = function () {
return (256 | Math.round(this.rgb[0])).toString(16).substr(1) + (256 | Math.round(this.rgb[1])).toString(16).substr(1) + (256 | Math.round(this.rgb[2])).toString(16).substr(1)
}, this.toHEXString = function () {
return "#" + this.toString().toUpperCase()
}, this.toRGBString = function () {
return "rgb(" + Math.round(this.rgb[0]) + "," + Math.round(this.rgb[1]) + "," + Math.round(this.rgb[2]) + ")"
}, this.isLight = function () {
return .213 * this.rgb[0] + .715 * this.rgb[1] + .072 * this.rgb[2] > 127.5
}, this._processParentElementsInDOM = function () {
if (!this._linkedElementsProcessed) {
this._linkedElementsProcessed = !0;
var e = this.targetElement;
do {
var t = l.getStyle(e);
t && "fixed" === t.position.toLowerCase() && (this.fixed = !0), e !== this.targetElement && (e._jscEventsAttached || (l.attachEvent(e, "scroll", l.onParentScroll), e._jscEventsAttached = !0))
} while ((e = e.parentNode) && !l.isElementType(e, "body"))
}
}, "string" == typeof e) {
var c = e, u = document.getElementById(c);
u ? this.targetElement = u : l.warn("Could not find target element with ID '" + c + "'")
} else e ? this.targetElement = e : l.warn("Invalid target element: '" + e + "'");
if (this.targetElement._jscLinkedInstance) l.warn("Cannot link jscolor twice to the same element. Skipping."); else {
this.targetElement._jscLinkedInstance = this, this.valueElement = l.fetchElement(this.valueElement), this.styleElement = l.fetchElement(this.styleElement);
var d = this, h = this.container ? l.fetchElement(this.container) : document.getElementsByTagName("body")[0],
p = 3;
if (l.isElementType(this.targetElement, "button")) if (this.targetElement.onclick) {
var f = this.targetElement.onclick;
this.targetElement.onclick = function (e) {
return f.call(this, e), !1
}
} else this.targetElement.onclick = function () {
return !1
};
if (this.valueElement && l.isElementType(this.valueElement, "input")) {
var m = function () {
d.fromString(d.valueElement.value, l.leaveValue), l.dispatchFineChange(d)
};
l.attachEvent(this.valueElement, "keyup", m), l.attachEvent(this.valueElement, "input", m), l.attachEvent(this.valueElement, "blur", function () {
d.importColor()
}), this.valueElement.setAttribute("autocomplete", "off")
}
this.styleElement && (this.styleElement._jscOrigStyle = {
backgroundImage: this.styleElement.style.backgroundImage,
backgroundColor: this.styleElement.style.backgroundColor,
color: this.styleElement.style.color
}), this.value ? this.fromString(this.value) || this.exportColor() : this.importColor()
}
}
}).jscolor.lookupClass = "jscolor", l.jscolor.installByClassName = function (e) {
var t = document.getElementsByTagName("input"), n = document.getElementsByTagName("button");
l.tryInstallOnElements(t, e), l.tryInstallOnElements(n, e)
}, l.register(), l.jscolor))
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.GenericCom = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(120), a = n(471), o = n(472), s = n(473), l = n(14);
var c = function (e) {
function t() {
return function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, t), function (e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return function (e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(t, a.BasePreferences), r(t, [{
key: "_writeToStorage", value: function (e) {
return new Promise(function (t) {
localStorage.setItem("pdfjs.preferences", JSON.stringify(e)), t()
})
}
}, {
key: "_readFromStorage", value: function (e) {
return new Promise(function (e) {
e(JSON.parse(localStorage.getItem("pdfjs.preferences")))
})
}
}]), t
}(), u = Object.create(i.DefaultExternalServices);
u.createDownloadManager = function () {
return new o.DownloadManager
}, u.createPreferences = function () {
return new c
}, u.createL10n = function () {
return new s.GenericL10n(l.PDFJS.locale)
}, i.PDFViewerApplication.externalServices = u, t.GenericCom = {}
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.BasePreferences = void 0;
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
return typeof e
} : function (e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}, i = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), a = n(9);
var o = null;
var s = function () {
function e() {
var t = this;
if (function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this.constructor === e) throw new Error("Cannot initialize BasePreferences.");
this.prefs = null, this._initializedPromise = (o || (o = Promise.resolve({
showPreviousViewOnLoad: !0,
defaultZoomValue: "",
sidebarViewOnLoad: 0,
enableHandToolOnLoad: !1,
cursorToolOnLoad: 0,
enableWebGL: !1,
pdfBugEnabled: !1,
disableRange: !1,
disableStream: !1,
disableAutoFetch: !1,
disableFontFace: !1,
disableTextLayer: !1,
useOnlyCssZoom: !1,
externalLinkTarget: 0,
enhanceTextSelection: !1,
renderer: "canvas",
renderInteractiveForms: !1,
enablePrintAutoRotate: !1,
disablePageMode: !1,
disablePageLabels: !1
})), o).then(function (e) {
return !0 === window.KGPdfViewerWebApp.useTextWidget && (e.renderInteractiveForms = !0), Object.defineProperty(t, "defaults", {
value: Object.freeze(e),
writable: !1,
enumerable: !0,
configurable: !1
}), t.prefs = (0, a.cloneObj)(e), t._readFromStorage(e)
}).then(function (e) {
e && (t.prefs = e)
})
}
return i(e, [{
key: "_writeToStorage", value: function (e) {
return Promise.reject(new Error("Not implemented: _writeToStorage"))
}
}, {
key: "_readFromStorage", value: function (e) {
return Promise.reject(new Error("Not implemented: _readFromStorage"))
}
}, {
key: "reset", value: function () {
var e = this;
return this._initializedPromise.then(function () {
return e.prefs = (0, a.cloneObj)(e.defaults), e._writeToStorage(e.defaults)
})
}
}, {
key: "reload", value: function () {
var e = this;
return this._initializedPromise.then(function () {
return e._readFromStorage(e.defaults)
}).then(function (t) {
t && (e.prefs = t)
})
}
}, {
key: "set", value: function (e, t) {
var n = this;
return this._initializedPromise.then(function () {
if (void 0 === n.defaults[e]) throw new Error('Set preference: "' + e + '" is undefined.');
if (void 0 === t) throw new Error("Set preference: no value is specified.");
var i = void 0 === t ? "undefined" : r(t), a = r(n.defaults[e]);
if (i !== a) {
if ("number" !== i || "string" !== a) throw new Error('Set preference: "' + t + '" is a ' + i + ", expected a " + a + ".");
t = t.toString()
} else if ("number" === i && !Number.isInteger(t)) throw new Error('Set preference: "' + t + '" must be an integer.');
return n.prefs[e] = t, n._writeToStorage(n.prefs)
})
}
}, {
key: "get", value: function (e) {
var t = this;
return this._initializedPromise.then(function () {
var n = t.defaults[e];
if (void 0 === n) throw new Error('Get preference: "' + e + '" is undefined.');
var r = t.prefs[e];
return void 0 !== r ? r : n
})
}
}]), e
}();
t.BasePreferences = s
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.DownloadManager = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}(), i = n(14);
function a(e, t) {
var n = document.createElement("a");
if (n.click) n.href = e, n.target = "_parent", "download" in n && (n.download = t), (document.body || document.documentElement).appendChild(n), n.click(), n.parentNode.removeChild(n); else {
if (window.top === window && e.split("#")[0] === window.location.href.split("#")[0]) {
var r = -1 === e.indexOf("?") ? "?" : "&";
e = e.replace(/#|$/, r + "$&")
}
window.open(e, "_parent")
}
}
var o = function () {
function e() {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e)
}
return r(e, [{
key: "downloadUrl", value: function (e, t) {
(0, i.createValidAbsoluteUrl)(e, "http://example.com") && a(e + "#pdfjs.action=download", t)
}
}, {
key: "downloadData", value: function (e, t, n) {
if (navigator.msSaveBlob) return navigator.msSaveBlob(new Blob([e], {type: n}), t);
a((0, i.createObjectURL)(e, n, i.PDFJS.disableCreateObjectURL), t)
}
}, {
key: "download", value: function (e, t, n) {
navigator.msSaveBlob ? navigator.msSaveBlob(e, n) || this.downloadUrl(t, n) : i.PDFJS.disableCreateObjectURL ? this.downloadUrl(t, n) : a(URL.createObjectURL(e), n)
}
}]), e
}();
t.DownloadManager = o
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.GenericL10n = void 0;
var r = function () {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
return function (t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t
}
}();
n(474);
var i = document.webL10n, a = function () {
function e(t) {
!function (e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, e), this._lang = t, this._ready = new Promise(function (e, n) {
i.setLanguage(t, function () {
e(i)
})
})
}
return r(e, [{
key: "getDirection", value: function () {
return this._ready.then(function (e) {
return e.getDirection()
})
}
}, {
key: "get", value: function (e, t, n) {
return this._ready.then(function (r) {
return r.get(e, t, n)
})
}
}, {
key: "translate", value: function (e) {
return this._ready.then(function (t) {
return t.translate(e)
})
}
}]), e
}();
t.GenericL10n = a
}, function (e, t, n) {
"use strict";
document.webL10n = function (e, t, n) {
var r = {}, i = "", a = "textContent", o = "", s = {}, l = "loading", c = !0;
function u(e) {
var n = t.createEvent("Event");
n.initEvent("localized", !0, !1), n.language = e, t.dispatchEvent(n)
}
function d(e, t, n) {
t = t || function (e) {
}, n = n || function () {
};
var r = new XMLHttpRequest;
r.open("GET", e, c), r.overrideMimeType && r.overrideMimeType("text/plain; charset=utf-8"), r.onreadystatechange = function () {
4 == r.readyState && (200 == r.status || 0 === r.status ? t(r.responseText) : n())
}, r.onerror = n, r.ontimeout = n;
try {
r.send(null)
} catch (e) {
n()
}
}
function h(e, t, n, o) {
var s = e.replace(/[^\/]*$/, "") || "./";
d(e, function (e) {
i += e, function (e, n) {
var r = {}, i = /^\s*|\s*$/, a = /^\s*#|^\s*$/, o = /^\s*\[(.*)\]\s*$/, l = /^\s*@import\s+url\((.*)\)\s*$/i,
c = /^([^=\s]*)\s*=\s*(.+)$/;
function u(e, n, u) {
var d = e.replace(i, "").split(/[\r\n]+/), p = "*", f = t.split("-", 1)[0], m = !1, v = "";
!function e() {
for (; ;) {
if (!d.length) return void u();
var i = d.shift();
if (!a.test(i)) {
if (n) {
if (v = o.exec(i)) {
p = v[1].toLowerCase(), m = "*" !== p && p !== t && p !== f;
continue
}
if (m) continue;
if (v = l.exec(i)) return void h(s + v[1], e)
}
var g = i.match(c);
g && 3 == g.length && (r[g[1]] = (y = g[2]).lastIndexOf("\\") < 0 ? y : y.replace(/\\\\/g, "\\").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\{/g, "{").replace(/\\}/g, "}").replace(/\\"/g, '"').replace(/\\'/g, "'"))
}
}
var y
}()
}
function h(e, t) {
d(e, function (e) {
u(e, !1, t)
}, function () {
console.warn(e + " not found."), t()
})
}
u(e, !0, function () {
n(r)
})
}(e, function (e) {
for (var t in e) {
var i, o, s = t.lastIndexOf(".");
s > 0 ? (i = t.substring(0, s), o = t.substr(s + 1)) : (i = t, o = a), r[i] || (r[i] = {}), r[i][o] = e[t]
}
n && n()
})
}, o)
}
function p(e, n) {
e && (e = e.toLowerCase()), n = n || function () {
}, r = {}, i = "", o = "", o = e;
var a, s = t.querySelectorAll('link[type="application/l10n"]'), c = s.length;
if (0 === c) {
var d = (a = t.querySelector('script[type="application/l10n"]')) ? JSON.parse(a.innerHTML) : null;
if (d && d.locales && d.default_locale) {
if (console.log("using the embedded JSON directory, early way out"), !(r = d.locales[e])) {
var p = d.default_locale.toLowerCase();
for (var f in d.locales) {
if ((f = f.toLowerCase()) === e) {
r = d.locales[e];
break
}
f === p && (r = d.locales[p])
}
}
n()
} else console.log("no resource to load, early way out");
return u(e), void (l = "complete")
}
var m, v = 0;
function g(e) {
var t = e.href;
this.load = function (e, n) {
h(t, e, n, function () {
console.warn(t + " not found."), console.warn('"' + e + '" resource not found'), o = "", n()
})
}
}
m = function () {
++v >= c && (n(), u(e), l = "complete")
};
for (var y = 0; y < c; y++) {
new g(s[y]).load(e, m)
}
}
function f(e, t, n) {
var i = r[e];
if (!i) {
if (console.warn("#" + e + " is undefined."), !n) return null;
i = n
}
var a = {};
for (var o in i) {
var s = i[o];
s = v(s = m(s, t, e, o), t, e), a[o] = s
}
return a
}
function m(e, t, n, i) {
var a = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);
if (!a || !a.length) return e;
var o, l = a[1], c = a[2];
(t && c in t ? o = t[c] : c in r && (o = r[c]), l in s) && (e = (0, s[l])(e, o, n, i));
return e
}
function v(e, t, n) {
return e.replace(/\{\{\s*(.+?)\s*\}\}/g, function (e, i) {
return t && i in t ? t[i] : i in r ? r[i] : (console.log("argument {{" + i + "}} for #" + n + " is undefined."), e)
})
}
function g(e) {
var n = function (e) {
if (!e) return {};
var t = e.getAttribute("data-l10n-id"), n = e.getAttribute("data-l10n-args"), r = {};
if (n) try {
r = JSON.parse(n)
} catch (e) {
console.warn("could not parse arguments for #" + t)
}
return {id: t, args: r}
}(e);
if (n.id) {
var r = f(n.id, n.args);
if (r) {
if (r[a]) {
if (0 === function (e) {
if (e.children) return e.children.length;
if (void 0 !== e.childElementCount) return e.childElementCount;
for (var t = 0, n = 0; n < e.childNodes.length; n++) t += 1 === e.nodeType ? 1 : 0;
return t
}(e)) e[a] = r[a]; else {
for (var i = e.childNodes, o = !1, s = 0, l = i.length; s < l; s++) 3 === i[s].nodeType && /\S/.test(i[s].nodeValue) && (o ? i[s].nodeValue = "" : (i[s].nodeValue = r[a], o = !0));
if (!o) {
var c = t.createTextNode(r[a]);
e.insertBefore(c, e.firstChild)
}
}
delete r[a]
}
for (var u in r) e[u] = r[u]
} else console.warn("#" + n.id + " is undefined.")
}
}
return s.plural = function (e, t, n, i) {
var l = parseFloat(t);
if (isNaN(l)) return e;
if (i != a) return e;
s._pluralRules || (s._pluralRules = function (e) {
function t(e, t) {
return -1 !== t.indexOf(e)
}
function n(e, t, n) {
return t <= e && e <= n
}
var r = {
0: function (e) {
return "other"
}, 1: function (e) {
return n(e % 100, 3, 10) ? "few" : 0 === e ? "zero" : n(e % 100, 11, 99) ? "many" : 2 == e ? "two" : 1 == e ? "one" : "other"
}, 2: function (e) {
return 0 !== e && e % 10 == 0 ? "many" : 2 == e ? "two" : 1 == e ? "one" : "other"
}, 3: function (e) {
return 1 == e ? "one" : "other"
}, 4: function (e) {
return n(e, 0, 1) ? "one" : "other"
}, 5: function (e) {
return n(e, 0, 2) && 2 != e ? "one" : "other"
}, 6: function (e) {
return 0 === e ? "zero" : e % 10 == 1 && e % 100 != 11 ? "one" : "other"
}, 7: function (e) {
return 2 == e ? "two" : 1 == e ? "one" : "other"
}, 8: function (e) {
return n(e, 3, 6) ? "few" : n(e, 7, 10) ? "many" : 2 == e ? "two" : 1 == e ? "one" : "other"
}, 9: function (e) {
return 0 === e || 1 != e && n(e % 100, 1, 19) ? "few" : 1 == e ? "one" : "other"
}, 10: function (e) {
return n(e % 10, 2, 9) && !n(e % 100, 11, 19) ? "few" : e % 10 != 1 || n(e % 100, 11, 19) ? "other" : "one"
}, 11: function (e) {
return n(e % 10, 2, 4) && !n(e % 100, 12, 14) ? "few" : e % 10 == 0 || n(e % 10, 5, 9) || n(e % 100, 11, 14) ? "many" : e % 10 == 1 && e % 100 != 11 ? "one" : "other"
}, 12: function (e) {
return n(e, 2, 4) ? "few" : 1 == e ? "one" : "other"
}, 13: function (e) {
return n(e % 10, 2, 4) && !n(e % 100, 12, 14) ? "few" : 1 != e && n(e % 10, 0, 1) || n(e % 10, 5, 9) || n(e % 100, 12, 14) ? "many" : 1 == e ? "one" : "other"
}, 14: function (e) {
return n(e % 100, 3, 4) ? "few" : e % 100 == 2 ? "two" : e % 100 == 1 ? "one" : "other"
}, 15: function (e) {
return 0 === e || n(e % 100, 2, 10) ? "few" : n(e % 100, 11, 19) ? "many" : 1 == e ? "one" : "other"
}, 16: function (e) {
return e % 10 == 1 && 11 != e ? "one" : "other"
}, 17: function (e) {
return 3 == e ? "few" : 0 === e ? "zero" : 6 == e ? "many" : 2 == e ? "two" : 1 == e ? "one" : "other"
}, 18: function (e) {
return 0 === e ? "zero" : n(e, 0, 2) && 0 !== e && 2 != e ? "one" : "other"
}, 19: function (e) {
return n(e, 2, 10) ? "few" : n(e, 0, 1) ? "one" : "other"
}, 20: function (e) {
return !n(e % 10, 3, 4) && e % 10 != 9 || n(e % 100, 10, 19) || n(e % 100, 70, 79) || n(e % 100, 90, 99) ? e % 1e6 == 0 && 0 !== e ? "many" : e % 10 != 2 || t(e % 100, [12, 72, 92]) ? e % 10 != 1 || t(e % 100, [11, 71, 91]) ? "other" : "one" : "two" : "few"
}, 21: function (e) {
return 0 === e ? "zero" : 1 == e ? "one" : "other"
}, 22: function (e) {
return n(e, 0, 1) || n(e, 11, 99) ? "one" : "other"
}, 23: function (e) {
return n(e % 10, 1, 2) || e % 20 == 0 ? "one" : "other"
}, 24: function (e) {
return n(e, 3, 10) || n(e, 13, 19) ? "few" : t(e, [2, 12]) ? "two" : t(e, [1, 11]) ? "one" : "other"
}
}, i = {
af: 3,
ak: 4,
am: 4,
ar: 1,
asa: 3,
az: 0,
be: 11,
bem: 3,
bez: 3,
bg: 3,
bh: 4,
bm: 0,
bn: 3,
bo: 0,
br: 20,
brx: 3,
bs: 11,
ca: 3,
cgg: 3,
chr: 3,
cs: 12,
cy: 17,
da: 3,
de: 3,
dv: 3,
dz: 0,
ee: 3,
el: 3,
en: 3,
eo: 3,
es: 3,
et: 3,
eu: 3,
fa: 0,
ff: 5,
fi: 3,
fil: 4,
fo: 3,
fr: 5,
fur: 3,
fy: 3,
ga: 8,
gd: 24,
gl: 3,
gsw: 3,
gu: 3,
guw: 4,
gv: 23,
ha: 3,
haw: 3,
he: 2,
hi: 4,
hr: 11,
hu: 0,
id: 0,
ig: 0,
ii: 0,
is: 3,
it: 3,
iu: 7,
ja: 0,
jmc: 3,
jv: 0,
ka: 0,
kab: 5,
kaj: 3,
kcg: 3,
kde: 0,
kea: 0,
kk: 3,
kl: 3,
km: 0,
kn: 0,
ko: 0,
ksb: 3,
ksh: 21,
ku: 3,
kw: 7,
lag: 18,
lb: 3,
lg: 3,
ln: 4,
lo: 0,
lt: 10,
lv: 6,
mas: 3,
mg: 4,
mk: 16,
ml: 3,
mn: 3,
mo: 9,
mr: 3,
ms: 0,
mt: 15,
my: 0,
nah: 3,
naq: 7,
nb: 3,
nd: 3,
ne: 3,
nl: 3,
nn: 3,
no: 3,
nr: 3,
nso: 4,
ny: 3,
nyn: 3,
om: 3,
or: 3,
pa: 3,
pap: 3,
pl: 13,
ps: 3,
pt: 3,
rm: 3,
ro: 9,
rof: 3,
ru: 11,
rwk: 3,
sah: 0,
saq: 3,
se: 7,
seh: 3,
ses: 0,
sg: 0,
sh: 11,
shi: 19,
sk: 12,
sl: 14,
sma: 7,
smi: 7,
smj: 7,
smn: 7,
sms: 7,
sn: 3,
so: 3,
sq: 3,
sr: 11,
ss: 3,
ssy: 3,
st: 3,
sv: 3,
sw: 3,
syr: 3,
ta: 3,
te: 3,
teo: 3,
th: 0,
ti: 4,
tig: 3,
tk: 3,
tl: 4,
tn: 3,
to: 0,
tr: 0,
ts: 3,
tzm: 22,
uk: 11,
ur: 3,
ve: 3,
vi: 0,
vun: 3,
wa: 4,
wae: 3,
wo: 0,
xh: 3,
xog: 3,
yo: 0,
zh: 0,
zu: 3
}[e.replace(/-.*$/, "")];
return i in r ? r[i] : (console.warn("plural form unknown for [" + e + "]"), function () {
return "other"
})
}(o));
var c = "[" + s._pluralRules(l) + "]";
return 0 === l && n + "[zero]" in r ? e = r[n + "[zero]"][i] : 1 == l && n + "[one]" in r ? e = r[n + "[one]"][i] : 2 == l && n + "[two]" in r ? e = r[n + "[two]"][i] : n + c in r ? e = r[n + c][i] : n + "[other]" in r && (e = r[n + "[other]"][i]), e
}, {
get: function (e, t, n) {
var r, i = e.lastIndexOf("."), o = a;
i > 0 && (o = e.substr(i + 1), e = e.substring(0, i)), n && ((r = {})[o] = n);
var s = f(e, t, r);
return s && o in s ? s[o] : "{{" + e + "}}"
}, getData: function () {
return r
}, getText: function () {
return i
}, getLanguage: function () {
return o
}, setLanguage: function (e, t) {
p(e, function () {
t && t()
})
}, getDirection: function () {
var e = o.split("-", 1)[0];
return ["ar", "he", "fa", "ps", "ur"].indexOf(e) >= 0 ? "rtl" : "ltr"
}, translate: function (e) {
for (var n = function (e) {
return e ? e.querySelectorAll("*[data-l10n-id]") : []
}(e = e || t.documentElement), r = n.length, i = 0; i < r; i++) g(n[i]);
g(e)
}, getReadyState: function () {
return l
}, ready: function (n) {
n && ("complete" == l || "interactive" == l ? e.setTimeout(function () {
n()
}) : t.addEventListener && t.addEventListener("localized", function e() {
t.removeEventListener("localized", e), n()
}))
}
}
}(window, document)
}, function (e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {value: !0}), t.PDFPrintService = void 0;
var r = n(9), i = n(120), a = n(14), o = null, s = null;
function l(e, t, n, i) {
this.pdfDocument = e, this.pagesOverview = t, this.printContainer = n, this.l10n = i || r.NullL10n, this.currentPage = -1, this.scratchCanvas = document.createElement("canvas")
}
l.prototype = {
layout: function () {
this.throwIfInactive();
var e = document.querySelector("body");
e.setAttribute("data-pdfjsprinting", !0), this.pagesOverview.every(function (e) {
return e.width === this.pagesOverview[0].width && e.height === this.pagesOverview[0].height
}, this) || console.warn("Not all pages have the same size. The printed result may be incorrect!"), this.pageStyleSheet = document.createElement("style");
var t = this.pagesOverview[0];
this.pageStyleSheet.textContent = "@page { size: " + t.width + "pt " + t.height + "pt;}", e.appendChild(this.pageStyleSheet)
}, destroy: function () {
o === this && (this.printContainer.textContent = "", this.pageStyleSheet && this.pageStyleSheet.parentNode && (this.pageStyleSheet.parentNode.removeChild(this.pageStyleSheet), this.pageStyleSheet = null), this.scratchCanvas.width = this.scratchCanvas.height = 0, this.scratchCanvas = null, o = null, v().then(function () {
-1 !== s.active.indexOf("printServiceOverlay") && s.close("printServiceOverlay")
}))
}, renderPages: function () {
var e = this, t = this.pagesOverview.length;
return new Promise(function n(i, a) {
if (e.throwIfInactive(), ++e.currentPage >= t) return h(t, t, e.l10n), void i();
var s = e.currentPage;
h(s, t, e.l10n), function (e, t, n, i) {
var a = o.scratchCanvas;
a.width = Math.floor(i.width * (150 / 72)), a.height = Math.floor(i.height * (150 / 72));
var s = Math.floor(i.width * r.CSS_UNITS) + "px", l = Math.floor(i.height * r.CSS_UNITS) + "px",
c = a.getContext("2d");
return c.save(), c.fillStyle = "rgb(255, 255, 255)", c.fillRect(0, 0, a.width, a.height), c.restore(), t.getPage(n).then(function (e) {
var t = {
canvasContext: c,
transform: [150 / 72, 0, 0, 150 / 72, 0, 0],
viewport: e.getViewport(1, i.rotation),
intent: "print"
};
return e.render(t).promise
}).then(function () {
return {width: s, height: l}
})
}(0, e.pdfDocument, s + 1, e.pagesOverview[s]).then(e.useRenderedPage.bind(e)).then(function () {
n(i, a)
}, a)
})
}, useRenderedPage: function (e) {
this.throwIfInactive();
var t = document.createElement("img");
t.style.width = e.width, t.style.height = e.height;
var n = this.scratchCanvas;
"toBlob" in n && !a.PDFJS.disableCreateObjectURL ? n.toBlob(function (e) {
t.src = URL.createObjectURL(e)
}) : t.src = n.toDataURL();
var r = document.createElement("div");
return r.appendChild(t), this.printContainer.appendChild(r), new Promise(function (e, n) {
t.onload = e, t.onerror = n
})
}, performPrint: function () {
var e = this;
return this.throwIfInactive(), new Promise(function (t) {
setTimeout(function () {
e.active ? (c.call(window), setTimeout(t, 20)) : t()
}, 0)
})
}, get active() {
return this === o
}, throwIfInactive: function () {
if (!this.active) throw new Error("This print request was cancelled or completed.")
}
};
var c = window.print;
function u(e) {
var t = document.createEvent("CustomEvent");
t.initCustomEvent(e, !1, !1, "custom"), window.dispatchEvent(t)
}
function d() {
o && (o.destroy(), u("afterprint"))
}
function h(e, t, n) {
var r = document.getElementById("printServiceOverlay"), i = Math.round(100 * e / t),
a = r.querySelector("progress"), o = r.querySelector(".relative-progress");
a.value = i, n.get("print_progress_percent", {progress: i}, i + "%").then(function (e) {
o.textContent = e
})
}
window.print = function () {
if (o) console.warn("Ignored window.print() because of a pending print job."); else {
v().then(function () {
o && s.open("printServiceOverlay")
});
try {
u("beforeprint")
} finally {
if (!o) return console.error("Expected print service to be initialized."), void v().then(function () {
s.active.indexOf("printServiceOverlay") > -1 && s.close("printServiceOverlay")
});
var e = o;
o.renderPages().then(function () {
return e.performPrint()
}).catch(function () {
}).then(function () {
e.active && d()
})
}
}
};
var p = !!document.attachEvent;
if (window.addEventListener("keydown", function (e) {
if (80 === e.keyCode && (e.ctrlKey || e.metaKey) && !e.altKey && (!e.shiftKey || window.chrome || window.opera)) {
if (window.print(), p) return;
return e.preventDefault(), void (e.stopImmediatePropagation ? e.stopImmediatePropagation() : e.stopPropagation())
}
}, !0), p && document.attachEvent("onkeydown", function (e) {
if (80 === (e = e || window.event).keyCode && e.ctrlKey) return e.keyCode = 0, !1
}), "onbeforeprint" in window) {
var f = function (e) {
"custom" !== e.detail && e.stopImmediatePropagation && e.stopImmediatePropagation()
};
window.addEventListener("beforeprint", f), window.addEventListener("afterprint", f)
}
var m = void 0;
function v() {
if (!m) {
if (!(s = i.PDFViewerApplication.overlayManager)) throw new Error("The overlay manager has not yet been initialized.");
m = s.register("printServiceOverlay", document.getElementById("printServiceOverlay"), d, !0), document.getElementById("printCancel").onclick = d
}
return m
}
i.PDFPrintServiceFactory.instance = {
supportsPrinting: !0, createPrintService: function (e, t, n, r) {
if (o) throw new Error("The print service is created and active.");
return o = new l(e, t, n, r)
}
}, t.PDFPrintService = l
}]);