require("./index.css");
var $dYZEH$unionpdfmodels = require("@unionpdf/models");
var $dYZEH$reactjsxruntime = require("react/jsx-runtime");
var $dYZEH$react = require("react");

function $parcel$exportWildcard(dest, source) {
  Object.keys(source).forEach(function(key) {
    if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
      return;
    }

    Object.defineProperty(dest, key, {
      enumerable: true,
      get: function get() {
        return source[key];
      }
    });
  });

  return dest;
}
function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
var $67fde60292f59f18$exports = {};
var $c3d84c7f3f022977$exports = {};

$parcel$export($c3d84c7f3f022977$exports, "PdfNavigator", () => $c3d84c7f3f022977$export$c50b8951719f4254);

const $c3d84c7f3f022977$var$LOG_SOURCE = "PdfNavigator";
const $c3d84c7f3f022977$var$LOG_CATEGORY = "Navigate";
class $c3d84c7f3f022977$export$c50b8951719f4254 {
    constructor(logger = new (0, $dYZEH$unionpdfmodels.NoopLogger)()){
        this.logger = logger;
        this.currPageIndex = 0;
        this.listeners = [];
    }
    gotoPage(data, source) {
        this.logger.debug($c3d84c7f3f022977$var$LOG_SOURCE, $c3d84c7f3f022977$var$LOG_CATEGORY, `${source} try to navigate to `, data);
        if (this.currPageIndex === data.pageIndex) return;
        this.currPageIndex = data.pageIndex;
        this.emit({
            kind: "GotoPage",
            data: data
        }, source);
    }
    emit(evt, source) {
        for (const listener of this.listeners)try {
            if (listener.source !== source) listener.handler(evt, source);
        } catch (e) {
            this.logger.error($c3d84c7f3f022977$var$LOG_SOURCE, $c3d84c7f3f022977$var$LOG_CATEGORY, "error happens when calling navigator listener: ", e);
        }
    }
    addEventListener(source, handler) {
        const index = this.listeners.findIndex((_listener)=>{
            return _listener.source === source;
        });
        if (index === -1) this.listeners.push({
            source: source,
            handler: handler
        });
    }
    removeEventListener(source, handler) {
        const index = this.listeners.findIndex((_listener)=>{
            return _listener.source === source && _listener.handler === handler;
        });
        if (index !== -1) this.listeners.splice(index, 1);
    }
}


var $755c8179fe46ecad$exports = {};

$parcel$export($755c8179fe46ecad$exports, "PdfNavigatorContext", () => $755c8179fe46ecad$export$caa2ab773e33e5e);
$parcel$export($755c8179fe46ecad$exports, "PdfNavigatorContextProvider", () => $755c8179fe46ecad$export$e54912d9d6938cde);
$parcel$export($755c8179fe46ecad$exports, "usePdfNavigator", () => $755c8179fe46ecad$export$5783548f96893eea);


const $755c8179fe46ecad$export$caa2ab773e33e5e = /*#__PURE__*/ (0, ($parcel$interopDefault($dYZEH$react))).createContext(null);
function $755c8179fe46ecad$export$e54912d9d6938cde(props) {
    const { children: children , navigator: navigator  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($755c8179fe46ecad$export$caa2ab773e33e5e.Provider, {
        value: navigator,
        children: children
    });
}
function $755c8179fe46ecad$export$5783548f96893eea() {
    return (0, $dYZEH$react.useContext)($755c8179fe46ecad$export$caa2ab773e33e5e);
}


var $cf7129446d2a0796$exports = {};

$parcel$export($cf7129446d2a0796$exports, "PdfApplication", () => $cf7129446d2a0796$export$2b57e2eec3927466);


var $94e70350e14a7015$exports = {};

$parcel$export($94e70350e14a7015$exports, "PdfApplicationMode", () => $94e70350e14a7015$export$d428584fab51ca5c);
$parcel$export($94e70350e14a7015$exports, "PdfApplicationContext", () => $94e70350e14a7015$export$176a77a47ca6f551);
$parcel$export($94e70350e14a7015$exports, "PdfApplicationContextProvider", () => $94e70350e14a7015$export$97649174a84438ac);
$parcel$export($94e70350e14a7015$exports, "usePdfApplication", () => $94e70350e14a7015$export$8140ffd75f17fcde);


let $94e70350e14a7015$export$d428584fab51ca5c;
(function(PdfApplicationMode) {
    PdfApplicationMode[PdfApplicationMode["Read"] = 0] = "Read";
    PdfApplicationMode[PdfApplicationMode["Edit"] = 1] = "Edit";
})($94e70350e14a7015$export$d428584fab51ca5c || ($94e70350e14a7015$export$d428584fab51ca5c = {}));
const $94e70350e14a7015$export$176a77a47ca6f551 = /*#__PURE__*/ (0, ($parcel$interopDefault($dYZEH$react))).createContext({
    mode: $94e70350e14a7015$export$d428584fab51ca5c.Read
});
function $94e70350e14a7015$export$97649174a84438ac(props) {
    const { children: children , mode: mode  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($94e70350e14a7015$export$176a77a47ca6f551.Provider, {
        value: {
            mode: mode
        },
        children: children
    });
}
function $94e70350e14a7015$export$8140ffd75f17fcde() {
    return (0, $dYZEH$react.useContext)($94e70350e14a7015$export$176a77a47ca6f551);
}


function $cf7129446d2a0796$export$2b57e2eec3927466(props) {
    const { mode: mode , children: children , ...rest } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
        className: `pdf__application ${mode === (0, $94e70350e14a7015$export$d428584fab51ca5c).Edit ? "pdf__application--edit" : "pdf__application--read"}`,
        ...rest,
        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $94e70350e14a7015$export$97649174a84438ac), {
            mode: mode,
            children: children
        })
    });
}



var $1598d44315b5fc6c$exports = {};

$parcel$export($1598d44315b5fc6c$exports, "PdfDocument", () => $1598d44315b5fc6c$export$d46c104bc6d5cb7e);



var $a75e6b16ab56d170$exports = {};

