0% found this document useful (0 votes)
8 views87 pages

Program

The document contains JavaScript code that defines a class for managing localized string data and handling user interactions like touch and wheel events. It includes methods for retrieving values, asserting conditions, and notifying events related to touch gestures and wheel movements. Additionally, it sets up event listeners for various user actions and manages state related to touch interactions.

Uploaded by

hammad77939
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views87 pages

Program

The document contains JavaScript code that defines a class for managing localized string data and handling user interactions like touch and wheel events. It includes methods for retrieving values, asserting conditions, and notifying events related to touch gestures and wheel movements. Additionally, it sets up event listeners for various user actions and manages state related to touch interactions.

Uploaded by

hammad77939
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

( () => {

"use strict";

function e(e, t) {

if (!e) {

let e = "Assertion failed";

t && (e = e + ": " + t);

const i = new Error(e);

throw function() {

const e = this || self;

return [Link],

}().traceAssertionsForTesting && [Link]([Link]),

return e

const t = new class {

constructor() {

this.data_ = null

set data(t) {

e(!this.data_, "Re-setting data."),

this.data_ = t

valueExists(e) {

return !!this.data_ && e in this.data_


}

getValue(t) {

e(this.data_, "No data. Did you remember to include [Link]?");

const i = this.data_[t];

return e(void 0 !== i, "Could not find value for " + t),

getString(t) {

const i = [Link](t);

return e("string" == typeof i, `[${i}] (${t}) is not a string`),

getStringF(e, ...t) {

const i = [Link](e);

return i ? [Link](i, ...t) : ""

substituteString(t, ...i) {

return [Link](/\$(.|$|\n)/g, (function(t) {

if (e([Link](/\$[$1-9]/), "Unescaped $ found in localized string."),

"$$" === t)

return "$";

const n = i[Number(t[1]) - 1];

return null == n ? "" : [Link]()

))

}
getSubstitutedStringPieces(t, ...i) {

return ([Link](/(\$[1-9])|(([^$]|\$([^1-9]|$))+)/g) || []).map((function(t) {

if (![Link](/^\$[1-9]$/))

return e(([Link](/\$/g) || []).length % 2 == 0, "Unescaped $ found in localized


string."),

value: [Link](/\$\$/g, "$"),

arg: null

};

const n = i[Number(t[1]) - 1];

return null == n ? {

value: "",

arg: t

}:{

value: [Link](),

arg: t

))

getBoolean(t) {

const i = [Link](t);

return e("boolean" == typeof i, `[${i}] (${t}) is not a boolean`),

getInteger(t) {
const i = [Link](t);

return e("number" == typeof i, `[${i}] (${t}) is not a number`),

e(i === [Link](i), "Number isn't integer: " + i),

overrideValues(t) {

e("object" == typeof t, "Replacements must be a dictionary object."),

e(this.data_, "Data must exist before being overridden");

for (const e in t)

this.data_[e] = t[e]

resetForTesting(e=null) {

this.data_ = e

isInitialized() {

return null !== this.data_

[Link](![Link]("loadTimeData"), "[Link] is already


set."),

[Link](window, {

loadTimeData: t

});

const i = -1 !== [Link]("Mac")

, n = ([Link]("Win"),
-1 !== [Link]("MacIntel") && [Link],

["iPhone", "iPad", "iPod"].indexOf([Link]),

[Link]("Android"),

i ? "metaKey" : "ctrlKey");

function o(e, t) {

for (; null !== [Link] && null !== [Link]; )

e = [Link];

return "Tab" !== t && ([Link] || "INPUT" === [Link] || "TEXTAREA" ===
[Link])

function a(e, t, i) {

return t ? "Tab" !== [Link] && !function(e) {

if ([Link] >= "0" && [Link] <= "9" && !([Link] || s(e) || [Link]))

return !0;

return !1

}(e) && "Enter" !== [Link] && "Backspace" !== [Link] : i && "Escape" !== [Link] &&
!function(e) {

switch ([Link]) {

case "PageUp":

case "PageDown":

case "ArrowUp":

case "ArrowDown":

case "ArrowLeft":

case "ArrowRight":

return !0;

default:

return !1
}

}(e) && !function(e) {

return s(e) && "p" == [Link]

}(e) && !function(e) {

return s(e) && "s" == [Link]

}(e)

function s(e) {

return e[n]

class r {

constructor(e) {

this.element_ = void 0,

this.pinchStartEvent_ = void 0,

this.swipeStartEvent_ = void 0,

this.lastTouchTouchesCount_ = void 0,

this.lastEvent_ = void 0,

this.accumulatedWheelScale_ = void 0,

this.wheelEndTimeout_ = void 0,

this.eventTarget_ = void 0,

this.element_ = e,

this.element_.addEventListener("touchstart", this.onTouchStart_.bind(this), {

passive: !0

});

const t = this.onTouch_.bind(this);

this.element_.addEventListener("touchmove", t, {
passive: !0

}),

this.element_.addEventListener("touchend", t, {

passive: !0

}),

this.element_.addEventListener("touchcancel", t, {

passive: !0

}),

this.element_.addEventListener("wheel", this.onWheel_.bind(this), {

passive: !1

}),

[Link]("contextmenu", (e => this.handleContextMenuEvent_(e))),

this.pinchStartEvent_ = null,

this.swipeStartEvent_ = null,

this.lastTouchTouchesCount_ = 0,

this.lastEvent_ = null,

this.accumulatedWheelScale_ = null,

this.wheelEndTimeout_ = null,

this.eventTarget_ = new EventTarget

getEventTarget() {

return this.eventTarget_

wasTwoFingerTouch() {

return 2 === this.lastTouchTouchesCount_

}
notify_(e, t) {

this.eventTarget_.dispatchEvent(new CustomEvent(e,{

detail: t

}))

onTouchStart_(e) {

this.lastTouchTouchesCount_ = [Link],

[Link]() ? (this.lastEvent_ = e,

this.pinchStartEvent_ = e,

this.notify_("pinchstart", {

center: r.center_(e)

})) : 1 === this.lastTouchTouchesCount_ && (this.swipeStartEvent_ = e)

onTouch_(e) {

if (this.pinchStartEvent_) {

const t = this.lastEvent_;

if ([Link] < 2 || [Link] !== [Link]) {

const e = r.pinchScaleRatio_(t, this.pinchStartEvent_)

, i = r.center_(t);

return this.pinchStartEvent_ = null,

this.lastEvent_ = null,

void this.notify_("pinchend", {

startScaleRatio: e,

center: i

})

}
const i = r.pinchScaleRatio_(e, t)

, n = r.pinchScaleRatio_(e, this.pinchStartEvent_)

, o = r.center_(e);

this.notify_("pinchupdate", {

scaleRatio: i,

direction: i > 1 ? "in" : "out",

startScaleRatio: n,

center: o

}),

this.lastEvent_ = e

} else if (this.swipeStartEvent_) {

if (this.swipeStartEvent_.[Link] !== [Link])

return void (this.swipeStartEvent_ = null);

const t = r.panDistance_(e, this.swipeStartEvent_)

,i={

x: this.swipeStartEvent_.touches[0].clientX,

y: this.swipeStartEvent_.touches[0].clientY

};

[Link](t.y) >= 100 ? (this.notify_("swipe", {

direction: t.y < 0 ? "up" : "down",

center: i

}),

this.swipeStartEvent_ = null) : [Link](t.x) >= 100 && (this.notify_("swipe", {

direction: t.x < 0 ? "left" : "right",

center: i

}),
this.swipeStartEvent_ = null)

onWheel_(e) {

if (![Link]) {

let t = "";

return [Link] > 0 ? t = "down" : [Link] < 0 ? t = "up" : [Link] > 0 ? t = "left" :
[Link] < 0 && (t = "right"),

void this.notify_("wheel", {

center: {

x: [Link],

y: [Link]

},

direction: t

})

[Link]();

const t = [Link](-[Link] / 100)

, i = [Link](1.25, [Link](.75, t))

,n={

x: [Link],

y: [Link]

};

null == this.accumulatedWheelScale_ && (this.accumulatedWheelScale_ = 1,

this.notify_("pinchstart", {

center: n
})),

this.accumulatedWheelScale_ *= i,

this.notify_("pinchupdate", {

scaleRatio: i,

direction: i > 1 ? "in" : "out",

startScaleRatio: this.accumulatedWheelScale_,

center: n

}),

null != this.wheelEndTimeout_ && ([Link](this.wheelEndTimeout_),

this.wheelEndTimeout_ = null);

const o = {

startScaleRatio: this.accumulatedWheelScale_,

center: n

};

this.wheelEndTimeout_ = [Link](( () => {

this.notify_("pinchend", o),

this.wheelEndTimeout_ = null,

this.accumulatedWheelScale_ = null

), 100)

handleContextMenuEvent_(e) {

[Link] && ![Link]() &&


[Link]()

static pinchScaleRatio_(e, t) {
const i = r.distance_(t)

, n = r.distance_(e);

return 0 === i ? null : n / i

static distance_(e) {

const t = [Link][0]

, i = [Link][1]

, n = [Link] - [Link]

, o = [Link] - [Link];

return [Link](n * n + o * o)

static panDistance_(e, t) {

const i = [Link][0]

, n = [Link][0];

return {

x: [Link] - [Link],

y: [Link] - [Link]

static center_(e) {

const t = [Link][0]

, i = [Link][1];

return {

x: ([Link] + [Link]) / 2,

y: ([Link] + [Link]) / 2

}
}

function l(e) {

const t = new Map;

for (const n of e) {

var i;

const e = [Link]()

, o = null === (i = [Link]) || void 0 === i ? void 0 : [Link](n);

e && o && [Link](e, o)

if ([Link]) {

const e = ["", "Source modules:"];

for (const [i,n] of [Link]())

[Link](` ${i} ${n}`);

return [Link]("\n")

let h;

function d(e, t) {

let i;

i = h ? [Link](Error, [e, t]) : [Link];

return l(t) ? i + "\n" + l(t) : i

class c {

recordValue(e, t) {

var i;
null === (i = this.plugin_) || void 0 === i || [Link]({

type: "metricsRecordValue",

metric: e,

value: t

})

recordTime(e, t) {

var i;

null === (i = this.plugin_) || void 0 === i || [Link]({

type: "metricsRecordTime",

metricName: e,

metricValue: t

})

recordUserAction(e) {

var t;

null === (t = this.plugin_) || void 0 === t || [Link]({

type: "metricsRecordUserAction",

metricName: e

})

constructor(e) {

this.plugin_ = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,
[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

[Link] = void 0,

this.plugin_ = e

let g = function(e) {

return e[e.SINGLE_PAGE = 0] = "SINGLE_PAGE",

e[e.DUAL_PAGE = 1] = "DUAL_PAGE",

}({})

, u = function(e) {

return e[[Link] = 0] = "CONTINUOUS",

e[[Link] = 1] = "DISCRETE",
e

}({});

class p {

[Link] = p;

var _ = function(e) {

return e[[Link] = 0] = "InvalidPage",

e[[Link] = 1] = "CoverPage",

e[[Link] = 2] = "RightPageInPair",

e[[Link] = 3] = "LeftPageInPair",

e[[Link] = 4] = "LastSinglePage",

}(_ || {});

class v extends p {

constructor(e, t, i) {

super(),

this.coverPageEnabled_ = !1,

this.isRTL_ = !0,

this.pageCount_ = 0,

this.coverPageEnabled_ = e,

this.isRTL_ = t,

this.pageCount_ = i

getLayoutType() {

return g.DUAL_PAGE

}
getAnnotationOverlayBufferCount() {

return [Link]

getSkeletalPageBufferCount() {

return [Link]

getPageType(e) {

const t = this.coverPageEnabled_;

return e < 0 || e >= this.pageCount_ ? _.InvalidPage : t ? 0 === e ? _.CoverPage : e % 2 ==


1 ? e === this.pageCount_ - 1 ? _.LastSinglePage : _.LeftPageInPair : _.RightPageInPair : e % 2 ==
0 ? e === this.pageCount_ - 1 ? _.LastSinglePage : _.LeftPageInPair : _.RightPageInPair

getPageSet(e) {

switch ([Link](e)) {

case _.CoverPage:

case _.LastSinglePage:

return [e];

case _.LeftPageInPair:

return [e, e + 1];

case _.RightPageInPair:

return [e - 1, e];

case _.InvalidPage:

return null;

default:

throw new Error("Unhandled pagetype")

}
getShadowsForPage(e) {

switch ([Link](e)) {

case _.CoverPage:

case _.LastSinglePage:

case _.LeftPageInPair:

case _.RightPageInPair:

return [Link];

default:

throw new Error("Invalid PageType value sent.")

getNumberOfPagesInPageSet() {

return [Link]

isCoverPageEnabled() {

return this.coverPageEnabled_

[Link] = 4,

[Link] = 10,

[Link] = 2,

[Link] = {

top: 3,

bottom: 7,

left: 5,

right: 5
},

[Link] = v;

class m extends p {

getLayoutType() {

return g.SINGLE_PAGE

getAnnotationOverlayBufferCount() {

return [Link]

getSkeletalPageBufferCount() {

return [Link]

getPageSet(e) {

return [e]

getShadowsForPage() {

return [Link]

getNumberOfPagesInPageSet() {

return [Link]

[Link] = 2,

[Link] = 5,

[Link] = 1,

[Link] = {
top: 3,

bottom: 7,

left: 5,

right: 5

},

[Link] = m;

let f = function(e) {

return e[[Link] = 0] = "NONE",

e[[Link] = 1] = "INKING",

e[[Link] = 2] = "ERASING",

e[[Link] = 3] = "HIGHLIGHTING",

e[e.ADDING_FREE_TEXT = 4] = "ADDING_FREE_TEXT",

}({});

class y {

constructor(e, t, i) {

[Link] = e => {

"-ms-keyboard" === [Link] ? (this.highlightModePluginPointerEvents_ = [new


[Link]([Link],e)],

this.enableFreeFormHighlight_(this.viewport_.getPageAtYScreenCoordinate_([Link]))) :
this.highlightModePluginPointerEvents_ = [e]

[Link] = e => {

"-ms-keyboard" === [Link] ? this.highlightModePluginPointerEvents_.push(new


[Link]([Link],e)) : this.highlightModePluginPointerEvents_.push(e)
}

[Link] = () => {

this.highlightModePluginPointerEvents_ = []

[Link] = e => {

const t = this.viewport_.pluginToFrameCoordinate({

x: [Link],

y: [Link]

})

, i = new PointerEvent([Link],{

pointerType: [Link],

pointerId: [Link],

isPrimary: [Link],

clientX: t.x,

clientY: t.y,

altKey: [Link],

button: [Link],

ctrlKey: [Link],

metaKey: [Link],

shiftKey: [Link],

view: window

});

switch ([Link]) {

case "pointerdown":
this.annotationMode_ === [Link] &&
[Link](i);

break;

case "pointermove":

this.isSelecting_ && this.viewportScroller_.onMousemove(i),

this.annotationMode_ === [Link] &&


[Link](i);

break;

case "pointerup":

this.annotationMode_ === [Link] &&


[Link](i)

this.plugin_ = e,

this.pdfFreeFormHighlighterEnabled_ = t,

this.supportCrossProcessPointerEventHandling_ = i,

this.annotationMode_ = [Link],

this.metrics_ = [Link](),

this.freeFormAttributes_ = null,

this.highlightModePluginPointerEvents_ = [],

this.pdfViewerUIEventCallback_ = function() {}

this.pdfContentViewUIEventCallback_ = function() {}

this.pluginControllerMessageCallback_ = function() {}

,
this.pointerEventSubscribeCallback_ = function() {}

this.pointerEventUnsubscribeCallback_ = function() {}

this.overlayController_ = new OverlayController

initializeAnnotationManager(e, t) {

this.viewport_ = e,

this.overlayController_.initialize(e, t)

activateOverlays_(e, t, i) {

this.overlayController_.setInkListener(( (e, t) => {

this.pluginControllerMessageCallback_({

type: "addInkStroke",

inkPageNumber: e,

inkStrokeData: t

}),

[Link]()

)),

this.overlayController_.setEraserListener(( (e, t) => {

this.pluginControllerMessageCallback_({

type: "eraserEvent",

eventType: e,

event: {

x: [Link],
y: [Link] - this.viewport_.embedTopOffset

})

));

const n = [Link]();

this.overlayController_.setInkReadyListener(( () => {

this.pluginControllerMessageCallback_({

type: "inkInitialized",

inkInitializeTime: [Link]() - n

})

)),

this.overlayController_.setTouchScrollUpdatedListener((e => {

this.pdfViewerUIEventCallback_("set-touch-draw-mode", {

isTouchDrawEnabled: !e

}),

[Link](e, !0)

)),

this.overlayController_.activateOverlays([Link], [Link], [Link], t, i)

enableFreeFormHighlight_(t) {

if (e(null !== this.freeFormAttributes_),

!this.pdfFreeFormHighlighterEnabled_)

return;
if (-1 === t)

return;

const i = this.freeFormAttributes_

, n = this.highlightModePluginPointerEvents_[0];

n && "pointerdown" === [Link] && (this.overlayController_.overlaysActivated ||


this.activateOverlays_(i, [Link], !1),

this.overlayController_.setAnnotationMode([Link], t),

this.overlayController_.inkAttributesChanged([Link], [Link], [Link]),

this.overlayController_.dispatchPointerEvents(this.highlightModePluginPointerEvents_,
t),

this.highlightModePluginPointerEvents_ = [])

disableFreeFormHighlight() {

this.pdfFreeFormHighlighterEnabled_ && this.annotationMode_ == [Link] &&


(this.overlayController_.setAnnotationMode([Link]),

this.highlightModePluginPointerEvents_ = [])

enterInkingMode(e, t) {

this.overlayController_.overlaysActivated ?
(this.overlayController_.setAnnotationMode([Link]),

this.overlayController_.inkAttributesChanged([Link], [Link], [Link])) :


this.activateOverlays_(e, [Link], t)

exitInkingMode() {

this.overlayController_.overlaysActivated &&
this.overlayController_.deactivateOverlays(),

this.overlayController_.setInkListener(null)

}
enterHighlightMode(t=!0) {

e(null !== this.freeFormAttributes_),

this.pdfFreeFormHighlighterEnabled_ && (this.overlayController_.overlaysActivated ||


this.activateOverlays_(this.freeFormAttributes_, [Link], t),

this.overlayController_.setAnnotationMode([Link]),

this.supportCrossProcessPointerEventHandling_ ? this.pointerEventSubscribeCallback_() :
(this.plugin_.addEventListener("pointerdown", [Link]),

this.plugin_.addEventListener("pointermove",
[Link]),

this.plugin_.addEventListener("pointerup", [Link])))

exitHighlightMode() {

this.overlayController_.overlaysActivated &&
this.overlayController_.deactivateOverlays(),

this.overlayController_.setInkListener(null),

this.freeFormAttributes_ = null,

this.highlightModePluginPointerEvents_ = [],

this.supportCrossProcessPointerEventHandling_ ?
this.pointerEventUnsubscribeCallback_() : (this.plugin_.removeEventListener("pointerdown",
[Link]),

this.plugin_.removeEventListener("pointermove",
[Link]),

this.plugin_.removeEventListener("pointerup",
[Link]))

annotationModeChanged(e) {

const t = this.annotationMode_;

if (this.annotationMode_ = [Link],
t === this.annotationMode_) {

let t = null;

this.annotationMode_ === [Link] ? t = [Link] :


this.pdfFreeFormHighlighterEnabled_ && this.annotationMode_ === [Link] &&
this.overlayController_.overlaysActivated && (t = [Link],

this.freeFormAttributes_ = [Link]),

t && this.overlayController_.inkAttributesChanged([Link], [Link], [Link])

} else

this.overlayController_.isInitialized && (t === [Link] ? [Link]() : t ===


[Link] && [Link](),

this.annotationMode_ === [Link] ? [Link]([Link],


[Link]) : this.annotationMode_ === [Link] &&
(this.freeFormAttributes_ = [Link],

[Link]([Link])));

const i = {

type: "setAnnotationConfiguration",

annotationMode: this.annotationMode_

};

this.annotationMode_ === [Link] && ([Link] =


[Link]),

this.pluginControllerMessageCallback_(i)

updateTouchScrollState(e, t) {

this.pluginControllerMessageCallback_({

type: "updateTouchScrollState",

isTouchScrollEnabled: e,

isAutoTriggered: t

})
}

touchDrawModeChange(e, t) {

e ? this.overlayController_.disableTouchScroll() :
this.overlayController_.enableTouchScroll(),

[Link](!e, t)

viewportChanged() {

this.overlayController_.viewportChanged()

onBlur() {

[Link] || this.overlayController_.overlaysActivated &&


this.overlayController_.onFocusLost()

colorSchemeChange(e) {

this.overlayController_.highContrastModeChanged([Link], [Link])

documentDimensionUpdate() {

this.overlayController_.overlaysActivated &&
this.overlayController_.documentDimensionsChanged()

setPdfViewerUIEventCallback(e) {

this.pdfViewerUIEventCallback_ = e

setPdfContentViewUIEventCallback(e) {

this.pdfContentViewUIEventCallback_ = e

setPluginControllerCallback(e) {
this.pluginControllerMessageCallback_ = e

setPointerEventSubscribeCallback(e) {

this.pointerEventSubscribeCallback_ = e

setPointerEventUnsubscribeCallback(e) {

this.pointerEventUnsubscribeCallback_ = e

inkStrokeAdded(e) {

this.overlayController_.removeWetInk([Link], [Link],
[Link]),

this.pdfViewerUIEventCallback_("ink-stroke-dried", {

success: [Link],

numberOfStrokes: [Link]

})

enableFreeFormHighlight(e) {

if (this.overlayController_.isInitialized && this.annotationMode_ === [Link]) {

const t = this.viewport_.findPageForPoint(e.x, e.y);

this.enableFreeFormHighlight_(t)

setShiftKeyPressed(e) {

this.overlayController_.setShiftKeyPressed(e)

deactivateOverlays() {
this.overlayController_.overlaysActivated &&
(this.overlayController_.deactivateOverlays(),

this.overlayController_.setInkListener(null))

handleCreateHighlight(e, t, i, n) {

this.pluginControllerMessageCallback_({

type: "createHighlightFromSelection",

a: e,

r: t,

g: i,

b: n

})

handleChangeHighlightColor(e, t, i, n) {

this.pluginControllerMessageCallback_({

type: "changeHighlightColor",

a: e,

r: t,

g: i,

b: n

})

handleDeleteHighlight() {

this.pluginControllerMessageCallback_({

type: "deleteHighlight"

})
}

HandleTextOnlyHighlightToggle(e) {

this.pluginControllerMessageCallback_({

type: "setTextOnlyHighlightEnabled",

isEnabled: [Link]

})

handleFreeTextEvent(e) {

switch ([Link]) {

case "freeTextAdded":

this.pdfContentViewUIEventCallback_("free-text-dried", {

pageNumber: [Link],

freeTextId: [Link],

success: [Link]

});

break;

case "setFreeTextFont":

this.pdfContentViewUIEventCallback_("set-free-text-font", {

fontFamily: [Link]

});

break;

case "showEditableFreeText":

this.pdfContentViewUIEventCallback_("show-editable-free-text", e);

break;

case "showNewFreeTextAt":

this.pdfContentViewUIEventCallback_("show-add-free-text-box", {
pageNumber: [Link],

left: [Link],

top: [Link],

isRotated: !0

});

break;

case "showAddFreeTextBox":

const t = this.viewport_.findPageForPoint(e.x, e.y);

if (-1 === t)

throw new Error(`Point not on any PDF Page. Point coordinates: ${e.x}, ${e.y}`);

this.pdfContentViewUIEventCallback_("show-add-free-text-box", {

pageNumber: t,

left: e.x - this.viewport_.getPageInsetDimensions(t).x,

top: e.y - this.viewport_.getPageInsetDimensions(t).y

});

break

case "freeTextEditsSaved":

this.pdfContentViewUIEventCallback_("free-text-dried", {

pageNumber: [Link],

freeTextId: [Link],

success: [Link]

});

break;

default:
throw new Error(`Unknown free text event: ${[Link]}`)

handleFreeTextUIEvent(e, t) {

switch (e) {

case "create-free-text-annotation":

this.pluginControllerMessageCallback_({

type: "createFreeTextAnnotation",

...t

});

break;

case "update-free-text-annotation":

this.pluginControllerMessageCallback_({

type: "updateFreeTextAnnotation",

...t

});

break;

case "delete-free-text-annotation":

this.pluginControllerMessageCallback_({

type: "deleteFreeTextAnnotation",

...t

});

break;

case "free-text-pointer-event":

this.pluginControllerMessageCallback_({

type: "pointerEvent",
...t

});

break;

default:

throw new Error(`Unknown free text UI event: ${e}`)

get annotationMode() {

return this.annotationMode_

class w {

constructor(e, t, i) {

this.viewport_ = e,

this.plugin_ = t,

this.window_ = i,

this.mousemoveCallback_ = null,

this.timerId_ = null,

this.scrollVelocity_ = null,

this.lastFrameTime_ = 0,

this.isScrollingEnabled_ = !1

startDragScrollTimer_() {

null === this.timerId_ && (this.timerId_ =


this.window_.setInterval(this.dragScrollPage_.bind(this), w.DRAG_TIMER_INTERVAL_MS_),

this.lastFrameTime_ = [Link]())
}

stopDragScrollTimer() {

null !== this.timerId_ && (this.window_.clearInterval(this.timerId_),

this.timerId_ = null,

this.lastFrameTime_ = 0)

dragScrollPage_() {

const e = this.viewport_.position

, t = [Link]()

, i = (t - this.lastFrameTime_) / w.DRAG_TIMER_INTERVAL_MS_;

e.y += this.scrollVelocity_.y * i,

e.x += this.scrollVelocity_.x * i,

this.viewport_.position = e,

this.lastFrameTime_ = t

calculateVelocity_(e) {

const t = this.viewport_.frameToPluginViewportCoord({

x: [Link],

y: [Link]

})

, i = this.viewport_.getPluginRectInFrame();

[Link](t.x) <= [Link] ? t.x -= w.SCROLL_EXTRAPOLATION_DISTANCE_ :


[Link](t.x - [Link]) <= [Link] && (t.x += w.SCROLL_EXTRAPOLATION_DISTANCE_),

[Link](t.y) <= [Link] ? t.y -= w.SCROLL_EXTRAPOLATION_DISTANCE_ :


[Link](t.y - [Link]) <= [Link] && (t.y += w.SCROLL_EXTRAPOLATION_DISTANCE_);

let n = [Link]([Link](-t.x, t.x - [Link], 0), w.MAX_DRAG_SCROLL_DISTANCE_) *


[Link](t.x)
, o = [Link]([Link](-t.y, t.y - [Link], 0), w.MAX_DRAG_SCROLL_DISTANCE_) *
[Link](t.y);

return n = [Link](n) < w.MIN_DRAG_SCROLL_DISTANCE_ && [Link](n) >


[Link] ? w.MIN_DRAG_SCROLL_DISTANCE_ * [Link](n) : n,

o = [Link](o) < w.MIN_DRAG_SCROLL_DISTANCE_ && [Link](o) > [Link]


? w.MIN_DRAG_SCROLL_DISTANCE_ * [Link](o) : o,

x: n,

y: o

onMousemove(e) {

this.scrollVelocity_ = this.calculateVelocity_(e),

this.scrollVelocity_.x || this.scrollVelocity_.y ? this.timerId_ ||


this.startDragScrollTimer_() : [Link]()

handlePointerEventFromPlugin(e) {

if (!this.isScrollingEnabled_ || ![Link] || "pointermove" !== [Link])

return;

const t = [Link]

, i = this.viewport_.pluginToFrameCoordinate({

x: [Link],

y: [Link]

});

[Link]({

clientX: i.x,

clientY: i.y,
type: "mousemove"

})

setEnableScrolling(e) {

e ? (this.mousemoveCallback_ || (this.mousemoveCallback_ =
[Link](this)),

this.plugin_.addEventListener("mousemove", this.mousemoveCallback_, !1)) :


([Link](),

this.mousemoveCallback_ && this.plugin_.removeEventListener("mousemove",


this.mousemoveCallback_, !1)),

this.isScrollingEnabled_ = e

function b(e, t, i, n, o, a) {

const s = E(n.y / o, i)

, r = (n.y + [Link] - a) / o;

let l = [Link] - 1;

if (r <= i[[Link] - 1].y + i[[Link] - 1].height) {

l = T(C(e, n, o), t, a, o, i)

return [s, l]

function E(e, t) {

if (e < 0)

return 0;

let i = 0

, n = [Link] - 1;
for (; n >= i; ) {

const o = [Link](i + (n - i) / 2);

let a = 0;

o > 0 && (a = t[o - 1].y + t[o - 1].height);

const s = t[o].y + t[o].height;

if (a <= e && e <= s)

return o;

a>e?n=o-1:i=o+1

return [Link] - 1

function C(e, t, i) {

return {

x: t.x / i,

y: t.y / i,

width: [Link] / i,

height: [Link] / i

function P(e, t, i, n, o, a) {

const s = I(e, t, i, n, o, a);

return {

width: [Link] - ([Link] ? n : 0),

height: [Link] - ([Link] ? n : 0)

}
function I(e, t, i, n, o, a) {

const s = S(t, i);

if (!s)

return {

horizontal: !1,

vertical: !1

};

const r = [Link]()

, l = "hidden" === [Link]("overflow-x").value

, h = "hidden" === [Link]("overflow-y").value;

return [Link] > [Link] && !l ? [Link] += n : [Link] > [Link] && !h && ([Link] += n),

horizontal: !l && [Link] > [Link],

vertical: !h && [Link] + o > [Link]

function S(e, t) {

return e ? {

width: [Link]([Link] * t),

height: [Link]([Link] * t)

} : null

function T(e, t, i, n, o) {

const a = e.y + [Link] - i / n

, s = E([Link](a), o);

if ([Link]() === g.SINGLE_PAGE || s + 1 >= [Link])


return s;

return k(e, o[s + 1]) > 0 ? s + 1 : s

function k(e, t) {

const i = [Link](e.x, t.x)

, n = [Link](e.y, t.y)

, o = [Link](e.x + [Link], t.x + [Link])

, a = [Link](e.y + [Link], t.y + [Link]);

return i >= o || n >= a ? 0 : (o - i) * (a - n)

function M(e, t) {

let[i,n,o,a] = [1 / 0, 1 / 0, 0, 0];

for (const s of e) {

const {x: e, y: r, width: l, height: h} = t[s];

i = [Link](i, e),

n = [Link](n, r),

o = [Link](o, e + l),

a = [Link](a, r + h)

return {

x: i,

y: n,

width: o - i,

height: a - n

}
w.DRAG_TIMER_INTERVAL_MS_ = 100,

w.MAX_DRAG_SCROLL_DISTANCE_ = 100,

w.MIN_DRAG_SCROLL_DISTANCE_ = 5,

w.SCROLL_EXTRAPOLATION_DISTANCE_ = 1;

class A {

constructor(e, t, i, n, o, a, s) {

this.window_ = void 0,

this.sizer_ = void 0,

this.scrollbarWidth_ = void 0,

this.firstPageSeparator_ = void 0,

this.embedTopOffset_ = void 0,

this.pageDimensions_ = void 0,

this.rotations_ = void 0,

this.layoutBehavior_ = void 0,

this.zoom_ = void 0,

this.scrollType_ = void 0,

this.updateLayoutContainerCallback_ = void 0,

this.renderLayoutContainerCallback_ = void 0,

this.updatePluginEmbedCallback_ = void 0,

this.documentDimensions_ = void 0,

this.position_ = void 0,

this.pdfOOPIFScrollbarEnabled_ = void 0,

this.viewportChangedCallbacks_ = void 0,

this.window_ = e,

this.sizer_ = t,

this.scrollbarWidth_ = i,
this.firstPageSeparator_ = n,

this.embedTopOffset_ = o,

this.layoutBehavior_ = a,

this.zoom_ = 1,

this.scrollType_ = [Link],

this.updateLayoutContainerCallback_ = function() {}

this.renderLayoutContainerCallback_ = function() {}

this.updatePluginEmbedCallback_ = function() {}

this.documentDimensions_ = null,

this.pageDimensions_ = [],

this.rotations_ = 0,

this.position_ = {

x: 0,

y: 0

},

this.pdfOOPIFScrollbarEnabled_ = s,

this.viewportChangedCallbacks_ = []

get size() {

return P({

width: this.window_.innerWidth,

height: this.window_.innerHeight
}, this.documentDimensions_, [Link](), [Link], this.embedTopOffset_
+ this.firstPageSeparator_, [Link])

documentNeedsScrollbars(e) {

const t = [Link];

return I({

width: this.window_.innerWidth,

height: this.window_.innerHeight

}, this.documentDimensions_, e, [Link], this.embedTopOffset_ +


this.firstPageSeparator_, t)

updateViewport() {

this.viewportChangedCallbacks_.forEach((function(e) {

e()

))

getZoom() {

return this.zoom_

setRenderLayoutContainerCallback(e) {

this.renderLayoutContainerCallback_ = e

setUpdateLayoutContainerCallback(e) {

this.updateLayoutContainerCallback_ = e

setUpdatePluginEmbedCallback(e) {
this.updatePluginEmbedCallback_ = e

get pageCount() {

return this.pageDimensions_.length

getClockwiseRotations() {

return this.rotations_

isPdfOopifScrollbarEnabled() {

return this.pdfOOPIFScrollbarEnabled_

setClockwiseRotations(e) {

this.rotations_ !== e && (this.rotations_ = e)

getDocumentDimensions() {

return {

width: this.documentDimensions_.width,

height: this.documentDimensions_.height

getVisiblePageRange() {

return b([Link], [Link], this.pageDimensions_, [Link],


[Link](), this.embedTopOffset_)

getPageScreenRect(e) {

if (!this.documentDimensions_)
return {

x: 0,

y: 0,

width: 0,

height: 0

};

e >= this.pageDimensions_.length && (e = this.pageDimensions_.length - 1);

const t = this.pageDimensions_[e]

, i = [Link](e)

, n = t.x + this.layoutBehavior_.getShadowsForPage(e).left

, o = [Link]();

return {

x: n * o + [Link]() - [Link].x,

y: this.embedTopOffset_ + i.y * o - [Link].y,

width: [Link] * o,

height: [Link] * o

getRenderedPageScreenRect(e) {

const t = [Link](e);

return {

x: [Link](t.x),

y: [Link](t.y),

width: [Link]([Link]),

height: [Link]([Link])

}
}

getPageLayoutRect(e) {

if (!this.documentDimensions_)

return {

x: 0,

y: 0,

width: 0,

height: 0

};

e >= this.pageDimensions_.length && (e = this.pageDimensions_.length - 1);

const t = [Link](e)

, i = [Link]();

return {

x: t.x * i,

y: t.y * i,

width: [Link] * i,

height: [Link] * i

getRenderedPageLayoutRect(e) {

const t = [Link](e);

return {

x: [Link](t.x),

y: [Link](t.y),

width: [Link]([Link]),

height: [Link]([Link])
}

getLayoutContainerRect() {

const e = this.embedTopOffset_ + this.firstPageSeparator_;

return function(e, t, i, n) {

let o = ([Link] - [Link] * i) / 2;

o = [Link]([Link](o, 0));

const a = S(t, i);

return {

x: o,

y: n,

width: [Link],

height: [Link]

}([Link], this.documentDimensions_, [Link](), e)

findPageForPoint(e, t) {

const i = [Link]();

for (let n = i[0]; n <= i[1]; n++) {

const i = [Link](n);

if (e >= i.x && e <= i.x + [Link] && t >= i.y && t <= i.y + [Link])

return n

return -1

addViewportChangedCallback(e) {
this.viewportChangedCallbacks_.push(e)

removeViewportChangedCallback(e) {

this.viewportChangedCallbacks_ = this.viewportChangedCallbacks_.filter((t => t !== e))

get position() {

return this.position_

getGutterWidth() {

return [Link]([Link](([Link] - this.documentDimensions_.width *


[Link]()) / 2), 0)

getPageInsetDimensions(e) {

return function(e, t, i) {

const n = [Link](e);

return {

x: t.x + [Link],

y: t.y + [Link],

width: [Link] - [Link] - [Link],

height: [Link] - [Link] - [Link]

}(e, this.pageDimensions_[e], this.layoutBehavior_)

getMostVisiblePage() {

const e = this.getViewportRect_()

, t = this.getPageAtY_([Link](e.y))
, i = this.getLastPageInViewport_(e);

return t === i ? t : function(e, t, i, n) {

let o = e

, a = 0;

for (let s = e; s < t + 1; s++) {

const e = n[s].width * n[s].height;

if (e <= 0)

continue;

const t = k(n[s], i) / e;

t > a && (o = s,

a = t)

return o

}(t, i, e, this.pageDimensions_)

getFirstVisiblePage() {

const e = this.getViewportRect_();

return this.getPageAtY_([Link](e.y))

getViewportRect_() {

return C([Link], [Link], [Link]())

getViewportRectWithZoom_() {

return C([Link], [Link], 1)

getPageAtY_(e) {
return E(e, this.pageDimensions_)

getPluginRectInFrame() {

return {

x: 0,

y: [Link],

width: [Link],

height: [Link] - [Link]

getPageAtYScreenCoordinate_(e) {

return this.getPageAtY_((e + [Link].y - this.embedTopOffset_) / [Link]())

getLastPageInViewport_(e) {

return T(e, [Link], this.embedTopOffset_, [Link](),


this.pageDimensions_)

set scrollType(e) {

this.scrollType_ = e

get scrollType() {

return this.scrollType_

set embedTopOffset(e) {

this.embedTopOffset_ = e

}
set position(e) {

this.position_ = e

get embedTopOffset() {

return this.embedTopOffset_

get layoutBehavior() {

return this.layoutBehavior_

set layoutBehavior(e) {

this.layoutBehavior_ = e

get documentDimensions() {

return this.documentDimensions_

set documentDimensions(e) {

this.documentDimensions_ = e

get scrollbarWidth() {

return this.scrollbarWidth_

get firstPageSeparator() {

return this.firstPageSeparator_

get zoom() {

return this.zoom_
}

set zoom(e) {

this.zoom_ = e

class D extends A {

constructor(e, t, i, n, o, a, s, r) {

super(e, t, i, n, o, s, r),

this.pdfFastScrollAsIsZoomEnabled_ = void 0,

this.isFullscreen_ = void 0,

[Link] = () => [Link] === [Link],

[Link] = () => {

const e = [Link]()

, t = M([Link](e), this.pageDimensions_)

, i = [Link];

[Link]("--page-scale", [Link]()),

[Link]("--y-clip-start", [Link](t.y).toString()),

[Link]("--y-clip-end", [Link]([Link] - (t.y +


[Link])).toString())

this.pdfFastScrollAsIsZoomEnabled_ = a,

this.isFullscreen_ = !1

setSize(e, t) {

this.pdfFastScrollAsIsZoomEnabled_ ? this.updatePluginEmbedCallback_(e, t) :
(this.sizer_.[Link] = e + "px",
this.sizer_.[Link] = t + "px")

updateViewport_() {

this.viewportChangedCallbacks_.forEach((e => {

e()

))

setDocumentDimensions(e) {

[Link] = e,

this.pageDimensions_ = [Link];

const t = [Link];

t >= 0 && t < 4 && [Link]() !== t && (this.rotations_ = t)

setLayoutBehavior(e) {

[Link] = e

handleToggleFullscreen(e) {

[Link]("fullscreen-mode", e),

this.isFullscreen_ = e,

this.isFullscreen_ ? ([Link] = [Link],

[Link]([Link])) :
([Link]([Link]),

[Link] = [Link])

goToNextPage() {
const e = [Link]();

[Link]([Link](e + [Link](),
this.pageDimensions_.length - [Link]()))

goToPreviousPage() {

const e = [Link]();

[Link]([Link](0, e - [Link]()))

scrollToPage(e) {

if (![Link] || e < 0 || e >= this.pageDimensions_.length)

return;

const t = [Link](e)

, {x: i, y: n, width: o, height: a} = M(t, this.pageDimensions_)

, s = [Link]

, r = [Link]

,l={

x: i * s + (o * s - [Link]) / 2,

y: n * s + (a * s - [Link]) / 2

};

[Link] = {

x: l.x,

y: [Link](l.y, 0)

},

[Link]()

contentSizeChanged_() {
if (![Link]())

return;

const e = S([Link], [Link]);

e && [Link]([Link], [Link] + this.firstPageSeparator_)

set zoom(e) {

[Link] = e,

this.contentSizeChanged_()

get zoom() {

return [Link]

get sizer() {

return this.sizer_

get firstPageSeperator() {

return this.firstPageSeparator_

get pageDimensions() {

return [Link]

getZoom() {

return [Link]

pluginToFrameCoordinate(e) {

return {
x: e.x,

y: e.y

frameToPluginViewportCoord(e) {

return {

x: e.x,

y: e.y

get position() {

return {

x: this.window_.scrollX,

y: this.window_.scrollY

set position(e) {

this.window_.scrollTo({

left: e.x,

top: e.y

})

get isFullscreen() {

return this.isFullscreen_

}
!function(e) {

const t = e;

function i(e, i) {

if ([Link] > 0) {

if ("getScriptHash"in i[0].[Link])

return [Link] = d,

[Link](t, [e, i]);

[Link] = h

return "function" == typeof h ? [Link](t, [e, i]) : [Link]

[Link] !== i && [Link] !== d && (h = [Link],

[Link] = i)

}(Error);

const x = new MessageChannel;

"undefined" != typeof hookErrorReporting && hookErrorReporting("pdf-content", (e => {

const t = {

errorInfo: e,

type: "contentViewError"

};

[Link](t),

[Link] = e

));

const L = [Link]("embed")

, F = [Link]("pdfoopifscrollbarenabled")
, N = [Link]("pdfshiftstraightlineinkingenabled")

, O = [Link]("pdfpreviewenabled")

, R = [Link]("pdfLoadUIAfterRenderEnabled")

, H = [Link]("pdfscrollingonmainthread")

, V = [Link]("pdfscrollingwithrequestanimationframe")

, G = [Link]("pdffastscrollenabled")

, K = +[Link]["first-page-separator"].value;

let U = !1;

const z = G ? [Link]("layout-container") :
[Link]("sizer")

, B = [Link]("internal-document-container");

let X, $ = L, W = !1;

const Z = new Promise((e => X = e));

F && !H && ([Link]("no-compositor-scroll"),

[Link]("no-compositor-scroll"));

const Y = new class {

constructor(e, t, i, n, o, a, s) {

this.window_ = e,

this.plugin_ = i,

this.pdfAnnotationManager_ = null,

this.pdfAnnotationManagerResolver_ = null,

this.pdfAnnotationManagerLoaded_ = new Promise((e =>


this.pdfAnnotationManagerResolver_ = e)),

this.documentContainer_ = n,

this.pdfViewerUIEventCallback_ = function() {}

this.pdfContentUIEventCallback_ = function() {}
,

this.pdfOOPIFScrollbarEnabled_ = a,

this.pdfFastScrollAsIsZoomEnabled_ = o;

const r = new m;

this.viewport_ = new D(this.window_,t,function(e) {

const t = [Link]("div");

[Link] = "hidden",

[Link] = "scroll",

[Link] = "50px",

[Link] = "50px",

[Link] = "absolute",

[Link](t);

const i = [Link] - (e ? [Link](parseFloat(getComputedStyle(t).width)) :


[Link]);

return [Link](t),

}(this.pdfFastScrollAsIsZoomEnabled_),s,0,this.pdfFastScrollAsIsZoomEnabled_,r,[Link]
crollbarEnabled_),

this.viewport_.setUpdatePluginEmbedCallback(( (e, t) => this.updatePluginEmbed_(e,


t))),

this.pdfOOPIFScrollbarEnabled_ && this.viewport_.addViewportChangedCallback(( () => {

this.pdfAnnotationManager_ && this.pdfAnnotationManager_.viewportChanged()

)),

this.viewportScroller_ = new w(this.viewport_,this.plugin_,this.window_),

this.isZoomInProgress_ = !1
}

setPdfViewerUIEventCallback(e) {

this.pdfViewerUIEventCallback_ = e

setPdfContentViewUIEventCallback(e) {

this.pdfContentUIEventCallback_ = e

getViewportSize_() {

return P({

width: [Link],

height: [Link]

}, this.documentDimensions_, this.zoom_, this.scrollbarWidth_, 0,


[Link])

setLayoutBehavior(e, t, i) {

let n;

switch (e) {

case g.SINGLE_PAGE:

n = new m;

break;

case g.DUAL_PAGE:

n = new v(t,i,this.viewport_.[Link])

this.viewport_.setLayoutBehavior(n)

setDocumentDimensions(e) {
this.pdfOOPIFScrollbarEnabled_ && this.viewport_.setDocumentDimensions(e)

updatePluginEmbed_(e, t) {

this.plugin_.setAttribute("height", t),

this.plugin_.setAttribute("width", e)

updateSize(e, t) {

this.pdfOOPIFScrollbarEnabled_ && this.viewport_.setSize(e, t)

handleToggleFullscreen(e) {

this.viewport_.handleToggleFullscreen(e)

handleOnWheel(e) {

return !!this.viewport_.isDiscreteScrollEnabled() && ("down" === [Link] ?


this.viewport_.goToNextPage() : "up" === [Link] && this.viewport_.goToPreviousPage(),

!0)

handleOnSwipe(e) {

return !!this.viewport_.isDiscreteScrollEnabled() && ("down" === [Link] ?


this.viewport_.goToPreviousPage() : "up" === [Link] && this.viewport_.goToNextPage(),

!0)

updateViewport(e) {

this.viewport_.zoom = e,

this.viewport_.updateViewport()

handleViewRecovery(e) {
[Link] && ([Link] &&
[Link](g.DUAL_PAGE, !1, !1),

this.viewport_.setClockwiseRotations([Link]))

get viewport() {

return this.viewport_

scrollTo(e) {

this.viewport_.position = e

initializeAnnotationManager() {

const e = [Link]("pdfFreeFormHighlighterEnabled");

this.pdfAnnotationManager_ = new y(this.plugin_,e,!1),

this.pdfAnnotationManagerResolver_(),

this.pdfAnnotationManager_.setPdfViewerUIEventCallback(( (e, t) =>


this.pdfViewerUIEventCallback_(e, t))),

this.pdfAnnotationManager_.setPdfContentViewUIEventCallback(( (e, t) =>


this.pdfContentUIEventCallback_(e, t))),

this.pdfAnnotationManager_.setPluginControllerCallback((e =>
this.plugin_.postMessage(e))),

this.pdfAnnotationManager_.initializeAnnotationManager(this.viewport_,
this.documentContainer_)

async handleAnnotationEvent(e, t) {

switch (await this.pdfAnnotationManagerLoaded_,

e) {

case "annotation-mode-changed":
[Link] !== f.ADDING_FREE_TEXT && [Link] !==
f.ADDING_FREE_TEXT || this.pdfContentUIEventCallback_("toggle-free-text-mode", {}),

[Link] = [Link],

this.pdfAnnotationManager_.annotationModeChanged(t);

break;

case "text-only-highlight-toggled":

this.pdfAnnotationManager_.HandleTextOnlyHighlightToggle(t);

break;

case "touch-draw-mode-changed":

this.pdfAnnotationManager_.touchDrawModeChange([Link],
[Link]);

break;

case "deactivateOverlays":

this.pdfAnnotationManager_.deactivateOverlays();

break;

case "inkStrokesAdded":

this.pdfAnnotationManager_.inkStrokeAdded(t);

case "enable-free-form-highlight":

this.pdfAnnotationManager_.enableFreeFormHighlight(t);

break;

case "colorSchemeChanged":

this.pdfAnnotationManager_.colorSchemeChange(t);

break;

case "createHighlightFromSelection":

this.pdfAnnotationManager_.handleCreateHighlight(t.a, t.r, t.g, t.b);

break;

case "changeHighlightColor":
this.pdfAnnotationManager_.handleChangeHighlightColor(t.a, t.r, t.g, t.b);

break;

case "deleteHighlight":

this.pdfAnnotationManager_.handleDeleteHighlight();

break;

case "documentDimensions":

this.pdfAnnotationManager_.documentDimensionUpdate();

break;

case "pointerEvent":

this.pdfAnnotationManager_.handlePointerEventFromPlugin(t);

break;

case "onBlur":

this.pdfAnnotationManager_.onBlur();

break;

case "viewportChanged":

this.viewport_.updateViewport();

break;

case "freeTextAdded":

case "setFreeTextFont":

case "showEditableFreeText":

case "showNewFreeTextAt":

case "showAddFreeTextBox":

case "freeTextEditsSaved":

this.pdfAnnotationManager_.handleFreeTextEvent({

type: e,

...t
});

break;

case "create-free-text-annotation":

case "update-free-text-annotation":

case "delete-free-text-annotation":

case "free-text-pointer-event":

this.pdfAnnotationManager_.handleFreeTextUIEvent(e, t);

break;

case "keyDown":

case "keyUp":

[Link] && "Shift" === [Link] &&


this.pdfAnnotationManager_.setShiftKeyPressed([Link]);

break;

default:

throw new Error(`Unknown annotation event: ${e}`)

enableViewportScrolling(t) {

e(this.pdfOOPIFScrollbarEnabled_),

this.viewportScroller_.setEnableScrolling(t)

getScrollOffset() {

return this.viewport_.position

set zoomInProgress(e) {

this.isZoomInProgress_ = e
}

get zoomInProgress() {

return this.isZoomInProgress_

set renderIteration(e) {

this.renderIteration_ = e

get renderIteration() {

return this.renderIteration_

get isFullscreen() {

return this.viewport_.isFullscreen

get annotationMode() {

return this.pdfAnnotationManager_.annotationMode

(window,z,L,B,G,F,K);

[Link](( (e, t) => pe(e, t))),

[Link](( (e, t) => {

ae(e, t)

)),

[Link] = Y,

[Link]("focus", (e => {

[Link]({
type: "focusChange",

focus: !0,

timestamp: [Link]()

})

)),

[Link]("blur", (e => {

[Link]({

type: "focusChange",

focus: !1,

timestamp: [Link]()

})

)),

[Link]("focusin", (e => {

[Link] && ($ = [Link])

)),

[Link]("full-frame") && [Link]();

const q = new URL([Link]("src"));

let j = [Link];

"chrome-untrusted://print" === j && (j = "edge://print"),

"edge://print" !== j && ([Link] = new c(L),

[Link] = {

HISTOGRAM_LOG: "histogram-log",

HISTOGRAM_LINEAR: "histogram-linear"
}),

[Link]({

type: "connect",

token: [Link]

}, j, [x.port2]);

const J = [Link]("#pdf-content-view-root");

let Q, ee = !1;

const te = new Promise((e => Q = e));

let ie;

const ne = new Promise((e => ie = e));

F || ([Link] = {

pdfOOPIFScrollbarEnabled: F

},

ie());

const oe = [];

function ae(e, t) {

const i = new CustomEvent("internal-plugin-event",{

bubbles: !1,

detail: {

eventName: e,

eventData: t

});

ee ? [Link](i) : (_e(),

[Link]([Link]))

}
[Link]("pdf-content-view-event", (e => {

var t;

switch ([Link]) {

case "pdf-content-view-loaded":

for (ee = !0; [Link] > 0; ) {

const e = [Link]();

ae([Link], [Link])

F && U && [Link]();

break;

case "form-field-event":

he({

type: "formFieldEvent",

eventData: [Link]

});

break;

case "form-document-event":

[Link]({

type: "formDocumentEvent",

eventData: [Link]

});

break;

case "page-level-form-field-appearance-stream-request":

[Link]({

type: "pageLevelFormFieldAppearanceRequest",

requestId: [Link],
dataList: [Link],

scale: [Link],

pageIndex: [Link]

});

break;

case "get-free-text-font":

[Link]({

type: "getFreeTextFont",

text: [Link]

});

break;

case "create-free-text-annotation":

case "update-free-text-annotation":

case "delete-free-text-annotation":

case "free-text-pointer-event":

[Link]([Link], [Link]);

break;

default:

throw new Error(`Unhandled content-view message: ${null === (t = [Link]) || void 0 ===
t ? void 0 : [Link]}`)

));

let se = !1

, re = !1;

[Link]("message", (t => {
switch ([Link]) {

case "formFocusChange":

se = [Link];

break;

case "setCaretModeEnabled":

re = [Link];

break;

case "setFormData":

case "appendFormFields":

const e = [Link]();

return ae([Link], {

formData: [Link],

config: [Link],

startTime: e,

shouldInitializeFormController: !W

}),

void (W || (W = !0,

X(),

pe("has-form-data", {})))

case "removeFormFields":

return e(W),

void ae([Link], {

pageIndex: [Link],

removedFieldIds: [Link]
});

case "documentDimensions":

F && ([Link]([Link]),

[Link]([Link], [Link]));

break;

case "onFieldAppearanceGenerated":

return void ae([Link], t);

case "viewRecoveryInfo":

R && [Link] && [Link]({

type: "pdfLoaderMessage",

data: [Link]

}, j),

[Link]([Link]);

break;

case "inkStrokesAdded":

case "enable-free-form-highlight":

case "colorSchemeChanged":

case "createHighlightFromSelection":

case "changeHighlightColor":

case "deleteHighlight":

case "freeTextAdded":

case "showEditableFreeText":

case "showNewFreeTextAt":

case "showAddFreeTextBox":

case "freeTextEditsSaved":

if (F)
return void [Link]([Link], [Link]);

break;

case "setIsSelecting":

if (F) {

const e = [Link];

return void [Link](e)

break;

case "renderIterationMessage":

if (F)

return void ([Link] && [Link] === [Link] &&


[Link] && ([Link] = !1,

W && ae("updateZoomInProgress", {

type: "updateZoomInProgress",

isZoomInProgress: !1

})));

break;

case "firstRenderComplete":

return Q(),

void (R && [Link]({

type: "pdfLoaderMessage",

data: [Link]

}, j));

case "loadProgress":

case "getPassword":

case "navigateToDestination":
R && [Link]({

type: "pdfLoaderMessage",

data: [Link]

}, j)

[Link]([Link])

));

let le = !1;

if ([Link] = i => {

switch ([Link]) {

case "layoutUpdate":

return e(W),

void ae([Link], [Link]);

case "setLayout":

if (!F)

break;

[Link]([Link], [Link], [Link]);

break;

case "setPDFFullscreenMode":

F && [Link]([Link]);

break;

case "subscribePointerEvents":

return [Link]("pointerdown", ge),

[Link]("pointermove", ge),

void [Link]("pointerup", ge);


case "unsubscribePointerEvents":

return [Link]("pointerdown", ge),

[Link]("pointermove", ge),

void [Link]("pointerup", ge);

case "restoreFocusToElement":

return void ($ && $.focus());

case "stopScrolling":

if (!F)

break;

return [Link] || ([Link] = !0,

W && ae("updateZoomInProgress", {

type: "updateZoomInProgress",

isZoomInProgress: !0

})),

le = !0,

void [Link]([Link]);

case "viewport":

if (!F) {

[Link]([Link]);

break

if ("afterZoom" === [Link]) {

[Link] = [Link],

le = !1,

[Link]([Link]);

const e = [Link]();
[Link]({

x: [Link],

y: [Link] + K

});

const t = [Link]();

e.x === t.x && e.y === t.y && [Link](new Event("scroll"))

return void [Link]([Link]);

case "syncScrollToRemote":

if (!F)

return;

le || [Link]({

x: [Link].x,

y: [Link].y

});

const e = [Link]();

return void [Link]({

type: "ackScrollToRemote",

x: e.x,

y: e.y,

scrollSuppressed: le

})

case "updateSize":

return void (le || ([Link]([Link], [Link]),


R && F && ([Link] = "auto")));

case "updateZoomInProgress":

return e(W),

void (F ? [Link] !== [Link] && ([Link] =


[Link],

ae([Link], [Link])) : ae([Link], [Link]));

case "loadTimeDataInfo":

return [Link] = [Link],

void ie();

case "initAnnotationManager":

return e(F),

U = !0,

void (ee ? [Link]() : _e());

case "annotationEvent":

return void (F && [Link]([Link], [Link]));

case "documentFocus":

F && ![Link] && [Link]("onBlur", [Link])

[Link]([Link])

F) {

if (V) {

let e = !1;

[Link]("scroll", ( () => {

e || ([Link](( () => {
const t = [Link]();

[Link]({

type: "syncScrollFromRemote",

x: t.x,

y: t.y

}),

e = !1

)),

e = !0)

), {

passive: !0

})

} else

[Link]("scroll", ( () => {

const e = [Link]();

[Link]({

type: "syncScrollFromRemote",

x: e.x,

y: e.y

})

));

[Link]("resize", ( () => {

pe("resize", {})
}

))

function he(e) {

[Link](e)

function de(e) {

const t = e;

[Link]({

type: "gesture",

gesture: {

type: [Link],

detail: [Link]

})

[Link] = function(t) {

switch ([Link]) {

case "updateFormFields":

W ? ae([Link], t) : [Link](( () => {

ae([Link], t)

));

break;

case "updateFormFieldOnKeyStroke":

case "doDefaultAction":
e(W),

ae([Link], t);

break;

case "setFormFieldFocus":

ae([Link], t);

break;

case "setPluginFocus":

[Link] && [Link]();

break;

case "setFreeTextFont":

F && [Link]([Link], t)

return {

type: "returnSyncMessage"

const ce = new r(window);

for (const e of ["pinchstart", "pinchupdate", "pinchend"])

[Link]().addEventListener(e, de);

function ge(e) {

[Link]({

type: "pointerEvent",

detail: {

type: [Link],

pointerId: [Link],
pointerType: [Link],

isPrimary: [Link],

clientX: [Link],

clientY: [Link],

altKey: [Link],

button: [Link],

ctrlKey: [Link],

metaKey: [Link],

shiftKey: [Link]

})

function ue(e) {

return !!([Link] || [Link] || [Link] || [Link])

function pe(e, t) {

[Link]({

type: e,

eventData: t

})

async function _e() {

await ne,

await te;

const e = [Link]("content-view-script-template");

e && [Link]([Link])
}

[Link]().addEventListener("wheel", F ? e => [Link]([Link]) : de),

[Link]().addEventListener("swipe", F ? e => [Link]([Link]) : de),

[Link]("keydown", (e => {

if (F && a(e, O, [Link]))

[Link]();

else if (!F || !o([Link], [Link]) && ![Link]) {

switch ([Link]) {

case " ":

case "Escape":

break;

case "PageDown":

case "PageUp":

ue(e) || re || [Link]();

break;

case "ArrowDown":

case "ArrowLeft":

case "ArrowRight":

case "ArrowUp":

se || ue(e) || re || [Link]();

break;

case "Tab":

se && ([Link](),

he({

type: "keyDown",

eventData: {
keyCode: [Link],

code: [Link],

key: [Link],

shiftKey: [Link],

ctrlKey: [Link],

altKey: [Link],

metaKey: [Link]

}));

break;

case "s":

if (s(e) && ![Link] && ![Link]) {

[Link](),

R && [Link]({

type: "pdfLoaderMessage",

data: {

type: "saveTriggered"

}, j);

break

return;

case "a":

if (!se && s(e) && ![Link] && ![Link]) {

[Link]();

break
}

return;

case "y":

if (s(e) && ![Link] && ![Link]) {

he({

type: "redoAction",

eventData: {}

});

break

return;

case "z":

if (s(e) && ![Link] && ![Link]) {

he({

type: "undoAction",

eventData: {}

});

break

return;

case "Shift":

if ([Link] || !N)

return;

if (F)

return void [Link]("keyDown", {

code: [Link],
key: [Link],

shiftKey: [Link],

ctrlKey: [Link],

altKey: [Link],

metaKey: [Link]

});

break;

default:

if (s(e))

break;

return

[Link]({

type: "sendKeyEvent",

keyEvent: {

keyCode: [Link],

code: [Link],

key: [Link],

shiftKey: [Link],

ctrlKey: [Link],

altKey: [Link],

metaKey: [Link]

})

}
)),

N && [Link]("keyup", (e => {

"Shift" === [Link] && (F ? [Link]("keyUp", {

code: [Link],

key: [Link],

shiftKey: [Link],

ctrlKey: [Link],

altKey: [Link],

metaKey: [Link]

}) : [Link]({

type: "sendKeyEvent",

keyEvent: {

keyCode: [Link],

code: [Link],

key: [Link],

shiftKey: [Link],

ctrlKey: [Link],

altKey: [Link],

metaKey: [Link]

}))

)),

[Link]("keypress", (e => {

if (!(F && o([Link], [Link]) || " " !== [Link]))

se || re || [Link]()
}

))

)();

You might also like