!function(root,factory){"function"==typeofdefine&&define.amd?define([],factory):"object"==typeofmodule&&module.exports?module.exports=factory():root.PDFObject=factory()}(this,function(){"use strict";if("undefined"==typeofwindow||void0===window.navigator||void0===window.navigator.userAgent)return!1;letwin=window,nav=win.navigator,ua=nav.userAgent,suppressConsole=!1,validateAX=function(type){varax=null;try{ax=newActiveXObject(type)}catch(e){ax=null}return!!ax},supportsPDFs=function(){if(void0!==nav.platform&&"MacIntel"===nav.platform&&void0!==nav.maxTouchPoints&&nav.maxTouchPoints>1||/Mobi|Tablet|Android|iPad|iPhone/.test(ua))return!1;letsupportsPDFVE="boolean"==typeofnav.pdfViewerEnabled;return!(supportsPDFVE&&!nav.pdfViewerEnabled)&&(supportsPDFVE&&nav.pdfViewerEnabled||function(){letisChromium=void0!==win.chrome,isSafari=void0!==win.safari||void0!==nav.vendor&&/Apple/.test(nav.vendor)&&/Safari/.test(ua),isFirefox=void0!==win.Mozilla||/irefox/.test(ua);returnisChromium||isSafari||isFirefox}()||"ActiveXObject"inwin&&(validateAX("AcroPDF.PDF")||validateAX("PDF.PdfCtrl")))}(),embedError=function(msg){returnsuppressConsole||console.log("[PDFObject]",msg),!1},generatePDFObjectMarkup=function(embedType,targetNode,url,pdfOpenFragment,width,height,id,title,omitInlineStyles,customAttribute,PDFJS_URL){!function(node){for(;node.firstChild;)node.removeChild(node.firstChild)}(targetNode);letsource=url;if("pdfjs"===embedType){source=PDFJS_URL+(-1!==PDFJS_URL.indexOf("?")?"&":"?")+"file="+encodeURIComponent(url)+pdfOpenFragment}elsesource+=pdfOpenFragment;letel=document.createElement("iframe");if(el.className="pdfobject",el.type="application/pdf",el.title=title,el.src=source,el.allow="fullscreen",el.frameborder="0",id&&(el.id=id),!omitInlineStyles){letstyle="border: none;";targetNode!==document.body?style+="width: "+width+"; height: "+height+";":style+="position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;",el.style.cssText=style}returncustomAttribute&&customAttribute.key&&-1===["className","type","title","src","style","id","allow","frameborder"].indexOf(customAttribute.key)&&el.setAttribute(customAttribute.key,void0!==customAttribute.value?customAttribute.value:""),targetNode.classList.add("pdfobject-container"),targetNode.appendChild(el),targetNode.getElementsByTagName("iframe")[0]},embed=function(url,targetSelector,options){letselector=targetSelector||!1,opt=options||{};suppressConsole="boolean"==typeofopt.suppressConsole&&opt.suppressConsole;letid="string"==typeofopt.id?opt.id:"",page=opt.page||!1,pdfOpenParams=opt.pdfOpenParams||{},fallbackLink="string"!=typeofopt.fallbackLink&&"boolean"!=typeofopt.fallbackLink||opt.fallbackLink,width=opt.width||"100%",height=opt.height||"100%",title=opt.title||"Embedded PDF",forcePDFJS="boolean"==typeofopt.forcePDFJS&&opt.forcePDFJS,omitInlineStyles="boolean"==typeofopt.omitInlineStyles&&opt.omitInlineStyles,PDFJS_URL=opt.PDFJS_URL||!1,targetNode=function(targetSelector){lettargetNode=document.body;return"string"==typeoftargetSelector?targetNode=document.querySelector(targetSelector):void0!==win.jQuery&&targetSelectorinstanceofjQuery&&targetSelector.length?targetNode=targetSelector.get(0):void0!==targetSelector.nodeType&&1===targetSelector.nodeType&&(targetNode=targetSelector),targetNode}(selector),pdfOpenFragment="",customAttribute=opt.customAttribute||{},fallbackHTML_default="<p>This browser does not support inline PDFs. Please download the PDF to view it: [pdflink]</p>";if("string"!=typeofurl)returnembedError("URL is not valid");if(!targetNode)returnembedError("Target element cannot be determined");if(page&&(pdfOpenParams.page=page),pdfOpenFragment=function(pdfParams){letprop,string="",paramArray=[],fdf="";if((pdfParams.comment||pdfParams.viewrect||pdfParams.highlight)&&(pdfParams.page||(pdfParams.page=1,embedError("The comment, viewrect, and highlight parameters require a page parameter, but none was specified. Defaulting to page 1."))),pdfParams.page&&(paramArray.push("page="+encodeURIComponent(pdfParams.page)),delet