$parcel$export($a75e6b16ab56d170$exports, "PdfEngineContext", () => $a75e6b16ab56d170$export$656d74ab10d4ec31);
$parcel$export($a75e6b16ab56d170$exports, "PdfEngineContextProvider", () => $a75e6b16ab56d170$export$ac36c6f7cf6ec8da);
$parcel$export($a75e6b16ab56d170$exports, "usePdfEngine", () => $a75e6b16ab56d170$export$6dabc89b58a60ab3);


const $a75e6b16ab56d170$export$656d74ab10d4ec31 = /*#__PURE__*/ (0, ($parcel$interopDefault($dYZEH$react))).createContext(null);
function $a75e6b16ab56d170$export$ac36c6f7cf6ec8da(props) {
    const { children: children , engine: engine  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($a75e6b16ab56d170$export$656d74ab10d4ec31.Provider, {
        value: engine,
        children: children
    });
}
function $a75e6b16ab56d170$export$6dabc89b58a60ab3() {
    return (0, $dYZEH$react.useContext)($a75e6b16ab56d170$export$656d74ab10d4ec31);
}


var $48f9a3dd64fe1467$exports = {};

$parcel$export($48f9a3dd64fe1467$exports, "defaultTheme", () => $48f9a3dd64fe1467$export$164de7ab8df77ef0);
$parcel$export($48f9a3dd64fe1467$exports, "ThemeContext", () => $48f9a3dd64fe1467$export$2c657da244d00bd6);
$parcel$export($48f9a3dd64fe1467$exports, "ThemeContextProvider", () => $48f9a3dd64fe1467$export$59c2a5d3b0139bc8);
$parcel$export($48f9a3dd64fe1467$exports, "useTheme", () => $48f9a3dd64fe1467$export$93d4e7f90805808f);



const $48f9a3dd64fe1467$export$164de7ab8df77ef0 = {};
const $48f9a3dd64fe1467$export$2c657da244d00bd6 = /*#__PURE__*/ (0, $dYZEH$react.createContext)($48f9a3dd64fe1467$export$164de7ab8df77ef0);
function $48f9a3dd64fe1467$export$59c2a5d3b0139bc8(props) {
    const { theme: theme , children: children  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($48f9a3dd64fe1467$export$2c657da244d00bd6.Provider, {
        value: theme,
        children: children
    });
}
function $48f9a3dd64fe1467$export$93d4e7f90805808f() {
    return (0, $dYZEH$react.useContext)($48f9a3dd64fe1467$export$2c657da244d00bd6);
}


var $3db4be2023343aac$exports = {};

$parcel$export($3db4be2023343aac$exports, "PdfDocumentContext", () => $3db4be2023343aac$export$fee7bd7de68330f1);
$parcel$export($3db4be2023343aac$exports, "PdfDocumentContextProvider", () => $3db4be2023343aac$export$f1798209adbb5a03);
$parcel$export($3db4be2023343aac$exports, "usePdfDocument", () => $3db4be2023343aac$export$3a01b9f380b97660);


const $3db4be2023343aac$export$fee7bd7de68330f1 = /*#__PURE__*/ (0, ($parcel$interopDefault($dYZEH$react))).createContext(null);
function $3db4be2023343aac$export$f1798209adbb5a03(props) {
    const { children: children , doc: doc  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($3db4be2023343aac$export$fee7bd7de68330f1.Provider, {
        value: doc,
        children: children
    });
}
function $3db4be2023343aac$export$3a01b9f380b97660() {
    return (0, $dYZEH$react.useContext)($3db4be2023343aac$export$fee7bd7de68330f1);
}


function $1598d44315b5fc6c$export$d46c104bc6d5cb7e(props) {
    const { id: id , source: source , onOpenSuccess: onOpenSuccess , onOpenFailure: onOpenFailure , children: children , ...rest } = props;
    const [doc, setDoc] = (0, $dYZEH$react.useState)(null);
    const engine = (0, $a75e6b16ab56d170$export$6dabc89b58a60ab3)();
    const theme = (0, $48f9a3dd64fe1467$export$93d4e7f90805808f)();
    const onOpenSuccessRef = (0, $dYZEH$react.useRef)(onOpenSuccess);
    onOpenSuccessRef.current = onOpenSuccess;
    const onOpenFailureRef = (0, $dYZEH$react.useRef)(onOpenFailure);
    onOpenFailureRef.current = onOpenFailure;
    (0, $dYZEH$react.useEffect)(()=>{
        if (engine && id && source) {
            setDoc(null);
            let doc;
            const task = engine.openDocument(id, source);
            task.wait((_doc)=>{
                doc = _doc;
                setDoc(doc);
                onOpenSuccessRef.current?.(doc);
            }, (error)=>{
                onOpenFailureRef.current?.(error);
            });
            return ()=>{
                task.abort();
                if (doc) engine.closeDocument(doc);
            };
        }
    }, [
        engine,
        id,
        source
    ]);
    const themeStyle = (0, $dYZEH$react.useMemo)(()=>{
        const styles = {};
        for(let key in theme)styles[`--${key}`] = theme[key];
        return styles;
    }, [
        theme
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
        className: "pdf__document",
        style: themeStyle,
        ...rest,
        children: doc ? /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $3db4be2023343aac$export$f1798209adbb5a03), {
            doc: doc,
            children: children
        }) : null
    });
}





$parcel$exportWildcard($67fde60292f59f18$exports, $c3d84c7f3f022977$exports);
$parcel$exportWildcard($67fde60292f59f18$exports, $755c8179fe46ecad$exports);
$parcel$exportWildcard($67fde60292f59f18$exports, $cf7129446d2a0796$exports);
$parcel$exportWildcard($67fde60292f59f18$exports, $94e70350e14a7015$exports);
$parcel$exportWildcard($67fde60292f59f18$exports, $1598d44315b5fc6c$exports);
$parcel$exportWildcard($67fde60292f59f18$exports, $3db4be2023343aac$exports);
$parcel$exportWildcard($67fde60292f59f18$exports, $a75e6b16ab56d170$exports);
$parcel$exportWildcard($67fde60292f59f18$exports, $48f9a3dd64fe1467$exports);


var $e8486cc6b23be6e7$exports = {};
var $e48da51f1f92ae93$exports = {};

$parcel$export($e48da51f1f92ae93$exports, "ErrorBoundary", () => $e48da51f1f92ae93$export$e926676385687eaf);








function $667d334a38c45691$export$353f5b6fc5456de1(props) {
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("button", {
        ...props
    });
}
function $667d334a38c45691$export$4c260019440d418f(props) {
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
        ...props
    });
}
function $667d334a38c45691$export$ef9b1a59e592288f(props) {
    const { options: options , ...rest } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("select", {
        ...rest,
        children: options.map((option, index)=>{
            return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("option", {
                value: option.value,
                children: option.label
            }, index);
        })
    });
}
function $667d334a38c45691$export$f5b8910cec6cf069(props) {
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("input", {
        ...props
    });
}


