UNPKG

@mescius/dspdfviewer

Version:
2 lines 175 kB
/*! For license information please see wasmSupportApiServer.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dspdfviewer=e():t.dspdfviewer=e()}(this,()=>(()=>{var t={4002:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toCamelCase=e.htmlDecode=e.unicodeToChar=e.fasterBytesToBase64=e.base64ToBytes=e.bytesToBase64=e.base64ToUtf8=e.utf8ToBase64=void 0,e.unicodeToChar=function(t){return t.replace(/\\u[\dA-F]{4}/gi,function(t){return String.fromCharCode(parseInt(t.replace(/\\u/g,""),16))})},e.htmlDecode=function(t){var e;if(window.DOMParser){e=(new window.DOMParser).parseFromString(t,"text/html").documentElement.textContent||""}else{var r=document.createElement("textarea");r.innerHTML=t,e=(0===r.childNodes.length?"":r.childNodes[0].nodeValue)||""}return e=e.replace("","•")};var r=function(){for(var t=[],e="A".charCodeAt(0),r="a".charCodeAt(0),n="0".charCodeAt(0),i=0;i<26;++i)t.push(String.fromCharCode(e+i));for(i=0;i<26;++i)t.push(String.fromCharCode(r+i));for(i=0;i<10;++i)t.push(String.fromCharCode(n+i));return t.push("+"),t.push("/"),t}();e.fasterBytesToBase64=function(t){for(var e,r="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(t),o=i.byteLength,a=o%3,s=o-a,u=0;u<s;u+=3)r+=n[(16515072&(e=i[u]<<16|i[u+1]<<8|i[u+2]))>>18]+n[(258048&e)>>12]+n[(4032&e)>>6]+n[63&e];return 1==a?r+=n[(252&(e=i[s]))>>2]+n[(3&e)<<4]+"==":2==a&&(r+=n[(64512&(e=i[s]<<8|i[s+1]))>>10]+n[(1008&e)>>4]+n[(15&e)<<2]+"="),r},e.bytesToBase64=function(t){var e,n="",i=t.length;for(e=2;e<i;e+=3)n+=r[t[e-2]>>2],n+=r[(3&t[e-2])<<4|t[e-1]>>4],n+=r[(15&t[e-1])<<2|t[e]>>6],n+=r[63&t[e]];return e===i+1&&(n+=r[t[e-2]>>2],n+=r[(3&t[e-2])<<4],n+="=="),e===i&&(n+=r[t[e-2]>>2],n+=r[(3&t[e-2])<<4|t[e-1]>>4],n+=r[(15&t[e-1])<<2],n+="="),n},e.base64ToBytes=function(t){for(var e=";base64,",r=t.indexOf(e),n=-1!==r?t.substring(r+8):t,i=window.atob(n),o=i.length,a=new Uint8Array(new ArrayBuffer(o)),s=0;s<o;s++)a[s]=i.charCodeAt(s);return a},e.utf8ToBase64=function(t){return window.btoa(unescape(encodeURIComponent(t)))},e.base64ToUtf8=function(t){return decodeURIComponent(escape(window.atob(t)))},e.toCamelCase=function(t){return void 0===t?"":t.toString().replace(/[-_]+(.)?/g,function(t,e){return e?e.toUpperCase():""}).replace(/^./,function(t){return t.toLowerCase()})}},14265:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WasmSupportApiExtenal=void 0;var s=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.loadWasmModule=function(){return o(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,window.createDsPdfModule()];case 1:return[2,t.sent()]}})})},e}(r(88375).WasmSupportApiBase);e.WasmSupportApiExtenal=s,window.WasmSupportApi=s},19164:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createObjectURL=e.addLinkAttributes=e.LinkTarget=e.removeNullCharacters=e.getFilenameFromUrl=e.makeAbsoluteUrl=e.findBaseScriptUrl=void 0;var r=function(){var t="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:{};if(!t.document)return"";for(var e=t.document.getElementsByTagName("script"),r=e.length-1;r>=0;r--)if(e[r].src)return e[r].src.toString();return""}();function n(){var t=-1!==r.indexOf("/js")?r.lastIndexOf("/js"):r.lastIndexOf("/");return r.substr(0,t)}e.findBaseScriptUrl=n,e.makeAbsoluteUrl=function(t,e){return 0===t.indexOf("http://")||0===t.indexOf("https://")?t:(e||(e=n()),e.lastIndexOf("/")!==e.length-1&&(e="".concat(e,"/")),"".concat(e).concat(t))},e.getFilenameFromUrl=function(t){if(!t)return"";var e=t.indexOf("#"),r=t.indexOf("?"),n=Math.min(e>0?e:t.length,r>0?r:t.length),i=t.substring(t.lastIndexOf("/",n)+1,n).substring(t.lastIndexOf("\\",n)+1,n);if(r>0&&-1===(i+"").toLowerCase().indexOf(".pdf")){var o=t.substr(r)||"",a=o.toLowerCase().indexOf(".pdf");if(o&&a>0){var s=(o=o.substring(0,a+4)).replace(/[\\?#=]/g,"/").lastIndexOf("/");s>=0&&s<a&&(i=o.substr(s+1))}}return i};var i=/\x00/g;function o(t){return"string"!=typeof t?t:t.replace(i,"")}e.removeNullCharacters=o;var a,s=["","_self","_blank","_parent","_top"];!function(t){t[t.NONE=0]="NONE",t[t.SELF=1]="SELF",t[t.BLANK=2]="BLANK",t[t.PARENT=3]="PARENT",t[t.TOP=4]="TOP"}(a=e.LinkTarget||(e.LinkTarget={})),e.addLinkAttributes=function(t,e){var r=e.url,n=e.target,i=e.rel;if(t.href=t.title=r?o(r):"",r){var u=Object.values(a).includes(n)?n:a.NONE;t.target=s[u],t.rel="string"==typeof i?i:"noopener noreferrer nofollow"}},e.createObjectURL=function(t,e,r){return void 0===r&&(r=!1),(n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",function(t,e,r){if(void 0===r&&(r=!1),!r&&URL.createObjectURL){var i=function(t,e){if(void 0===e&&(e=""),"undefined"!=typeof Blob)return new Blob([t],{type:e});throw new Error('The "Blob" constructor is not supported.')}(t,e);return URL.createObjectURL(i)}for(var o="data:"+e+";base64,",a=0,s=t.length;a<s;a+=3){var u=255&t[a],c=255&t[a+1],l=255&t[a+2],d=(3&u)<<4|c>>4,h=a+1<s?(15&c)<<2|l>>6:64,f=a+2<s?63&l:64;o+=n[u>>2]+n[d]+n[h]+n[f]}return o})(t,e,r);var n}},24463:function(t,e,r){"use strict";var n,i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},a=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnnotationAllowsSelectTextBehind=e.updateRotationInit=e.findRotationInit=e.calcRotationRectangles=e.initAnnotationRotateSupport=e.insertFirst=e.applyAnnotationRotate=e.applyAnnotationRotate2=e.clearAnnotationRotate=e.updateAnnotationContentPosition=e.updateInputCheckedAppearance=e.setInputCheckedState=e.logError=e.logMessage=e.isEditorModeEnabled=e.sortedIndex=e.getAccentTextColor=e.moveInkLists=e.detachHeadCss=e.detachHeadJs=e.attachHeadCss=e.cleanseRichText=e.stripHtmlTags=e.attachHeadJs=e.setActiveUserName=e.getActiveUserName=e.getDefaultUserName=e.humanReadableFileSize=e.formatDateTime=e.copyStringToClipboard=e.formatRelativeDate=e.dateToPdfDateString=e.pdfDateStringToDate=e.changeOriginToTop=e.changeOriginToBottom=e.changeRectangleOrigin=e.convertToPdfPoint=e.convertToViewportPoint=e.inverseTransform=e.applyInverseTransform=e.applyTransform=e.getAxialAlignedBoundingBox=e.adjustCoordinates=e.getTransformMatrix=e.cloneObject=e.mergeObject=e.isTypedArray=e.resetStampAspectRatio=e.updateInitialRectPosition=e.generateUid=void 0,e.getFontFormatFromUrl=e.loadFileData=e.getValueFromCssText=e.setImageFileFromCanvas=e.generateRichMediaPoster=e.injectSerializableFile=e.getStandardizedLanguageKey=void 0;var s=r(63125),u=r(81495),c=r(41918),l=r(32675),d=r(57998),h=r(19164);function f(t){return(t||"")+Date.now().toString(36)+Math.random().toString(36).substr(2)}function p(t,e){if(t.rotationInit){var r=t.rect,n=t.rotationInit.initRect,i=Math.abs(r[2]-r[0]),o=Math.abs(r[3]-r[1]),a=Math.abs(n[2]-n[0]),s=Math.abs(n[3]-n[1]),u=a-i,c=s-o;e&&(r[0]=e[0],r[1]=e[1],r[2]=r[0]+i,r[3]=r[1]+o);var d=t.rotate||0;switch(d){case 0:case 90:case 180:case 270:var h=(0,l.rotateRect)(r,null,d);n[0]=h[0],n[1]=h[1],n[2]=h[2],n[3]=h[3];break;default:n[0]=r[0]+u/2,n[1]=r[1]-c/2,n[2]=n[0]+a,n[3]=n[1]+s}}}function m(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function g(t,e,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===e||r&&void 0!==t&&(i=t)!==Object(i))return t;var i;if(m(e))return e;if(void 0===t){if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)t=[];else{if(!e||"object"!=typeof e)return e;t={}}}if(e){if(e instanceof Array){if(t&&t instanceof Array){for(var o=[],a=0;a<e.length;a++)t.length>a?o[a]=g(t[a],e[a]):o[a]=g(void 0,e[a]);return o}return e}if("object"==typeof e&&t&&"object"==typeof t){if(t instanceof Array&&(t={}),n)for(var s in t)e.hasOwnProperty(s)||(t[s]=e[s]);for(var s in e)t[s]="implementation"===s||"irtAnnotations"===s||"parentAnnotation"===s||"popupAnnotation"===s||"threads"===s||"bead"===s||"firstBead"===s||"source"===s?e[s]:g(t[s],e[s]);return t}}return e}function y(t,e,r,n,i){void 0===i&&(i=!1);var o=t;if(i)return[r,0,0,-n,-o[0]*r,o[3]*n];var a=e;switch((a%=360)<0&&(a+=360),a||(a=0),a){case 90:return[0,r,n,0,-o[1]*r,-o[0]*n];case 180:return[-r,0,0,n,o[2]*r,-o[1]*n];case 270:return[0,-r,-n,0,o[3]*r,o[2]*n];default:return[r,0,0,-n,-o[0]*r,o[3]*n]}}function v(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}function b(t,e){var r=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/r,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/r]}function w(t){var e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}function _(t){var e=document.createElement("textarea");e.value=t,e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),e.setSelectionRange(0,e.value.length);try{document.execCommand("copy")}catch(t){}document.body.removeChild(e)}function A(t,e){try{if(!t)return"";e||(e="yyyy-mm-dd HH:MM");e={0:"HH:MM",1:"h:MM tt",2:"HH:MM:ss",3:"h:MM:ss tt"}[e]||e;var r=function(t,e){void 0===e&&(e=2);for(var r=String(t);r.length<e;)r="0"+r;return r},n=function(t){return t<12?"am":"pm"},i={yyyy:String(t.getFullYear()),yy:String(t.getFullYear()).slice(-2),mmmm:t.toLocaleString("default",{month:"long"}),mmm:t.toLocaleString("default",{month:"short"}),mm:r(t.getMonth()+1),m:String(t.getMonth()+1),dddd:t.toLocaleString("default",{weekday:"long"}),ddd:t.toLocaleString("default",{weekday:"short"}),dd:r(t.getDate()),d:String(t.getDate()),HH:r(t.getHours()),H:String(t.getHours()),hh:r(t.getHours()%12||12),h:String(t.getHours()%12||12),MM:r(t.getMinutes()),M:String(t.getMinutes()),ss:r(t.getSeconds()),s:String(t.getSeconds()),tt:n(t.getHours()),t:n(t.getHours())[0]};return e.replace(/yyyy|yy|mmmm|mmm|mm|m|dddd|ddd|dd|d|HH|H|hh|h|MM|M|ss|s|tt|t/g,function(t){return i[t]})}catch(e){return String(t)}}e.generateUid=f,e.updateInitialRectPosition=p,e.resetStampAspectRatio=function(t,e,r,n,i,o){return void 0===o&&(o=!0),new Promise(function(a){if(t){var s=window.URL.createObjectURL(new Blob([t.buffer||t])),u=new Image;u.onload=function(){var t={width:u.naturalWidth||u.width,height:u.naturalHeight||u.height};i&&(t.width=72*t.width/i,t.height=72*t.height/i);var l=e.getPageSize(e.pageIndex),d=n.rect,h=Math.abs(d[2]-d[0]),f=Math.abs(d[3]-d[1]),m=Math.max(h,f),g=c.GcMeasurement.fitWithAspectRatio(t,m>10?{width:m,height:m}:l),y={x:n.rect[0],y:n.rect[1]};y.x+g.width>l.width&&(y.x=l.width-g.width),y.y+g.height>l.height&&(y.y=l.height-g.height),y.x<0&&(y.x=0),y.y<0&&(y.y=0);var v=[y.x,y.y,y.x+g.width,y.y+g.height];n.rect=v,n.rotate&&(n.rotationInit=void 0,L(n,n.rotate),p(n,[y.x,y.y])),e.updateAnnotation(r,n).then(function(t){o&&e.selectAnnotation(t.pageIndex,t.annotation),a(t)}),s&&(URL.revokeObjectURL(s),s=null)},u.onerror=function(){s&&(URL.revokeObjectURL(s),s=null),a(null)},u.src=s}else a(null)})},e.isTypedArray=m,e.mergeObject=g,e.cloneObject=function(t){return g(void 0,t)},e.getTransformMatrix=y,e.adjustCoordinates=function(t,e,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!1),void 0===o&&(o=1);var a,s=[t[0]<0?-t[0]:t[0],t[1]<0?-t[1]:t[1]],u=!0;t[0]<0&&0===t[2]?(a=[t[0],t[1]-s[1],t[2],t[3]-s[1]],u=!1):a=[t[0]-s[0],t[1]-s[1],t[2]-s[0],t[3]-s[1]];var c=y(a,r,o,o,!1);n&&(c=w(c));var l=v(e,c);return i||(l=[l[0],a[3]-l[1]]),u?[l[0]+t[0],l[1]+t[1]]:[l[0],l[1]+t[1]]},e.getAxialAlignedBoundingBox=function(t,e){var r=v(t,e),n=v(t.slice(2,4),e),i=v([t[0],t[3]],e),o=v([t[2],t[1]],e);return[Math.min(r[0],n[0],i[0],o[0]),Math.min(r[1],n[1],i[1],o[1]),Math.max(r[0],n[0],i[0],o[0]),Math.max(r[1],n[1],i[1],o[1])]},e.applyTransform=v,e.applyInverseTransform=b,e.inverseTransform=w,e.convertToViewportPoint=function(t,e,r){return v([t,e],r)},e.convertToPdfPoint=function(t,e,r){return b([t,e],r)},e.changeRectangleOrigin=function(t,e,r,n){void 0===r&&(r="BottomLeft"),void 0===n&&(n=!0);var i=a([],t,!0);if(n){var o=Math.min(t[1],t[3]),s=Math.max(t[1],t[3]);return("BottomLeft"===r||"TopLeft"===r)&&(i[1]=e[3]-s+e[1],i[3]=e[3]-o+e[1]),(0,l.normalizeRect)(i)}return o=t[1],s=t[3],("BottomLeft"===r||"TopLeft"===r)&&(i[1]=e[3]-o+e[1],i[3]=e[3]-s+e[1]),i},e.changeOriginToBottom=function(t,e){return e[3]-t+e[1]},e.changeOriginToTop=function(t,e){return e[3]-t-e[1]},e.pdfDateStringToDate=function(t){if(!t||"string"!=typeof t)return t&&t.getTime?t:null;n||(n=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var e=n.exec(t);if(!e)return null;var r=parseInt(e[1],10),i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;var o=parseInt(e[3],10);o=o>=1&&o<=31?o:1;var a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;var s=parseInt(e[5],10);s=s>=0&&s<=59?s:0;var u=parseInt(e[6],10);u=u>=0&&u<=59?u:0;var c=e[7]||"Z",l=parseInt(e[8],10);l=l>=0&&l<=23?l:0;var d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===c?(a+=l,s+=d):"+"===c&&(a-=l,s-=d),new Date(Date.UTC(r,i,o,a,s,u))},e.dateToPdfDateString=function(t){var e=null;if(void 0===t)return null;if(t instanceof Date)e=t;else if("string"==typeof t)e=new Date(t);else if("number"==typeof t)e=new Date(t);else{if(!t||!t.toDate)return null;e=t.toDate()}if(!e)return null;if(isNaN(e.getTime()))return null;var r=e.getUTCFullYear(),n=e.getUTCMonth()+1,i=e.getUTCDate(),o=e.getUTCHours(),a=e.getUTCMinutes(),s=e.getUTCSeconds(),u=r.toString().padStart(4,"0"),c=n.toString().padStart(2,"0"),l=i.toString().padStart(2,"0"),d=o.toString().padStart(2,"0"),h=a.toString().padStart(2,"0"),f=s.toString().padStart(2,"0");return"D:".concat(u).concat(c).concat(l).concat(d).concat(h).concat(f,"Z")},e.formatRelativeDate=function(t,e,r){if(!t)return"";var n=new Date,i=t.getTime()-n.getTime(),o=i>0,a=Math.abs(i);if(a<1e3)return e.t("labels.relative-date.right-now","right now");var s=Math.floor(a/1e3);if(s<60)return o?e.t("labels.relative-date.in-seconds-format","in {{sec}} sec.",{sec:s}):e.t("labels.relative-date.seconds-ago-format","{{sec}} sec. ago",{sec:s});var u=Math.floor(a/6e4);if(u<60)return o?e.t("labels.relative-date.in-minutes-format","in {{min}} min.",{min:u}):e.t("labels.relative-date.minutes-ago-format","{{min}} min. ago",{min:u});var c=A(t,r);return o?e.t("labels.relative-date.at-format","at {{date}}",{date:c}):c},e.copyStringToClipboard=function(t){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(t).then(function(){}).catch(function(e){_(t)}):_(t)},e.formatDateTime=A,e.humanReadableFileSize=function(t,e){var r;r=e?[e.t("labels.fileSize.b","B"),e.t("labels.fileSize.kb","KB"),e.t("labels.fileSize.mb","MB"),e.t("labels.fileSize.gb","GB"),e.t("labels.fileSize.tb","TB"),"PB","EB","ZB","YB"]:["B","KB","MB","GB","TB","PB","EB","ZB","YB"];var n=t?Math.floor(Math.log(t)/Math.log(1024)):0;return 1*(t/Math.pow(1024,n)).toFixed(2)+" "+r[n]};var k="gcpdfviewerusername";function x(){var t=d.SharedRef.i18n;return t?t.t("annotation-defaults.default-user-name","Anonymous"):"Anonymous"}e.getDefaultUserName=x,e.getActiveUserName=function(t){var e=void 0;if(t&&(e=t.userName),!e)try{var r=localStorage.getItem(k);if(r){var n=JSON.parse(r);n&&(e=n.userName)}}catch(t){}return e||(e=x()),e},e.setActiveUserName=function(t,e){t||(t=x());try{var r={userName:t,setBy:e};localStorage.setItem(k,JSON.stringify(r))}catch(t){}};var T={},S={};function C(t,e){try{for(var r=t.querySelector(e),n=0;r&&n<5;)r.remove?r.remove():r.parentNode.removeChild(r),r=t.querySelector(e),n++}catch(t){}}function E(t,e,r){var n=t.closest(".annotationLayer"),i=null==n?void 0:n.querySelectorAll('input[data-name="'+t.getAttribute("data-name")+'"]');i&&i.length>1?i.forEach(function(n){r&&n.hasAttribute("exportValue")&&r===n.getAttribute("exportValue")?I(n,!0):"radio"===t.type&&t!==n&&e?I(n,!1):I(n,t===n?e:void 0)}):I(t,e)}function I(t,e){void 0===e&&(e=!!t.checked);var r=t.closest("section");if(r){var n=r.getAttribute("data-annotation-id");if(n){e?r.classList.add("checked"):r.classList.remove("checked");var i=t.getAttribute("exportValue");if(i){var o=".gc-annotation-appearance-"+n+"-N",a=".gc-annotation-appearance-"+n+"-N_"+i.replace(/[\s\\\/\n]+/gm,"_"),s=".gc-annotation-appearance-"+n+"-N_Off",u=r.querySelector(o),c=r.querySelector(s),l=r.querySelector(a);l||(l=r.querySelector(".gc-annotation-appearance-"+n+"-N_Yes")||r.querySelector(".gc-annotation-appearance-"+n+"-N_On")),l&&(u&&(u.style.display="none"),r.classList.add("gc-annotation-has-appearance"),e?(l.style.display="block",c&&(c.style.display="none")):(l.style.display="none",c&&(c.style.display="block")))}}}}function R(t,e,r,n){t.style.position="absolute",t.style.left="",t.style.top="",t.style.right="";var i="100%",o="100%";switch(e){case-90:case 90:t.style.transformOrigin="0 0",i="".concat(r,"px"),o="".concat(n,"px"),t.style.left="0px",t.style.top="".concat(r,"px");break;case-180:case 180:t.style.transformOrigin="0 0",t.style.top="".concat(r,"px"),t.style.left="".concat(n,"px");break;case-270:case 270:t.style.transformOrigin="0 0",i="".concat(r,"px"),o="".concat(n,"px"),t.style.left="".concat(n,"px");break;default:i="".concat(n,"px"),o="".concat(r,"px"),t.style.transformOrigin="initial"}t.style.width=i,t.style.height=o}function M(t){for(var e=t.classList.contains("gc-rotate-support")?[t]:Array.from(t.querySelectorAll(".gc-rotate-support")),r=0;r<e.length;r++){var n=e[r];n.style.transform="",n.style.transformOrigin="",n.style.left="",n.style.top="",n.style.right="";for(var i=0,o=Array.from(n.querySelectorAll("IMG"));i<o.length;i++){var a=o[i];a.style.transform="",a.style.transformOrigin=""}}}function O(t,e){var r;if(void 0===e&&(e=[0,0,0,0]),t.rotationInit)r=t.rotationInit.initRect||t.rect||e;else if(!t.fileIdChanged){if(t.appearanceBBox){var n=t.appearanceBBox[2]-t.appearanceBBox[0],i=t.appearanceBBox[3]-t.appearanceBBox[1],o=(t.rect[2]-t.rect[0]-n)/2,a=(t.rect[3]-t.rect[1]-i)/2,s=t.rect[0]+o,u=t.rect[1]+a;r=[s,u,s+n,u+i]}!r&&t.rotate&&(r=(0,l.rotateRect)(t.rect||e,null,t.rotate,!0))}return r||(r=t.rect||e),r}function B(t,e,r){void 0===r&&(r=!1);var n=t.closest(".gc-annotation")||t.closest(".gc-widget")||t.closest("section"),i=e.rotate;if(Number.isFinite(i))for(var o=O(e,[n.offsetLeft,n.offsetTop,n.offsetLeft+n.offsetWidth,n.offsetTop+n.offsetHeight]),a=e.rect||[n.offsetLeft,n.offsetTop,n.offsetLeft+n.offsetWidth,n.offsetTop+n.offsetHeight],s=Math.abs(o[2]-o[0]),u=Math.abs(o[3]-o[1]),c=Math.abs(a[2]-a[0]),l=Math.abs(a[3]-a[1]),d=t.classList.contains("gc-rotate-support")?[t]:Array.from(t.querySelectorAll(".gc-rotate-support")),h=0;h<d.length;h++){var f=d[h],p=(f.style.transform||"").toString();p=p.replace(/(\s*rotate\(.+\))/gm,""),p+=" rotate("+-i+"deg)",f.style.transform=p,f.style.transformOrigin="",f.style.width=s+"px",f.style.height=u+"px",f.style.position="absolute",f.style.left="".concat((c-s)/2,"px"),f.style.top="".concat((l-u)/2,"px"),f.setAttribute("data-result-width",s.toString());var m=f.querySelector(".gc-text-content");m&&(m.style.width="100%",m.style.height="100%");for(var g=0,y=Array.from(t.querySelectorAll("IMG"));g<y.length;g++){var v=y[g];v.style.width="100%",v.style.height="100%"}}}function D(t,e,r){var n;if(void 0===r&&(r=!1),t&&e)if(e.rotate||e.orientation){if(e.annotationType===s.AnnotationTypeCode.INK)return;if(e.annotationType===s.AnnotationTypeCode.FREETEXT)return;if(!(0,s.isFormFieldWidget)(e))return B(t,e,r);var i=e.rotate||0,o=e.orientation||0;o&&(i=o);var a=t.closest(".gc-annotation")||t.closest(".gc-widget")||t.closest("section");if(!r&&a.classList.contains("gc-annotation-has-appearance")&&!a.classList.contains("gc-use-custom-appearance"))return;for(var u=t.classList.contains("gc-rotate-support")?[t]:Array.from(t.querySelectorAll(".gc-rotate-support")),c=0;c<u.length;c++){if(p=(p=((f=u[c]).style.transform||"").toString()).replace(/(\s*rotate\(.+\))/gm,""),p+=" rotate("+-i+"deg)",f.style.transform=p,f.style.transformOrigin="",!f.classList.contains("gc-annotation")&&!a.classList.contains("freeTextAnnotation")){a.__borderCopied||(a.__borderCopied=!0,a.style.border&&(f.style.border=a.style.border),a.style.borderColor&&(f.style.borderColor=a.style.borderColor),"none none solid"===a.style.borderStyle?(f.style.borderBottomStyle="solid",f.style.borderBottomWidth=a.style.borderBottomWidth,f.style.borderBottomColor=a.style.borderBottomColor,a.style.paddingBottom=a.style.borderBottomWidth,a.style.borderBottomWidth="0px"):a.style.borderWidth&&(f.style.borderWidth=a.style.borderWidth,a.style.padding=a.style.borderWidth,a.style.borderWidth="0px"),a.style.borderStyle&&(f.style.borderStyle=a.style.borderStyle)),!o&&i&&i%90==0&&(o=i);var l=(null===(n=e.rotationInit)||void 0===n?void 0:n.initRect)||e.rect;(!l||o&&(a.offsetWidth||a.offsetHeight))&&(l=[a.offsetLeft,a.offsetTop,a.offsetLeft+a.offsetWidth,a.offsetTop+a.offsetHeight]);var d=Math.abs(l[2]-l[0]),h=Math.abs(l[3]-l[1]);o?R(f,o,h,d):e.rotationInit&&(f.style.width="".concat(d,"px"),f.style.height="".concat(h,"px"),f.style.position="absolute",f.style.left="".concat(e.rotationInit.dx||0,"px"),f.style.top="".concat(e.rotationInit.dy||0,"px"))}}}else for(u=t.classList.contains("gc-rotate-support")?[t]:Array.from(t.querySelectorAll(".gc-rotate-support")),c=0;c<u.length;c++){var f,p;(f=u[c]).style.width="100%",f.style.height="100%",f.style.left="0px",f.style.top="0px",p=(p=(f.style.transform||"").toString()).replace(/(\s*rotate\(.+\))/gm,""),f.style.transform=p,f.style.transformOrigin=""}}function N(t,e){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function L(t,e,r){if(e){var n=r||O(t),i=Math.abs(n[2]-n[0]),o=Math.abs(n[3]-n[1]),a=(0,l.rotateRectAndFillBoth)(n,[n[0]+i/2,n[1]+o/2],e),s=a.rotatedRect,u=a.transformedRect,c=Math.abs(s[2]-s[0]),d=Math.abs(s[3]-s[1]);t.rotationInit={initRect:n,rotatedRect:s,transformedRect:u,angle:e,dx:(c-i)/2,dy:(d-o)/2},t.rect=s}else t.rotationInit&&(t.rotationInit.initRect&&(t.rect=t.rotationInit.initRect),t.rotationInit=void 0),r&&(t.rect=r)}function P(t,e){var r=(0,l.rotateRect)(t,null,e,!0),n=(0,l.findLinesIntersection)([r[0],r[3]],[r[2],r[3]],[t[0],t[1]],[t[0],t[3]]),i=(0,l.findLinesIntersection)([r[0],r[1]],[r[2],r[3]],[t[2],t[1]],[t[2],t[3]]);return n&&i?(0,l.normalizeRect)([n[0],n[1],i[0],i[1]]):a([],t,!0)}function z(t,e,r,n,a,s){return void 0===n&&(n="file"),void 0===a&&(a=!0),void 0===s&&(s=""),i(this,void 0,void 0,function(){var u=this;return o(this,function(c){return s=s||e["".concat(n,"Id")],[2,new Promise(function(c){t.toBlob(function(l){return i(u,void 0,void 0,function(){var i,u,d,h,p,m;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,,3,4]),l?[4,l.arrayBuffer()]:[3,2];case 1:i=o.sent(),u=new Uint8Array(i),d=s||f("".concat(n,"_img")),h="".concat(n,".png"),p=u.length,e["".concat(n,"Id")]=d,e["".concat(n,"Name")]=h,e["".concat(n,"Length")]=p,r.storage.setItem(d,u),m={id:e.id,fileId:d,fileName:h,fileLength:p,filePropName:n},r.viewer.eventBus.dispatch("annotation-image-loaded",m),o.label=2;case 2:return a&&(t.width=0,t.height=0),[3,4];case 3:return c(),[7];case 4:return[2]}})})},"image/png")})]})})}e.attachHeadJs=function(t,e,r){return new Promise(function(n,i){if(e){if(S[e])return void n();S[e]=!0}var o=((r=r||document).getElementsByTagName?r.getElementsByTagName("head")[0]:void 0)||r.body||r,a=document.createElement("script");e&&a.setAttribute("id",e),a.type="text/javascript",a.src=t,a.async=!0,a.onerror=function(t){i(t)};var s=!1;a.onload=a.onreadystatechange=function(t){var e=t.target;s||e.readyState&&"complete"!=e.readyState||(s=!0,n())},o.insertBefore(a,o.firstChild)})},e.stripHtmlTags=function(t){var e=document.createElement("div");return e.innerHTML=t||"",e.innerText||e.textContent||""},e.cleanseRichText=function(t){return t?t.replace(/<\/?(?:script|iframe|object|embed|form|input|textarea|select|option|button)[^>]*>/gi,"").replace(/<\?xml[^>]*\?>|<body[^>]*>|<\/body>/gi,""):""},e.attachHeadCss=function(t,e,r){if(e){if(T[e])return;T[e]=!0}var n=((r=r||document).getElementsByTagName?r.getElementsByTagName("head")[0]:void 0)||r.body||r,i=document.createElement("link");e&&i.setAttribute("id",e),i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href","data:text/css;charset=UTF-8,"+encodeURIComponent(t)),n.insertBefore(i,n.firstChild)},e.detachHeadJs=function(t,e){t&&(C((e=e||document).head||e,"#"+t),delete S[t])},e.detachHeadCss=function(t,e){t&&(C((e=e||document).head||e,"#"+t),delete T[t])},e.moveInkLists=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n++)for(var o=i[n],a=0;a<o.length;a++)o[a].x=o[a].x-e,o[a].y=o[a].y-r},e.getAccentTextColor=function(){var t=document.querySelector(".gc-menu__btn-container");return t&&window.getComputedStyle&&window.getComputedStyle(t,null).getPropertyValue("background-color")||"#000000"},e.sortedIndex=function(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r},e.isEditorModeEnabled=function(t){return t&&!!(0,u.findSelfOrAncestor)(t,"gc-editor-mode")},e.logMessage=function(t){window.console&&window.console.log(t);var e=document.querySelector("#log-message");if(e){var r=new Date;t=(t=t+(" ("+r.getHours()+":"+r.getSeconds()+"."+r.getMilliseconds()+")")+";<br>"+e.innerHTML).substr(0,Math.min(t.length,512)),e.innerHTML=t}},e.logError=function(t){if("object"==typeof(t=t||"[empty message]")){var e="{ ";for(var r in t)e=e+r+"="+t[r]+"; ";t=e+="}"}window.console&&window.console.log(t);var n=document.querySelector("#log-error-message")||document.querySelector("#log-message");if(n){var i=new Date,o=" ("+i.getHours()+":"+i.getSeconds()+"."+i.getMilliseconds()+")";n.innerHTML=t+o}},e.setInputCheckedState=function(t,e,r,n){var i,o;if(t){var a=t.closest("section"),s=e!==t.checked||a&&(e&&!a.classList.contains("checked")||!e&&a.classList.contains("checked")),u=null;e?(t.setAttribute("checked","true"),t.checked=!0,t.hasAttribute("exportValue")&&(u=t.getAttribute("exportValue")),null===(i=t.closest("section"))||void 0===i||i.classList.add("checked")):(t.removeAttribute("checked"),t.checked=!1,null===(o=t.closest("section"))||void 0===o||o.classList.remove("checked")),E(t,e,u),s&&r&&r.onInputChanged(t,n)}},e.updateInputCheckedAppearance=E,e.updateAnnotationContentPosition=function(t,e,r){if(e||r)switch(t.annotationType){case s.AnnotationTypeCode.LINE:var n=t.lineCoordinates;if(n)for(var i=0;i<n.length;i+=2)e&&(n[i]=n[i]-e),r&&(n[i+1]=n[i+1]-r);break;case s.AnnotationTypeCode.INK:var o=t.inkLists;if(o)for(var a=0,u=o;a<u.length;a++)for(var c=0,l=u[a];c<l.length;c++){var d=l[c];e&&(d.x=d.x-e),r&&(d.y=d.y-r)}break;case s.AnnotationTypeCode.POLYLINE:case s.AnnotationTypeCode.POLYGON:var h=t.vertices;if(h)for(var f=0,p=h;f<p.length;f++){d=p[f];e&&(d.x=d.x-e),r&&(d.y=d.y-r)}}},e.clearAnnotationRotate=M,e.applyAnnotationRotate2=B,e.applyAnnotationRotate=D,e.insertFirst=N,e.initAnnotationRotateSupport=function(t,e,r){var n=t.querySelector(".gc-rotate-support")||document.createElement("div");n.classList.add("gc-rotate-support"),r&&("string"==typeof r?n.innerHTML=r:n.appendChild(r)),N(t,n),e.rotate||e.orientation?D(n,e):M(n)},e.calcRotationRectangles=L,e.findRotationInit=P,e.updateRotationInit=function(t){t.rotationInit&&t.rotate&&(t.rotationInit.initRect=P(t.rect,t.rotate))},e.isAnnotationAllowsSelectTextBehind=function(t){return!t||!!(t.className||"").match(new RegExp("(".concat(["underlineAnnotation","squigglyAnnotation","strikeOutAnnotation","highlightAnnotation"].join("|"),")")))},e.getStandardizedLanguageKey=function(t,e){"auto"===t&&(t=((window.navigator.language||window.navigator.userLanguage)+"").toLowerCase().split("-")[0]),"auto"===e&&(e=((window.navigator.language||window.navigator.userLanguage)+"").toLowerCase().split("-")[0]);var r=(t||"").toLowerCase().split("-")[0];return{zh:"cn",hk:"cn",tw:"cn",jp:"ja",us:"en",ru:"ru",de:"de"}[r]||e||t||r||""},e.injectSerializableFile=function(t,e,r){var n;if(void 0===r&&(r="file"),(t.annotationType===s.AnnotationTypeCode.FILEATTACHMENT||t.annotationType===s.AnnotationTypeCode.RICHMEDIA)&&t[r]){var i=t[r].content,o=(null===(n=t[r])||void 0===n?void 0:n.filename)||"noname";if(delete t[r],i&&0!==o.indexOf("__empty.")){t["".concat(r,"Id")]&&e.removeItem(t["".concat(r,"Id")]);var a=(0,h.removeNullCharacters)((0,h.getFilenameFromUrl)(o||"noname")),u="".concat(a,"_").concat(t.id);t.fileName=a,t["".concat(r,"Id")]=u,t.fileLength=i.length,e.setItem(u,i)}}},e.generateRichMediaPoster=function(t,e,r){return i(this,void 0,void 0,function(){var n,i,a,s,u,c,l,d,h,f;return o(this,function(o){switch(o.label){case 0:return r||(r={}),n=r.drawBackOnly,i=r.filePropName||"file",a=r.knownFileId,s=t.rect&&!r.width?Math.abs(t.rect[2]-t.rect[0]):r.width||320,u=t.rect&&!r.height?Math.abs(t.rect[3]-t.rect[1]):r.height||240,(c=document.createElement("canvas")).width=s,c.height=u,l=c.getContext("2d"),d=r.foreColor||"#ffffff",h=r.backColor||"#000000",l.fillStyle=h,l.fillRect(0,0,s,u),n||(l.fillStyle=d,f=24,l.beginPath(),l.moveTo(12,u-8-f),l.arcTo(32,u-8-f,32,u-8,4),l.arcTo(32,u-8,8,u-8,4),l.arcTo(8,u-8,8,u-8-f,4),l.arcTo(8,u-8-f,32,u-8-f,4),l.closePath(),l.fillStyle=d,l.strokeStyle=d,l.lineWidth=2,l.fill(),l.stroke(),l.beginPath(),l.moveTo(15,u-8-7),l.lineTo(25,u-8-12),l.lineTo(15,u-8-17),l.closePath(),l.fillStyle=h,l.fill()),[4,z(c,t,e,i,!0,a)];case 1:return o.sent(),[2]}})})},e.setImageFileFromCanvas=z,e.getValueFromCssText=function(t,e){if(!t||!e)return null;var r=new RegExp("".concat(e,":\\s*([^;]+);")),n=t.match(r);return n?n[1].trim():null},e.loadFileData=function(t){return i(this,void 0,void 0,function(){var e,r;return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch(t)];case 1:if(!(e=n.sent()).ok)throw new Error("Failed to load file from ".concat(t));return[4,e.arrayBuffer()];case 2:return r=n.sent(),[2,new Uint8Array(r)];case 3:throw n.sent();case 4:return[2]}})})},e.getFontFormatFromUrl=function(t,e){var r;try{if(!t)return e;switch((null===(r=t.split(".").pop())||void 0===r?void 0:r.toLowerCase())||""){case"ttc":return"ttc";case"ttf":return"truetype";case"otf":return"opentype";case"woff":return"woff";case"woff2":return"woff2";default:return e}}catch(t){return e}}},32675:(t,e)=>{"use strict";function r(t,e,r){return void 0===r||0===+r?Math[t](e):(e=+e,r=+r,isNaN(e)||"number"!=typeof r||r%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-r:-r)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+r:r))))}function n(t,e){return r("round",t,e)}function i(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}function o(t,e,r,i,o,a){void 0===a&&(a=!0);var s=a?Math.PI/180*o:o,u=Math.cos(s),c=Math.sin(s),l=u*(i-e)-c*(r-t)+e;return[n(u*(r-t)+c*(i-e)+t,-1),n(l,-1)]}function a(t,e,r,n){var i=Math.atan2(n-e,r-t)*(180/Math.PI);return i<0&&(i=360+i),i}function s(t,e,r,n){if(void 0===n&&(n=!0),!e){var a=Math.abs(t[2]-t[0]),s=Math.abs(t[3]-t[1]);e=[t[0]+a/2,t[1]+s/2]}var u=o(e[0],e[1],t[0],t[1],r,n),c=o(e[0],e[1],t[2],t[3],r,n);return i([u[0],u[1],c[0],c[1]])}Object.defineProperty(e,"__esModule",{value:!0}),e.findLinesIntersection=e.rotateRectAndFillBoth=e.getAngle=e.getDistance=e.reverseRotateRect=e.rotateRect=e.deg2rad=e.rad2Deg=e.findVectorsAngle=e.rotatePoint=e.normalizeRect=e.round10=e.ceil10=e.floor10=void 0,e.floor10=function(t,e){return r("floor",t,e)},e.ceil10=function(t,e){return r("ceil",t,e)},e.round10=n,e.normalizeRect=i,e.rotatePoint=o,e.findVectorsAngle=function(t,e,r){var n=a(r[0],r[1],t[0],t[1]);return(360+a(r[0],r[1],e[0],e[1])-n)%360},e.rad2Deg=function(t){return 180*t/Math.PI},e.deg2rad=function(t){return t*(Math.PI/180)},e.rotateRect=s,e.reverseRotateRect=function(t,e,r){var n=0;return[{a:-360,sect:1},{a:-321,sect:2},{a:-270,sect:1},{a:-269,sect:2},{a:-232,sect:1},{a:-141,sect:2},{a:-90,sect:1},{a:-89,sect:2},{a:-52,sect:1},{a:39,sect:2},{a:90,sect:1},{a:91,sect:2},{a:128,sect:1},{a:219,sect:2},{a:270,sect:1},{a:271,sect:2},{a:308,sect:1}].forEach(function(t){t.a<=r&&(n=t.sect)}),s(1===n?t:[t[2],t[1],t[0],t[3]],e,-r,!0)},e.getDistance=function(t,e,r,n){var i=r-t,o=n-e;return Math.sqrt(o*o+i*i)},e.getAngle=function(t,e,r,n){var i=r-t,o=n-e;return Math.atan2(o,i)},e.rotateRectAndFillBoth=function(t,e,r,n){void 0===n&&(n=!0);var o=s(t=i(t),e,r,n),a=s([t[2],t[1],t[0],t[3]],e,r,n),u=[Math.min(o[0],a[0]),Math.min(o[1],a[1]),Math.max(o[2],a[2]),Math.max(o[3],a[3])];return{rotatedRect:i([Math.max(t[0],u[0]),Math.min(t[1],u[1]),Math.min(t[2],u[2]),Math.max(t[3],u[3])]),transformedRect:o}},e.findLinesIntersection=function(t,e,r,n){var i=e[1]-t[1],o=t[0]-e[0],a=i*t[0]+o*t[1],s=n[1]-r[1],u=r[0]-n[0],c=s*r[0]+u*r[1],l=i*u-s*o;return l?[(u*a-o*c)/l,(i*c-s*a)/l]:null}},41918:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GcMeasurement=void 0;var r=function(){function t(){}return t.fitWithAspectRatio=function(t,e){var r=t.width,n=t.height,i=r/n;return r>e.width&&(n=(r=e.width)/i),n>e.height&&(r=(n=e.height)*i),{width:r,height:n}},t.measureDomText=function(t,e,r){var n=document.createElement("div");n.style.fontFamily=e,n.style.fontSize=r,n.style.whiteSpace="nowrap",n.style.width="auto",n.style.height="auto",n.style.visibility="hidden",n.style.position="absolute",n.style.zIndex="-10",n.style.left="-1000px",n.innerHTML=t,document.body.appendChild(n);var i={w:n.clientWidth,h:n.clientHeight};return n.remove(),i},t.getElementOuterSize=function(t){try{var e=getComputedStyle(t),r=void 0,n=void 0;return"BODY"===t.tagName?(r=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth):(r=t.offsetHeight,n=t.offsetWidth),r+=parseFloat(e.marginTop?e.marginTop:"0")+parseFloat(e.marginBottom?e.marginBottom:"0"),{w:n+=parseFloat(e.marginLeft?e.marginLeft:"0")+parseFloat(e.marginRight?e.marginRight:"0"),h:r}}catch(e){return{w:t.offsetWidth,h:t.offsetHeight}}},t.getElementInnerSize=function(t){try{var e=getComputedStyle(t),r=void 0,n=void 0;return"BODY"===t.tagName?(r=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0,r-=parseFloat(e.marginTop?e.marginTop:"0")+parseFloat(e.marginBottom?e.marginBottom:"0"),n-=parseFloat(e.marginLeft?e.marginLeft:"0")+parseFloat(e.marginRight?e.marginRight:"0")):(r=t.offsetHeight,n=t.offsetWidth),r-=parseFloat(e.paddingTop?e.paddingTop:"0")+parseFloat(e.paddingBottom?e.paddingBottom:"0"),{w:n-=parseFloat(e.paddingLeft?e.paddingLeft:"0")+parseFloat(e.paddingRight?e.paddingRight:"0"),h:r}}catch(e){return{w:t.offsetWidth,h:t.offsetHeight}}},t.intersectRect=function(t,e){return!(e.x>t.x+t.w||e.x+e.w<t.x||e.y>t.y+t.h||e.y+e.h<t.y)},t.isPointInBounds=function(t,e){var r=e.x+e.w,n=e.y+e.h;return e.x<=t.x&&t.x<=r&&e.y<=t.y&&t.y<=n},t.getWindowScrollOffsets=function(){var t=document.documentElement;return{left:(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0),top:(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}},t.getWindowSize=function(){return{w:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},t.getAbsoluteOffsetLeft=function(t){for(var e=0;t;)Number.isNaN(t.offsetLeft)||(e+=t.offsetLeft),t=t.offsetParent;return e},t.getAbsoluteOffsetTop=function(t){for(var e=0;t;)Number.isNaN(t.offsetTop)||(e+=t.offsetTop),t=t.offsetParent;return e},t}();e.GcMeasurement=r},57998:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedRef=void 0;var r="___gcpdfviewer_shared_ref",n="___gcpdfviewer_shared_ref18n",i=function(){function t(t,e,r){this.viewer=t,this.moment=e,this.i18n=r,this.i18n}return t.onViewerInitialize=function(e,n){window[r]||(window[r]={}),window[r][e.instanceId]=new t(e,n,e.in17n)},t.get=function(t,e){if(void 0===e&&(e=!1),window[r]||(window[r]={}),!window[r][t]&&e)for(var n in window[r])return window[r][n];if(!t&&!e)throw new Error("Missing instanceId");return window[r][t]},t.dispose=function(e){t.get(e)&&(t.get(e).dispose(),delete window[r][e])},Object.defineProperty(t,"moment",{get:function(){return t.get("",!0).moment},enumerable:!1,configurable:!0}),Object.defineProperty(t,"i18n",{get:function(){var e,r;return null!==(r=null===(e=t.get("",!0))||void 0===e?void 0:e.i18n)&&void 0!==r?r:window[n]},set:function(t){window[n]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"count",{get:function(){return window[r]?Object.keys(window[r]).length:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this.viewer.storage},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.releaseResources()},t.prototype.releaseResources=function(){this.storage.releaseResources()},t}();e.SharedRef=i},63125:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.getAnnotationIconKey=e.getAnnotationDisplayName=e.getAnnotationDisplayTitle=e.ChoiceWidget=e.ButtonWidget=e.TextWidget=e.WidgetAnnotation=e.SoundAnnotation=e.FileAttachmentAnnotation=e.StampAnnotation=e.SignatureAnnotation=e.FreeTextAnnotation=e.TextAnnotation=e.LinkAnnotation=e.InkAnnotation=e.ReplaceTextAnnotation=e.RedactAnnotation=e.StrikeOutAnnotation=e.SquigglyAnnotation=e.UnderlineAnnotation=e.HighlightAnnotation=e.SquareAnnotation=e.CircleAnnotation=e.PolygonAnnotation=e.PolyLineAnnotation=e.LineAnnotation=e.MarkupAnnotation=e.PopupAnnotation=e.AnnotationBase=e.edtorModeToButtonKey=e.getAnnotationOptionsKeyName=e.findAnnotationSubType=e.findFieldObjectType=e.isRadioButtonFieldWidget=e.isFormFieldWidget=e.isStatusTextAnnotation=e.TextAlignmentType=e.AnnotationTypeCode=void 0;var o,a=r(89526),s="Helvetica";function u(t){return!!t&&(t.annotationType===o.WIDGET||t.annotationType===o.SIGNATURE)}!function(t){t[t.TEXT=1]="TEXT",t[t.LINK=2]="LINK",t[t.FREETEXT=3]="FREETEXT",t[t.LINE=4]="LINE",t[t.SQUARE=5]="SQUARE",t[t.CIRCLE=6]="CIRCLE",t[t.POLYGON=7]="POLYGON",t[t.POLYLINE=8]="POLYLINE",t[t.HIGHLIGHT=9]="HIGHLIGHT",t[t.UNDERLINE=10]="UNDERLINE",t[t.SQUIGGLY=11]="SQUIGGLY",t[t.STRIKEOUT=12]="STRIKEOUT",t[t.STAMP=13]="STAMP",t[t.CARET=14]="CARET",t[t.INK=15]="INK",t[t.POPUP=16]="POPUP",t[t.FILEATTACHMENT=17]="FILEATTACHMENT",t[t.SOUND=18]="SOUND",t[t.MOVIE=19]="MOVIE",t[t.WIDGET=20]="WIDGET",t[t.SCREEN=21]="SCREEN",t[t.PRINTERMARK=22]="PRINTERMARK",t[t.TRAPNET=23]="TRAPNET",t[t.WATERMARK=24]="WATERMARK",t[t.THREED=25]="THREED",t[t.REDACT=26]="REDACT",t[t.SIGNATURE=27]="SIGNATURE",t[t.RICHMEDIA=90]="RICHMEDIA",t[t.THREADBEAD=150]="THREADBEAD",t[t.REPLACETEXT=500]="REPLACETEXT"}(o=e.AnnotationTypeCode||(e.AnnotationTypeCode={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(e.TextAlignmentType||(e.TextAlignmentType={})),e.isStatusTextAnnotation=function(t){return"Review"===t.stateModel&&("Accepted"===t.state||"Cancelled"===t.state||"Completed"===t.state||"Rejected"===t.state)},e.isFormFieldWidget=u,e.isRadioButtonFieldWidget=function(t){if(!t)return!1;var e=t;return e.annotationType===o.WIDGET&&"Btn"===e.fieldType&&!0===e.radioButton},e.findFieldObjectType=function(t){return t.annotationType===o.SIGNATURE?"signature":"Tx"===t.fieldType?(t.comb||t.multiLine||t.hasPasswordFlag,"text"):"Btn"===t.fieldType?t.checkBox?"checkbox":t.radioButton?"radiobutton":(t.submitForm||t.resetForm||t.pushButton,"button"):"Ch"===t.fieldType?t.combo?"combobox":"listbox":""},e.findAnnotationSubType=function(t,e){switch(t){case o.TEXT:return"Text";case o.CARET:return"Caret";case o.CIRCLE:return"Circle";case o.FILEATTACHMENT:return"FileAttachment";case o.FREETEXT:return"FreeText";case o.INK:return"Ink";case o.LINE:return"Line";case o.LINK:return"Link";case o.MOVIE:return"Movie";case o.POLYGON:return"Polygon";case o.POLYLINE:return"PolyLine";case o.POPUP:return"Popup";case o.PRINTERMARK:return"PrinterMark";case o.REDACT:return"Redact";case o.REPLACETEXT:return"ReplaceText";case o.SCREEN:return"Screen";case o.SIGNATURE:return"Signature";case o.SOUND:return"Sound";case o.SQUARE:return"Square";case o.HIGHLIGHT:return"Highlight";case o.UNDERLINE:return"Underline";case o.SQUIGGLY:return"Squiggly";case o.STRIKEOUT:return"StrikeOut";case o.STAMP:return"Stamp";case o.THREADBEAD:return"ThreadBead";case o.THREED:return"Threed";case o.WATERMARK:return"WaterMark";case o.WIDGET:return"Widget";case o.RICHMEDIA:return"RichMedia"}return e},e.getAnnotationOptionsKeyName=function(t){if(!t)return"unknownAnnotation";switch(t.annotationType){case o.FREETEXT:return"freeTextAnnotation";case o.TEXT:return"textAnnotation";case o.INK:return"inkAnnotation";case o.SQUARE:return"squareAnnotation";case o.LINK:return"linkAnnotation";case o.REDACT:return"redactAnnotation";case o.REPLACETEXT:return"replaceTextAnnotation";case o.CIRCLE:return"circleAnnotation";case o.LINE:return"lineAnnotation";case o.POLYLINE:return"polyLineAnnotation";case o.POLYGON:return"polygonAnnotation";case o.FILEATTACHMENT:return"fileAttachmentAnnotation";case o.RICHMEDIA:return"richMediaAnnotation";case o.SOUND:return"soundAnnotation";case o.STAMP:return"stampAnnotation";case o.WIDGET:switch(t.fieldType){case"Tx":return t.comb?"combTextField":t.multiLine?"textArea":t.hasPasswordFlag?"passwordField":"textField";case"Ch":return t.combo?"comboChoice":"listBoxChoice";case"Btn":return t.submitForm?"submitButton":t.resetForm?"resetButton":t.checkBox?"checkBoxButton":t.radioButton?"radioButton":"pushButton"}break;case o.POPUP:return"popupAnnotation";case o.SIGNATURE:return"signatureField";case o.HIGHLIGHT:return"highlightAnnotation";case o.UNDERLINE:return"underlineAnnotation";case o.SQUIGGLY:return"squigglyAnnotation";case o.STRIKEOUT:return"strikeOutAnnotation";case o.RICHMEDIA:return"richMediaAnnotation"}return"unknownAnnotation"},e.edtorModeToButtonKey=function(t){switch(t){case a.EditMode.CheckBoxButtonWidget:return"edit-widget-btn-checkbox";case a.EditMode.Circle:return"edit-circle";case a.EditMode.ComboChoiceWidget:return"edit-widget-ch-combo";case a.EditMode.CombTextFieldWidget:return"edit-widget-tx-comb";case a.EditMode.Erase:return"edit-erase";case a.EditMode.FileAttachment:return"edit-file-attachment";case a.EditMode.FreeText:return"edit-free-text";case a.EditMode.Ink:return"edit-ink";case a.EditMode.Line:return"edit-line";case a.EditMode.Link:return"edit-link";case a.EditMode.ListBoxChoiceWidget:return"edit-widget-ch-list-box";case a.EditMode.PasswordFieldWidget:return"edit-widget-tx-password";case a.EditMode.Polygon:return"edit-polygon";case a.EditMode.Polyline:return"edit-polyline";case a.EditMode.PushButtonWidget:return"edit-widget-btn-push";case a.EditMode.RadioButtonWidget:return"edit-widget-btn-radio";case a.EditMode.Redact:return"edit-redact";case a.EditMode.ReplaceText:return"edit-replace-text";case a.EditMode.ResetButtonWidget:return"edit-widget-btn-reset";case a.EditMode.Select:return"edit-select";case a.EditMode.Sound:return"edit-sound";case a.EditMode.Square:return"edit-square";case a.EditMode.Stamp:return"edit-stamp";case a.EditMode.Highlight:return"edit-highlight";case a.EditMode.Underline:return"edit-underline";case a.EditMode.Squiggly:return"edit-squiggly";case a.EditMode.StrikeOut:return"edit-strike-out";case a.EditMode.Caret:return"edit-caret";case a.EditMode.Movie:return"edit-movie";case a.EditMode.PrinterMark:return"edit-printer-mark";case a.EditMode.TrapNet:return"edit-trap-net";case a.EditMode.Watermark:return"edit-watermark";case a.EditMode.ThreeDimension:return"edit-3d";case a.EditMode.Projection:return"edit-projection";case a.EditMode.RichMedia:return"edit-rich-media";case a.EditMode.SubmitButtonWidget:return"edit-widget-btn-submit";case a.EditMode.Text:return"edit-text";case a.EditMode.TextAreaWidget:return"edit-widget-tx-text-area";case a.EditMode.TextFieldWidget:return"edit-widget-tx-field"}return"key_not-found_error"};var c=function(){this.annotationFlags=0,this.useCustomAppearance=!0,this.opacity=1,this.printableFlag=!0};e.AnnotationBase=c;var l=function(t){function e(){var e=t.call(this)||this;return e.subtype="Popup",e}return i(e,t),e}(c);e.PopupAnnotation=l;var d=function(t){function e(){return t.call(this)||this}return i(e,t),e}(c);e.MarkupAnnotation=d;var h=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.LINE,e.subtype="Line",e.borderStyle={width:1,style:1,horizontalCornerRadius:0,verticalCornerRadius:0},e.color="#000000",e}return i(e,t),e}(d);e.LineAnnotation=h;var f=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.POLYLINE,e.subtype="PolyLine",e.borderStyle={width:1,style:1,horizontalCornerRadius:0,verticalCornerRadius:0},e.color="#000000",e}return i(e,t),e}(d);e.PolyLineAnnotation=f;var p=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.POLYGON,e.subtype="Polygon",e}return i(e,t),e}(f);e.PolygonAnnotation=p;var m=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.CIRCLE,e.subtype="Circle",e.borderStyle={width:1,style:1,horizontalCornerRadius:0,verticalCornerRadius:0},e.color="#000000",e}return i(e,t),e}(d);e.CircleAnnotation=m;var g=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.SQUARE,e.subtype="Square",e.borderStyle={width:1,style:1,horizontalCornerRadius:0,verticalCornerRadius:0},e.color="#000000",e}return i(e,t),e}(d);e.SquareAnnotation=g;var y=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.HIGHLIGHT,e.subtype="Highlight",e.color="#fff066",e}return i(e,t),e}(d);e.HighlightAnnotation=y;var v=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.UNDERLINE,e.subtype="Underline",e.color="#000000",e}return i(e,t),e}(d);e.UnderlineAnnotation=v;var b=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.SQUIGGLY,e.subtype="Squiggly",e.color="#ff0000",e}return i(e,t),e}(d);e.SquigglyAnnotation=b;var w=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.STRIKEOUT,e.subtype="StrikeOut",e.color="#000000",e}return i(e,t),e}(d);e.StrikeOutAnnotation=w;var _=function(t){function e(){var e=t.call(this)||this;return e.annotationType=o.REDACT,e.subtype="Redact",e.borderStyle={width:1,style:1,horizontalCornerRadius:0,vertical