const $5ed4cf37fd6ec2d8$export$47c7a09a9c745c32 = {
    ToolbarComponent: (0, $667d334a38c45691$export$4c260019440d418f),
    ButtonComponent: (0, $667d334a38c45691$export$353f5b6fc5456de1),
    SelectComponent: (0, $667d334a38c45691$export$ef9b1a59e592288f),
    InputComponent: (0, $667d334a38c45691$export$f5b8910cec6cf069)
};
const $5ed4cf37fd6ec2d8$export$c37ea42564a5df3c = /*#__PURE__*/ (0, $dYZEH$react.createContext)($5ed4cf37fd6ec2d8$export$47c7a09a9c745c32);
function $5ed4cf37fd6ec2d8$export$53b091cec8283fd(props) {
    const { children: children , components: components  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($5ed4cf37fd6ec2d8$export$c37ea42564a5df3c.Provider, {
        value: {
            ...$5ed4cf37fd6ec2d8$export$47c7a09a9c745c32,
            ...components
        },
        children: children
    });
}
function $5ed4cf37fd6ec2d8$export$ac09e16cba7ea428() {
    return (0, $dYZEH$react.useContext)($5ed4cf37fd6ec2d8$export$c37ea42564a5df3c);
}
function $5ed4cf37fd6ec2d8$export$99ae2648e430e84e(is) {
    const binding = $5ed4cf37fd6ec2d8$export$ac09e16cba7ea428();
    return binding[is];
}
function $5ed4cf37fd6ec2d8$export$aa5b7e97087b9e24() {
    return $5ed4cf37fd6ec2d8$export$99ae2648e430e84e("ButtonComponent");
}
function $5ed4cf37fd6ec2d8$export$b3c1fb91a092f024() {
    return $5ed4cf37fd6ec2d8$export$99ae2648e430e84e("ToolbarComponent");
}
function $5ed4cf37fd6ec2d8$export$1a3fc139fb4a9210() {
    return $5ed4cf37fd6ec2d8$export$99ae2648e430e84e("SelectComponent");
}
function $5ed4cf37fd6ec2d8$export$461fe4d8e5b241df() {
    return $5ed4cf37fd6ec2d8$export$99ae2648e430e84e("InputComponent");
}
const $5ed4cf37fd6ec2d8$export$eeac4527d8896b91 = {
    unknownError: "Unknown Error",
    rotate0Deg: "0 degree",
    rotate90Deg: "90 degree",
    rotate180Deg: "180 degree",
    rotate270Deg: "270 degree"
};
const $5ed4cf37fd6ec2d8$export$91a6b3e6b173027a = /*#__PURE__*/ (0, $dYZEH$react.createContext)($5ed4cf37fd6ec2d8$export$eeac4527d8896b91);
function $5ed4cf37fd6ec2d8$export$3ccbe4a5cf1a6d53(props) {
    const { children: children , strings: strings  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($5ed4cf37fd6ec2d8$export$91a6b3e6b173027a.Provider, {
        value: {
            ...$5ed4cf37fd6ec2d8$export$eeac4527d8896b91,
            ...strings
        },
        children: children
    });
}
function $5ed4cf37fd6ec2d8$export$284d56c62f28218c() {
    return (0, $dYZEH$react.useContext)($5ed4cf37fd6ec2d8$export$91a6b3e6b173027a);
}
function $5ed4cf37fd6ec2d8$export$b9d932297e849254(key) {
    const strings = (0, $dYZEH$react.useContext)($5ed4cf37fd6ec2d8$export$91a6b3e6b173027a);
    return strings[key] || key;
}


class $e48da51f1f92ae93$export$e926676385687eaf extends (0, ($parcel$interopDefault($dYZEH$react))).Component {
    constructor(props){
        super(props);
        this.state = {};
    }
    static getDerivedStateFromError(error) {
        return {
            error: error
        };
    }
    componentDidCatch(error, errorInfo) {
        console.log(error, errorInfo);
    }
    render() {
        if (this.state.error) return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $5ed4cf37fd6ec2d8$export$91a6b3e6b173027a).Consumer, {
            children: (strings)=>{
                return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("h1", {
                    children: strings.unknownError
                });
            }
        });
        return this.props.children;
    }
}


var $07aafc7b19e25a78$exports = {};

$parcel$export($07aafc7b19e25a78$exports, "PDF_NAVIGATOR_SOURCE_TOOLBAR", () => $07aafc7b19e25a78$export$4c7b7fca4aeb9016);
$parcel$export($07aafc7b19e25a78$exports, "PdfToolbar", () => $07aafc7b19e25a78$export$88448ef14ae22a2d);







const $07aafc7b19e25a78$export$4c7b7fca4aeb9016 = "Toolbar";
function $07aafc7b19e25a78$export$88448ef14ae22a2d(props) {
    const { scaleFactor: scaleFactor , changeScaleFactor: changeScaleFactor , rotation: rotation , changeRotation: changeRotation , children: children , ...rest } = props;
    const strings = (0, $5ed4cf37fd6ec2d8$export$284d56c62f28218c)();
    const { ToolbarComponent: ToolbarComponent , InputComponent: InputComponent , SelectComponent: SelectComponent  } = (0, $5ed4cf37fd6ec2d8$export$ac09e16cba7ea428)();
    const pdfDoc = (0, $3db4be2023343aac$export$3a01b9f380b97660)();
    const pdfNavigator = (0, $755c8179fe46ecad$export$5783548f96893eea)();
    const navigate = (0, $dYZEH$react.useCallback)((evt)=>{
        const pageIndex = parseInt(evt.target.value, 10);
        if (!isNaN(pageIndex)) {
            pdfNavigator?.gotoPage({
                pageIndex: pageIndex - 1
            }, $07aafc7b19e25a78$export$4c7b7fca4aeb9016);
            setCurrPageIndex(pageIndex - 1);
        }
    }, [
        pdfNavigator
    ]);
    const [currPageIndex, setCurrPageIndex] = (0, $dYZEH$react.useState)(pdfNavigator?.currPageIndex || 0);
    (0, $dYZEH$react.useEffect)(()=>{
        if (pdfNavigator) {
            const handle = (evt, source)=>{
                switch(evt.kind){
                    case "GotoPage":
                        if (source !== $07aafc7b19e25a78$export$4c7b7fca4aeb9016) setCurrPageIndex(evt.data.pageIndex);
                        break;
                }
            };
            pdfNavigator.addEventListener($07aafc7b19e25a78$export$4c7b7fca4aeb9016, handle);
            return ()=>{
                pdfNavigator.removeEventListener($07aafc7b19e25a78$export$4c7b7fca4aeb9016, handle);
            };
        }
    }, [
        pdfNavigator,
        setCurrPageIndex
    ]);
    const rotationOptions = [
        {
            label: strings.rotate0Deg,
            value: "0"
        },
        {
            label: strings.rotate90Deg,
            value: "1"
        },
        {
            label: strings.rotate180Deg,
            value: "2"
        },
        {
            label: strings.rotate270Deg,
            value: "3"
        }, 
    ];
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $e48da51f1f92ae93$export$e926676385687eaf), {
        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsxs)(ToolbarComponent, {
            className: "pdf__toolbar",
            ...rest,
            children: [
                /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)(SelectComponent, {
                    className: "pdf__toolbar__select pdf__toolbar__select--rotation",
                    value: rotation,
                    onChange: changeRotation,
                    options: rotationOptions
                }),
                /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)(InputComponent, {
                    className: "pdf__toolbar__input pdf__toolbar__input--scalefactor",
                    type: "number",
                    min: "0.5",
                    max: "3.0",
                    step: "0.1",
                    value: scaleFactor,
                    onChange: changeScaleFactor
                }),
                /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)(InputComponent, {
                    className: "pdf__toolbar__input pdf__toolbar__input--page",
                    value: currPageIndex + 1,
                    min: "1",
                    max: pdfDoc?.pageCount,
                    type: "number",
                    onChange: navigate
                })
            ]
        })
    });
}


var $0d0eec522705db02$exports = {};

$parcel$export($0d0eec522705db02$exports, "PDF_NAVIGATOR_SOURCE_THUMBNAILS", () => $0d0eec522705db02$export$65978a2e0d68c048);
$parcel$export($0d0eec522705db02$exports, "PdfThumbnails", () => $0d0eec522705db02$export$d783f7eb7c78aaf1);
$parcel$export($0d0eec522705db02$exports, "PdfThumbnail", () => $0d0eec522705db02$export$95e001485d557055);







const $0d0eec522705db02$export$65978a2e0d68c048 = "PdfThumbnails";
function $0d0eec522705db02$export$d783f7eb7c78aaf1(props) {
    const { layout: layout = {
        direction: "vertical",
        itemsCount: 1
    } , scaleFactor: scaleFactor = 1 , rotation: rotation = 0 ,  } = props;
    const doc = (0, $3db4be2023343aac$export$3a01b9f380b97660)();
    const pdfNavigator = (0, $755c8179fe46ecad$export$5783548f96893eea)();
    const [currPageIndex, setCurrPageIndex] = (0, $dYZEH$react.useState)(pdfNavigator?.currPageIndex || 0);
    (0, $dYZEH$react.useEffect)(()=>{
        if (pdfNavigator) {
            const handle = (evt, source)=>{
                switch(evt.kind){
                    case "GotoPage":
                        if (source !== $0d0eec522705db02$export$65978a2e0d68c048) setCurrPageIndex(evt.data.pageIndex);
                        break;
                }
            };
            pdfNavigator.addEventListener($0d0eec522705db02$export$65978a2e0d68c048, handle);
            return ()=>{
                pdfNavigator.removeEventListener($0d0eec522705db02$export$65978a2e0d68c048, handle);
            };
        }
    }, [
        pdfNavigator,
        setCurrPageIndex
    ]);
    const gotoPage = (0, $dYZEH$react.useCallback)((page)=>{
        pdfNavigator?.gotoPage({
            pageIndex: page.index
        }, $0d0eec522705db02$export$65978a2e0d68c048);
        setCurrPageIndex(page.index);
    }, [
        pdfNavigator,
        setCurrPageIndex
    ]);
    const styleTemplate = [];
    for(let i = 0; i < layout.itemsCount; i++)styleTemplate.push("1fr");
    const [visiblePageIndexes, setVisiblePageIndexed] = (0, $dYZEH$react.useState)([]);
    const containerRef = (0, $dYZEH$react.useRef)(null);
    const [observer, setObserver] = (0, $dYZEH$react.useState)(null);
    (0, $dYZEH$react.useEffect)(()=>{
        const container = containerRef.current;
        if (container) {
            const observer = new IntersectionObserver((entries)=>{
                const visiblePageIndexes = entries.filter((entry)=>{
                    return entry.isIntersecting;
                }).map((entry)=>{
                    return Number(entry.target.dataset.pageIndex);
                });
                setVisiblePageIndexed(visiblePageIndexes);
            }, {
                root: container,
                rootMargin: "0px 0px",
                threshold: 0
            });
            setObserver(observer);
            return ()=>{
                observer?.disconnect();
            };
        }
    }, [
        containerRef.current
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $e48da51f1f92ae93$export$e926676385687eaf), {
        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
            ref: containerRef,
            className: `pdf__thumbnails pdf__thumbnails--${layout.direction}`,
            style: layout.direction === "vertical" ? {
                gridTemplateColumns: styleTemplate.join(" ")
            } : {
                gridTemplateRows: styleTemplate.join(" ")
            },
            children: doc?.pages.map((page, index)=>{
                const isCurrent = page.index === currPageIndex;
                const isVisible = visiblePageIndexes.indexOf(page.index) !== -1;
                return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($0d0eec522705db02$export$95e001485d557055, {
                    observer: observer,
                    page: page,
                    isVisible: isVisible,
                    scaleFactor: scaleFactor,
                    rotation: rotation,
                    isCurrent: isCurrent,
                    onClick: gotoPage
                }, index);
            })
        })
    });
}
function $0d0eec522705db02$export$95e001485d557055(props) {
    const engine = (0, $a75e6b16ab56d170$export$6dabc89b58a60ab3)();
    const doc = (0, $3db4be2023343aac$export$3a01b9f380b97660)();
    const { observer: observer , page: page , scaleFactor: scaleFactor , rotation: rotation , isVisible: isVisible , isCurrent: isCurrent , onClick: onClick ,  } = props;
    const [src, setSrc] = (0, $dYZEH$react.useState)("");
    (0, $dYZEH$react.useEffect)(()=>{
        if (!src && engine && doc && page && isVisible) {
            const task = engine.renderThumbnail(doc, page, scaleFactor, rotation);
            task.wait((imageData)=>{
                setSrc($0d0eec522705db02$var$imageDataToDataUrl(imageData));
            }, ()=>{});
            return ()=>{
                task.abort();
            };
        }
    }, [
        src,
        engine,
        doc,
        page,
        scaleFactor,
        rotation,
        isVisible
    ]);
    const containerRef = (0, $dYZEH$react.useRef)(null);
    (0, $dYZEH$react.useEffect)(()=>{
        const container = containerRef.current;
        if (observer && container) {
            observer.observe(container);
            return ()=>{
                observer.unobserve(container);
            };
        }
    }, [
        observer,
        containerRef.current
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsxs)("div", {
        ref: containerRef,
        "data-page-index": page.index,
        tabIndex: 0,
        className: `pdf__thumbnail ${isCurrent ? "pdf__thumbnail--current" : ""}`,
        children: [
            /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("img", {
                alt: `page ${page.index}`,
                src: src,
                onClick: ()=>{
                    onClick(page);
                },
                width: page.size.width * scaleFactor,
                height: page.size.height * scaleFactor
            }),
            /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("span", {
                children: page.index + 1
            })
        ]
    });
}
function $0d0eec522705db02$var$imageDataToDataUrl(imageData) {
    const canvas = document.createElement("canvas");
    canvas.width = imageData.width;
    canvas.height = imageData.height;
    const context = canvas.getContext("2d");
    context?.putImageData(imageData, 0, 0);
    return canvas.toDataURL();
}


var $b298e4b2f75767e1$exports = {};

$parcel$export($b298e4b2f75767e1$exports, "PDF_NAVIGATOR_SOURCE_OUTLINES", () => $b298e4b2f75767e1$export$13482b88be5917db);
$parcel$export($b298e4b2f75767e1$exports, "PdfBookmarks", () => $b298e4b2f75767e1$export$e47befc34cb62abc);
$parcel$export($b298e4b2f75767e1$exports, "PdfBookmarkEntry", () => $b298e4b2f75767e1$export$cbd49cefa3e29d3);








const $b298e4b2f75767e1$export$13482b88be5917db = "PdfBookmarks";
function $b298e4b2f75767e1$export$e47befc34cb62abc(props) {
    const engine = (0, $a75e6b16ab56d170$export$6dabc89b58a60ab3)();
    const doc = (0, $3db4be2023343aac$export$3a01b9f380b97660)();
    const [bookmarks, setBookmarks] = (0, $dYZEH$react.useState)({
        bookmarks: []
    });
    (0, $dYZEH$react.useEffect)(()=>{
        if (engine && doc) {
            const task = engine.getBookmarks(doc);
            task.wait(setBookmarks, ()=>{});
            return ()=>{
                task.abort();
            };
        }
    }, [
        engine,
        doc
    ]);
    const pdfNavigator = (0, $755c8179fe46ecad$export$5783548f96893eea)();
    const [currPageIndex, setCurrPageIndex] = (0, $dYZEH$react.useState)(pdfNavigator?.currPageIndex || 0);
    (0, $dYZEH$react.useEffect)(()=>{
        if (pdfNavigator) {
            const handle = (evt, source)=>{
                switch(evt.kind){
                    case "GotoPage":
                        if (source !== $b298e4b2f75767e1$export$13482b88be5917db) setCurrPageIndex(evt.data.pageIndex);
                        break;
                }
            };
            pdfNavigator.addEventListener($b298e4b2f75767e1$export$13482b88be5917db, handle);
            return ()=>{
                pdfNavigator.removeEventListener($b298e4b2f75767e1$export$13482b88be5917db, handle);
            };
        }
    }, [
        pdfNavigator,
        setCurrPageIndex
    ]);
    const handleEntryClicked = (0, $dYZEH$react.useCallback)((bookmark)=>{
        console.log(bookmark);
        if (!bookmark.target) return;
        switch(bookmark.target.type){
            case "action":
                switch(bookmark.target.action.type){
                    case (0, $dYZEH$unionpdfmodels.PdfActionType).Goto:
                        pdfNavigator?.gotoPage({
                            pageIndex: bookmark.target.action.destination.pageIndex
                        }, $b298e4b2f75767e1$export$13482b88be5917db);
                        break;
                }
                break;
            case "destination":
                pdfNavigator?.gotoPage({
                    pageIndex: bookmark.target.destination.pageIndex
                }, $b298e4b2f75767e1$export$13482b88be5917db);
                break;
        }
    }, [
        pdfNavigator
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $e48da51f1f92ae93$export$e926676385687eaf), {
        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
            className: "pdf__bookmarks",
            children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("ol", {
                children: bookmarks.bookmarks.map((bookmark, index)=>{
                    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($b298e4b2f75767e1$export$cbd49cefa3e29d3, {
                        currPageIndex: currPageIndex,
                        bookmark: bookmark,
                        onClick: handleEntryClicked
                    }, index);
                })
            })
        })
    });
}
function $b298e4b2f75767e1$export$cbd49cefa3e29d3(props) {
    const { currPageIndex: currPageIndex , bookmark: bookmark , onClick: onClick  } = props;
    let isCurrent = false;
    if (bookmark.target) switch(bookmark.target.type){
        case "destination":
            isCurrent = currPageIndex === bookmark.target.destination.pageIndex;
            break;
        case "action":
            switch(bookmark.target.action.type){
                case (0, $dYZEH$unionpdfmodels.PdfActionType).Goto:
                    isCurrent = bookmark.target.action.destination.pageIndex === currPageIndex;
                    break;
            }
            break;
    }
    const [isUnfold, setIsUnfold] = (0, $dYZEH$react.useState)(false);
    const activiate = (0, $dYZEH$react.useCallback)(()=>{
        setIsUnfold((isUnfold)=>{
            return !isUnfold;
        });
        onClick(bookmark);
    }, [
        setIsUnfold,
        onClick,
        bookmark
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsxs)("li", {
        tabIndex: 0,
        className: `pdf__bookmarks__entry ${isCurrent ? "pdf__bookmarks__entry--current" : ""}`,
        children: [
            /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("span", {
                onClick: activiate,
                children: bookmark.title
            }),
            bookmark.children && bookmark.children.length !== 0 && isUnfold ? /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("ol", {
                style: {
                    listStyle: "none",
                    paddingLeft: "1rem"
                },
                children: bookmark.children.map((entry, index)=>{
                    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($b298e4b2f75767e1$export$cbd49cefa3e29d3, {
                        currPageIndex: currPageIndex,
                        bookmark: entry,
                        onClick: onClick
                    }, index);
                })
            }) : null
        ]
    });
}


var $679788b947938349$exports = {};

$parcel$export($679788b947938349$exports, "PDF_NAVIGATOR_SOURCE_PAGES", () => $679788b947938349$export$93d718cb74c89323);
$parcel$export($679788b947938349$exports, "PDF_PAGE_DEFAULT_GAP", () => $679788b947938349$export$c1c3c2d00ca886b);
$parcel$export($679788b947938349$exports, "PdfPages", () => $679788b947938349$export$de646539ee056018);
$parcel$export($679788b947938349$exports, "PdfPage", () => $679788b947938349$export$1686f89eb33d2b08);





function $b80eb584c01e57b1$export$f3604a28e9b0338c(rect, scaleFactor, rotation) {
    const { origin: origin , size: size  } = rect;
    const rotatedAnnoSize = rotation % 2 === 0 ? size : (0, $dYZEH$unionpdfmodels.swap)(size);
    const scaledAnnoSize = {
        width: Math.ceil(rotatedAnnoSize.width * scaleFactor),
        height: Math.ceil(rotatedAnnoSize.height * scaleFactor)
    };
    const scaledOrigin = {
        x: Math.ceil(origin.x * scaleFactor),
        y: Math.ceil(origin.y * scaleFactor)
    };
    switch(rotation){
        case 0:
            return {
                top: scaledOrigin.y,
                left: scaledOrigin.x,
                width: scaledAnnoSize.width,
                height: scaledAnnoSize.height
            };
        case 1:
            return {
                top: scaledOrigin.x,
                right: scaledOrigin.y,
                width: scaledAnnoSize.width,
                height: scaledAnnoSize.height
            };
        case 2:
            return {
                bottom: scaledOrigin.y,
                right: scaledOrigin.x,
                width: scaledAnnoSize.width,
                height: scaledAnnoSize.height
            };
        case 3:
            return {
                bottom: scaledOrigin.x,
                left: scaledOrigin.y,
                width: scaledAnnoSize.width,
                height: scaledAnnoSize.height
            };
    }
}





const $679788b947938349$export$93d718cb74c89323 = "PdfPages";
const $679788b947938349$export$c1c3c2d00ca886b = 8;
function $679788b947938349$export$de646539ee056018(props) {
    const { viewport: viewport , pageGap: pageGap = $679788b947938349$export$c1c3c2d00ca886b , visibleRange: visibleRange = [
        -1,
        1
    ] , scaleFactor: scaleFactor = 1 , rotation: rotation = 0 , pageContentComponent: ContentComponent ,  } = props;
    const pdfDoc = (0, $3db4be2023343aac$export$3a01b9f380b97660)();
    const pdfNavigator = (0, $755c8179fe46ecad$export$5783548f96893eea)();
    const containerElemRef = (0, $dYZEH$react.useRef)(null);
    const [scrollOffset, setScrollOffset] = (0, $dYZEH$react.useState)({
        top: 0,
        left: 0
    });
    const [currPageIndex, setCurrPageIndex] = (0, $dYZEH$react.useState)(pdfNavigator?.currPageIndex || 0);
    const pdfPages = (0, $dYZEH$react.useMemo)(()=>{
        if (!pdfDoc) return [];
        let pageOffset = pageGap;
        return pdfDoc?.pages.map((page)=>{
            const offset = pageOffset;
            const visualSize = (0, $dYZEH$unionpdfmodels.calculateSize)(page.size, scaleFactor, rotation);
            pageOffset = pageOffset + visualSize.height + pageGap;
            return {
                ...page,
                offset: offset,
                visualSize: visualSize
            };
        });
    }, [
        pdfDoc,
        pageGap,
        scaleFactor,
        rotation
    ]);
    const handleScroll = (0, $dYZEH$react.useCallback)((evt)=>{
        const target = evt.target;
        setScrollOffset({
            top: target.scrollTop,
            left: target.scrollLeft
        });
        for (const page of pdfPages){
            const pageBottomY = page.offset + page.size.height * scaleFactor;
            if (pageBottomY > target.scrollTop) {
                pdfNavigator?.gotoPage({
                    pageIndex: page.index
                }, $679788b947938349$export$93d718cb74c89323);
                setCurrPageIndex(page.index);
                break;
            }
        }
    }, [
        pdfNavigator,
        pdfPages,
        setCurrPageIndex
    ]);
    (0, $dYZEH$react.useEffect)(()=>{
        const containerElem = containerElemRef.current;
        if (containerElem) {
            containerElem.addEventListener("scroll", handleScroll);
            return ()=>{
                containerElem.removeEventListener("scroll", handleScroll);
            };
        }
    }, [
        containerElemRef.current,
        handleScroll
    ]);
    const visibleRangeTop = Math.max(0, scrollOffset.top + visibleRange[0] * viewport.height);
    const visibleRangeBottom = Math.max(0, scrollOffset.top + viewport.height + visibleRange[1] * viewport.height);
    const gotoPage = (0, $dYZEH$react.useCallback)((data)=>{
        const containerElem = containerElemRef.current;
        if (containerElem) {
            const { pageIndex: pageIndex , rect: rect  } = data;
            const page = pdfPages[pageIndex];
            if (!page) return;
            if (!rect) containerElem.scrollTo({
                left: 0,
                top: page.offset
            });
            else {
                const style = (0, $b80eb584c01e57b1$export$f3604a28e9b0338c)(rect, scaleFactor, rotation);
                const { top: top = 0 , left: left = 0 , right: right = 0 , bottom: bottom = 0 , width: width , height: height ,  } = style;
                let scrollOffset;
                switch(rotation){
                    case 0:
                        scrollOffset = {
                            top: page.offset + top,
                            left: left
                        };
                        break;
                    case 1:
                        scrollOffset = {
                            top: page.offset + top,
                            left: page.visualSize.width - width - right
                        };
                        break;
                    case 2:
                        scrollOffset = {
                            top: page.offset + page.visualSize.height - bottom - height,
                            left: page.visualSize.width - width - right
                        };
                        break;
                    case 3:
                        scrollOffset = {
                            top: page.offset + page.visualSize.height - bottom - height,
                            left: left
                        };
                        break;
                }
                containerElem.scrollTo(scrollOffset);
            }
            setCurrPageIndex(pageIndex);
        }
    }, [
        pdfPages,
        setCurrPageIndex,
        scaleFactor,
        rotation
    ]);
    (0, $dYZEH$react.useEffect)(()=>{
        if (pdfNavigator) {
            const handle = (evt, source)=>{
                switch(evt.kind){
                    case "GotoPage":
                        if (source !== $679788b947938349$export$93d718cb74c89323) gotoPage(evt.data);
                        break;
                }
            };
            pdfNavigator.addEventListener($679788b947938349$export$93d718cb74c89323, handle);
            return ()=>{
                pdfNavigator.removeEventListener($679788b947938349$export$93d718cb74c89323, handle);
            };
        }
    }, [
        pdfNavigator,
        gotoPage
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $e48da51f1f92ae93$export$e926676385687eaf), {
        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
            className: "pdf__pages",
            children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
                className: "pdf__pages__container",
                style: {
                    width: viewport.width,
                    height: viewport.height
                },
                ref: containerElemRef,
                children: pdfPages.map((page)=>{
                    const isVisible = !(page.offset > visibleRangeBottom || page.offset + page.size.height * scaleFactor < visibleRangeTop);
                    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)($679788b947938349$export$1686f89eb33d2b08, {
                        isCurrent: page.index === currPageIndex,
                        page: page,
                        isVisible: isVisible,
                        pageGap: pageGap,
                        scaleFactor: scaleFactor,
                        rotation: rotation,
                        visualSize: page.visualSize,
                        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)(ContentComponent, {
                            isCurrent: page.index === currPageIndex,
                            page: page,
                            isVisible: isVisible,
                            pageGap: pageGap,
                            scaleFactor: scaleFactor,
                            rotation: rotation,
                            visualSize: page.visualSize
                        })
                    }, page.index);
                })
            })
        })
    });
}
function $679788b947938349$export$1686f89eb33d2b08(props) {
    const { children: children , ...rest } = props;
    const { isCurrent: isCurrent , pageGap: pageGap , visualSize: visualSize  } = rest;
    const style = (0, $dYZEH$react.useMemo)(()=>{
        return {
            marginTop: pageGap,
            marginBottom: pageGap,
            width: visualSize.width,
            height: visualSize.height
        };
    }, [
        pageGap,
        visualSize
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
        tabIndex: 0,
        className: `pdf__page ${isCurrent ? "pdf__page--current" : ""}`,
        style: style,
        children: children
    });
}


var $c910461fa830e541$exports = {};

$parcel$export($c910461fa830e541$exports, "PdfPageCanvas", () => $c910461fa830e541$export$3cc2f0efd44954a5);





function $c910461fa830e541$export$3cc2f0efd44954a5(props) {
    const doc = (0, $3db4be2023343aac$export$3a01b9f380b97660)();
    const engine = (0, $a75e6b16ab56d170$export$6dabc89b58a60ab3)();
    const { page: page , scaleFactor: scaleFactor , rotation: rotation , isVisible: isVisible  } = props;
    const canvasElemRef = (0, $dYZEH$react.useRef)(null);
    (0, $dYZEH$react.useEffect)(()=>{
        const canvasElem = canvasElemRef.current;
        if (canvasElem && engine && doc && isVisible) {
            const task = engine.renderPage(doc, page, scaleFactor, rotation);
            task.wait((imageData)=>{
                canvasElem.width = imageData.width;
                canvasElem.height = imageData.height;
                const ctx = canvasElem.getContext("2d");
                if (ctx) ctx.putImageData(imageData, 0, 0, 0, 0, imageData.width, imageData.height);
            }, ()=>{});
            return ()=>{
                task.abort();
            };
        }
    }, [
        page,
        engine,
        doc,
        isVisible,
        scaleFactor,
        rotation
    ]);
    if (!isVisible) return null;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("canvas", {
        className: "pdf__page__layer pdf__page__layer--canvas",
        ref: canvasElemRef
    });
}


var $1326dabb1129c75c$exports = {};

$parcel$export($1326dabb1129c75c$exports, "PdfPageAnnotations", () => $1326dabb1129c75c$export$f4b87b3193e18e82);




function $1326dabb1129c75c$export$f4b87b3193e18e82(props) {
    const { isVisible: isVisible , page: page , scaleFactor: scaleFactor , rotation: rotation , annotationComponent: AnnotationComponent ,  } = props;
    const engine = (0, $a75e6b16ab56d170$export$6dabc89b58a60ab3)();
    const doc = (0, $3db4be2023343aac$export$3a01b9f380b97660)();
    const [annotations, setAnnotations] = (0, $dYZEH$react.useState)([]);
    (0, $dYZEH$react.useEffect)(()=>{
        if (engine && doc && page && isVisible) {
            const task = engine.getPageAnnotations(doc, page, scaleFactor, rotation);
            task.wait(setAnnotations, ()=>{});
            return ()=>{
                task.abort();
            };
        }
    }, [
        isVisible,
        engine,
        doc,
        page,
        scaleFactor,
        rotation
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
        className: "pdf__page__layer pdf__page__layer--annotations",
        children: annotations.map((annotation)=>{
            return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)(AnnotationComponent, {
                page: page,
                annotation: annotation,
                scaleFactor: scaleFactor,
                rotation: rotation
            }, annotation.id);
        })
    });
}


var $0ad6770656e443db$exports = {};

$parcel$export($0ad6770656e443db$exports, "PdfPageAnnotationBase", () => $0ad6770656e443db$export$5c234731547f435d);




function $0ad6770656e443db$export$5c234731547f435d(props) {
    const { annotation: annotation , scaleFactor: scaleFactor , rotation: rotation , children: children , className: className , ...rest } = props;
    const style = (0, $dYZEH$react.useMemo)(()=>{
        return (0, $b80eb584c01e57b1$export$f3604a28e9b0338c)(annotation.rect, scaleFactor, rotation);
    }, [
        annotation,
        rotation,
        scaleFactor
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("div", {
        style: style,
        className: `pdf__annotation ${className || ""}`,
        ...rest,
        children: children
    });
}


var $6e7507c790ab0aad$exports = {};

$parcel$export($6e7507c790ab0aad$exports, "PdfPageLinkAnnotation", () => $6e7507c790ab0aad$export$7fe83d2582775c38);






function $6e7507c790ab0aad$export$7fe83d2582775c38(props) {
    const { page: page , annotation: annotation , scaleFactor: scaleFactor , rotation: rotation  } = props;
    const pdfNavigator = (0, $755c8179fe46ecad$export$5783548f96893eea)();
    const href = (0, $dYZEH$react.useMemo)(()=>{
        if (!annotation.target) return "#";
        if (annotation.target.type === "action") switch(annotation.target.action.type){
            case (0, $dYZEH$unionpdfmodels.PdfActionType).Goto:
                return `#${annotation.target.action.destination.pageIndex}`;
            case (0, $dYZEH$unionpdfmodels.PdfActionType).URI:
                return annotation.target.action.uri;
        }
        else return `#${annotation.target.destination.pageIndex}`;
    }, [
        annotation
    ]);
    const onClick = (0, $dYZEH$react.useCallback)((evt)=>{
        if (props.onClick) props.onClick(annotation);
        else {
            evt.preventDefault();
            if (!annotation.target) return;
            if (annotation.target.type === "action") switch(annotation.target.action.type){
                case (0, $dYZEH$unionpdfmodels.PdfActionType).Goto:
                    pdfNavigator?.gotoPage({
                        pageIndex: annotation.target.action.destination.pageIndex
                    }, "annotation");
                    break;
                case (0, $dYZEH$unionpdfmodels.PdfActionType).URI:
                    window.open(annotation.target.action.uri, "_blank");
                    break;
            }
            else pdfNavigator?.gotoPage({
                pageIndex: annotation.target.destination.pageIndex
            }, "annotation");
        }
    }, [
        pdfNavigator,
        page,
        annotation,
        props.onClick
    ]);
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $0ad6770656e443db$export$5c234731547f435d), {
        className: "pdf__annotation--link",
        annotation: annotation,
        scaleFactor: scaleFactor,
        rotation: rotation,
        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("a", {
            target: "_blank",
            href: href,
            onClick: onClick,
            children: annotation.text
        })
    });
}


var $ad673609692d1ea1$exports = {};

$parcel$export($ad673609692d1ea1$exports, "PdfPageTextAnnotation", () => $ad673609692d1ea1$export$66b5d5fe7e1e26fd);




function $ad673609692d1ea1$export$66b5d5fe7e1e26fd(props) {
    const { annotation: annotation , scaleFactor: scaleFactor , rotation: rotation  } = props;
    return /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)((0, $0ad6770656e443db$export$5c234731547f435d), {
        className: "pdf__annotation--text",
        annotation: annotation,
        scaleFactor: scaleFactor,
        rotation: rotation,
        children: /*#__PURE__*/ (0, $dYZEH$reactjsxruntime.jsx)("span", {
            children: annotation.text
        })
    });
}


$parcel$exportWildcard($e8486cc6b23be6e7$exports, $e48da51f1f92ae93$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $07aafc7b19e25a78$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $0d0eec522705db02$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $b298e4b2f75767e1$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $679788b947938349$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $c910461fa830e541$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $1326dabb1129c75c$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $0ad6770656e443db$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $6e7507c790ab0aad$exports);
$parcel$exportWildcard($e8486cc6b23be6e7$exports, $ad673609692d1ea1$exports);


$parcel$exportWildcard(module.exports, $67fde60292f59f18$exports);
$parcel$exportWildcard(module.exports, $e8486cc6b23be6e7$exports);


//# sourceMappingURL=index.js.map
