@kne-components/react-file 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +0,0 @@
1
- /*! For license information please see 44.0f60eb2f.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_kne_components_react_file=self.webpackChunk_kne_components_react_file||[]).push([[44],{33724:(t,e,i)=>{"use strict";i.d(e,{A:()=>Nt});var n=i(68102),s=i(3141);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}function o(t,e,i){return(e=a(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],e.includes(i)||{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}var h=i(94922),c=i.n(h),d=i(54159),u=i.n(d);function p(t,e){(function(t){return"string"===typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var i=function(t){return"string"===typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),i&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function g(t){return t<=1?"".concat(100*Number(t),"%"):t}function f(t){return 1===t.length?"0"+t:String(t)}function m(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*i*(e-t):i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function v(t){return b(t)/255}function b(t){return parseInt(t,16)}var y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function w(t){var e,i,n,s={r:0,g:0,b:0},r=1,a=null,o=null,l=null,h=!1,c=!1;return"string"===typeof t&&(t=function(t){if(t=t.trim().toLowerCase(),0===t.length)return!1;var e=!1;if(y[t])t=y[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};var i=E.rgb.exec(t);if(i)return{r:i[1],g:i[2],b:i[3]};if(i=E.rgba.exec(t),i)return{r:i[1],g:i[2],b:i[3],a:i[4]};if(i=E.hsl.exec(t),i)return{h:i[1],s:i[2],l:i[3]};if(i=E.hsla.exec(t),i)return{h:i[1],s:i[2],l:i[3],a:i[4]};if(i=E.hsv.exec(t),i)return{h:i[1],s:i[2],v:i[3]};if(i=E.hsva.exec(t),i)return{h:i[1],s:i[2],v:i[3],a:i[4]};if(i=E.hex8.exec(t),i)return{r:b(i[1]),g:b(i[2]),b:b(i[3]),a:v(i[4]),format:e?"name":"hex8"};if(i=E.hex6.exec(t),i)return{r:b(i[1]),g:b(i[2]),b:b(i[3]),format:e?"name":"hex"};if(i=E.hex4.exec(t),i)return{r:b(i[1]+i[1]),g:b(i[2]+i[2]),b:b(i[3]+i[3]),a:v(i[4]+i[4]),format:e?"name":"hex8"};if(i=E.hex3.exec(t),i)return{r:b(i[1]+i[1]),g:b(i[2]+i[2]),b:b(i[3]+i[3]),format:e?"name":"hex"};return!1}(t)),"object"===typeof t&&(C(t.r)&&C(t.g)&&C(t.b)?(e=t.r,i=t.g,n=t.b,s={r:255*p(e,255),g:255*p(i,255),b:255*p(n,255)},h=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):C(t.h)&&C(t.s)&&C(t.v)?(a=g(t.s),o=g(t.v),s=function(t,e,i){t=6*p(t,360),e=p(e,100),i=p(i,100);var n=Math.floor(t),s=t-n,r=i*(1-e),a=i*(1-s*e),o=i*(1-(1-s)*e),l=n%6;return{r:255*[i,a,r,r,o,i][l],g:255*[o,i,i,a,r,r][l],b:255*[r,r,o,i,i,a][l]}}(t.h,a,o),h=!0,c="hsv"):C(t.h)&&C(t.s)&&C(t.l)&&(a=g(t.s),l=g(t.l),s=function(t,e,i){var n,s,r;if(t=p(t,360),e=p(e,100),i=p(i,100),0===e)s=i,r=i,n=i;else{var a=i<.5?i*(1+e):i+e-i*e,o=2*i-a;n=m(o,a,t+1/3),s=m(o,a,t),r=m(o,a,t-1/3)}return{r:255*n,g:255*s,b:255*r}}(t.h,a,l),h=!0,c="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=function(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}(r),{ok:h,format:t.format||c,r:Math.min(255,Math.max(s.r,0)),g:Math.min(255,Math.max(s.g,0)),b:Math.min(255,Math.max(s.b,0)),a:r}}var A="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),x="[\\s|\\(]+(".concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")\\s*\\)?"),_="[\\s|\\(]+(".concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")\\s*\\)?"),E={CSS_UNIT:new RegExp(A),rgb:new RegExp("rgb"+x),rgba:new RegExp("rgba"+_),hsl:new RegExp("hsl"+x),hsla:new RegExp("hsla"+_),hsv:new RegExp("hsv"+x),hsva:new RegExp("hsva"+_),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function C(t){return Boolean(E.CSS_UNIT.exec(String(t)))}var S=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function M(t){var e=function(t,e,i){t=p(t,255),e=p(e,255),i=p(i,255);var n=Math.max(t,e,i),s=Math.min(t,e,i),r=0,a=n,o=n-s,l=0===n?0:o/n;if(n===s)r=0;else{switch(n){case t:r=(e-i)/o+(e<i?6:0);break;case e:r=(i-t)/o+2;break;case i:r=(t-e)/o+4}r/=6}return{h:r,s:l,v:a}}(t.r,t.g,t.b);return{h:360*e.h,s:e.s,v:e.v}}function T(t){var e=t.r,i=t.g,n=t.b;return"#".concat(function(t,e,i,n){var s=[f(Math.round(t).toString(16)),f(Math.round(e).toString(16)),f(Math.round(i).toString(16))];return n&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}(e,i,n,!1))}function k(t,e,i){var n;return(n=Math.round(t.h)>=60&&Math.round(t.h)<=240?i?Math.round(t.h)-2*e:Math.round(t.h)+2*e:i?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?n+=360:n>=360&&(n-=360),n}function P(t,e,i){return 0===t.h&&0===t.s?t.s:((n=i?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(n=1),i&&5===e&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function R(t,e,i){var n;return(n=i?t.v+.05*e:t.v-.15*e)>1&&(n=1),Number(n.toFixed(2))}var L=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];L.primary=L[5];var I=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];I.primary=I[5];var F=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];F.primary=F[5];var D=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];D.primary=D[5];var O=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];O.primary=O[5];var N=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];N.primary=N[5];var z=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];z.primary=z[5];var B=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];B.primary=B[5];var H=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];H.primary=H[5];var j=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];j.primary=j[5];var V=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];V.primary=V[5];var $=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];$.primary=$[5];var U=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];U.primary=U[5];var W=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];W.primary=W[5];var G=["#2b1611","#441d12","#592716","#7c3118","#aa3e19","#d84a1b","#e87040","#f3956a","#f8b692","#fad4bc"];G.primary=G[5];var q=["#2b1d11","#442a11","#593815","#7c4a15","#aa6215","#d87a16","#e89a3c","#f3b765","#f8cf8d","#fae3b7"];q.primary=q[5];var X=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];X.primary=X[5];var K=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];K.primary=K[5];var Y=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];Y.primary=Y[5];var Q=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];Q.primary=Q[5];var J=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];J.primary=J[5];var Z=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];Z.primary=Z[5];var tt=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];tt.primary=tt[5];var et=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];et.primary=et[5];var it=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];it.primary=it[5];var nt=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];nt.primary=nt[5];const st=(0,h.createContext)({});function rt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function at(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(i),!0).forEach((function(e){o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):rt(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ot="data-rc-order",lt="data-rc-priority",ht=new Map;function ct(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return t?t.startsWith("data-")?t:"data-".concat(t):"rc-util-key"}function dt(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function ut(t){return Array.from((ht.get(t)||t).children).filter((function(t){return"STYLE"===t.tagName}))}function pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"===typeof window||!window.document||!window.document.createElement)return null;var i=e.csp,n=e.prepend,s=e.priority,r=void 0===s?0:s,a=function(t){return"queue"===t?"prependQueue":t?"prepend":"append"}(n),o="prependQueue"===a,l=document.createElement("style");l.setAttribute(ot,a),o&&r&&l.setAttribute(lt,"".concat(r)),null!==i&&void 0!==i&&i.nonce&&(l.nonce=null===i||void 0===i?void 0:i.nonce),l.innerHTML=t;var h=dt(e),c=h.firstChild;if(n){if(o){var d=(e.styles||ut(h)).filter((function(t){if(!["prepend","prependQueue"].includes(t.getAttribute(ot)))return!1;var e=Number(t.getAttribute(lt)||0);return r>=e}));if(d.length)return h.insertBefore(l,d[d.length-1].nextSibling),l}h.insertBefore(l,c)}else h.appendChild(l);return l}function gt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=dt(e);return(e.styles||ut(i)).find((function(i){return i.getAttribute(ct(e))===t}))}function ft(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=dt(i),s=ut(n),r=at(at({},i),{},{styles:s});!function(t,e){var i=ht.get(t);if(!i||!function(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1}(document,i)){var n=pt("",e),s=n.parentNode;ht.set(t,s),t.removeChild(n)}}(n,r);var a=gt(e,r);if(a){var o,l,h;if(null!==(o=r.csp)&&void 0!==o&&o.nonce&&a.nonce!==(null===(l=r.csp)||void 0===l?void 0:l.nonce))a.nonce=null===(h=r.csp)||void 0===h?void 0:h.nonce;return a.innerHTML!==t&&(a.innerHTML=t),a}var c=pt(t,r);return c.setAttribute(ct(r),e),c}function mt(t){var e;return null===t||void 0===t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}function vt(t){return function(t){return mt(t)instanceof ShadowRoot}(t)?mt(t):null}var bt={},yt=[];function wt(t,e){}function At(t,e){}function xt(t,e,i){e||bt[i]||(t(!1,i),bt[i]=!0)}function _t(t,e){xt(wt,t,e)}_t.preMessage=function(t){yt.push(t)},_t.resetWarned=function(){bt={}},_t.noteOnce=function(t,e){xt(At,t,e)};const Et=_t;function Ct(t){return"object"===r(t)&&"string"===typeof t.name&&"string"===typeof t.theme&&("object"===r(t.icon)||"function"===typeof t.icon)}function St(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).reduce((function(e,i){var n,s=t[i];if("class"===i)e.className=s,delete e.class;else delete e[i],e[(n=i,n.replace(/-(.)/g,(function(t,e){return e.toUpperCase()})))]=s;return e}),{})}function Mt(t,e,i){return i?c().createElement(t.tag,at(at({key:e},St(t.attrs)),i),(t.children||[]).map((function(i,n){return Mt(i,"".concat(e,"-").concat(t.tag,"-").concat(n))}))):c().createElement(t.tag,at({key:e},St(t.attrs)),(t.children||[]).map((function(i,n){return Mt(i,"".concat(e,"-").concat(t.tag,"-").concat(n))})))}function Tt(t){return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[],n=w(t),s=5;s>0;s-=1){var r=M(n),a=T(w({h:k(r,s,!0),s:P(r,s,!0),v:R(r,s,!0)}));i.push(a)}i.push(T(n));for(var o=1;o<=4;o+=1){var l=M(n),h=T(w({h:k(l,o),s:P(l,o),v:R(l,o)}));i.push(h)}return"dark"===e.theme?S.map((function(t){var n=t.index,s=t.opacity;return T(function(t,e,i){var n=i/100;return{r:(e.r-t.r)*n+t.r,g:(e.g-t.g)*n+t.g,b:(e.b-t.b)*n+t.b}}(w(e.backgroundColor||"#141414"),w(i[n]),100*s))})):i}(t)[0]}function kt(t){return t?Array.isArray(t)?t:[t]:[]}var Pt=["icon","className","onClick","style","primaryColor","secondaryColor"],Rt={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var Lt=function(t){var e,i,n=t.icon,s=t.className,r=t.onClick,a=t.style,o=t.primaryColor,c=t.secondaryColor,d=l(t,Pt),u=h.useRef(),p=Rt;if(o&&(p={primaryColor:o,secondaryColor:c||Tt(o)}),function(t){var e=(0,h.useContext)(st),i=e.csp,n=e.prefixCls,s="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";n&&(s=s.replace(/anticon/g,n)),(0,h.useEffect)((function(){var e=vt(t.current);ft(s,"@ant-design-icons",{prepend:!0,csp:i,attachTo:e})}),[])}(u),e=Ct(n),i="icon should be icon definiton, but got ".concat(n),Et(e,"[@ant-design/icons] ".concat(i)),!Ct(n))return null;var g=n;return g&&"function"===typeof g.icon&&(g=at(at({},g),{},{icon:g.icon(p.primaryColor,p.secondaryColor)})),Mt(g.icon,"svg-".concat(g.name),at(at({className:s,onClick:r,style:a,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:u}))};Lt.displayName="IconReact",Lt.getTwoToneColors=function(){return at({},Rt)},Lt.setTwoToneColors=function(t){var e=t.primaryColor,i=t.secondaryColor;Rt.primaryColor=e,Rt.secondaryColor=i||Tt(e),Rt.calculated=!!i};const It=Lt;function Ft(t){var e=kt(t),i=(0,s.A)(e,2),n=i[0],r=i[1];return It.setTwoToneColors({primaryColor:n,secondaryColor:r})}var Dt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Ft(H.primary);var Ot=h.forwardRef((function(t,e){var i=t.className,r=t.icon,a=t.spin,c=t.rotate,d=t.tabIndex,p=t.onClick,g=t.twoToneColor,f=l(t,Dt),m=h.useContext(st),v=m.prefixCls,b=void 0===v?"anticon":v,y=m.rootClassName,w=u()(y,b,o(o({},"".concat(b,"-").concat(r.name),!!r.name),"".concat(b,"-spin"),!!a||"loading"===r.name),i),A=d;void 0===A&&p&&(A=-1);var x=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,_=kt(g),E=(0,s.A)(_,2),C=E[0],S=E[1];return h.createElement("span",(0,n.A)({role:"img","aria-label":r.name},f,{ref:e,tabIndex:A,onClick:p,className:w}),h.createElement(It,{icon:r,primaryColor:C,secondaryColor:S,style:x}))}));Ot.displayName="AntdIcon",Ot.getTwoToneColor=function(){var t=It.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},Ot.setTwoToneColor=Ft;const Nt=Ot},79111:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};var a=i(33724);const o=s.forwardRef((function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))}))},12791:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};var a=i(33724);const o=s.forwardRef((function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))}))},15032:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};var a=i(33724);const o=s.forwardRef((function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))}))},56859:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};var a=i(33724);const o=s.forwardRef((function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))}))},58882:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};var a=i(33724);const o=s.forwardRef((function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))}))},98546:(t,e,i)=>{"use strict";i.d(e,{ZF:()=>C,lV:()=>v});var n=i(94922),s=i.n(n),r=i(55199),a=i(78678),o=i(68102);const l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};var h=i(33724);const c=n.forwardRef((function(t,e){return n.createElement(h.A,(0,o.A)({},t,{ref:e,icon:l}))}));var d=i(54159),u=i.n(d);i(16052),i(50805);function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},p.apply(null,arguments)}function g(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;i[n]=t[n]}return i}const f=["onClick","children"],m=t=>{const[e,i]=(0,n.useState)(!1),s=(0,a.A)((function(){return i(!0),Promise.resolve(t&&t(...arguments)).then((()=>{i(!1)}))}));return{isLoading:e,setIsLoading:i,callback:s}},v=t=>{let{onClick:e,children:i}=t,n=g(t,f);const{isLoading:a,callback:o}=m(e);return s().createElement(r.Button,p({},n,{loading:a,onClick:o}),"function"===typeof i?i(a):i)};var b="_zIHFy",y="_R-IrF",w="_F1kMl",A="_Iee0d",x="_aGBVE",_="_0oW1K";const E=["title","message","isDelete","showCancel","cancelText","onCancel","isModal","okText","placement","children","onClick","getContainer","renderModal"],C=t=>{const e=Object.assign({},{message:"\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f",confirm:"\u786e\u5b9a",delete:"\u5220\u9664",cancel:"\u53d6\u6d88"},t.locale),i=Object.assign({},{isDelete:!0},t,{locale:e}),{title:o,message:l,isDelete:h,showCancel:d,cancelText:f,onCancel:v,isModal:C,okText:S,placement:M,children:T,onClick:k,getContainer:P,renderModal:R}=i,L=g(i,E),[I,F]=(0,n.useState)(!1),{isLoading:D,callback:O}=m(k),N=(0,a.A)((()=>{F(!0)})),z=s().createElement(r.Flex,{className:w,vertical:!0,gap:8,onClick:t=>{t.stopPropagation()}},o&&s().createElement(r.Flex,{align:"flex-start",gap:8,className:A},h&&s().createElement(c,{className:"title-icon"}),o),s().createElement(r.Flex,{align:"flex-start",gap:8,className:u()(x,{[_]:o})},!o&&h?s().createElement(c,{className:"title-icon"}):null,l||e.message)),B=()=>"function"===typeof T?T(p({},L,{onClick:N})):s().createElement(r.Button,p({},L,{loading:D,onClick:()=>{N()}}),T);if(C){const t={open:I,onCancel:()=>{F(!1),v&&v()},wrapClassName:y,okText:S||(h?e.delete:e.confirm),cancelText:f||e.cancel,onOk:t=>(F(!1),O(t)),closable:!1,okButtonProps:{danger:h},getContainer:P,children:z};return s().createElement(s().Fragment,null,"function"===typeof R?R(t):s().createElement(r.Modal,t),B())}return s().createElement(r.Popconfirm,{overlayClassName:u()(b),okButtonProps:{danger:h},title:z,open:I,getPopupContainer:P,onCancel:v,placement:M,showCancel:d,okText:S||(h?e.delete:e.confirm),cancelText:f||e.cancel,onOpenChange:F,onConfirm:t=>{O(t)}},B())};var S=Array.isArray,M="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof i.g?i.g:"undefined"!==typeof self?self:{},T="object"==typeof M&&M&&M.Object===Object&&M,k="object"==typeof self&&self&&self.Object===Object&&self,P=T||k||Function("return this")(),R=P.Symbol,L=Object.prototype,I=L.hasOwnProperty,F=L.toString,D=R?R.toStringTag:void 0;var O=function(t){var e=I.call(t,D),i=t[D];try{t[D]=void 0;var n=!0}catch(r){}var s=F.call(t);return n&&(e?t[D]=i:delete t[D]),s},N=Object.prototype.toString;var z=function(t){return N.call(t)},B=R?R.toStringTag:void 0;var H=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?O(t):z(t)};var j=function(t){return null!=t&&"object"==typeof t};var V=function(t){return"symbol"==typeof t||j(t)&&"[object Symbol]"==H(t)},$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,U=/^\w*$/;var W=function(t,e){if(S(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!V(t))||(U.test(t)||!$.test(t)||null!=e&&t in Object(e))};var G=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var q=function(t){if(!G(t))return!1;var e=H(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},X=P["__core-js_shared__"],K=function(){var t=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Y=function(t){return!!K&&K in t},Q=Function.prototype.toString;var J=function(t){if(null!=t){try{return Q.call(t)}catch(e){}try{return t+""}catch(e){}}return""},Z=/^\[object .+?Constructor\]$/,tt=Function.prototype,et=Object.prototype,it=tt.toString,nt=et.hasOwnProperty,st=RegExp("^"+it.call(nt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var rt=function(t){return!(!G(t)||Y(t))&&(q(t)?st:Z).test(J(t))};var at=function(t,e){return null==t?void 0:t[e]};var ot=function(t,e){var i=at(t,e);return rt(i)?i:void 0},lt=ot(Object,"create");var ht=function(){this.__data__=lt?lt(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},dt=Object.prototype.hasOwnProperty;var ut=function(t){var e=this.__data__;if(lt){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return dt.call(e,t)?e[t]:void 0},pt=Object.prototype.hasOwnProperty;var gt=function(t){var e=this.__data__;return lt?void 0!==e[t]:pt.call(e,t)};var ft=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=lt&&void 0===e?"__lodash_hash_undefined__":e,this};function mt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}mt.prototype.clear=ht,mt.prototype.delete=ct,mt.prototype.get=ut,mt.prototype.has=gt,mt.prototype.set=ft;var vt=mt;var bt=function(){this.__data__=[],this.size=0};var yt=function(t,e){return t===e||t!==t&&e!==e};var wt=function(t,e){for(var i=t.length;i--;)if(yt(t[i][0],e))return i;return-1},At=Array.prototype.splice;var xt=function(t){var e=this.__data__,i=wt(e,t);return!(i<0)&&(i==e.length-1?e.pop():At.call(e,i,1),--this.size,!0)};var _t=function(t){var e=this.__data__,i=wt(e,t);return i<0?void 0:e[i][1]};var Et=function(t){return wt(this.__data__,t)>-1};var Ct=function(t,e){var i=this.__data__,n=wt(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};function St(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}St.prototype.clear=bt,St.prototype.delete=xt,St.prototype.get=_t,St.prototype.has=Et,St.prototype.set=Ct;var Mt=St,Tt=ot(P,"Map");var kt=function(){this.size=0,this.__data__={hash:new vt,map:new(Tt||Mt),string:new vt}};var Pt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Rt=function(t,e){var i=t.__data__;return Pt(e)?i["string"==typeof e?"string":"hash"]:i.map};var Lt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e};var It=function(t){return Rt(this,t).get(t)};var Ft=function(t){return Rt(this,t).has(t)};var Dt=function(t,e){var i=Rt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};function Ot(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Ot.prototype.clear=kt,Ot.prototype.delete=Lt,Ot.prototype.get=It,Ot.prototype.has=Ft,Ot.prototype.set=Dt;var Nt=Ot;function zt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=e?e.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var a=t.apply(this,n);return i.cache=r.set(s,a)||r,a};return i.cache=new(zt.Cache||Nt),i}zt.Cache=Nt;var Bt=zt;var Ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jt=/\\(\\)?/g,Vt=function(t){var e=Bt(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ht,(function(t,i,n,s){e.push(n?s.replace(jt,"$1"):i||t)})),e}));var $t=function(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s},Ut=R?R.prototype:void 0,Wt=Ut?Ut.toString:void 0;var Gt=function t(e){if("string"==typeof e)return e;if(S(e))return $t(e,t)+"";if(V(e))return Wt?Wt.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i};var qt=function(t){return null==t?"":Gt(t)};var Xt=function(t,e){return S(t)?t:W(t,e)?[t]:Vt(qt(t))};var Kt=function(t){if("string"==typeof t||V(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var Yt=function(t,e){for(var i=0,n=(e=Xt(e,t)).length;null!=t&&i<n;)t=t[Kt(e[i++])];return i&&i==n?t:void 0},Qt=function(){try{var t=ot(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();var Jt=function(t,e,i){"__proto__"==e&&Qt?Qt(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i},Zt=Object.prototype.hasOwnProperty;var te=function(t,e,i){var n=t[e];Zt.call(t,e)&&yt(n,i)&&(void 0!==i||e in t)||Jt(t,e,i)},ee=/^(?:0|[1-9]\d*)$/;var ie=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&ee.test(t))&&t>-1&&t%1==0&&t<e};var ne=function(t,e,i,n){if(!G(t))return t;for(var s=-1,r=(e=Xt(e,t)).length,a=r-1,o=t;null!=o&&++s<r;){var l=Kt(e[s]),h=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(s!=a){var c=o[l];void 0===(h=n?n(c,l,o):void 0)&&(h=G(c)?c:ie(e[s+1])?[]:{})}te(o,l,h),o=o[l]}return t};var se=function(t,e,i){for(var n=-1,s=e.length,r={};++n<s;){var a=e[n],o=Yt(t,a);i(o,a)&&ne(r,Xt(a,t),o)}return r};var re=function(t,e){return null!=t&&e in Object(t)};var ae=function(t){return j(t)&&"[object Arguments]"==H(t)},oe=Object.prototype,le=oe.hasOwnProperty,he=oe.propertyIsEnumerable,ce=ae(function(){return arguments}())?ae:function(t){return j(t)&&le.call(t,"callee")&&!he.call(t,"callee")};var de=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var ue=function(t,e,i){for(var n=-1,s=(e=Xt(e,t)).length,r=!1;++n<s;){var a=Kt(e[n]);if(!(r=null!=t&&i(t,a)))break;t=t[a]}return r||++n!=s?r:!!(s=null==t?0:t.length)&&de(s)&&ie(a,s)&&(S(t)||ce(t))};var pe=function(t,e){return null!=t&&ue(t,e,re)};var ge=function(t,e){return se(t,e,(function(e,i){return pe(t,i)}))};var fe=function(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t},me=R?R.isConcatSpreadable:void 0;var ve=function(t){return S(t)||ce(t)||!!(me&&t&&t[me])};var be=function t(e,i,n,s,r){var a=-1,o=e.length;for(n||(n=ve),r||(r=[]);++a<o;){var l=e[a];i>0&&n(l)?i>1?t(l,i-1,n,s,r):fe(r,l):s||(r[r.length]=l)}return r};var ye=function(t){return(null==t?0:t.length)?be(t,1):[]};var we=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)},Ae=Math.max;var xe=function(t,e,i){return e=Ae(void 0===e?t.length-1:e,0),function(){for(var n=arguments,s=-1,r=Ae(n.length-e,0),a=Array(r);++s<r;)a[s]=n[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=n[s];return o[e]=i(a),we(t,this,o)}};var _e=function(t){return function(){return t}};var Ee=Qt?function(t,e){return Qt(t,"toString",{configurable:!0,enumerable:!1,value:_e(e),writable:!0})}:function(t){return t},Ce=Date.now;var Se=function(t){var e=0,i=0;return function(){var n=Ce(),s=16-(n-i);if(i=n,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Ee);Me=function(t,e){return null==t?{}:ge(t,e)},Se(xe(Me,void 0,ye),Me+"");var Me;Bt((t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;const a=r?0:["small","middle","large"].indexOf(s.size)>-1?8*(["small","middle","large"].indexOf(s.size)+1):Number.isInteger(s.size)?s.size:8;let o=0,l=0;for(;e>=l+n[o]+o*a&&o<n.length;)l+=n[o],o+=1;for(;e<l+(o-1)*a+(o<n.length?i+a:0)&&o>0;)l-=n[o-1],o-=1;return o}),(t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;return`${e}${i}${n.join(",")}${Object.values(s).join(",")}${r&&r.toString()}`}))},79461:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=t=>{const e=[];let i=0;const n=()=>{if(0!==e.length){if(i<t){const t=e.shift();i+=1,t().finally((()=>{i-=1,n()}))}}else i=0};return t=>new Promise((i=>{e.push((()=>{const e=Promise.resolve().then((()=>t()));return i(e),e})),n()}))}},36580:(t,e,i)=>{"use strict";i.d(e,{A:()=>H});var n,s=0,r=!1,a=!1,o="[iFrameSizer]",l=null,h=window.requestAnimationFrame,c=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d={},u=null,p=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){w("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function g(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function f(t,e,i){t.addEventListener(e,i,!1)}function m(t,e,i){t.removeEventListener(e,i,!1)}function v(t){return o+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}function b(t){return d[t]?d[t].log:r}function y(t,e){A("log",t,e,b(t))}function w(t,e){A("warn",t,e,!0)}function A(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](v(e),i)}function x(t){function e(){s("Height"),s("Width"),R((function(){P(x),M(E),g("onResized",x)}),x,"init")}function i(t){return"border-box"!==t.boxSizing?0:(t.paddingTop?parseInt(t.paddingTop,10):0)+(t.paddingBottom?parseInt(t.paddingBottom,10):0)}function n(t){return"border-box"!==t.boxSizing?0:(t.borderTopWidth?parseInt(t.borderTopWidth,10):0)+(t.borderBottomWidth?parseInt(t.borderBottomWidth,10):0)}function s(t){var e=Number(d[E]["max"+t]),i=Number(d[E]["min"+t]),n=t.toLowerCase(),s=Number(x[n]);y(E,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,y(E,"Set "+n+" to min value")),s>e&&(s=e,y(E,"Set "+n+" to max value")),x[n]=""+s}function r(t){return v.slice(v.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){L("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=x.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:e.height,iframeWidth:e.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(e.top-t.top,10),offsetLeft:parseInt(e.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),t,e)},n=32,O[s=e]||(O[s]=setTimeout((function(){O[s]=null,i()}),n))}function h(t){var e=t.getBoundingClientRect();return S(E),{x:Math.floor(Number(e.left)+Number(l.x)),y:Math.floor(Number(e.top)+Number(l.y))}}function c(t){var e=t?h(x.iframe):{x:0,y:0},i={x:Number(x.width)+e.x,y:Number(x.height)+e.y};y(E,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(l=i,u(),y(E,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):w(E,"Unable to scroll to requested position, window.parentIFrame not found")}function u(){!1===g("onScroll",l)?T():M(E)}function p(t){var e={};if(0===Number(x.width)&&0===Number(x.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:x.width,y:x.height};g(t,{iframe:x.iframe,screenX:Number(e.x),screenY:Number(e.y),type:x.type})}function g(t,e){return _(E,t,e)}var v=t.data,x={},E=null;"[iFrameResizerChild]Ready"===v?function(){for(var t in d)L("iFrame requested init",I(t),d[t].iframe,t)}():o===(""+v).slice(0,13)&&v.slice(13).split(":")[0]in d?(x=function(){var t=v.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=d[t[0]]&&d[t[0]].iframe,r=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(r)+n(r),width:t[2],type:t[3]}}(),E=x.id,d[E]&&(d[E].loaded=!0),!function(){var t=x.type in{true:1,false:1,undefined:1};return t&&y(E,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return d[t]||(e=!1,w(x.type+" No settings for "+t+". Message was: "+v)),e}(E)&&(y(E,"Received: "+v),function(){var t=!0;return null===x.iframe&&(w(E,"IFrame ("+x.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=d[E]&&d[E].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(y(E,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){var t=d[E]&&d[E].remoteHost;return y(E,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+x.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(d[E]&&d[E].firstRun&&d[E]&&(d[E].firstRun=!1),x.type){case"close":C(x.iframe);break;case"message":t=r(6),y(E,"onMessage passed: {iframe: "+x.iframe.id+", message: "+t+"}"),g("onMessage",{iframe:x.iframe,message:JSON.parse(t)}),y(E,"--");break;case"mouseenter":p("onMouseEnter");break;case"mouseleave":p("onMouseLeave");break;case"autoResize":d[E].autoResize=JSON.parse(r(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":a(d[E]&&d[E].iframe,E),function(){function t(t,n){function s(){d[i]?a(d[i].iframe,i):e()}["scroll","resize"].forEach((function(e){y(i,t+e+" listener for sendPageInfo"),n(window,e,s)}))}function e(){t("Remove ",m)}var i=E;t("Add ",f),d[i]&&(d[i].stopPageInfo=e)}();break;case"pageInfoStop":d[E]&&d[E].stopPageInfo&&(d[E].stopPageInfo(),delete d[E].stopPageInfo);break;case"inPageLink":!function(t){var e=t.split("#")[1]||"",i=decodeURIComponent(e),n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){var t=h(n);y(E,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),l={x:t.x,y:t.y},u(),y(E,"--")}():window.top===window.self?y(E,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):y(E,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":k(x);break;case"init":e(),g("onInit",x.iframe);break;default:0===Number(x.width)&&0===Number(x.height)?w("Unsupported message received ("+x.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):e()}var t}())):function(t,e){A("info",t,e,b(t))}(E,"Ignored: "+v)}function _(t,e,i){var n=null,s=null;if(d[t]){if("function"!==typeof(n=d[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function E(t){var e=t.id;delete d[e]}function C(t){var e=t.id;if(!1!==_(e,"onClose",e)){y(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){w(i)}_(e,"onClosed",e),y(e,"--"),E(t),n&&(n.disconnect(),n=null)}else y(e,"Close iframe cancelled by onClose event")}function S(t){null===l&&y(t,"Get page position: "+(l={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+l.y)}function M(t){null!==l&&(window.scrollTo(l.x,l.y),y(t,"Set page position: "+l.x+","+l.y),T())}function T(){l=null}function k(t){y(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),S(t.id),R((function(){P(t),L("reset","reset",t.iframe,t.id)}),t,"reset")}function P(t){function e(e){a||"0"!==t[e]||(a=!0,y(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(d[t]&&d[t].iframe.style[e])}function i(t){return null!==t.offsetParent}d[t]&&i(d[t].iframe)&&(e("height")||e("width"))&&L("Visibility change","resize",d[t].iframe,t)}Object.keys(d).forEach((function(e){t(e)}))}function e(e){y("window","Mutation observed: "+e[0].target+" "+e[0].type),D(t,16)}function i(){var t=document.querySelector("body"),i={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};new n(e).observe(t,i)}var n=g();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",y(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):y("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;d[n]&&(d[n].sizeHeight&&i("height"),d[n].sizeWidth&&i("width"))}function R(t,e,i){i!==e.type&&h&&!window.jasmine?(y(e.id,"Requesting animation frame"),h(t)):t()}function L(t,e,i,n,s){var r=!1;n=n||i.id,d[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=d[n]&&d[n].targetOrigin;y(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(o+e,s)}():w(n,"["+t+"] IFrame("+n+") not found"),s&&d[n]&&d[n].warningTimeout&&(d[n].msgTimeout=setTimeout((function(){!d[n]||d[n].loaded||r||(r=!0,w(n,"IFrame has not responded within "+d[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),d[n].warningTimeout)))}function I(t){return t+":"+d[t].bodyMarginV1+":"+d[t].sizeWidth+":"+d[t].log+":"+d[t].interval+":"+d[t].enablePublicMethods+":"+d[t].autoResize+":"+d[t].bodyMargin+":"+d[t].heightCalculationMethod+":"+d[t].bodyBackground+":"+d[t].bodyPadding+":"+d[t].tolerance+":"+d[t].inPageLinks+":"+d[t].resizeFrom+":"+d[t].widthCalculationMethod+":"+d[t].mouseEvents}function F(t,e){function i(t){var e=t.split("Callback");if(2===e.length){var i="on"+e[0].charAt(0).toUpperCase()+e[0].slice(1);this[i]=this[t],delete this[t],w(a,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var a=function(i){if("string"!==typeof i)throw new TypeError("Invaild id for iFrame. Expected String");return""===i&&(t.id=i=function(){var t=e&&e.id||p.id+s++;return null!==document.getElementById(t)&&(t+=s++),t}(),r=(e||{}).log,y(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);a in d&&"iFrameResizer"in t?w(a,"Ignored iFrame, already setup."):(!function(e){var n;e=e||{},d[a]=Object.create(null),d[a].iframe=t,d[a].firstRun=!0,d[a].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(t){if("object"!==typeof t)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(i,e),function(t){for(var e in p)Object.prototype.hasOwnProperty.call(p,e)&&(d[a][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:p[e])}(e),d[a]&&(d[a].targetOrigin=!0===d[a].checkOrigin?""===(n=d[a].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(e),function(){switch(y(a,"IFrame scrolling "+(d[a]&&d[a].scrolling?"enabled":"disabled")+" for "+a),t.style.overflow=!1===(d[a]&&d[a].scrolling)?"hidden":"auto",d[a]&&d[a].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=d[a]?d[a].scrolling:"no"}}(),function(){function e(e){var i=d[a][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,y(a,"Set "+e+" = "+t.style[e]))}function i(t){if(d[a]["min"+t]>d[a]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}i("Height"),i("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!==typeof(d[a]&&d[a].bodyMargin)&&"0"!==(d[a]&&d[a].bodyMargin)||(d[a].bodyMarginV1=d[a].bodyMargin,d[a].bodyMargin=d[a].bodyMargin+"px"),function(e){var i=g();i&&(n=function(e){if(!t.parentNode)return null;var i=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&C(t)}))}))}));return i.observe(t.parentNode,{childList:!0}),i}(i)),f(t,"load",(function(){L("iFrame.onload",e,t,void 0,!0),function(){var e=d[a]&&d[a].firstRun,i=d[a]&&d[a].heightCalculationMethod in c;!e&&i&&k({iframe:t,height:0,width:0,type:"init"})}()})),L("init",e,t,void 0,!0)}(I(a)),d[a]&&(d[a].iframe.iFrameResizer={close:C.bind(null,d[a].iframe),removeListeners:E.bind(null,d[a].iframe),resize:L.bind(null,"Window resize","resize",d[a].iframe),moveToAnchor:function(t){L("Move to anchor","moveToAnchor:"+t,d[a].iframe,a)},sendMessage:function(t){L("Send Message","message:"+(t=JSON.stringify(t)),d[a].iframe,a)}}))}function D(t,e){null===u&&(u=setTimeout((function(){u=null,t()}),e))}var O={};function N(){"hidden"!==document.visibilityState&&(y("document","Trigger event: Visibility change"),D((function(){z("Tab Visible","resize")}),16))}function z(t,e){Object.keys(d).forEach((function(i){(function(t){return d[t]&&"parent"===d[t].resizeFrom&&d[t].autoResize&&!d[t].firstRun})(i)&&L(t,e,d[i].iframe,i)}))}function B(){f(window,"message",x),f(window,"resize",(function(){var t;y("window","Trigger event: "+(t="resize")),D((function(){z("Window "+t,"resize")}),16)})),f(document,"visibilitychange",N),f(document,"-webkit-visibilitychange",N)}var H=function(){function t(t,i){i&&(!function(){if(!i.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==i.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+i.tagName+">")}(),F(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!h;t+=1)h=window[e[t]+"RequestAnimationFrame"];h?h=h.bind(window):y("setup","RequestAnimationFrame not supported")}(),B(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&w("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(void 0,i));break;case"object":t(i,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return e}}()},88406:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(94922),s=i.n(n);function r(){return r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},r.apply(this,arguments)}var a={doc:t=>n.createElement("svg",r({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),docx:t=>n.createElement("svg",r({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),full:t=>n.createElement("svg",r({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),n.createElement("title",null,"\u5145\u6ee1"),n.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},n.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-145.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},n.createElement("g",{id:"\\u5145\\u6EE1",transform:"translate(145.000000, 1567.000000)"},n.createElement("path",{d:"M12.09375,0 C12.35,0 12.6,0.05 12.8359375,0.15 C13.0640625,0.2453125 13.2671875,0.3828125 13.4421875,0.5578125 C13.6171875,0.7328125 13.7546875,0.9375 13.85,1.1640625 C13.95,1.4 14,1.65 14,1.90625 L14,1.90625 L14,12.09375 C14,12.35 13.95,12.6 13.85,12.8359375 C13.7546875,13.0640625 13.6171875,13.2671875 13.4421875,13.4421875 C13.2671875,13.6171875 13.0625,13.7546875 12.8359375,13.85 C12.6,13.95 12.35,14 12.09375,14 L12.09375,14 L1.90625,14 C1.65,14 1.4,13.95 1.1640625,13.85 C0.9359375,13.7546875 0.7328125,13.6171875 0.5578125,13.4421875 C0.3828125,13.2671875 0.2453125,13.0625 0.15,12.8359375 C0.05,12.6 0,12.35 0,12.09375 L0,12.09375 L0,1.90625 C0,1.65 0.05,1.4 0.15,1.1640625 C0.2453125,0.9359375 0.3828125,0.7328125 0.5578125,0.5578125 C0.7328125,0.3828125 0.9375,0.2453125 1.1640625,0.15 C1.4,0.05 1.65,0 1.90625,0 L1.90625,0 Z M12.09375,1.125 L1.90625,1.125 C1.475,1.125 1.125,1.475 1.125,1.90625 L1.125,1.90625 L1.125,12.09375 C1.125,12.525 1.475,12.875 1.90625,12.875 L1.90625,12.875 L12.09375,12.875 C12.525,12.875 12.875,12.525 12.875,12.09375 L12.875,12.09375 L12.875,1.90625 C12.875,1.475 12.525,1.125 12.09375,1.125 L12.09375,1.125 Z M2.5734375,7.484375 C2.878125,7.490625 3.125,7.740625 3.125,8.046875 L3.125,8.046875 L3.125,10.0640625 L5.1265625,8.0625 C5.3453125,7.84375 5.703125,7.84375 5.921875,8.0625 C6.140625,8.28125 6.140625,8.6390625 5.921875,8.8578125 L5.921875,8.8578125 L3.903125,10.875 L5.909375,10.875 C6.2265625,10.875 6.4890625,11.13125 6.484375,11.4484375 C6.478125,11.7546875 6.228125,12 5.921875,12 L5.921875,12 L2.5734375,12 C2.25625,12 2,11.74375 2,11.4265625 L2,11.4265625 L2,8.0578125 C2,7.740625 2.2578125,7.478125 2.5734375,7.484375 Z M11.4296875,2 C11.7453125,2 12,2.25625 12,2.5703125 L12,2.5703125 L12,5.940625 C12,6.2578125 11.7421875,6.5203125 11.4265625,6.5140625 C11.121875,6.5078125 10.875,6.2578125 10.875,5.9515625 L10.875,5.9515625 L10.875,3.9359375 L8.8734375,5.9375 C8.6546875,6.15625 8.296875,6.15625 8.078125,5.9375 C7.859375,5.71875 7.859375,5.3609375 8.078125,5.1421875 L8.078125,5.1421875 L10.0953125,3.125 L8.0890625,3.125 C7.771875,3.125 7.509375,2.86875 7.515625,2.5515625 C7.521875,2.2453125 7.771875,2 8.078125,2 L8.078125,2 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),gif:t=>n.createElement("svg",r({t:1646123917228,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1827,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1828}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1829}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1830}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#CC7598","p-id":1831}),n.createElement("path",{d:"M288 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z m96 80a16 16 0 0 1-16 16 16 16 0 0 1-16-16V560a16 16 0 0 1 16-16 16 16 0 0 1 16 16z m176-208h-96a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h48a16 16 0 0 0 0-32h-48v-64h80a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":1832})),jpg:t=>n.createElement("svg",r({t:1646123877293,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1269,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1270}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1271}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1272}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1273}),n.createElement("path",{d:"M320 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m256 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM208 544a16 16 0 0 0-16 16v144a32 32 0 0 1-64 0v-16a16 16 0 0 0-32 0v16a64 64 0 0 0 128 0V560a16 16 0 0 0-16-16z",fill:"#FFFFFF","p-id":1274})),mp4:t=>n.createElement("svg",r({t:1646123927989,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1966,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1967}),n.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1968}),n.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1969}),n.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#724AE2","p-id":1970}),n.createElement("path",{d:"M537.088 547.84c9.728 0 14.336 4.608 14.336 13.824v132.608h18.944c9.728 0.512 14.336 4.608 14.336 13.312s-5.12 13.312-15.36 13.312h-18.432v37.888c-0.512 9.728-5.12 14.336-13.824 14.336s-13.312-5.12-13.312-15.36v-36.864h-79.36c-12.8-0.512-19.456-4.096-19.456-11.776 0-4.096 1.536-7.68 4.096-11.776l94.208-141.312 0.512-1.024c3.584-4.608 8.192-7.168 13.312-7.168z m-302.592-1.536c7.168 0 11.264 5.12 11.264 15.872v193.536c0 10.752-4.608 15.872-11.264 15.872s-11.264-5.12-11.264-15.872V622.08l-44.544 140.8c-2.048 6.144-8.192 8.704-12.288 8.704s-10.24-3.072-12.288-8.704l-46.08-140.8v133.632c0 10.752-6.144 15.872-12.8 15.872s-12.8-5.12-12.8-15.872V562.176c0-10.752 5.632-15.872 12.8-15.872 4.608 0 10.752 3.072 12.8 8.704L166.4 728.064l56.832-173.056c2.048-6.144 6.144-8.704 11.264-8.704z m121.856 0c35.328 0 63.488 28.672 63.488 64 0 34.816-27.648 62.976-62.464 64h-33.28v79.872c0 8.704-7.168 15.872-15.872 15.872-8.192 0-15.36-6.656-15.872-14.848V562.176c0-8.192 6.656-15.36 14.848-15.872h49.152z m166.912 58.368l-59.904 90.112h59.904v-90.112z m-166.912-26.624h-31.744v64h31.744c17.92 0 31.744-14.848 31.744-32.256s-13.824-31.744-31.744-31.744z",fill:"#FFFFFF","p-id":1971})),pdf:t=>n.createElement("svg",r({t:1646123842588,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1304,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1305}),n.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1306}),n.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1307}),n.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#CD4050","p-id":1308}),n.createElement("path",{d:"M192 544.256h-48.128c-8.704 0-15.872 7.168-15.872 15.872v192c0 8.704 7.168 15.872 15.872 15.872s15.872-7.168 15.872-15.872v-79.872h31.744c35.328 0 64-28.672 64-64s-28.16-64-63.488-64z m158.72 0c34.816 0 62.976 27.648 64 62.464v97.792c0 34.816-27.648 62.976-62.464 64h-49.664c-8.704 0-15.36-6.656-15.872-14.848V560.64c0-8.704 6.656-15.36 14.848-15.872h49.152z m227.328 0c8.704 0 15.872 7.168 15.872 15.872S586.752 576 578.048 576h-80.384v64h48.128c8.704 0 15.872 7.168 15.872 15.872s-7.168 15.872-15.872 15.872h-48.128v79.872c0 8.704-7.168 15.872-15.872 15.872s-15.872-7.168-15.872-15.872v-192c0-8.704 7.168-15.872 15.872-15.872h96.256zM350.72 576h-31.744v159.744h31.744c17.408 0 31.232-13.824 31.744-30.72v-97.28C382.976 590.336 368.64 576 350.72 576zM192 576c17.92 0 31.744 14.336 31.744 31.744S209.92 640 192 640h-31.744v-64H192z",fill:"#FFFFFF","p-id":1309})),png:t=>n.createElement("svg",r({t:1646123868693,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1130,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1131}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1132}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1133}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1134}),n.createElement("path",{d:"M160 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m448 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM400 544a16 16 0 0 0-16 16v137.6l-98.88-146.56a7.36 7.36 0 0 0-2.24-2.24l-2.56-1.6h-16l-2.56 2.24v5.12a13.76 13.76 0 0 0 0 3.52v192a16 16 0 0 0 32 0v-137.6l96 142.08a15.68 15.68 0 0 0 32-3.2v-192A16 16 0 0 0 400 544z",fill:"#FFFFFF","p-id":1135})),ppt:t=>n.createElement("svg",r({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),pptx:t=>n.createElement("svg",r({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),rar:t=>n.createElement("svg",r({t:1646123940344,className:"icon",viewBox:"0 0 1056 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2245,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M1.248 0h1024v1024h-1024z",fillOpacity:0,"p-id":2246}),n.createElement("path",{d:"M849.248 1024h-672c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5F1EC","p-id":2247}),n.createElement("path",{d:"M922.848 313.6h-819.2V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#E0B773","p-id":2248}),n.createElement("path",{d:"M244.448 252.8v-57.6h25.6l25.6 54.4h25.6l-32-54.4c19.2-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m32-73.6h-32v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 3.2 6.4 3.2 16 0 6.4-3.2 9.6-6.4 12.8 0 3.2-6.4 6.4-12.8 6.4z m83.2 73.6l9.6-28.8h48l9.6 28.8h22.4l-48-131.2h-16l-48 131.2h22.4z m54.4-48h-38.4l19.2-57.6 19.2 57.6z m86.4 48v-57.6h25.6l25.6 54.4h22.4l-28.8-54.4c16-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m28.8-73.6h-28.8v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 6.4 6.4 6.4 16 0 6.4-3.2 9.6-6.4 12.8-6.4 3.2-12.8 6.4-19.2 6.4z",fill:"#FFFFFF","p-id":2249}),n.createElement("path",{d:"M922.848 236.8h-150.4c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5F1EC","p-id":2250}),n.createElement("path",{d:"M426.848 464v409.6h172.8V464h-172.8z m150.4 140.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#E0B773","p-id":2251})),rotate:t=>n.createElement("svg",r({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),n.createElement("title",null,"\u65cb\u8f6c"),n.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},n.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-77.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},n.createElement("g",{id:"\\u65CB\\u8F6C",transform:"translate(77.000000, 1567.000000)"},n.createElement("path",{d:"M9.16414904,5.6345426 C9.35110931,5.6345426 9.53041217,5.70881228 9.66261304,5.84101315 C9.79481391,5.97321402 9.86908359,6.15251688 9.86908359,6.33947715 L9.86908359,12.683888 C9.86908359,13.0732126 9.55347364,13.3888226 9.16414904,13.3888226 L0.704934547,13.3888226 C0.315609953,13.3888226 1.8189894e-12,13.0732126 1.8189894e-12,12.683888 L1.8189894e-12,6.33947715 C1.8189894e-12,6.15251688 0.0742696765,5.97321402 0.206470548,5.84101315 C0.33867142,5.70881228 0.517974281,5.6345426 0.704934547,5.6345426 L9.16414904,5.6345426 Z M8.4592145,7.04441168 L1.40986909,7.04441168 L1.40986909,11.9789535 L8.4592145,11.9789535 L8.4592145,7.04441168 Z M7.58258803,0.714885198 C7.63035214,0.738767256 7.66052367,0.787585825 7.66052367,0.840987728 L7.66052367,2.02739256 C11.1625178,2.03011634 14,4.86980822 14,8.37180343 C14,8.62367799 13.8656872,8.85643618 13.6475639,8.98238459 C13.4294405,9.108333 13.1606904,9.108333 12.942567,8.98238459 C12.7244437,8.85643618 12.5900924,8.62367799 12.5901309,8.37180343 C12.5901323,5.64845715 10.3838686,3.43998499 7.66052367,3.43726164 L7.66052367,4.50664733 C7.66052367,4.56004923 7.63035214,4.6088678 7.58258803,4.63274986 C7.53482391,4.65663192 7.47766614,4.65147801 7.43494462,4.61943686 L4.99093655,2.78660706 C4.95543522,2.75998107 4.93454178,2.71819419 4.93454178,2.67381753 C4.93454178,2.62944087 4.95543522,2.58765399 4.99093655,2.561028 L7.43494462,0.728198195 C7.47766614,0.696157053 7.53482391,0.691003139 7.58258803,0.714885198 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),svg:t=>n.createElement("svg",r({t:1646123950101,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2385,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":2386}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":2387}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":2388}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":2389}),n.createElement("path",{d:"M160 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m246.08-96a16 16 0 0 0-20.8 8.96l-64 155.84-64-155.84a16 16 0 1 0-29.44 11.84l77.76 192a24.96 24.96 0 0 0 3.2 4.8 12.8 12.8 0 0 0 4.8 3.2 12.8 12.8 0 0 0 4.8 0h5.76l3.2-2.24a13.12 13.12 0 0 0 5.44-6.4l77.76-192a15.68 15.68 0 0 0-4.48-20.16zM576 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":2390})),unknow:t=>n.createElement("svg",r({t:1646123889587,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1551,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M914.92 287.344L697.718 81.474v128.338c0 43.554 34.968 79.189 77.706 79.189h141.99l-2.494-1.657z",fill:"#027AFF","p-id":1552}),n.createElement("path",{d:"M768.284 316.733c-54.48 0-99.056-48.997-99.056-108.882V66.223h-373.35c-30.593 0-55.624 27-55.624 60v348.869h490.802c37.476 0 68.137 33.073 68.137 73.496v207.894c0 40.424-30.661 73.497-68.137 73.497H240.254v70.128c0 33 25.031 60 55.625 60h563.637c30.594 0 55.625-27 55.625-60V316.733H768.284z",fill:"#027AFF","p-id":1553}),n.createElement("path",{d:"M699.302 519.057H156.028c-31.109 0-56.561 25.381-56.561 56.403v153.038c0 31.021 25.452 56.402 56.561 56.402h543.274c31.11 0 56.562-25.38 56.562-56.402V575.46c0-31.022-25.453-56.403-56.562-56.403z m-444.857 211.51c-4.902 4.135-10.558 6.203-16.874 6.203-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.451-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.545 11.28-7.636 15.417z m29.884-89.775c-2.263 2.068-9.993 6.957-23.379 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.849 2.82-0.849 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.259-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.918-1.503-10.84-4.605-2.923-2.82-4.431-6.487-4.431-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.874 0 30.637 4.418 41.384 13.349 10.18 8.46 15.271 18.989 15.271 31.68 0 12.69-3.488 22.372-10.652 29.14zM442.7 730.566c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.884-89.774c-2.263 2.068-9.993 6.957-23.38 14.571-3.864 2.256-6.221 4.136-7.07 5.64-0.565 0.846-0.848 2.82-0.848 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.258-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.358 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.919-1.503-10.841-4.605-2.922-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.873 0 30.637 4.418 41.383 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.652 29.14z m158.372 89.774c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.067-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.883-89.774c-2.262 2.068-9.992 6.957-23.378 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.85 2.82-0.85 6.016 0 4.7-1.507 8.367-4.618 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.841-3.29-3.488-2.632-5.185-6.392-5.185-11.28v-10.247c0-7.896 3.582-14.477 10.841-19.553 6.976-3.572 13.763-7.238 20.456-10.81 7.26-3.854 10.841-8.367 10.841-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.571 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.147 6.017-9.05 8.93-14.611 8.93-4.337 0-7.919-1.503-10.841-4.605-2.923-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.909-18.143 16.874 0 30.637 4.418 41.384 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.653 29.14z",fill:"#027AFF","p-id":1554})),xls:t=>n.createElement("svg",r({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),n.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),xlsx:t=>n.createElement("svg",r({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),n.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),zip:t=>n.createElement("svg",r({t:1646123936994,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2105,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M0 0h1024v1024H0z",fillOpacity:0,"p-id":2106}),n.createElement("path",{d:"M848 1024H176c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5ECEC","p-id":2107}),n.createElement("path",{d:"M921.6 313.6H102.4V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#BC8585","p-id":2108}),n.createElement("path",{d:"M300.8 252.8v-19.2H240l57.6-96v-16h-80v16h57.6l-57.6 96v16h83.2z m70.4 0V121.6H352v131.2h19.2z m80 0v-51.2H480c12.8 0 22.4-3.2 32-12.8 6.4-6.4 9.6-16 9.6-25.6 0-6.4 0-12.8-3.2-19.2-3.2-6.4-6.4-9.6-9.6-12.8-6.4-3.2-9.6-6.4-16-6.4h-64V256h22.4z m28.8-70.4h-28.8v-41.6H480c6.4 0 9.6 0 12.8 3.2 3.2 0 3.2 3.2 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4-3.2 9.6-6.4 12.8-3.2 6.4-9.6 9.6-16 9.6z",fill:"#FFFFFF","p-id":2109}),n.createElement("path",{d:"M921.6 236.8H771.2c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5ECEC","p-id":2110}),n.createElement("path",{d:"M425.6 464v409.6h172.8V464H425.6zM576 604.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#BC8585","p-id":2111}))};const o=t=>{const{size:e,type:i}=Object.assign({},{size:40,type:"unknow"},t),n=a[i]||a.unknow;return s().createElement(n,{width:e,height:e})}},7717:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(3141),s=i(94922);const r=function(t,e){e=Object.assign({},{defaultValue:"defaultValue",value:"value",onChange:"onChange"},e);var i=(0,s.useRef)(e.value in t),r=(0,s.useState)(t[e.defaultValue]),a=(0,n.A)(r,2),o=a[0],l=a[1],h=(0,s.useRef)(null);return h.current=i.current?t[e.value]:o,[h.current,function(n){for(var s="function"===typeof n?h.current=n(h.current):n,r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];t[e.onChange]&&t[e.onChange].apply(t,[s].concat(a)),i.current||l(s)}]}},78678:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(94922);const s=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=(0,n.useRef)(t);return e||(i.current=t),(0,n.useCallback)((function(){return i.current&&i.current(...arguments)}),[])}},50805:(t,e,i)=>{"use strict";i.d(e,{A:()=>h});var n=i(94922),s=i(98771),r=i.n(s),a=i(95600),o=i.n(a),l=i(78678);const h=(t,e)=>{const i=(0,n.useRef)(null);i.current=Object.assign({},{time:500,isDebounce:!1},e);const s=(0,n.useRef)(null),a=(0,l.A)(t);return(0,n.useLayoutEffect)((()=>{const t=s.current,e=()=>window.requestAnimationFrame((()=>{t&&a(t)}));e();const n=new ResizeObserver((i.current.isDebounce?o():r())(e,i.current.time));return t&&n.observe(t),()=>{n.disconnect()}}),[a]),s}},64579:(t,e,i)=>{var n=i(78913),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},78913:t=>{var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},95600:(t,e,i)=>{var n=i(2316),s=i(93375),r=i(2899),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,h,c,d,u,p,g=0,f=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(e){var i=l,n=h;return l=h=void 0,g=e,d=t.apply(n,i)}function y(t){var i=t-p;return void 0===p||i>=e||i<0||m&&t-g>=c}function w(){var t=s();if(y(t))return A(t);u=setTimeout(w,function(t){var i=e-(t-p);return m?o(i,c-(t-g)):i}(t))}function A(t){return u=void 0,v&&l?b(t):(l=h=void 0,d)}function x(){var t=s(),i=y(t);if(l=arguments,h=this,p=t,i){if(void 0===u)return function(t){return g=t,u=setTimeout(w,e),f?b(t):d}(p);if(m)return clearTimeout(u),u=setTimeout(w,e),b(p)}return void 0===u&&(u=setTimeout(w,e)),d}return e=r(e)||0,n(i)&&(f=!!i.leading,c=(m="maxWait"in i)?a(r(i.maxWait)||0,e):c,v="trailing"in i?!!i.trailing:v),x.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=p=h=u=void 0},x.flush=function(){return void 0===u?d:A(s())},x}},93375:(t,e,i)=>{var n=i(36382);t.exports=function(){return n.Date.now()}},98771:(t,e,i)=>{var n=i(95600),s=i(2316);t.exports=function(t,e,i){var r=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(r="leading"in i?!!i.leading:r,a="trailing"in i?!!i.trailing:a),n(t,e,{leading:r,maxWait:e,trailing:a})}},2899:(t,e,i)=>{var n=i(64579),s=i(2316),r=i(90931),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,h=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var i=o.test(t);return i||l.test(t)?h(t.slice(2),i?2:8):a.test(t)?NaN:+t}},57325:(t,e,i)=>{var n=i(20907),s=0;t.exports=function(t){var e=++s;return n(t)+e}},74935:(t,e,i)=>{"use strict";var n=i(94922),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function h(t,e,i){var n,r={},h=null,c=null;for(n in void 0!==i&&(h=""+i),void 0!==e.key&&(h=""+e.key),void 0!==e.ref&&(c=e.ref),e)a.call(e,n)&&!l.hasOwnProperty(n)&&(r[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)void 0===r[n]&&(r[n]=e[n]);return{$$typeof:s,type:t,key:h,ref:c,props:r,_owner:o.current}}e.jsx=h,e.jsxs=h},89261:(t,e,i)=>{"use strict";t.exports=i(74935)},98677:t=>{"use strict";var e=function(){};t.exports=e},9062:()=>{},41481:()=>{},54159:(t,e)=>{var i;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t="",e=0;e<arguments.length;e++){var i=arguments[e];i&&(t=a(t,r(i)))}return t}function r(t){if("string"===typeof t||"number"===typeof t)return t;if("object"!==typeof t)return"";if(Array.isArray(t))return s.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var i in t)n.call(t,i)&&t[i]&&(e=a(e,i));return e}function a(t,e){return e?t?t+" "+e:t+e:t}t.exports?(s.default=s,t.exports=s):void 0===(i=function(){return s}.apply(e,[]))||(t.exports=i)}()},47215:(t,e,i)=>{"use strict";function n(t){var e,i,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=n(t[e]))&&(s&&(s+=" "),s+=i)}else for(i in t)t[i]&&(s&&(s+=" "),s+=i);return s}i.d(e,{A:()=>s});const s=function(){for(var t,e,i=0,s="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=n(t))&&(s&&(s+=" "),s+=e);return s}},63697:(t,e,i)=>{"use strict";function n(t){var e=!1;return{promise:new Promise((function(i,n){t.then((function(t){return!e&&i(t)})).catch((function(t){return!e&&n(t)}))})),cancel:function(){e=!0}}}i.d(e,{A:()=>n})},36294:(t,e,i)=>{"use strict";i.d(e,{Ay:()=>r});var n=function(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},s=n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function r(t,e){var i={};return s.forEach((function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)})),i}},31079:(t,e,i)=>{"use strict";i.d(e,{D6:()=>_s,EA:()=>As,Tm:()=>xs,YE:()=>Es,dU:()=>ys,ng:()=>ws});var n={d:(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},s=globalThis.pdfjsLib={};n.d(s,{AbortException:()=>mt,AnnotationEditorLayer:()=>vs,AnnotationEditorParamsType:()=>b,AnnotationEditorType:()=>v,AnnotationEditorUIManager:()=>be,AnnotationLayer:()=>rs,AnnotationMode:()=>m,CMapCompressionType:()=>Q,ColorPicker:()=>ps,DOMSVGFactory:()=>Gt,DrawLayer:()=>bs,FeatureTest:()=>wt,GlobalWorkerOptions:()=>hi,ImageKind:()=>S,InvalidPDFException:()=>ut,MissingPDFException:()=>pt,OPS:()=>J,Outliner:()=>ls,PDFDataRangeTransport:()=>un,PDFDateString:()=>se,PDFWorker:()=>vn,PasswordResponses:()=>Z,PermissionFlag:()=>y,PixelsPerInch:()=>Vt,RenderingCancelledException:()=>Xt,TextLayer:()=>Zi,UnexpectedResponseException:()=>gt,Util:()=>xt,VerbosityLevel:()=>Y,XfaLayer:()=>Tn,build:()=>En,createValidAbsoluteUrl:()=>ot,fetchData:()=>$t,getDocument:()=>hn,getFilenameFromUrl:()=>Qt,getPdfFilenameFromUrl:()=>Jt,getXfaPageViewport:()=>re,isDataScheme:()=>Kt,isPdfFile:()=>Yt,noContextMenu:()=>ee,normalizeUnicode:()=>Ct,renderTextLayer:()=>tn,setLayerDimensions:()=>he,shadow:()=>lt,updateTextLayer:()=>en,version:()=>_n});const r="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),a=[1,0,0,1,0,0],o=[.001,0,0,.001,0,0],l=1.35,h=1,c=2,d=4,u=16,p=32,g=64,f=256,m={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},v={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},b={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},y={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},w=0,A=1,x=2,_=3,E=3,C=4,S={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},M=1,T=2,k=3,P=4,R=5,L=6,I=7,F=8,D=9,O=10,N=11,z=12,B=13,H=14,j=15,V=16,$=17,U=20,W=1,G=2,q=3,X=4,K=5,Y={ERRORS:0,WARNINGS:1,INFOS:5},Q={NONE:0,BINARY:1},J={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},Z={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let tt=Y.WARNINGS;function et(t){Number.isInteger(t)&&(tt=t)}function it(){return tt}function nt(t){tt>=Y.INFOS&&console.log(`Info: ${t}`)}function st(t){tt>=Y.WARNINGS&&console.log(`Warning: ${t}`)}function rt(t){throw new Error(t)}function at(t,e){t||rt(e)}function ot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const n=e?new URL(t,e):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function lt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const ht=function(){function t(e,i){this.constructor===t&&rt("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class ct extends ht{constructor(t,e){super(t,"PasswordException"),this.code=e}}class dt extends ht{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class ut extends ht{constructor(t){super(t,"InvalidPDFException")}}class pt extends ht{constructor(t){super(t,"MissingPDFException")}}class gt extends ht{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class ft extends ht{constructor(t){super(t,"FormatError")}}class mt extends ht{constructor(t){super(t,"AbortException")}}function vt(t){"object"===typeof t&&void 0!==t?.length||rt("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let s=0;s<e;s+=i){const r=Math.min(s+i,e),a=t.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function bt(t){"string"!==typeof t&&rt("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}function yt(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class wt{static get isLittleEndian(){return lt(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return lt(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return lt(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){return"undefined"!==typeof navigator&&"string"===typeof navigator?.platform?lt(this,"platform",{isMac:navigator.platform.includes("Mac")}):lt(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return lt(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const At=Array.from(Array(256).keys(),(t=>t.toString(16).padStart(2,"0")));class xt{static makeHexColor(t,e,i){return`#${At[t]}${At[e]}${At[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=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])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[1])]}static inverseTransform(t){const 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]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,h=a-o||1;return[Math.sqrt(l),Math.sqrt(h)]}static normalizeRect(t){const 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}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[i,s,n,r]}static#t(t,e,i,n,s,r,a,o,l,h){if(l<=0||l>=1)return;const c=1-l,d=l*l,u=d*l,p=c*(c*(c*t+3*l*e)+3*d*i)+u*n,g=c*(c*(c*s+3*l*r)+3*d*a)+u*o;h[0]=Math.min(h[0],p),h[1]=Math.min(h[1],g),h[2]=Math.max(h[2],p),h[3]=Math.max(h[3],g)}static#e(t,e,i,n,s,r,a,o,l,h,c,d){if(Math.abs(l)<1e-12)return void(Math.abs(h)>=1e-12&&this.#t(t,e,i,n,s,r,a,o,-c/h,d));const u=h**2-4*c*l;if(u<0)return;const p=Math.sqrt(u),g=2*l;this.#t(t,e,i,n,s,r,a,o,(-h+p)/g,d),this.#t(t,e,i,n,s,r,a,o,(-h-p)/g,d)}static bezierBoundingBox(t,e,i,n,s,r,a,o,l){return l?(l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o)):l=[Math.min(t,a),Math.min(e,o),Math.max(t,a),Math.max(e,o)],this.#e(t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),this.#e(t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l),l}}let _t=null,Et=null;function Ct(t){return _t||(_t=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Et=new Map([["\ufb05","\u017ft"]])),t.replaceAll(_t,((t,e,i)=>e?e.normalize("NFKC"):Et.get(i)))}const St="pdfjs_internal_id_",Mt=0,Tt=1,kt=2,Pt=3,Rt=4,Lt=5,It=6,Ft=7,Dt=8;class Ot{constructor(){this.constructor===Ot&&rt("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(){}}class Nt{#i=!1;constructor(){let{enableHWA:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.constructor===Nt&&rt("Cannot initialize BaseCanvasFactory."),this.#i=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#i})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){rt("Abstract method `_createCanvas` called.")}}class zt{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===zt&&rt("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?Q.BINARY:Q.NONE;return this._fetchData(i,n).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}_fetchData(t,e){rt("Abstract method `_fetchData` called.")}}class Bt{constructor(t){let{baseUrl:e=null}=t;this.constructor===Bt&&rt("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetchData(i).catch((t=>{throw new Error(`Unable to load font data at: ${i}`)}))}_fetchData(t){rt("Abstract method `_fetchData` called.")}}class Ht{constructor(){this.constructor===Ht&&rt("Cannot initialize BaseSVGFactory.")}create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){rt("Abstract method `_createSVG` called.")}}const jt="http://www.w3.org/2000/svg";class Vt{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=(()=>this.CSS/this.PDF)()}async function $t(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(te(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise(((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE)if(200!==s.status&&0!==s.status)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)}))}class Ut extends zt{_fetchData(t,e){return $t(t,this.isCompressed?"arraybuffer":"text").then((t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):bt(t),compressionType:e})))}}class Wt extends Bt{_fetchData(t){return $t(t,"arraybuffer").then((t=>new Uint8Array(t)))}}class Gt extends Ht{_createSVG(t){return document.createElementNS(jt,t)}}class qt{constructor(t){let{viewBox:e,scale:i,rotation:n,offsetX:s=0,offsetY:r=0,dontFlip:a=!1}=t;this.viewBox=e,this.scale=i,this.rotation=n,this.offsetX=s,this.offsetY=r;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let h,c,d,u,p,g,f,m;switch(n%=360,n<0&&(n+=360),n){case 180:h=-1,c=0,d=0,u=1;break;case 90:h=0,c=1,d=1,u=0;break;case 270:h=0,c=-1,d=-1,u=0;break;case 0:h=1,c=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,u=-u),0===h?(p=Math.abs(l-e[1])*i+s,g=Math.abs(o-e[0])*i+r,f=(e[3]-e[1])*i,m=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,g=Math.abs(l-e[1])*i+r,f=(e[2]-e[0])*i,m=(e[3]-e[1])*i),this.transform=[h*i,c*i,d*i,u*i,p-h*i*o-d*i*l,g-c*i*o-u*i*l],this.width=f,this.height=m}get rawDims(){const{viewBox:t}=this;return lt(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new qt({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return xt.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=xt.applyTransform([t[0],t[1]],this.transform),i=xt.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return xt.applyInverseTransform([t,e],this.transform)}}class Xt extends ht{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function Kt(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function Yt(t){return"string"===typeof t&&/\.pdf$/i.test(t)}function Qt(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function Jt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(Kt(t))return st('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class Zt{started=(()=>Object.create(null))();times=[];time(t){t in this.started&&st(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||st(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push(`${i.padEnd(e)} ${s-n}ms\n`);return t.join("")}}function te(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function ee(t){t.preventDefault()}function ie(t){console.log("Deprecated API usage: "+t)}let ne;class se{static toDateObject(t){if(!t||"string"!==typeof t)return null;ne||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=ne.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===l?(r+=h,a+=c):"+"===l&&(r-=h,a-=c),new Date(Date.UTC(i,n,s,r,a,o))}}function re(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:r}=t.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new qt({viewBox:a,scale:i,rotation:n})}function ae(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):(st(`Not a valid color format: "${t}"`),[0,0,0])}function oe(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function le(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform().invertSelf();return[e,i,n,s,r,a]}function he(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof qt){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=wt.isCSSRoundSupported,o=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${s}px`,h=a?`round(${o}, 1px)`:`calc(${o})`,c=a?`round(${l}, 1px)`:`calc(${l})`;i&&e.rotation%180!==0?(r.width=c,r.height=h):(r.width=h,r.height=c)}n&&t.setAttribute("data-main-rotation",e.rotation)}class ce{#n=null;#s=null;#r;#a=null;constructor(t){this.#r=t}render(){const t=this.#n=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const e=this.#r._uiManager._signal;t.addEventListener("contextmenu",ee,{signal:e}),t.addEventListener("pointerdown",ce.#o,{signal:e});const i=this.#a=document.createElement("div");i.className="buttons",t.append(i);const n=this.#r.toolbarPosition;if(n){const{style:e}=t,i="ltr"===this.#r._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd=100*i+"%",e.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return this.#l(),t}static#o(t){t.stopPropagation()}#h(t){this.#r._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#c(t){this.#r._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#d(t){const e=this.#r._uiManager._signal;t.addEventListener("focusin",this.#h.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#c.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",ee,{signal:e})}hide(){this.#n.classList.add("hidden"),this.#s?.hideDropdown()}show(){this.#n.classList.remove("hidden")}#l(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#r.editorType}-button`),this.#d(t),t.addEventListener("click",(t=>{this.#r._uiManager.delete()}),{signal:this.#r._uiManager._signal}),this.#a.append(t)}get#u(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#d(t),this.#a.prepend(t,this.#u)}addColorPicker(t){this.#s=t;const e=t.renderButton();this.#d(e),this.#a.prepend(e,this.#u)}remove(){this.#n.remove(),this.#s?.destroy(),this.#s=null}}class de{#a=null;#n=null;#p;constructor(t){this.#p=t}#g(){const t=this.#n=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ee,{signal:this.#p._signal});const e=this.#a=document.createElement("div");return e.className="buttons",t.append(e),this.#f(),t}#m(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const r=s.x+(e?s.width:0);t>i?(n=r,i=t):e?r>n&&(n=r):r<n&&(n=r)}return[e?1-n:n,i]}show(t,e,i){const[n,s]=this.#m(e,i),{style:r}=this.#n||=this.#g();t.append(this.#n),r.insetInlineEnd=100*n+"%",r.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#n.remove()}#f(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#p._signal;t.addEventListener("contextmenu",ee,{signal:i}),t.addEventListener("click",(()=>{this.#p.highlightSelection("floating_button")}),{signal:i}),this.#a.append(t)}}function ue(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}class pe{#v=0;get id(){return"pdfjs_internal_editor_"+this.#v++}}class ge{#b=(()=>function(){if("undefined"!==typeof crypto&&"function"===typeof crypto?.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return vt(t)}())();#v=0;#y=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return lt(this,"_isSVGFittingCanvas",e.decode().then((()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]))))}async#w(t,e){this.#y||=new Map;let i=this.#y.get(t);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let t;if(i||={bitmap:null,id:`image_${this.#b}_${this.#v++}`,refCounter:0,isSvg:!1},"string"===typeof e?(i.url=e,t=await $t(e,"blob")):t=i.file=e,"image/svg+xml"===t.type){const e=ge._isSVGFittingCanvas,n=new FileReader,s=new Image,r=new Promise(((t,r)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,t()},n.onload=async()=>{const t=i.svgUrl=n.result;s.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},s.onerror=n.onerror=r}));n.readAsDataURL(t),await r}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(n){console.error(n),i=null}return this.#y.set(t,i),i&&this.#y.set(i.id,i),i}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return this.#w(`${e}_${i}_${n}_${s}`,t)}async getFromUrl(t){return this.#w(t,t)}async getFromId(t){this.#y||=new Map;const e=this.#y.get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=this.#y.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#y||=new Map;const e=this.#y.get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#b}_`)}}class fe{#A=[];#x=!1;#_;#E=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#_=t}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}=t;if(s&&e(),this.#x)return;const l={cmd:e,undo:i,post:n,type:r};if(-1===this.#E)return this.#A.length>0&&(this.#A.length=0),this.#E=0,void this.#A.push(l);if(a&&this.#A[this.#E].type===r)return o&&(l.undo=this.#A[this.#E].undo),void(this.#A[this.#E]=l);const h=this.#E+1;h===this.#_?this.#A.splice(0,1):(this.#E=h,h<this.#A.length&&this.#A.splice(h)),this.#A.push(l)}undo(){if(-1===this.#E)return;this.#x=!0;const{undo:t,post:e}=this.#A[this.#E];t(),e?.(),this.#x=!1,this.#E-=1}redo(){if(this.#E<this.#A.length-1){this.#E+=1,this.#x=!0;const{cmd:t,post:e}=this.#A[this.#E];t(),e?.(),this.#x=!1}}hasSomethingToUndo(){return-1!==this.#E}hasSomethingToRedo(){return this.#E<this.#A.length-1}destroy(){this.#A=null}}class me{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=wt.platform;for(const[i,n,s={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1)))}}#C(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(this.#C(e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:r=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...r,e)(),s||(e.stopPropagation(),e.preventDefault()))}}class ve{static _colorsMapping=(()=>new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]))();get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,ae(n))}e.remove()}(t),lt(this,"_colors",t)}convert(t){const e=ae(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every(((t,i)=>t===e[i])))return ve._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?xt.makeHexColor(...e):t}}class be{#S=(()=>new AbortController)();#M=null;#T=(()=>new Map)();#k=(()=>new Map)();#P=null;#R=null;#L=null;#I=(()=>new fe)();#F=0;#D=(()=>new Set)();#O=null;#N=null;#z=(()=>new Set)();#B=!1;#H=null;#j=null;#V=null;#$=!1;#U=null;#W=(()=>new pe)();#G=!1;#q=!1;#X=null;#K=null;#Y=null;#Q=(()=>v.NONE)();#J=(()=>new Set)();#Z=null;#tt=null;#et=null;#it=this.blur.bind(this);#nt=this.focus.bind(this);#st=this.copy.bind(this);#rt=this.cut.bind(this);#at=this.paste.bind(this);#ot=this.keydown.bind(this);#lt=this.keyup.bind(this);#ht=this.onEditingAction.bind(this);#ct=this.onPageChanging.bind(this);#dt=this.onScaleChanging.bind(this);#ut=this.onRotationChanging.bind(this);#pt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#gt=[0,0];#ft=null;#mt=null;#vt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=be.prototype,e=t=>t.#mt.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,e)=>{let{target:i}=e;if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return lt(this,"_keyboardManager",new me([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&t.#mt.contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&t.#mt.contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,r,a,o,l){this._signal=this.#S.signal,this.#mt=t,this.#vt=e,this.#P=i,this._eventBus=n,this._eventBus._on("editingaction",this.#ht),this._eventBus._on("pagechanging",this.#ct),this._eventBus._on("scalechanging",this.#dt),this._eventBus._on("rotationchanging",this.#ut),this.#bt(),this.#yt(),this.#wt(),this.#R=s.annotationStorage,this.#H=s.filterFactory,this.#tt=r,this.#V=a||null,this.#B=o,this.#Y=l||null,this.viewParameters={realScale:Vt.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#S?.abort(),this.#S=null,this._signal=null,this._eventBus._off("editingaction",this.#ht),this._eventBus._off("pagechanging",this.#ct),this._eventBus._off("scalechanging",this.#dt),this._eventBus._off("rotationchanging",this.#ut);for(const t of this.#k.values())t.destroy();this.#k.clear(),this.#T.clear(),this.#z.clear(),this.#M=null,this.#J.clear(),this.#I.destroy(),this.#P?.destroy(),this.#U?.hide(),this.#U=null,this.#j&&(clearTimeout(this.#j),this.#j=null),this.#ft&&(clearTimeout(this.#ft),this.#ft=null)}async mlGuess(t){return this.#Y?.guess(t)||null}get hasMLManager(){return!!this.#Y}get hcmFilter(){return lt(this,"hcmFilter",this.#tt?this.#H.addHCMFilter(this.#tt.foreground,this.#tt.background):"none")}get direction(){return lt(this,"direction",getComputedStyle(this.#mt).direction)}get highlightColors(){return lt(this,"highlightColors",this.#V?new Map(this.#V.split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return lt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setMainHighlightColorPicker(t){this.#K=t}editAltText(t){this.#P?.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;this.#F=e-1}focusMainContainer(){this.#mt.focus()}findParent(t,e){for(const i of this.#k.values()){const{x:n,y:s,width:r,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+r&&e>=s&&e<=s+a)return i}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#vt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#z.add(t)}removeShouldRescale(t){this.#z.delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*Vt.PDF_TO_CSS_UNITS;for(const i of this.#z)i.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}#At(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=e,a=e.toString(),o=this.#At(e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(l){e.empty(),this.#Q===v.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:v.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of this.#k.values())if(e.hasTextLayer(o)){e.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r,text:a});break}}}#xt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#At(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#U||=new de(this),this.#U.show(e,i,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#R||this.#R.has(t.id)||this.#R.setValue(t.id,t)}#_t(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#Z&&(this.#U?.hide(),this.#Z=null,this.#Et({hasSelectedText:!1})));const{anchorNode:e}=t;if(e===this.#Z)return;if(this.#At(t).closest(".textLayer")){if(this.#U?.hide(),this.#Z=e,this.#Et({hasSelectedText:!0}),(this.#Q===v.HIGHLIGHT||this.#Q===v.NONE)&&(this.#Q===v.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#$=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this._signal,e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&this.#Ct("main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else this.#Z&&(this.#U?.hide(),this.#Z=null,this.#Et({hasSelectedText:!1}))}#Ct(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.#Q===v.HIGHLIGHT?this.highlightSelection(t):this.#B&&this.#xt()}#bt(){document.addEventListener("selectionchange",this.#_t.bind(this),{signal:this._signal})}#St(){const t=this._signal;window.addEventListener("focus",this.#nt,{signal:t}),window.addEventListener("blur",this.#it,{signal:t})}#Mt(){window.removeEventListener("focus",this.#nt),window.removeEventListener("blur",this.#it)}blur(){if(this.isShiftKeyDown=!1,this.#$&&(this.#$=!1,this.#Ct("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#J)if(e.div.contains(t)){this.#X=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#X)return;const[t,e]=this.#X;this.#X=null,e.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),e.focus()}#wt(){const t=this._signal;window.addEventListener("keydown",this.#ot,{signal:t}),window.addEventListener("keyup",this.#lt,{signal:t})}#Tt(){window.removeEventListener("keydown",this.#ot),window.removeEventListener("keyup",this.#lt)}#kt(){const t=this._signal;document.addEventListener("copy",this.#st,{signal:t}),document.addEventListener("cut",this.#rt,{signal:t}),document.addEventListener("paste",this.#at,{signal:t})}#Pt(){document.removeEventListener("copy",this.#st),document.removeEventListener("cut",this.#rt),document.removeEventListener("paste",this.#at)}#yt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#wt(),this.#kt()}removeEditListeners(){this.#Tt(),this.#Pt()}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of this.#N)if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of this.#N)if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#M?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const i of this.#J){const t=i.serialize(!0);t&&e.push(t)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const t of this.#N)if(t.isHandlingMimeForPasting(r.type))return void t.paste(r,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void st(`paste: "${s.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const r of i){const e=n.deserialize(r);if(!e)return;t.push(e)}const e=()=>{for(const e of t)this.#Rt(e);this.#Lt(t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){st(`paste: "${s.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#Q===v.NONE||this.isEditorHandlingKeyboard||be._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#$&&(this.#$=!1,this.#Ct("main_toolbar")))}onEditingAction(t){let{name:e}=t;switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#Et(t){Object.entries(t).some((t=>{let[e,i]=t;return this.#pt[e]!==i}))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#pt,t)}),this.#Q===v.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#It([[b.HIGHLIGHT_FREE,!0]]))}#It(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#St(),this.#kt(),this.#Et({isEditing:this.#Q!==v.NONE,isEmpty:this.#Ft(),hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:this.#I.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Mt(),this.#Pt(),this.#Et({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#N){this.#N=t;for(const t of this.#N)this.#It(t.defaultPropertiesToUpdate)}}getId(){return this.#W.id}get currentLayer(){return this.#k.get(this.#F)}getLayer(t){return this.#k.get(t)}get currentPageIndex(){return this.#F}addLayer(t){this.#k.set(t.pageIndex,t),this.#G?t.enable():t.disable()}removeLayer(t){this.#k.delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.#Q!==t){if(this.#Q=t,t===v.NONE)return this.setEditingState(!1),void this.#Dt();this.setEditingState(!0),this.#Ot(),this.unselectAll();for(const e of this.#k.values())e.updateMode(t);if(e||!i){if(e)for(const t of this.#T.values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#Q&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#N){switch(t){case b.CREATE:return void this.currentLayer.addNewEditor();case b.HIGHLIGHT_DEFAULT_COLOR:this.#K?.updateColor(e);break;case b.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#et||=new Map).set(t,e),this.showAllEditors("highlight",e)}for(const i of this.#J)i.updateParams(t,e);for(const i of this.#N)i.updateDefaultParams(t,e)}}showAllEditors(t,e){for(const i of this.#T.values())i.editorType===t&&i.show(e);(this.#et?.get(b.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#It([[b.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#q!==t){this.#q=t;for(const e of this.#k.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}#Ot(){if(!this.#G){this.#G=!0;for(const t of this.#k.values())t.enable();for(const t of this.#T.values())t.enable()}}#Dt(){if(this.unselectAll(),this.#G){this.#G=!1;for(const t of this.#k.values())t.disable();for(const t of this.#T.values())t.disable()}}getEditors(t){const e=[];for(const i of this.#T.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#T.get(t)}addEditor(t){this.#T.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#j&&clearTimeout(this.#j),this.#j=setTimeout((()=>{this.focusMainContainer(),this.#j=null}),0)),this.#T.delete(t.id),this.unselect(t),t.annotationElementId&&this.#D.has(t.annotationElementId)||this.#R?.remove(t.id)}addDeletedAnnotationElement(t){this.#D.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#D.has(t)}removeDeletedAnnotationElement(t){this.#D.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Rt(t){const e=this.#k.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#M!==t&&(this.#M=t,t&&this.#It(t.propertiesToUpdate))}get#Nt(){let t=null;for(t of this.#J);return t}updateUI(t){this.#Nt===t&&this.#It(t.propertiesToUpdate)}toggleSelected(t){if(this.#J.has(t))return this.#J.delete(t),t.unselect(),void this.#Et({hasSelectedEditor:this.hasSelection});this.#J.add(t),t.select(),this.#It(t.propertiesToUpdate),this.#Et({hasSelectedEditor:!0})}setSelected(t){for(const e of this.#J)e!==t&&e.unselect();this.#J.clear(),this.#J.add(t),t.select(),this.#It(t.propertiesToUpdate),this.#Et({hasSelectedEditor:!0})}isSelected(t){return this.#J.has(t)}get firstSelectedEditor(){return this.#J.values().next().value}unselect(t){t.unselect(),this.#J.delete(t),this.#Et({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#J.size}get isEnterHandled(){return 1===this.#J.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#I.undo(),this.#Et({hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Ft()})}redo(){this.#I.redo(),this.#Et({hasSomethingToUndo:!0,hasSomethingToRedo:this.#I.hasSomethingToRedo(),isEmpty:this.#Ft()})}addCommands(t){this.#I.add(t),this.#Et({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Ft()})}#Ft(){if(0===this.#T.size)return!0;if(1===this.#T.size)for(const t of this.#T.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#J];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#Rt(e)},mustExec:!0})}commitOrRemove(){this.#M?.commitOrRemove()}hasSomethingToControl(){return this.#M||this.hasSelection}#Lt(t){for(const e of this.#J)e.unselect();this.#J.clear();for(const e of t)e.isEmpty()||(this.#J.add(e),e.select());this.#Et({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#J)t.commit();this.#Lt(this.#T.values())}unselectAll(){if((!this.#M||(this.#M.commitOrRemove(),this.#Q===v.NONE))&&this.hasSelection){for(const t of this.#J)t.unselect();this.#J.clear(),this.#Et({hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;this.#gt[0]+=t,this.#gt[1]+=e;const[i,n]=this.#gt,s=[...this.#J];this.#ft&&clearTimeout(this.#ft),this.#ft=setTimeout((()=>{this.#ft=null,this.#gt[0]=this.#gt[1]=0,this.addCommands({cmd:()=>{for(const t of s)this.#T.has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)this.#T.has(t.id)&&t.translateInPage(-i,-n)},mustExec:!1})}),1e3);for(const r of s)r.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#O=new Map;for(const t of this.#J)this.#O.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#O)return!1;this.disableUserSelect(!1);const t=this.#O;this.#O=null;let e=!1;for(const[{x:n,y:s,pageIndex:r},a]of t)a.newX=n,a.newY=s,a.newPageIndex=r,e||=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex;if(!e)return!1;const i=(t,e,i,n)=>{if(this.#T.has(t.id)){const s=this.#k.get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:r}]of t)i(e,n,s,r)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:r}]of t)i(e,n,s,r)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#O)for(const i of this.#O.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#J.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#M===t}getActive(){return this.#M}getMode(){return this.#Q}get imageManager(){return lt(this,"imageManager",new ge)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,h=e.rangeCount;l<h;l++)if(!t.contains(e.getRangeAt(l).commonAncestorContainer))return null;const{x:i,y:n,width:s,height:r}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(t,e,a,o)=>({x:(e-n)/r,y:1-(t+a-i)/s,width:o/r,height:a/s});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/s,y:1-(e+o-n)/r,width:a/s,height:o/r});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/r,y:(t-i)/s,width:o/r,height:a/s});break;default:a=(t,e,a,o)=>({x:(t-i)/s,y:(e-n)/r,width:a/s,height:o/r})}const o=[];for(let l=0,h=e.rangeCount;l<h;l++){const t=e.getRangeAt(l);if(!t.collapsed)for(const{x:e,y:i,width:n,height:s}of t.getClientRects())0!==n&&0!==s&&o.push(a(e,i,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation(t){let{annotationElementId:e,id:i}=t;(this.#L||=new Map).set(e,i)}removeChangedExistingAnnotation(t){let{annotationElementId:e}=t;this.#L?.delete(e)}renderAnnotationElement(t){const e=this.#L?.get(t.data.id);if(!e)return;const i=this.#R.getRawValue(e);i&&(this.#Q!==v.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}}class ye{#zt="";#Bt=!1;#Ht=null;#jt=null;#Vt=null;#$t=!1;#r=null;static _l10nPromise=null;constructor(t){this.#r=t}static initialize(t){ye._l10nPromise||=t}async render(){const t=this.#Ht=document.createElement("button");t.className="altText";const e=await ye._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=this.#r._uiManager._signal;t.addEventListener("contextmenu",ee,{signal:i}),t.addEventListener("pointerdown",(t=>t.stopPropagation()),{signal:i});const n=t=>{t.preventDefault(),this.#r._uiManager.editAltText(this.#r)};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",(e=>{e.target===t&&"Enter"===e.key&&(this.#$t=!0,n(e))}),{signal:i}),await this.#Ut(),t}finish(){this.#Ht&&(this.#Ht.focus({focusVisible:this.#$t}),this.#$t=!1)}isEmpty(){return!this.#zt&&!this.#Bt}get data(){return{altText:this.#zt,decorative:this.#Bt}}set data(t){let{altText:e,decorative:i}=t;this.#zt===e&&this.#Bt===i||(this.#zt=e,this.#Bt=i,this.#Ut())}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#Ht&&(!t&&this.#Vt&&(clearTimeout(this.#Vt),this.#Vt=null),this.#Ht.disabled=!t)}destroy(){this.#Ht?.remove(),this.#Ht=null,this.#jt=null}async#Ut(){const t=this.#Ht;if(!t)return;if(!this.#zt&&!this.#Bt)return t.classList.remove("done"),void this.#jt?.remove();t.classList.add("done"),ye._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((e=>{t.setAttribute("aria-label",e)}));let e=this.#jt;if(!e){this.#jt=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip");const i=e.id=`alt-text-tooltip-${this.#r.id}`;t.setAttribute("aria-describedby",i);const n=100,s=this.#r._uiManager._signal;s.addEventListener("abort",(()=>{clearTimeout(this.#Vt),this.#Vt=null}),{once:!0}),t.addEventListener("mouseenter",(()=>{this.#Vt=setTimeout((()=>{this.#Vt=null,this.#jt.classList.add("show"),this.#r._reportTelemetry({action:"alt_text_tooltip"})}),n)}),{signal:s}),t.addEventListener("mouseleave",(()=>{this.#Vt&&(clearTimeout(this.#Vt),this.#Vt=null),this.#jt?.classList.remove("show")}),{signal:s})}e.innerText=this.#Bt?await ye._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#zt,e.parentNode||t.append(e);const i=this.#r.getImageForAltText();i?.setAttribute("aria-describedby",e.id)}}class we{#Wt=null;#Gt=null;#zt=null;#qt=!1;#Xt=!1;#Kt=null;#Yt=null;#Qt=this.focusin.bind(this);#Jt=this.focusout.bind(this);#Zt=null;#te="";#ee=!1;#ie=null;#ne=!1;#se=!1;#re=!1;#ae=null;#oe=0;#le=0;#he=null;_initialOptions=(()=>Object.create(null))();_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#ce=!1;#de=(()=>we._zIndex++)();static _borderLineWidth=-1;static _colorManager=(()=>new ve)();static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=we.prototype._resizeWithKeyboard,e=be.TRANSLATE_SMALL,i=be.TRANSLATE_BIG;return lt(this,"_resizerKeyboardManager",new me([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],we.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===we&&rt("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,r];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return lt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new Ae({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e,i){if(we._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map((e=>[e,t.get(e.replaceAll(/([A-Z])/g,(t=>`-${t.toLowerCase()}`)))]))),i?.strings)for(const s of i.strings)we._l10nPromise.set(s,t.get(s));if(-1!==we._borderLineWidth)return;const n=getComputedStyle(document.documentElement);we._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){rt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ce}set _isDraggable(t){this.#ce=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#de}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#ue(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ee?this.#ee=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;e?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/r,this.fixAndSetPosition()}#pe(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}translate(t,e){this.#pe(this.parentDimensions,t,e)}translateInPage(t,e){this.#ie||=[this.x,this.y],this.#pe(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){this.#ie||=[this.x,this.y];const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:r}=this;const[a,o]=this.getBaseTranslation();s+=a,r+=o,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*r).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#ie&&(this.#ie[0]!==this.x||this.#ie[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=we,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const[e,i]=this.pageDimensions;let{x:n,y:s,width:r,height:a}=this;if(r*=e,a*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-r,n)),s=Math.max(0,Math.min(i-a,s));break;case 90:n=Math.max(0,Math.min(e-a,n)),s=Math.min(i,Math.max(r,s));break;case 180:n=Math.min(e,Math.max(r,n)),s=Math.min(i,Math.max(a,s));break;case 270:n=Math.min(e,Math.max(a,n)),s=Math.max(0,Math.min(i-r,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:h}=this.div;h.left=`${(100*n).toFixed(2)}%`,h.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#ge(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return we.#ge(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return we.#ge(t,e,360-this.parentRotation)}#fe(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this,n=e*t,s=i*t;return wt.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#Xt||(this.div.style.height=`${(100*e/n).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!this.#Xt&&e.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(t.width=`${(100*parseFloat(i)/r).toFixed(2)}%`),this.#Xt||s||(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#me(){if(this.#Kt)return;this.#Kt=document.createElement("div"),this.#Kt.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");this.#Kt.append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",this.#ve.bind(this,i),{signal:e}),t.addEventListener("contextmenu",ee,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#Kt)}#ve(t,e){e.preventDefault();const{isMac:i}=wt.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#zt?.toggle(!1);const n=this.#be.bind(this,t),s=this._isDraggable;this._isDraggable=!1;const r=this._uiManager._signal,a={passive:!0,capture:!0,signal:r};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",n,a),window.addEventListener("contextmenu",ee,{signal:r});const o=this.x,l=this.y,h=this.width,c=this.height,d=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const p=()=>{this.parent.togglePointerEvents(!0),this.#zt?.toggle(!0),this._isDraggable=s,window.removeEventListener("pointerup",p),window.removeEventListener("blur",p),window.removeEventListener("pointermove",n,a),window.removeEventListener("contextmenu",ee),this.parent.div.style.cursor=d,this.div.style.cursor=u,this.#ye(o,l,h,c)};window.addEventListener("pointerup",p,{signal:r}),window.addEventListener("blur",p,{signal:r})}#ye(t,e,i,n){const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:()=>{this.width=a,this.height=o,this.x=s,this.y=r;const[t,e]=this.parentDimensions;this.setDims(t*a,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,r]=this.parentDimensions;this.setDims(s*i,r*n),this.fixAndSetPosition()},mustExec:!0})}#be(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=we.MIN_SIZE/i,h=we.MIN_SIZE/n,c=t=>Math.round(1e4*t)/1e4,d=this.#fe(this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=this.#fe(360-this.rotation);let g,f,m=!1,v=!1;switch(t){case"topLeft":m=!0,g=(t,e)=>[0,0],f=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],f=(t,e)=>[t/2,e];break;case"topRight":m=!0,g=(t,e)=>[t,0],f=(t,e)=>[0,e];break;case"middleRight":v=!0,g=(t,e)=>[t,e/2],f=(t,e)=>[0,e/2];break;case"bottomRight":m=!0,g=(t,e)=>[t,e],f=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],f=(t,e)=>[t/2,0];break;case"bottomLeft":m=!0,g=(t,e)=>[0,e],f=(t,e)=>[t,0];break;case"middleLeft":v=!0,g=(t,e)=>[0,e/2],f=(t,e)=>[t,e/2]}const b=g(a,o),y=f(a,o);let w=u(...y);const A=c(s+w[0]),x=c(r+w[1]);let _=1,E=1,[C,S]=this.screenToPageTranslation(e.movementX,e.movementY);var M,T;if([C,S]=(M=C/i,T=S/n,[p[0]*M+p[2]*T,p[1]*M+p[3]*T]),m){const t=Math.hypot(a,o);_=E=Math.max(Math.min(Math.hypot(y[0]-b[0]-C,y[1]-b[1]-S)/t,1/a,1/o),l/a,h/o)}else v?_=Math.max(l,Math.min(1,Math.abs(y[0]-b[0]-C)))/a:E=Math.max(h,Math.min(1,Math.abs(y[1]-b[1]-S)))/o;const k=c(a*_),P=c(o*E);w=u(...f(k,P));const R=A-w[0],L=x-w[1];this.width=k,this.height=P,this.x=R,this.y=L,this.setDims(i*k,n*P),this.fixAndSetPosition()}altTextFinish(){this.#zt?.finish()}async addEditToolbar(){return this.#Zt||this.#se||(this.#Zt=new ce(this),this.div.append(this.#Zt.render()),this.#zt&&this.#Zt.addAltTextButton(await this.#zt.render())),this.#Zt}removeEditToolbar(){this.#Zt&&(this.#Zt.remove(),this.#Zt=null,this.#zt?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#zt||(ye.initialize(we._l10nPromise),this.#zt=new ye(this),this.#Wt&&(this.#zt.data=this.#Wt,this.#Wt=null),await this.addEditToolbar())}get altTextData(){return this.#zt?.data}set altTextData(t){this.#zt&&(this.#zt.data=t)}hasAltText(){return!this.#zt?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#qt?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#Qt,{signal:t}),this.div.addEventListener("focusout",this.#Jt,{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[n,s]=this.getInitialTranslation();return this.translate(n,s),ue(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=wt.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#ee=!0,this._isDraggable?this.#we(t):this.#Ae(t))}#Ae(t){const{isMac:e}=wt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#we(t){const e=this._uiManager.isSelected(this);let i,n;this._uiManager.setUpDragSession();const s=this._uiManager._signal;e&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:s},this.#oe=t.clientX,this.#le=t.clientY,n=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-this.#oe,i-this.#le);this.#oe=e,this.#le=i,this._uiManager.dragSelectedEditors(n,s)},window.addEventListener("pointermove",n,i));const r=()=>{window.removeEventListener("pointerup",r),window.removeEventListener("blur",r),e&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",n,i)),this.#ee=!1,this._uiManager.endDragSession()||this.#Ae(t)};window.addEventListener("pointerup",r,{signal:s}),window.addEventListener("blur",r,{signal:s})}moveInDOM(){this.#ae&&clearTimeout(this.#ae),this.#ae=setTimeout((()=>{this.#ae=null,this.parent?.moveEditorInDOM(this)}),0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,h=e/n,c=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[c+l+a,r-d-h-p+o,c+l+u+a,r-d-h+o];case 90:return[c+h+a,r-d+l+o,c+h+p+a,r-d+l+u+o];case 180:return[c-l-u+a,r-d+h+o,c-l+a,r-d+h+p+o];case 270:return[c-h-p+a,r-d-l-u+o,c-h+a,r-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,r]=t,a=s-i,o=r-n;switch(this.rotation){case 0:return[i,e-r,a,o];case 90:return[i,e-n,o,a];case 180:return[s,e-n,a,o];case 270:return[s,e-r,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#se=!0}disableEditMode(){this.#se=!1}isInEditMode(){return this.#se}shouldGetKeyboardEvents(){return this.#re}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#Qt,{signal:t}),this.div?.addEventListener("focusout",this.#Jt,{signal:t})}rotate(t){}serialize(){rt("An editor must be serializable")}static deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,n.#Wt=t.accessibilityData;const[s,r]=n.pageDimensions,[a,o,l,h]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=h/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",this.#Qt),this.div.removeEventListener("focusout",this.#Jt),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#ae&&(clearTimeout(this.#ae),this.#ae=null),this.#ue(),this.removeEditToolbar(),this.#he){for(const t of this.#he.values())clearTimeout(t);this.#he=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#me(),this.#Kt.classList.remove("hidden"),ue(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#Yt={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#Kt.children;if(!this.#Gt){this.#Gt=Array.from(e);const t=this.#xe.bind(this),i=this.#_e.bind(this),n=this._uiManager._signal;for(const e of this.#Gt){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",this.#Ee.bind(this,s),{signal:n}),we._l10nPromise.get(`pdfjs-editor-resizer-label-${s}`).then((t=>e.setAttribute("aria-label",t)))}}const i=this.#Gt[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(this.#Gt.length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)this.#Kt.append(this.#Kt.firstChild);else if(s>n)for(let e=0;e<s-n;e++)this.#Kt.firstChild.before(this.#Kt.lastChild);let t=0;for(const i of e){const e=this.#Gt[t++].getAttribute("data-resizer-name");we._l10nPromise.get(`pdfjs-editor-resizer-label-${e}`).then((t=>i.setAttribute("aria-label",t)))}}this.#Ce(0),this.#re=!0,this.#Kt.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#xe(t){we._resizerKeyboardManager.exec(this,t)}#_e(t){this.#re&&t.relatedTarget?.parentNode!==this.#Kt&&this.#ue()}#Ee(t){this.#te=this.#re?t:""}#Ce(t){if(this.#Gt)for(const e of this.#Gt)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#re&&this.#be(this.#te,{movementX:t,movementY:e})}#ue(){if(this.#re=!1,this.#Ce(-1),this.#Yt){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=this.#Yt;this.#ye(t,e,i,n),this.#Yt=null}}_stopResizingWithKeyboard(){this.#ue(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add("selectedEditor"),this.#Zt?this.#Zt?.show():this.addEditToolbar().then((()=>{this.div?.classList.contains("selectedEditor")&&this.#Zt?.show()}))}unselect(){this.#Kt?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#Zt?.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#ne}set isEditing(t){this.#ne=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#Xt=!0;const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){this.#he||=new Map;const{action:e}=t;let i=this.#he.get(e);return i&&clearTimeout(i),i=setTimeout((()=>{this._reportTelemetry(t),this.#he.delete(e),0===this.#he.size&&(this.#he=null)}),we._telemetryTimeout),void this.#he.set(e,i)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#qt=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#qt=!0}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class Ae extends we{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const xe=3285377520,_e=4294901760,Ee=65535;class Ce{constructor(t){this.h1=t?4294967295&t:xe,this.h2=t?4294967295&t:xe}update(t){let e,i;if("string"===typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n<s;n++){const s=t.charCodeAt(n);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,r=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,h=this.h2;const c=3432918353,d=461845907,u=11601,p=13715;for(let g=0;g<n;g++)1&g?(a=r[g],a=a*c&_e|a*u&Ee,a=a<<15|a>>>17,a=a*d&_e|a*p&Ee,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[g],o=o*c&_e|o*u&Ee,o=o<<15|o>>>17,o=o*d&_e|o*p&Ee,h^=o,h=h<<13|h>>>19,h=5*h+3864292196);switch(a=0,s){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*c&_e|a*u&Ee,a=a<<15|a>>>17,a=a*d&_e|a*p&Ee,1&n?l^=a:h^=a}this.h1=l,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&_e|36045*t&Ee,e=4283543511*e&_e|(2950163797*(e<<16|t>>>16)&_e)>>>16,t^=e>>>1,t=444984403*t&_e|60499*t&Ee,e=3301882366*e&_e|(3120437893*(e<<16|t>>>16)&_e)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Se=Object.freeze({map:null,hash:"",transfer:void 0});class Me{#Se=!1;#Me=(()=>new Map)();constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=this.#Me.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#Me.get(t)}remove(t){if(this.#Me.delete(t),0===this.#Me.size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of this.#Me.values())if(t instanceof we)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=this.#Me.get(t);let n=!1;if(void 0!==i)for(const[s,r]of Object.entries(e))i[s]!==r&&(n=!0,i[s]=r);else n=!0,this.#Me.set(t,e);n&&this.#Te(),e instanceof we&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#Me.has(t)}getAll(){return this.#Me.size>0?yt(this.#Me):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return this.#Me.size}#Te(){this.#Se||(this.#Se=!0,"function"===typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Se&&(this.#Se=!1,"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new Te(this)}get serializable(){if(0===this.#Me.size)return Se;const t=new Map,e=new Ce,i=[],n=Object.create(null);let s=!1;for(const[r,a]of this.#Me){const i=a instanceof we?a.serialize(!1,n):a;i&&(t.set(r,i),e.update(`${r}:${JSON.stringify(i)}`),s||=!!i.bitmap)}if(s)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:Se}get editorStats(){let t=null;const e=new Map;for(const i of this.#Me.values()){if(!(i instanceof we))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:s}=n;e.has(s)||e.set(s,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const r=t[s]||=new Map;for(const[t,e]of Object.entries(n)){if("type"===t)continue;let i=r.get(t);i||(i=new Map,r.set(t,i));const n=i.get(e)??0;i.set(e,n+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}}class Te extends Me{#ke;constructor(t){super();const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);this.#ke={map:s,hash:i,transfer:n}}get print(){rt("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#ke}}class ke{#Pe=(()=>new Set)();constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#Pe.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!this.#Pe.has(e.loadedName))if(at(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:n,style:s}=e,r=new FontFace(t,n,s);this.addNativeFontFace(r);try{await r.load(),this.#Pe.add(t),i?.(e)}catch{st(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else rt("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw st(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)}))}}get isFontLoadingAPISupported(){return lt(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let t=!1;return(r||"undefined"!==typeof navigator&&"string"===typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),lt(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(at(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return lt(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=n(c,976,h.length,h);const d=1482184792;let u=i(c,16);for(s=0,r=h.length-3;s<r;s+=4)u=u-d+i(h,s)|0;var p;s<h.length&&(u=u-d+i(h+"XXX",s)|0),c=n(c,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const g=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(g);const f=this._document.createElement("div");f.style.visibility="hidden",f.style.width=f.style.height="10px",f.style.position="absolute",f.style.top=f.style.left="0px";for(const m of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=m,f.append(t)}this._document.body.append(f),function t(e,i){if(++l>30)return st("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(h,(()=>{f.remove(),e.complete()}))}}class Pe{constructor(t,e){let{disableFontFace:i=!1,inspectFont:n=null}=e;this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this.disableFontFace=!0===i,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=vt(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(s){st(`getPathGenerator - ignoring character: "${s}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let r=0,a=i.length;r<a;)switch(i[r++]){case Mt:{const[t,e,s,a,o,l]=i.slice(r,r+6);n.push((i=>i.bezierCurveTo(t,e,s,a,o,l))),r+=6}break;case Tt:{const[t,e]=i.slice(r,r+2);n.push((i=>i.moveTo(t,e))),r+=2}break;case kt:{const[t,e]=i.slice(r,r+2);n.push((i=>i.lineTo(t,e))),r+=2}break;case Pt:{const[t,e,s,a]=i.slice(r,r+4);n.push((i=>i.quadraticCurveTo(t,e,s,a))),r+=4}break;case Rt:n.push((t=>t.restore()));break;case Lt:n.push((t=>t.save()));break;case It:at(2===n.length,"Scale command is only valid at the third position.");break;case Ft:{const[t,e,s,a,o,l]=i.slice(r,r+6);n.push((i=>i.transform(t,e,s,a,o,l))),r+=6}break;case Dt:{const[t,e]=i.slice(r,r+2);n.push((i=>i.translate(t,e))),r+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let i=2,s=n.length;i<s;i++)n[i](t)}}}if(r){var Re=Promise.withResolvers(),Le=null;(async()=>{const t=await i.e(673).then(i.t.bind(i,21673,19)),e=await i.e(688).then(i.t.bind(i,42688,19)),n=await i.e(123).then(i.t.bind(i,40504,19)),s=await i.e(395).then(i.t.bind(i,79395,19));return new Map(Object.entries({fs:t,http:e,https:n,url:s,canvas:undefined,path2d:undefined}))})().then((t=>{Le=t,Re.resolve()}),(t=>{st(`loadPackages: ${t}`),Le=new Map,Re.resolve()}))}class Ie{static get promise(){return Re.promise}static get(t){return Le?.get(t)}}const Fe=function(t){return Ie.get("fs").promises.readFile(t).then((t=>new Uint8Array(t)))};const De="Fill",Oe="Stroke",Ne="Shading";function ze(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class Be{constructor(){this.constructor===Be&&rt("Cannot initialize BaseShadingPattern.")}getPattern(){rt("Abstract method `getPattern` called.")}}class He extends Be{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if(n===Oe||n===De){const r=e.current.getClippedPathBoundingBox(n,oe(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,l=e.cachedCanvases.getCanvas("pattern",a,o,!0),h=l.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-r[0],-r[1]),i=xt.transform(i,[1,0,0,1,r[0],r[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),ze(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=t.createPattern(l.canvas,"no-repeat");const c=new DOMMatrix(i);s.setTransform(c)}else ze(t,this._bbox),s=this._createGradient(t);return s}}function je(t,e,i,n,s,r,a,o){const l=e.coords,h=e.colors,c=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=a,a=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u);const p=(l[i]+e.offsetX)*e.scaleX,g=(l[i+1]+e.offsetY)*e.scaleY,f=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,b=(l[s+1]+e.offsetY)*e.scaleY;if(g>=b)return;const y=h[r],w=h[r+1],A=h[r+2],x=h[a],_=h[a+1],E=h[a+2],C=h[o],S=h[o+1],M=h[o+2],T=Math.round(g),k=Math.round(b);let P,R,L,I,F,D,O,N;for(let z=T;z<=k;z++){if(z<m){const t=z<g?0:(g-z)/(g-m);P=p-(p-f)*t,R=y-(y-x)*t,L=w-(w-_)*t,I=A-(A-E)*t}else{let t;t=z>b?1:m===b?0:(m-z)/(m-b),P=f-(f-v)*t,R=x-(x-C)*t,L=_-(_-S)*t,I=E-(E-M)*t}let t;t=z<g?0:z>b?1:(g-z)/(g-b),F=p-(p-v)*t,D=y-(y-C)*t,O=w-(w-S)*t,N=A-(A-M)*t;const e=Math.round(Math.min(P,F)),i=Math.round(Math.max(P,F));let n=d*z+4*e;for(let s=e;s<=i;s++)t=(P-s)/(P-F),t<0?t=0:t>1&&(t=1),c[n++]=R-(R-D)*t|0,c[n++]=L-(L-O)*t|0,c[n++]=I-(I-N)*t|0,c[n++]=255}}function Ve(t,e,i){const n=e.coords,s=e.colors;let r,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,h=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<h;r++,e++)je(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),je(t,i,n[e+o+1],n[e+1],n[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(r=0,a=n.length;r<a;r+=3)je(t,i,n[r],n[r+1],n[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class $e extends Be{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),h=r/o,c=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/h,scaleY:1/c},u=o+4,p=l+4,g=i.getCanvas("mesh",u,p,!1),f=g.context,m=f.createImageData(o,l);if(e){const t=m.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const v of this._figures)Ve(m,v,d);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*h,offsetY:s-2*c,scaleX:h,scaleY:c}}getPattern(t,e,i,n){let s;if(ze(t,this._bbox),n===Ne)s=xt.singularValueDecompose2dScale(oe(t));else if(s=xt.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=xt.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Ne?null:this._background,e.cachedCanvases);return n!==Ne&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Ue extends Be{getPattern(){return"hotpink"}}const We=1,Ge=2;class qe{static MAX_PATTERN_SIZE=3e3;constructor(t,e,i,n,s){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,s=this.ystep,r=this.paintType,a=this.tilingType,o=this.color,l=this.canvasGraphicsFactory;nt("TilingType: "+a);const h=i[0],c=i[1],d=i[2],u=i[3],p=xt.singularValueDecompose2dScale(this.matrix),g=xt.singularValueDecompose2dScale(this.baseTransform),f=[p[0]*g[0],p[1]*g[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,f[0]),v=this.getSizeAndScale(s,this.ctx.canvas.height,f[1]),b=t.cachedCanvases.getCanvas("pattern",m.size,v.size,!0),y=b.context,w=l.createCanvasGraphics(y);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,r,o);let A=h,x=c,_=d,E=u;return h<0&&(A=0,_+=Math.abs(h)),c<0&&(x=0,E+=Math.abs(c)),y.translate(-m.scale*A,-v.scale*x),w.transform(m.scale,0,0,v.scale,0,0),y.save(),this.clipBbox(w,A,x,_,E),w.baseTransform=oe(w.ctx),w.executeOperatorList(e),w.endDrawing(),{canvas:b.canvas,scaleX:m.scale,scaleY:v.scale,offsetX:A,offsetY:x}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(qe.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const r=n-e,a=s-i;t.ctx.rect(e,i,r,a),t.current.updateRectMinMax(oe(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case We:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case Ge:const r=xt.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new ft(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,n){let s=i;n!==Ne&&(s=xt.transform(s,e.baseTransform),this.matrix&&(s=xt.transform(s,this.matrix)));const r=this.createPatternCanvas(e);let a=new DOMMatrix(s);a=a.translate(r.offsetX,r.offsetY),a=a.scale(1/r.scaleX,1/r.scaleY);const o=t.createPattern(r.canvas,"repeat");return o.setTransform(a),o}}function Xe(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=wt.isLittleEndian?4278190080:255,[h,c]=o?[a,l]:[l,a],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let g=0;for(let f=0;f<r;f++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[g++]=128&t?c:h,n[g++]=64&t?c:h,n[g++]=32&t?c:h,n[g++]=16&t?c:h,n[g++]=8&t?c:h,n[g++]=4&t?c:h,n[g++]=2&t?c:h,n[g++]=1&t?c:h}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[g++]=t&1<<7-e?c:h}return{srcPos:i,destPos:g}}const Ke=16;class Ye{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Qe(t,e,i,n,s,r,a,o,l,h){const[c,d,u,p,g,f]=oe(t);if(0===d&&0===u){const m=a*c+g,v=Math.round(m),b=o*p+f,y=Math.round(b),w=(a+l)*c+g,A=Math.abs(Math.round(w)-v)||1,x=(o+h)*p+f,_=Math.abs(Math.round(x)-y)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(p),v,y),t.drawImage(e,i,n,s,r,0,0,A,_),t.setTransform(c,d,u,p,g,f),[A,_]}if(0===c&&0===p){const m=o*u+g,v=Math.round(m),b=a*d+f,y=Math.round(b),w=(o+h)*u+g,A=Math.abs(Math.round(w)-v)||1,x=(a+l)*d+f,_=Math.abs(Math.round(x)-y)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,v,y),t.drawImage(e,i,n,s,r,0,0,_,A),t.setTransform(c,d,u,p,g,f),[_,A]}t.drawImage(e,i,n,s,r,a,o,l,h);return[Math.hypot(c,d)*l,Math.hypot(u,p)*h]}class Je{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=a,this.textMatrixScale=1,this.fontMatrix=o,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=w,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=xt.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=xt.applyTransform(e,t),n=xt.applyTransform(e.slice(2),t),s=xt.applyTransform([e[0],e[3]],t),r=xt.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],r[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],r[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],r[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],r[1])}updateScalingPathMinMax(t,e){xt.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,r,a,o,l,h){const c=xt.bezierBoundingBox(e,i,n,s,r,a,o,l,h);h||this.updateRectMinMax(t,c)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:De,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Oe){e||rt("Stroke bounding box must include transform.");const t=xt.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=xt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:De,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return xt.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Ze(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Ke,r=(i-s)/Ke,a=0===s?r:r+1,o=t.createImageData(n,Ke);let l,h=0;const c=e.data,d=o.data;let u,p,g,f;if(e.kind===S.GRAYSCALE_1BPP){const e=c.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),f=i.length,m=n+7>>3,v=4294967295,b=wt.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(g=u<r?Ke:s,l=0,p=0;p<g;p++){const t=e-h;let s=0;const r=t>m?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=c[h++],i[l++]=128&d?v:b,i[l++]=64&d?v:b,i[l++]=32&d?v:b,i[l++]=16&d?v:b,i[l++]=8&d?v:b,i[l++]=4&d?v:b,i[l++]=2&d?v:b,i[l++]=1&d?v:b;for(;s<r;s++)0===o&&(d=c[h++],o=128),i[l++]=d&o?v:b,o>>=1}for(;l<f;)i[l++]=0;t.putImageData(o,0,u*Ke)}}else if(e.kind===S.RGBA_32BPP){for(p=0,f=n*Ke*4,u=0;u<r;u++)d.set(c.subarray(h,h+f)),h+=f,t.putImageData(o,0,p),p+=Ke;u<a&&(f=n*s*4,d.set(c.subarray(h,h+f)),t.putImageData(o,0,p))}else{if(e.kind!==S.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(g=Ke,f=n*g,u=0;u<a;u++){for(u>=r&&(g=s,f=n*g),l=0,p=f;p--;)d[l++]=c[h++],d[l++]=c[h++],d[l++]=c[h++],d[l++]=255;t.putImageData(o,0,u*Ke)}}}function ti(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Ke,r=(i-s)/Ke,a=0===s?r:r+1,o=t.createImageData(n,Ke);let l=0;const h=e.data,c=o.data;for(let d=0;d<a;d++){const e=d<r?Ke:s;({srcPos:l}=Xe({src:h,srcPos:l,dest:c,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Ke)}}function ei(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function ii(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!r){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function ni(t,e){if(e)return!0;const i=xt.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Vt.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const si=["butt","round","square"],ri=["miter","round","bevel"],ai={},oi={};class li{constructor(t,e,i,n,s,r,a,o){let{optionalContentConfig:l,markedContentStack:h=null}=r;this.ctx=t,this.current=new Je(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=h||[],this.optionalContentConfig=l,this.cachedCanvases=new Ye(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:i,transparency:n=!1,background:s=null}=t;const r=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...oe(this.compositeCtx))}this.ctx.save(),ii(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=oe(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,r=t.fnArray;let a=e||0;const o=s.length;if(o===a)return a;const l=o-a>10&&"function"===typeof i,h=l?Date.now()+15:0;let c=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=r[a],p!==J.dependency)this[p].apply(this,s[a]);else for(const t of s[a]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),a}if(a++,a===o)return a;if(l&&++c>10){if(Date.now()>h)return i(),a;c=0}}}#Re(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Re(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#Le()}#Le(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const i=t.width,n=t.height;let s,r,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,h=n,c="prescale1";for(;a>2&&l>1||o>2&&h>1;){let e=l,i=h;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&h>1&&(i=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/i),s=this.cachedCanvases.getCanvas(c,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,h,0,0,e,i),t=s.canvas,l=e,h=i,c="prescale1"===c?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=oe(e);let o,l,h,c;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(r?a:[a.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!r){return{canvas:i,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])}}h=i}h||(c=this.cachedCanvases.getCanvas("maskCanvas",i,n),ti(c.context,t));let d=xt.transform(a,[1/i,0,0,-1/n,0,0]);d=xt.transform(d,[1,0,0,1,0,-n]);const[u,p,g,f]=xt.getAxialAlignedBoundingBox([0,0,i,n],d),m=Math.round(g-u)||1,v=Math.round(f-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",m,v),y=b.context,w=u,A=p;y.translate(-w,-A),y.transform(...d),h||(h=this._scaleImage(c.canvas,le(y)),h=h.img,o&&r&&o.set(l,h)),y.imageSmoothingEnabled=ni(oe(y),t.interpolate),Qe(y,h,0,0,h.width,h.height,0,0,i,n),y.globalCompositeOperation="source-in";const x=xt.transform(le(y),[1,0,0,1,-w,-A]);return y.fillStyle=r?s.getPattern(e,this,x,De):s,y.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,b.canvas)),{canvas:b.canvas,offsetX:Math.round(w),offsetY:Math.round(A)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=si[t]}setLineJoin(t){this.ctx.lineJoin=ri[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...oe(this.suspendedCtx)),ei(this.suspendedCtx,s),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,r,a){e.transform(t,i,n,s,r,a),this.__originalTransform(t,i,n,s,r,a)},t.setTransform=function(t,i,n,s,r,a){e.setTransform(t,i,n,s,r,a),this.__originalSetTransform(t,i,n,s,r,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,r,a){e.bezierCurveTo(t,i,n,s,r,a),this.__originalBezierCurveTo(t,i,n,s,r,a)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),ei(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],r=n[1],a=n[2]-s,o=n[3]-r;0!==a&&0!==o&&(this.genericComposeSMask(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,s,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,r,a,o,l,h,c){let d=t.canvas,u=o-h,p=l-c;if(r)if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),e=t.context;e.drawImage(d,-u,-p),r.some((t=>0!==t))&&(e.globalCompositeOperation="destination-atop",e.fillStyle=xt.makeHexColor(...r),e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over"),d=t.canvas,u=p=0}else if(r.some((t=>0!==t))){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,p,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=xt.makeHexColor(...r),t.fillRect(u,p,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(a));const g=new Path2D;g.rect(o,l,i,n),e.clip(g),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(ei(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),ei(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,r){this.ctx.transform(t,e,i,n,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let r,a,o=s.x,l=s.y;const h=oe(n),c=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],d=c?i.slice(0):null;for(let u=0,p=0,g=t.length;u<g;u++)switch(0|t[u]){case J.rectangle:o=e[p++],l=e[p++];const t=e[p++],i=e[p++],u=o+t,g=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(u,g):(n.lineTo(u,l),n.lineTo(u,g),n.lineTo(o,g)),c||s.updateRectMinMax(h,[o,l,u,g]),n.closePath();break;case J.moveTo:o=e[p++],l=e[p++],n.moveTo(o,l),c||s.updatePathMinMax(h,o,l);break;case J.lineTo:o=e[p++],l=e[p++],n.lineTo(o,l),c||s.updatePathMinMax(h,o,l);break;case J.curveTo:r=o,a=l,o=e[p+4],l=e[p+5],n.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],o,l),s.updateCurvePathMinMax(h,r,a,e[p],e[p+1],e[p+2],e[p+3],o,l,d),p+=6;break;case J.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(h,r,a,o,l,e[p],e[p+1],e[p+2],e[p+3],d),o=e[p+2],l=e[p+3],p+=4;break;case J.curveTo3:r=o,a=l,o=e[p+2],l=e[p+3],n.bezierCurveTo(e[p],e[p+1],o,l,o,l),s.updateCurvePathMinMax(h,r,a,e[p],e[p+1],o,l,o,l,d),p+=4;break;case J.closePath:n.closePath()}c&&s.updateScalingPathMinMax(h,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,le(e),Oe),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,le(e),De),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=ai}eoClip(){this.pendingClip=oi}beginText(){this.current.textMatrix=a,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),n=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||o,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||st("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const s=i.loadedName||"sans-serif",r=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let a="normal";i.black?a="900":i.bold&&(a="bold");const l=i.italic?"italic":"normal";let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${l} ${a} ${h}px ${r}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,r){this.current.textMatrix=[t,e,i,n,s,r],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,r=this.current,a=r.font,o=r.textRenderingMode,l=r.fontSize/r.fontSizeScale,h=o&E,c=!!(o&C),d=r.patternFill&&!a.missingFile;let u;if((a.disableFontFace||c||d)&&(u=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),h!==w&&h!==x||s.fill(),h!==A&&h!==x||s.stroke(),s.restore()):(h!==w&&h!==x||s.fillText(t,e,i),h!==A&&h!==x||s.strokeText(t,e,i)),c){(this.pendingTextPaths||=[]).push({transform:oe(s),x:e,y:i,fontSize:l,addToPath:u})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return lt(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,r=e.fontSizeScale,a=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,h=e.textHScale*l,c=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,g=n*e.fontMatrix[0],f=e.textRenderingMode===w&&!i.disableFontFace&&!e.patternFill;let m;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(h,-1):s.scale(h,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,le(s),De);m=oe(s),s.restore(),s.fillStyle=t}let v=e.lineWidth;const b=e.textMatrixScale;if(0===b||0===v){const t=e.textRenderingMode&E;t!==A&&t!==x||(v=this.getSinglePixelWidth())}else v/=b;if(1!==r&&(s.scale(r,r),v/=r),s.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*g*h,s.restore(),void this.compose()}let y,_=0;for(y=0;y<c;++y){const e=t[y];if("number"===typeof e){_+=u*e*n/1e3;continue}let h=!1;const c=(e.isSpace?o:0)+a,v=e.fontChar,b=e.accent;let w,A,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*g,n=t[2]*g;x=t?-t[0]:x,w=i/r,A=(_+n)/r}else w=_/r,A=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(v).width/n*r;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;h=!0,s.save(),s.scale(e,1),w/=e}else x!==t&&(w+=(x-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(f&&!b)s.fillText(v,w,A);else if(this.paintChar(v,w,A,m),b){const t=w+n*b.offset.x/r,e=A-n*b.offset.y/r;this.paintChar(b.fontChar,t,e,m)}_+=d?x*g-c*l:x*g+c*l,h&&s.restore()}d?e.y-=_:e.x+=_*h,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,r=i.fontDirection,a=n.vertical?1:-1,l=i.charSpacing,h=i.wordSpacing,c=i.textHScale*r,d=i.fontMatrix||o,u=t.length;let p,g,f,m;if(!(i.textRenderingMode===_)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(c,r),p=0;p<u;++p){if(g=t[p],"number"===typeof g){m=a*g*s/1e3,this.ctx.translate(m,0),i.x+=m*c;continue}const r=(g.isSpace?h:0)+l,o=n.charProcOperatorList[g.operatorListId];if(!o){st(`Type3 character "${g.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=g,this.save(),e.scale(s,s),e.transform(...d),this.executeOperatorList(o),this.restore());f=xt.applyTransform([g.width,0],d)[0]*s+r,e.translate(f,0),i.x+=f*c}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||oe(this.ctx),s={createCanvasGraphics:t=>new li(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new qe(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){const n=xt.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=xt.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new He(t);case"Mesh":return new $e(t);case"Dummy":return new Ue}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,le(e),Ne);const n=le(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=xt.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,r,a-s,o-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){rt("Should not call beginInlineImage")}beginImageData(){rt("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=oe(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(oe(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||nt("TODO: Support non-isolated groups."),t.knockout&&st("Knockout groups not supported.");const i=oe(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=xt.getAxialAlignedBoundingBox(t.bbox,oe(e));const s=[0,0,e.canvas.width,e.canvas.height];n=xt.intersect(n,s)||[0,0,0,0];const r=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-r,1),l=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,o,l]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(h,o,l),d=c.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:c.canvas,context:d,offsetX:r,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,a),e.save()),ei(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=oe(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=xt.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(this.#Re(),ii(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],r=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=r;const[s,a]=xt.singularValueDecompose2dScale(oe(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),h=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,h);const{canvas:c,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-a,0,r*a),ii(this.ctx)}else ii(this.ctx),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.endPath()}this.current=new Je(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Le(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let r,a,o,l=new Uint8Array(s*(i+1));const h=e+7&-8;let c=new Uint8Array(h*i),d=0;for(const f of t.data){let t=128;for(;t>0;)c[d++]=f&t?0:255,t>>=1}let u=0;for(d=0,0!==c[d]&&(l[0]=1,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[a]=c[d]?2:1,++u),d++;for(0!==c[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*h,o=r*s,c[d-h]!==c[d]&&(l[o]=c[d]?1:8,++u);let t=(c[d]?4:0)+(c[d-h]?8:0);for(a=1;a<e;a++)t=(t>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(c[d-h]!==c[d]&&(l[o+a]=c[d]?2:4,++u),u>1e3)return null}for(d=h*(i-1),o=r*s,0!==c[d]&&(l[o]=8,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[o+a]=c[d]?4:8,++u),d++;if(0!==c[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),g=new Path2D;for(r=0;u&&r<=i;r++){let t=r*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;g.moveTo(t%s,r);const n=t;let a=l[t];do{const e=p[a];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(a=i,l[t]=0):(a=i&51*a>>4,l[t]&=a>>2|a<<2),g.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return c=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(g),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),r=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const o=oe(a);a.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);a.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let h=0,c=r.length;h<c;h+=2){const t=xt.transform(o,[e,i,n,s,r[h],r[h+1]]),[c,d]=xt.applyTransform([0,0],t);a.drawImage(l.canvas,c,d)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:r,height:a,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",r,a),h=l.context;h.save();ti(h,this.getObject(t,s)),h.globalCompositeOperation="source-in",h.fillStyle=n?i.getPattern(h,this,le(e),De):i,h.fillRect(0,0,r,a),h.restore(),e.save(),e.transform(...o),e.scale(1,-1),Qe(e,l.canvas,0,0,r,a,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):st("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void st("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let l=0,h=n.length;l<h;l+=2)o.push({transform:[e,0,0,i,n[l],n[l+1]],x:0,y:0,w:r,h:a});this.paintInlineImageXObjectGroup(s,o)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),r=s.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!r){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Ze(n,t),s=this.applyTransferMapsToCanvas(n)}const a=this._scaleImage(s,le(n));n.imageSmoothingEnabled=ni(oe(n),t.interpolate),Qe(n,a.img,0,0,a.paintWidth,a.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Ze(s,t),n=this.applyTransferMapsToCanvas(s)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),Qe(i,n,s.x,s.y,s.w,s.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===oi?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=oe(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let r,a;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)r=a=1/i;else{const e=i*t;r=a=e<1?1/e:1}else if(0===t)r=1/i,a=1/n;else{const e=i*t,s=n*t;r=e<1?1/e:1,a=s<1?1/s:1}}else{const o=Math.abs(e*s-i*n),l=Math.hypot(e,i),h=Math.hypot(n,s);if(0===t)r=h/o,a=l/o;else{const e=t*o;r=h>e?h/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const r=e.getLineDash();if(t&&e.save(),e.scale(n,s),r.length>0){const t=Math.max(n,s);e.setLineDash(r.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const Cs in J)void 0!==li.prototype[Cs]&&(li.prototype[J[Cs]]=li.prototype[Cs]);class hi{static#Ie=null;static#Fe="";static get workerPort(){return this.#Ie}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#Ie=t}static get workerSrc(){return this.#Fe}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");this.#Fe=t}}const ci=1,di=2,ui=1,pi=2,gi=3,fi=4,mi=5,vi=6,bi=7,yi=8;function wi(t){switch(t instanceof Error||"object"===typeof t&&null!==t||rt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new mt(t.message);case"MissingPDFException":return new pt(t.message);case"PasswordException":return new ct(t.message,t.code);case"UnexpectedResponseException":return new gt(t.message,t.status);case"UnknownErrorException":return new dt(t.message,t.details);default:return new dt(t.message,t.toString())}}class Ai{constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#De(e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===ci)i.resolve(e.data);else{if(e.callback!==di)throw new Error("Unexpected callback case");i.reject(wi(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,s=e.sourceName;new Promise((function(t){t(n(e.data))})).then((function(n){i.postMessage({sourceName:t,targetName:s,callback:ci,callbackId:e.callbackId,data:n})}),(function(n){i.postMessage({sourceName:t,targetName:s,callback:di,callbackId:e.callbackId,reason:wi(n)})}))}else e.streamId?this.#Oe(e):n(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(r){s.reject(r)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:r,targetName:a,stream:vi,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{at(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:ui,streamId:s,reason:wi(t)}),e.promise}},i)}#Oe(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=r,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:fi,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:gi,streamId:e}),delete r.streamSinks[e])},error(t){at(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:mi,streamId:e,reason:wi(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise((function(e){e(a(t.data,o))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:yi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:yi,streamId:e,reason:wi(t)})}))}#De(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case yi:t.success?r.startCall.resolve():r.startCall.reject(wi(t.reason));break;case bi:t.success?r.pullCall.resolve():r.pullCall.reject(wi(t.reason));break;case vi:if(!a){s.postMessage({sourceName:i,targetName:n,stream:bi,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise((function(t){t(a.onPull?.())})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:bi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:bi,streamId:e,reason:wi(t)})}));break;case fi:if(at(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case gi:if(at(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#Ne(r,e);break;case mi:at(r,"error should have stream controller"),r.controller.error(wi(t.reason)),this.#Ne(r,e);break;case pi:t.success?r.cancelCall.resolve():r.cancelCall.reject(wi(t.reason)),this.#Ne(r,e);break;case ui:if(!a)break;new Promise((function(e){e(a.onCancel?.(wi(t.reason)))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:pi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:pi,streamId:e,reason:wi(t)})})),a.sinkCapability.reject(wi(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#Ne(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class xi{#ze;#Be;constructor(t){let{parsedData:e,rawData:i}=t;this.#ze=e,this.#Be=i}getRaw(){return this.#Be}get(t){return this.#ze.get(t)??null}getAll(){return yt(this.#ze)}has(t){return this.#ze.has(t)}}const _i=Symbol("INTERNAL");class Ei{#He=!1;#je=!1;#Ve=!1;#$e=!0;constructor(t,e){let{name:i,intent:n,usage:s}=e;this.#He=!!(t&c),this.#je=!!(t&d),this.name=i,this.intent=n,this.usage=s}get visible(){if(this.#Ve)return this.#$e;if(!this.#$e)return!1;const{print:t,view:e}=this.usage;return this.#He?"OFF"!==e?.viewState:!this.#je||"OFF"!==t?.printState}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==_i&&rt("Internal method `_setVisible` called."),this.#Ve=i,this.#$e=e}}class Ci{#Ue=null;#We=(()=>new Map)();#Ge=null;#qe=null;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;if(this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#qe=t.order;for(const i of t.groups)this.#We.set(i.id,new Ei(e,i));if("OFF"===t.baseState)for(const t of this.#We.values())t._setVisible(_i,!1);for(const e of t.on)this.#We.get(e)._setVisible(_i,!0);for(const e of t.off)this.#We.get(e)._setVisible(_i,!1);this.#Ge=this.getHash()}}#Xe(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let s;if(Array.isArray(e))s=this.#Xe(e);else{if(!this.#We.has(e))return st(`Optional content group not found: ${e}`),!0;s=this.#We.get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}isVisible(t){if(0===this.#We.size)return!0;if(!t)return nt("Optional content group not defined."),!0;if("OCG"===t.type)return this.#We.has(t.id)?this.#We.get(t.id).visible:(st(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#Xe(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#We.has(e))return st(`Optional content group not found: ${e}`),!0;if(this.#We.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#We.has(e))return st(`Optional content group not found: ${e}`),!0;if(!this.#We.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#We.has(e))return st(`Optional content group not found: ${e}`),!0;if(!this.#We.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#We.has(e))return st(`Optional content group not found: ${e}`),!0;if(this.#We.get(e).visible)return!1}return!0}return st(`Unknown optional content policy ${t.policy}.`),!0}return st(`Unknown group type ${t.type}.`),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.#We.get(t);i?(i._setVisible(_i,!!e,!0),this.#Ue=null):st(`Optional content group not found: ${t}`)}setOCGState(t){let e,{state:i,preserveRB:n}=t;for(const s of i){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=this.#We.get(s);if(t)switch(e){case"ON":t._setVisible(_i,!0);break;case"OFF":t._setVisible(_i,!1);break;case"Toggle":t._setVisible(_i,!t.visible)}}this.#Ue=null}get hasInitialVisibility(){return null===this.#Ge||this.getHash()===this.#Ge}getOrder(){return this.#We.size?this.#qe?this.#qe.slice():[...this.#We.keys()]:null}getGroups(){return this.#We.size>0?yt(this.#We):null}getGroup(t){return this.#We.get(t)||null}getHash(){if(null!==this.#Ue)return this.#Ue;const t=new Ce;for(const[e,i]of this.#We)t.update(`${e}:${i.visible}`);return this.#Ue=t.hexdigest()}}class Si{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;at(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:r,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,r?.length>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!i,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),t.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),t.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),t.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),t.transportReady()}_onReceiveData(t){let{begin:e,chunk:i}=t;const n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{at(this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(n),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){at(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Mi(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Ti(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class Mi{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=i||!1,this._filename=Yt(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Ti{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function ki(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);if(!Number.isInteger(a))return r;if(r.suggestedLength=a,a<=2*n)return r;if(s||!i)return r;if("bytes"!==e("Accept-Ranges"))return r;return"identity"!==(e("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r}function Pi(t){const e=t("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=o(t),t=l(t),r(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const r=[];for(let n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=a(i),t&&(i=unescape(i),0===n&&(i=o(i))),r.push(i)}return r.join("")}(t),i)return r(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=l(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),s=bt(i);i=n.decode(s),e=!1}catch{}}return i}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,i,n){if("q"===i||"Q"===i)return s(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{n=atob(n)}catch{}return s(e,n)}))}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(Yt(t))return t}return null}function Ri(t,e){return 404===t||0===t&&e.startsWith("file:")?new pt('Missing PDF "'+e+'".'):new gt(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function Li(t){return 200===t||206===t}function Ii(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Fi(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Di(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(st(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class Oi{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return at(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Ni(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new zi(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Ni{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=Fi(this._stream.httpHeaders);const i=e.url;fetch(i,Ii(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Li(t.status))throw Ri(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=ki({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Pi(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new mt("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Di(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class zi{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=Fi(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-1}`);const s=n.url;fetch(s,Ii(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Li(t.status))throw Ri(t.status,s);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Di(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Bi{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const s in i)n[s]=i[s];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const s in this.httpHeaders){const t=this.httpHeaders[s];void 0!==t&&e.setRequestHeader(s,t)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){const i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError?.(n.status);const s=n.status||200;if(!(200===s&&206===i.expectedStatus)&&s!==i.expectedStatus)return void i.onError?.(n.status);const r=function(t){const e=t.response;return"string"!==typeof e?e:bt(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:r})}else r?i.onDone({begin:0,chunk:r}):i.onError?.(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class Hi{constructor(t){this._source=t,this._manager=new Bi(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return at(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ji(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Vi(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class ji{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:s}=ki({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Pi(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Ri(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Vi{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=Ri(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const $i=/^file:\/\/\/[a-zA-Z]:\//;class Ui{constructor(t){this.source=t,this.url=function(t){const e=Ie.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(i.host||(i.protocol="file:"),i)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return at(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Yi(this):new Xi(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new Qi(this,t,e):new Ki(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Wi{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new mt("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Gi{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function qi(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class Xi extends Wi{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new pt(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=ki({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Pi(i)};if(this._request=null,"http:"===this._url.protocol){const i=Ie.get("http");this._request=i.request(qi(this._url,t.httpHeaders),e)}else{const i=Ie.get("https");this._request=i.request(qi(this._url,t.httpHeaders),e)}this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class Ki extends Gi{constructor(t,e,i){super(t),this._httpHeaders={};for(const s in t.httpHeaders){const e=t.httpHeaders[s];void 0!==e&&(this._httpHeaders[s]=e)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new pt(`Missing PDF "${this._url}".`);this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){const t=Ie.get("http");this._request=t.request(qi(this._url,this._httpHeaders),n)}else{const t=Ie.get("https");this._request=t.request(qi(this._url,this._httpHeaders),n)}this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class Yi extends Wi{constructor(t){super(t);let e=decodeURIComponent(this._url.path);$i.test(this._url.href)&&(e=e.replace(/^\//,""));const i=Ie.get("fs");i.promises.lstat(e).then((t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=new pt(`Missing PDF "${e}".`)),this._storedError=t,this._headersCapability.reject(t)}))}}class Qi extends Gi{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);$i.test(this._url.href)&&(n=n.replace(/^\//,""));const s=Ie.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const Ji=30;class Zi{#Ke=(()=>Promise.withResolvers())();#mt=null;#Ye=!1;#Qe=(()=>!!globalThis.FontInspector?.enabled)();#Je=null;#Ze=null;#ti=0;#ei=0;#ii=null;#ni=null;#si=0;#ri=0;#ai=(()=>Object.create(null))();#oi=[];#li=null;#hi=[];#ci=(()=>new WeakMap)();#di=null;static#ui=(()=>new Map)();static#pi=(()=>new Map)();static#gi=null;static#fi=(()=>new Set)();constructor(t){let{textContentSource:e,container:i,viewport:n}=t;if(e instanceof ReadableStream)this.#li=e;else{if("object"!==typeof e)throw new Error('No "textContentSource" parameter specified.');this.#li=new ReadableStream({start(t){t.enqueue(e),t.close()}})}this.#mt=this.#ni=i,this.#ri=n.scale*(globalThis.devicePixelRatio||1),this.#si=n.rotation,this.#Ze={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:s,pageHeight:r,pageX:a,pageY:o}=n.rawDims;this.#di=[1,0,0,-1,-a,o+r],this.#ei=s,this.#ti=r,Zi.#mi(),he(i,n),this.#Ke.promise.catch((()=>{})).then((()=>{Zi.#fi.delete(this),this.#Ze=null,this.#ai=null}))}render(){const t=()=>{this.#ii.read().then((e=>{let{value:i,done:n}=e;n?this.#Ke.resolve():(this.#Je??=i.lang,Object.assign(this.#ai,i.styles),this.#vi(i.items),t())}),this.#Ke.reject)};return this.#ii=this.#li.getReader(),Zi.#fi.add(this),t(),this.#Ke.promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==this.#si&&(i?.(),this.#si=s,he(this.#ni,{rotation:s})),n!==this.#ri){i?.(),this.#ri=n;const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Zi.#bi(this.#Je)};for(const e of this.#hi)t.properties=this.#ci.get(e),t.div=e,this.#yi(t)}}cancel(){const t=new mt("TextLayer task cancelled.");this.#ii?.cancel(t).catch((()=>{})),this.#ii=null,this.#Ke.reject(t)}get textDivs(){return this.#hi}get textContentItemsStr(){return this.#oi}#vi(t){if(this.#Ye)return;this.#Ze.ctx??=Zi.#bi(this.#Je);const e=this.#hi,i=this.#oi;for(const n of t){if(e.length>1e5)return st("Ignoring additional textDivs for performance reasons."),void(this.#Ye=!0);if(void 0!==n.str)i.push(n.str),this.#wi(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this.#mt;this.#mt=document.createElement("span"),this.#mt.classList.add("markedContent"),null!==n.id&&this.#mt.setAttribute("id",`${n.id}`),t.append(this.#mt)}else"endMarkedContent"===n.type&&(this.#mt=this.#mt.parentNode)}}#wi(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#hi.push(e);const n=xt.transform(this.#di,t.transform);let s=Math.atan2(n[1],n[0]);const r=this.#ai[t.fontName];r.vertical&&(s+=Math.PI/2);const a=this.#Qe&&r.fontSubstitution||r.fontFamily,o=Math.hypot(n[2],n[3]),l=o*Zi.#Ai(a,this.#Je);let h,c;0===s?(h=n[4],c=n[5]-l):(h=n[4]+l*Math.sin(s),c=n[5]-l*Math.cos(s));const d="calc(var(--scale-factor)*",u=e.style;this.#mt===this.#ni?(u.left=`${(100*h/this.#ei).toFixed(2)}%`,u.top=`${(100*c/this.#ti).toFixed(2)}%`):(u.left=`${d}${h.toFixed(2)}px)`,u.top=`${d}${c.toFixed(2)}px)`),u.fontSize=`${d}${(Zi.#gi*o).toFixed(2)}px)`,u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#Qe&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(p=!0)}if(p&&(i.canvasWidth=r.vertical?t.height:t.width),this.#ci.set(e,i),this.#Ze.div=e,this.#Ze.properties=i,this.#yi(this.#Ze),i.hasText&&this.#mt.append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#mt.append(t)}}#yi(t){const{div:e,properties:i,ctx:n,prevFontSize:s,prevFontFamily:r}=t,{style:a}=e;let o="";if(Zi.#gi>1&&(o=`scale(${1/Zi.#gi})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:l}=a,{canvasWidth:h,fontSize:c}=i;s===c&&r===l||(n.font=`${c*this.#ri}px ${l}`,t.prevFontSize=c,t.prevFontFamily=l);const{width:d}=n.measureText(e.textContent);d>0&&(o=`scaleX(${h*this.#ri/d}) ${o}`)}0!==i.angle&&(o=`rotate(${i.angle}deg) ${o}`),o.length>0&&(a.transform=o)}static cleanup(){if(!(this.#fi.size>0)){this.#ui.clear();for(const{canvas:t}of this.#pi.values())t.remove();this.#pi.clear()}}static#bi(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.#pi.get(t||="");if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#pi.set(t,e)}return e}static#mi(){if(null!==this.#gi)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#gi=t.getBoundingClientRect().height,t.remove()}static#Ai(t,e){const i=this.#ui.get(t);if(i)return i;const n=this.#bi(e),s=n.font;n.canvas.width=n.canvas.height=Ji,n.font=`30px ${t}`;const r=n.measureText("");let a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);if(a){const e=a/(a+o);return this.#ui.set(t,e),n.canvas.width=n.canvas.height=0,n.font=s,e}n.strokeStyle="red",n.clearRect(0,0,Ji,Ji),n.strokeText("g",0,0);let l=n.getImageData(0,0,Ji,Ji).data;o=0;for(let c=l.length-1-3;c>=0;c-=4)if(l[c]>0){o=Math.ceil(c/4/Ji);break}n.clearRect(0,0,Ji,Ji),n.strokeText("A",0,Ji),l=n.getImageData(0,0,Ji,Ji).data,a=0;for(let c=0,d=l.length;c<d;c+=4)if(l[c]>0){a=Ji-Math.floor(c/4/Ji);break}n.canvas.width=n.canvas.height=0,n.font=s;const h=a?a/(a+o):.8;return this.#ui.set(t,h),h}}function tn(){ie("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:t,container:e,viewport:i,...n}=arguments[0],s=Object.keys(n);s.length>0&&st("Ignoring `renderTextLayer` parameters: "+s.join(", "));const r=new Zi({textContentSource:t,container:e,viewport:i}),{textDivs:a,textContentItemsStr:o}=r;return{promise:r.render(),textDivs:a,textContentItemsStr:o}}function en(){ie("`updateTextLayer`, please use `TextLayer` instead.")}class nn{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){if(!i)return;let n=null;const s=i.name;if("#text"===s)n=i.value;else{if(!nn.shouldBuildText(s))return;i?.attributes?.textContent?n=i.attributes.textContent:i.value&&(n=i.value)}if(null!==n&&e.push({str:n}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const sn=65536,rn=r?class extends Nt{_createCanvas(t,e){return Ie.get("canvas").createCanvas(t,e)}}:class extends Nt{constructor(){let{ownerDocument:t=globalThis.document,enableHWA:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},an=r?class extends zt{_fetchData(t,e){return Fe(t).then((t=>({cMapData:t,compressionType:e})))}}:Ut,on=r?class extends Ot{}:class extends Ot{#xi;#_i;#Ei;#Ci;#Si;#v=0;constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.#Ei=t,this.#Ci=e}get#y(){return this.#xi||=new Map}get#Mi(){return this.#Si||=new Map}get#Ti(){if(!this.#_i){const t=this.#Ci.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=this.#Ci.createElementNS(jt,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#_i=this.#Ci.createElementNS(jt,"defs"),t.append(i),i.append(this.#_i),this.#Ci.body.append(t)}return this.#_i}#ki(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),r=new Array(256),a=new Array(256);for(let o=0;o<256;o++)s[o]=e[o]/255,r[o]=i[o]/255,a[o]=n[o]/255;return[s.join(","),r.join(","),a.join(",")]}addFilter(t){if(!t)return"none";let e=this.#y.get(t);if(e)return e;const[i,n,s]=this.#ki(t),r=1===t.length?i:`${i}${n}${s}`;if(e=this.#y.get(r),e)return this.#y.set(t,e),e;const a=`g_${this.#Ei}_transfer_map_${this.#v++}`,o=`url(#${a})`;this.#y.set(t,o),this.#y.set(r,o);const l=this.#Pi(a);return this.#Ri(i,n,s,l),o}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let s=this.#Mi.get(n);if(s?.key===i)return s.url;if(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#Mi.set(n,s)),!t||!e)return s.url;const r=this.#Li(t);t=xt.makeHexColor(...r);const a=this.#Li(e);if(e=xt.makeHexColor(...a),this.#Ti.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;const o=new Array(256);for(let u=0;u<=255;u++){const t=u/255;o[u]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),h=`g_${this.#Ei}_hcm_filter`,c=s.filter=this.#Pi(h);this.#Ri(l,l,l,c),this.#Ii(c);const d=(t,e)=>{const i=r[t]/255,n=a[t]/255,s=new Array(e+1);for(let r=0;r<=e;r++)s[r]=i+r/e*(n-i);return s.join(",")};return this.#Ri(d(0,5),d(1,5),d(2,5),c),s.url=`url(#${h})`,s.url}addAlphaFilter(t){let e=this.#y.get(t);if(e)return e;const[i]=this.#ki([t]),n=`alpha_${i}`;if(e=this.#y.get(n),e)return this.#y.set(t,e),e;const s=`g_${this.#Ei}_alpha_map_${this.#v++}`,r=`url(#${s})`;this.#y.set(t,r),this.#y.set(n,r);const a=this.#Pi(s);return this.#Fi(i,a),r}addLuminosityFilter(t){let e,i,n=this.#y.get(t||"luminosity");if(n)return n;if(t?([e]=this.#ki([t]),i=`luminosity_${e}`):i="luminosity",n=this.#y.get(i),n)return this.#y.set(t,n),n;const s=`g_${this.#Ei}_luminosity_map_${this.#v++}`,r=`url(#${s})`;this.#y.set(t,r),this.#y.set(i,r);const a=this.#Pi(s);return this.#Di(a),t&&this.#Fi(e,a),r}addHighlightHCMFilter(t,e,i,n,s){const r=`${e}-${i}-${n}-${s}`;let a=this.#Mi.get(t);if(a?.key===r)return a.url;if(a?(a.filter?.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},this.#Mi.set(t,a)),!e||!i)return a.url;const[o,l]=[e,i].map(this.#Li.bind(this));let h=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),c=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,u]=[n,s].map(this.#Li.bind(this));c<h&&([h,c,d,u]=[c,h,u,d]),this.#Ti.style.color="";const p=(t,e,i)=>{const n=new Array(256),s=(c-h)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(h+l*s),e=r+l*a;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},g=`g_${this.#Ei}_hcm_${t}_filter`,f=a.filter=this.#Pi(g);return this.#Ii(f),this.#Ri(p(d[0],u[0],5),p(d[1],u[1],5),p(d[2],u[2],5),f),a.url=`url(#${g})`,a.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==this.#Mi.size||(this.#_i&&(this.#_i.parentNode.parentNode.remove(),this.#_i=null),this.#xi&&(this.#xi.clear(),this.#xi=null),this.#v=0)}#Di(t){const e=this.#Ci.createElementNS(jt,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#Ii(t){const e=this.#Ci.createElementNS(jt,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#Pi(t){const e=this.#Ci.createElementNS(jt,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#Ti.append(e),e}#Oi(t,e,i){const n=this.#Ci.createElementNS(jt,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}#Ri(t,e,i,n){const s=this.#Ci.createElementNS(jt,"feComponentTransfer");n.append(s),this.#Oi(s,"feFuncR",t),this.#Oi(s,"feFuncG",e),this.#Oi(s,"feFuncB",i)}#Fi(t,e){const i=this.#Ci.createElementNS(jt,"feComponentTransfer");e.append(i),this.#Oi(i,"feFuncA",t)}#Li(t){return this.#Ti.style.color=t,ae(getComputedStyle(this.#Ti).getPropertyValue("color"))}},ln=r?class extends Bt{_fetchData(t){return Fe(t)}}:Wt;function hn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new dn,{docId:i}=e,n=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(r&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,s=t.data?function(t){if(r&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return bt(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,a=t.httpHeaders||null,o=!0===t.withCredentials,l=t.password??null,h=t.range instanceof un?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:sn;let d=t.worker instanceof vn?t.worker:null;const u=t.verbosity,p="string"!==typeof t.docBaseUrl||Kt(t.docBaseUrl)?null:t.docBaseUrl,g="string"===typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,m=t.CMapReaderFactory||an,v="string"===typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||ln,y=!0!==t.stopAtErrors,w=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,A=!1!==t.isEvalSupported,x="boolean"===typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!r,_=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,E="boolean"===typeof t.disableFontFace?t.disableFontFace:r,C=!0===t.fontExtraProperties,S=!0===t.enableXfa,M=t.ownerDocument||globalThis.document,T=!0===t.disableRange,k=!0===t.disableStream,P=!0===t.disableAutoFetch,R=!0===t.pdfBug,L=!0===t.enableHWA,I=h?h.length:t.length??NaN,F="boolean"===typeof t.useSystemFonts?t.useSystemFonts:!r&&!E,D="boolean"===typeof t.useWorkerFetch?t.useWorkerFetch:m===Ut&&b===Wt&&g&&v&&te(g,document.baseURI)&&te(v,document.baseURI),O=t.canvasFactory||new rn({ownerDocument:M,enableHWA:L}),N=t.filterFactory||new on({docId:i,ownerDocument:M});et(u);const z={canvasFactory:O,filterFactory:N};if(D||(z.cMapReaderFactory=new m({baseUrl:g,isCompressed:f}),z.standardFontDataFactory=new b({baseUrl:v})),!d){const t={verbosity:u,port:hi.workerPort};d=t.port?vn.fromPort(t):new vn(t),e._worker=d}const B={docId:i,apiVersion:"4.4.168",data:s,password:l,disableAutoFetch:P,rangeChunkSize:c,length:I,docBaseUrl:p,enableXfa:S,evaluatorOptions:{maxImageSize:w,disableFontFace:E,ignoreErrors:y,isEvalSupported:A,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:_,fontExtraProperties:C,useSystemFonts:F,cMapUrl:D?g:null,standardFontDataUrl:D?v:null}},H={disableFontFace:E,fontExtraProperties:C,ownerDocument:M,pdfBug:R,styleElement:null,loadingParams:{disableAutoFetch:P,enableXfa:S}};return d.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const t=d.messageHandler.sendWithPromise("GetDocRequest",B,s?[s.buffer]:null);let l;if(h)l=new Si(h,{disableRange:T,disableStream:k});else if(!s){if(!n)throw new Error("getDocument - no `url` parameter provided.");l=(t=>{if(r){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&te(t.url)?new Oi(t):new Ui(t)}return te(t.url)?new Oi(t):new Hi(t)})({url:n,length:I,httpHeaders:a,withCredentials:o,rangeChunkSize:c,disableRange:T,disableStream:k})}return t.then((t=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const n=new Ai(i,t,d.port),s=new bn(n,e,l,H,z);e._transport=s,n.send("Ready",null)}))})).catch(e._capability.reject),e}function cn(t){return"object"===typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class dn{static#Ei=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+dn.#Ei++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class un{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){rt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class pn{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return lt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class gn{#Ni=null;#zi=!1;constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new Zt:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new wn,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new qt({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return lt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(t){let{canvasContext:e,viewport:i,intent:n="display",annotationMode:s=m.ENABLE,transform:r=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:c=null}=t;this._stats?.time("Overall");const u=this._transport.getRenderingIntent(n,s,c),{renderingIntent:p,cacheKey:g}=u;this.#zi=!1,this.#Bi(),o||=this._transport.getOptionalContentConfig(p);let f=this._intentStates.get(g);f||(f=Object.create(null),this._intentStates.set(g,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const v=!!(p&d);f.displayReadyCapability||(f.displayReadyCapability=Promise.withResolvers(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(u));const b=t=>{f.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&(this.#zi=!0),this.#Hi(!v),t?(y.capability.reject(t),this._abortOperatorList({intentState:f,reason:t instanceof Error?t:new Error(t)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new xn({callback:b,params:{canvasContext:e,viewport:i,transform:r,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:h});(f.renderTasks||=new Set).add(y);const w=y.task;return Promise.all([f.displayReadyCapability.promise,o]).then((t=>{let[e,i]=t;if(this.destroyed)b();else{if(this._stats?.time("Rendering"),!(i.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:e,optionalContentConfig:i}),y.operatorListChanged()}})).catch(b),w}getOperatorList(){let{intent:t="display",annotationMode:e=m.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=this._transport.getRenderingIntent(t,e,i,!0);let s,r=this._intentStates.get(n.cacheKey);return r||(r=Object.create(null),this._intentStates.set(n.cacheKey,r)),r.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(s))},r.opListReadCapability=Promise.withResolvers(),(r.renderTasks||=new Set).add(s),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),r.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>nn.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then((function(i){let{value:n,done:r}=i;r?t(s):(s.lang??=n.lang,Object.assign(s.styles,n.styles),s.items.push(...n.items),e())}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#zi=!1,this.#Bi(),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#zi=!0;const e=this.#Hi(!1);return t&&e&&(this._stats&&=new Zt),e}#Hi(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#Bi(),!this.#zi||this.destroyed)return!1;if(t)return this.#Ni=setTimeout((()=>{this.#Ni=null,this.#Hi(!1)}),5e3),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#zi=!1,!0}#Bi(){this.#Ni&&(clearTimeout(this.#Ni),this.#Ni=null)}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&this.#Hi(!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n}=t;const{map:s,transfer:r}=n,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:s},r).getReader(),o=this._intentStates.get(i);o.streamReader=a;const l=()=>{a.read().then((t=>{let{value:e,done:i}=t;i?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),l())}),(t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#Hi(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}}))};l()}_abortOperatorList(t){let{intentState:e,reason:i,force:n=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(i instanceof Xt){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})}),t))}}if(e.streamReader.cancel(new mt(i.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}class fn{#ji=(()=>new Set)();#Vi=(()=>Promise.resolve())();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#Vi.then((()=>{for(const t of this.#ji)t.call(this,i)}))}addEventListener(t,e){this.#ji.add(e)}removeEventListener(t,e){this.#ji.delete(e)}terminate(){this.#ji.clear()}}const mn={isWorkerDisabled:!1,fakeWorkerId:0};r&&(mn.isWorkerDisabled=!0,hi.workerSrc||="./pdf.worker.mjs"),mn.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const n=new URL(e,i);return i.origin===n.origin},mn.createCDNWrapper=function(t){const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};class vn{static#$i;constructor(){let{name:t=null,port:e=null,verbosity:i=it()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(vn.#$i?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(vn.#$i||=new WeakMap).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return r?Promise.all([Ie.promise,this._readyCapability.promise]):this._readyCapability.promise}#Ui(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Ai("main","worker",t),this._messageHandler.on("ready",(function(){})),this.#Ui()}_initialize(){if(mn.isWorkerDisabled||vn.#Wi)return void this._setupFakeWorker();let{workerSrc:t}=vn;try{mn.isSameOrigin(window.location.href,t)||(t=mn.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Ai("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",(()=>{this._webWorker||n()}),{signal:s.signal}),i.on("test",(t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,this.#Ui()):n()})),i.on("ready",(t=>{if(s.abort(),this.destroyed)n();else try{r()}catch{this._setupFakeWorker()}}));const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch{nt("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){mn.isWorkerDisabled||(st("Setting up fake worker."),mn.isWorkerDisabled=!0),vn._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new fn;this._port=e;const i="fake"+mn.fakeWorkerId++,n=new Ai(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new Ai(i,i+"_worker",e),this.#Ui()})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),vn.#$i?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const e=this.#$i?.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new vn(t)}static get workerSrc(){if(hi.workerSrc)return hi.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Wi(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return lt(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#Wi)return this.#Wi;return(await i(77724)(this.workerSrc)).WorkerMessageHandler})())}}class bn{#Gi=(()=>new Map)();#qi=(()=>new Map)();#Xi=(()=>new Map)();#Ki=(()=>new Map)();#Yi=null;constructor(t,e,i,n,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new wn,this.fontLoader=new ke({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#Qi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.#Gi.get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return this.#Gi.set(t,n),n}get annotationStorage(){return lt(this,"annotationStorage",new Me)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=c,r=Se;switch(t){case"any":s=h;break;case"display":break;case"print":s=d;break;default:st(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case m.DISABLE:s+=g;break;case m.ENABLE:break;case m.ENABLE_FORMS:s+=u;break;case m.ENABLE_STORAGE:s+=p;r=(s&d&&i instanceof Te?i:this.annotationStorage).serializable;break;default:st(`getRenderingIntent - invalid annotationMode: ${e}`)}return n&&(s+=f),{renderingIntent:s,cacheKey:`${s}_${r.hash}`,annotationStorageSerializable:r}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Yi?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#qi.values())t.push(i._destroy());this.#qi.clear(),this.#Xi.clear(),this.#Ki.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Gi.clear(),this.filterFactory.destroy(),Zi.cleanup(),this._networkStream?.cancelAllRequests(new mt("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{at(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function(t){let{value:i,done:n}=t;n?e.close():(at(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const i=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then((()=>{n.isStreamingSupported&&n.isRangeSupported||(this._lastProgress&&e.onProgress?.(this._lastProgress),n.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),i.reject),i.promise})),t.on("GetRangeReader",((t,e)=>{at(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then((function(t){let{value:i,done:n}=t;n?e.close():(at(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{i.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new pn(i,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new ct(t.message,t.code);break;case"InvalidPDFException":i=new ut(t.message);break;case"MissingPDFException":i=new pt(t.message);break;case"UnexpectedResponseException":i=new gt(t.message,t.status);break;case"UnknownErrorException":i=new dt(t.message,t.details);break;default:rt("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(this.#Yi=Promise.withResolvers(),e.onPassword){const n=t=>{t instanceof Error?this.#Yi.reject(t):this.#Yi.resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){this.#Yi.reject(i)}}else this.#Yi.reject(new ct(t.message,t.code));return this.#Yi.promise})),t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#qi.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{let[i,n,s]=e;if(this.destroyed)return null;if(this.commonObjs.has(i))return null;switch(n){case"Font":const{disableFontFace:e,fontExtraProperties:r,pdfBug:a}=this._params;if("error"in s){const t=s.error;st(`Error during font loading: ${t}`),this.commonObjs.resolve(i,t);break}const o=a&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,l=new Pe(s,{disableFontFace:e,inspectFont:o});this.fontLoader.bind(l).catch((()=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!r&&l.data&&(l.data=null),this.commonObjs.resolve(i,l)}));break;case"CopyLocalImage":const{imageRef:h}=s;at(h,"The imageRef must be defined.");for(const t of this.#qi.values())for(const[,e]of t.objs)if(e?.ref===h)return e.dataLen?(this.commonObjs.resolve(i,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${n}`)}return null})),t.on("obj",(t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=this.#qi.get(i);if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":r.objs.resolve(e,s),s?.dataLen>1e7&&(r._maybeCleanupAfterRender=!0);break;case"Pattern":r.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${n}`)}else s?.bitmap?.close()})),t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&st("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=this.#Xi.get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&this.#Ki.set(i.refStr,t);const n=new gn(e,i,this,this._params.pdfBug);return this.#qi.set(e,n),n}));return this.#Xi.set(e,n),n}getPageIndex(t){return cn(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#Qi("GetFieldObjects")}hasJSActions(){return this.#Qi("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#Qi("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#Qi("GetOptionalContentConfig").then((e=>new Ci(e,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#Gi.get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new xi(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));return this.#Gi.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#qi.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear(),t||this.fontLoader.clear(),this.#Gi.clear(),this.filterFactory.destroy(!0),Zi.cleanup()}}cachedPageNumber(t){if(!cn(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#Ki.get(e)??null}}const yn=Symbol("INITIAL_DATA");class wn{#Ji=(()=>Object.create(null))();#Zi(t){return this.#Ji[t]||={...Promise.withResolvers(),data:yn}}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=this.#Zi(t);return i.promise.then((()=>e(i.data))),null}const i=this.#Ji[t];if(!i||i.data===yn)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=this.#Ji[t];return!!e&&e.data!==yn}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.#Zi(t);i.data=e,i.resolve()}clear(){for(const t in this.#Ji){const{data:e}=this.#Ji[t];e?.bitmap?.close()}this.#Ji=Object.create(null)}*[Symbol.iterator](){for(const t in this.#Ji){const{data:e}=this.#Ji[t];e!==yn&&(yield[t,e])}}}class An{#tn=null;constructor(t){this.#tn=t,this.onContinue=null}get promise(){return this.#tn.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#tn.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#tn.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#tn;return t.form||t.canvas&&e?.size>0}}class xn{#en=null;static#in=(()=>new WeakSet)();constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null}=t;this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new An(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){let{transparency:e=!1,optionalContentConfig:i}=t;if(this.cancelled)return;if(this._canvas){if(xn.#in.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");xn.#in.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:r,background:a}=this.params;this.gfx=new li(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:s,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#en&&(window.cancelAnimationFrame(this.#en),this.#en=null),xn.#in.delete(this._canvas),this.callback(t||new Xt(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#en=window.requestAnimationFrame((()=>{this.#en=null,this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),xn.#in.delete(this._canvas),this.callback())))}}const _n="4.4.168",En="19fbc8998";function Cn(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Sn(t){return Math.max(0,Math.min(255,255*t))}class Mn{static CMYK_G(t){let[e,i,n,s]=t;return["G",1-Math.min(1,.3*e+.59*n+.11*i+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=Sn(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Cn(e);return`#${i}${i}${i}`}static RGB_G(t){let[e,i,n]=t;return["G",.3*e+.59*i+.11*n]}static RGB_rgb(t){return t.map(Sn)}static RGB_HTML(t){return`#${t.map(Cn).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,n,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[Sn(1-Math.min(1,e+s)),Sn(1-Math.min(1,n+s)),Sn(1-Math.min(1,i+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,n]=t;const s=1-e,r=1-i,a=1-n;return["CMYK",s,r,a,Math.min(s,r,a)]}}class Tn{static setupStorage(t,e,i,n,s){const r=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",(t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of i.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})}))}}static setAttributes(t){let{html:e,element:i,storage:n=null,intent:s,linkService:r}=t;const{attributes:a}=i,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${s}`);for(const[l,h]of Object.entries(a))if(null!==h&&void 0!==h)switch(l){case"class":h.length&&e.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",h);break;case"style":Object.assign(e.style,h);break;case"textContent":e.textContent=h;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,h)}o&&r.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:s,linkService:i});const a="richText"!==s,o=t.div;if(o.append(r),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);r.append(t),a&&nn.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const h=[[n,-1,r]];for(;h.length>0;){const[t,n,r]=h.at(-1);if(n+1===t.children.length){h.pop();continue}const o=t.children[++h.at(-1)[1]];if(null===o)continue;const{name:c}=o;if("#text"===c){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const d=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,c):document.createElement(c);if(r.append(d),o.attributes&&this.setAttributes({html:d,element:o,storage:e,intent:s,linkService:i}),o.children?.length>0)h.push([o,-1,d]);else if(o.value){const t=document.createTextNode(o.value);a&&nn.shouldBuildText(c)&&l.push(t),d.append(t)}}for(const c of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))c.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const kn=1e3,Pn=new WeakSet;function Rn(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Ln{static create(t){switch(t.data.annotationType){case T:return new Fn(t);case M:return new Dn(t);case U:switch(t.data.fieldType){case"Tx":return new Nn(t);case"Btn":return t.data.radioButton?new Hn(t):t.data.checkBox?new Bn(t):new jn(t);case"Ch":return new Vn(t);case"Sig":return new zn(t)}return new On(t);case V:return new $n(t);case k:return new Wn(t);case P:return new Gn(t);case R:return new qn(t);case L:return new Xn(t);case F:return new Kn(t);case H:return new Qn(t);case j:return new Jn(t);case I:return new Yn(t);case D:return new Zn(t);case O:return new ts(t);case N:return new es(t);case z:return new is(t);case B:return new ns(t);case $:return new ss(t);default:return new In(t)}}}class In{#nn=null;#sn=!1;#rn=null;constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:i,richText:n}=t;return!!(e?.str||i?.str||n?.str)}get hasPopupData(){return In._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#nn||={rect:this.data.rect.slice(0)};const{rect:e}=t;e&&this.#an(e),this.#rn?.popup.updateEdited(t)}resetEdited(){this.#nn&&(this.#an(this.#nn.rect),this.#rn?.popup.resetEdited(),this.#nn=null)}#an(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;i?.splice(0,4,...t);const{width:l,height:h}=Rn(t);e.left=100*(t[0]-a)/s+"%",e.top=100*(r-t[3]+o)/r+"%",0===n?(e.width=100*l/s+"%",e.height=100*h/r+"%"):this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof On||(s.tabIndex=kn);const{style:r}=s;if(r.zIndex=this.parent.zIndex++,e.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof $n){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=Rn(e.rect);if(!t&&e.borderStyle.width>0){r.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;r.borderRadius=e}else if(this instanceof Hn){const t=`calc(${a}px * var(--scale-factor)) / calc(${o}px * var(--scale-factor))`;r.borderRadius=t}switch(e.borderStyle.style){case W:r.borderStyle="solid";break;case G:r.borderStyle="dashed";break;case q:st("Unimplemented border style: beveled");break;case X:st("Unimplemented border style: inset");break;case K:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?(this.#sn=!0,r.borderColor=xt.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=xt.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:c,pageX:d,pageY:u}=n.rawDims;r.left=100*(l[0]-d)/h+"%",r.top=100*(l[1]-u)/c+"%";const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width=100*a/h+"%",r.height=100*o/c+"%"):this.setRotation(p,s),s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:r}=Rn(this.data.rect);let a,o;t%180===0?(a=100*s/i,o=100*r/n):(a=100*r/i,o=100*s/n),e.style.width=`${a}%`,e.style.height=`${o}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],r=n.slice(1);i.target.style[e]=Mn[`${s}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[e]:Mn[`${s}_rgb`](r)})};return lt(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];s?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const r=i[n];if(r){r({detail:{[n]:s},target:t}),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,s]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[r,a,o,l]=t.subarray(2,6);if(n===r&&s===a&&e===o&&i===l)return}const{style:r}=this.container;let a;if(this.#sn){const{borderColor:t,borderWidth:e}=r;r.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:h}=this,c=h.createElement("svg");c.classList.add("quadrilateralsContainer"),c.setAttribute("width",0),c.setAttribute("height",0);const d=h.createElement("defs");c.append(d);const u=h.createElement("clipPath"),p=`clippath_${this.data.id}`;u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let g=2,f=t.length;g<f;g+=8){const i=t[g],n=t[g+1],r=t[g+2],c=t[g+3],d=h.createElement("rect"),p=(r-e)/o,f=(s-n)/l,m=(i-r)/o,v=(n-c)/l;d.setAttribute("x",p),d.setAttribute("y",f),d.setAttribute("width",m),d.setAttribute("height",v),u.append(d),a?.push(`<rect vector-effect="non-scaling-stroke" x="${p}" y="${f}" width="${m}" height="${v}"/>`)}this.#sn&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(c),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=this.#rn=new $n({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){rt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:r}of n){if(-1===t)continue;if(s===e)continue;const n="string"===typeof r?r:null,a=document.querySelector(`[data-element-id="${s}"]`);!a||Pn.has(a)?i.push({id:s,exportValue:n,domElement:a}):st(`_getElementsByName - element not allowed: ${s}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(Pn.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}class Fn extends In{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(this.#on(i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(this.#ln(i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}#hn(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#hn()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#hn()}#on(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#hn()}#ln(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#hn()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1))}t.onclick||(t.onclick=()=>!1),this.#hn()}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#hn(),!this._fieldObjects)return st('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{i?.();const{fields:t,refs:n,include:s}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&r.push(i)}else for(const e of Object.values(this._fieldObjects))r.push(...e);const a=this.annotationStorage,o=[];for(const e of r){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;a.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${t}"]`);i&&(Pn.has(i)?i.dispatchEvent(new Event("resetform")):st(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}}class Dn extends In{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class On extends In{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return wt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(i,(t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}})}))}_setEventListeners(t,e,i,n){for(const[s,r]of i)("Action"===r||this.data.actions?.[r])&&("Focus"!==r&&"Blur"!==r||(e||={focused:!1}),this._setEventListener(t,e,s,r,n),"Focus"!==r||this.data.actions?.Blur?"Blur"!==r||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":xt.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let r;const a=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(l*n))||1);r=Math.min(n,a(e/l))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/l))}s.fontSize=`calc(${r}px * var(--scale-factor))`,s.color=xt.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Nn extends On{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),s.setValue(r.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let s=n.value||"";const r=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;r&&s.length>r&&(s=s.slice(0,r));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:s,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=a??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",a??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Pn.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=kn,this._setRequired(i,this.data.required),r&&(i.maxLength=r),i.addEventListener("input",(n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),o.formattedValue=null})),i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e,o.formattedValue=null}));let l=t=>{const{formattedValue:e}=o;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",(t=>{if(o.focused)return;const{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)})),i.addEventListener("updatefromsandbox",(i=>{this.showElementAndHideCanvas(i.target);const n={value(i){o.userValue=i.detail.value??"",t.setValue(e,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:s}=i;if(0===n)return void s.removeAttribute("maxLength");s.setAttribute("maxLength",n);let r=o.userValue;!r||r.length<=n||(r=r.slice(0,n),s.value=o.userValue=r,t.setValue(e,{value:r}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)})),i.addEventListener("keydown",(t=>{o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;const{value:n}=t.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const n=l;l=null,i.addEventListener("blur",(t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{value:i}=t.target;o.userValue=i,o.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),n(t)})),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",(t=>{o.lastCommittedValue=null;const{data:i,target:n}=t,{value:s,selectionStart:r,selectionEnd:a}=n;let l=r,h=a;switch(t.inputType){case"deleteWordBackward":{const t=s.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=s.substring(r).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":r===a&&(l-=1);break;case"deleteContentForward":r===a&&(h+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:i||"",willCommit:!1,selStart:l,selEnd:h}})})),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(l&&i.addEventListener("blur",l),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/r;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class zn extends On{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Bn extends On{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"===typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return Pn.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=kn,s.addEventListener("change",(n=>{const{name:s,checked:r}=n.target;for(const a of this._getElementsByName(s,i)){const i=r&&a.exportValue===e.exportValue;a.domElement&&(a.domElement.checked=i),t.setValue(a.id,{value:i})}t.setValue(i,{value:r})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue})),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",(e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Hn extends On{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"===typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});const s=document.createElement("input");if(Pn.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=kn,s.addEventListener("change",(e=>{const{name:n,checked:s}=e.target;for(const r of this._getElementsByName(n,i))t.setValue(r.id,{value:!1});t.setValue(i,{value:s})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==i&&i===e.buttonValue})),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class jn extends Fn{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class Vn extends On{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");Pn.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=kn;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const i of n.options)i.selected=i.value===e}));for(const h of this.data.options){const t=document.createElement("option");t.textContent=h.displayValue,t.value=h.exportValue,i.value.includes(h.exportValue)&&(t.setAttribute("selected",!0),s=!1),n.append(t)}let r=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),r=()=>{t.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[e])):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=a(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(i=>{const s={value(i){r?.();const s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(const t of n.options)t.selected=l.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,r=i.detail.remove;if(s[r].selected=!1,n.remove(r),s.length>0){-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0)}t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){const{index:s,displayValue:r,exportValue:h}=i.detail.insert,c=n.children[s],d=document.createElement("option");d.textContent=r,d.value=h,c?c.before(d):n.append(d),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)})),n.addEventListener("input",(i=>{const n=a(!0),s=a(!1);t.setValue(e,{value:n}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:s,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):n.addEventListener("input",(function(i){t.setValue(e,{value:a(!0)})})),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class $n extends In{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:In._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Un({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>`${St}${t}`)).join(",")),this.container}}class Un{#cn=this.#dn.bind(this);#un=this.#pn.bind(this);#gn=this.#fn.bind(this);#mn=this.#vn.bind(this);#bn=null;#mt=null;#yn=null;#wn=null;#An=null;#xn=null;#_n=null;#En=!1;#Cn=null;#E=null;#Sn=null;#Mn=null;#Tn=null;#nn=null;#kn=!1;constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:h,parentRect:c,open:d}=t;this.#mt=e,this.#Tn=s,this.#yn=a,this.#Mn=o,this.#xn=l,this.#bn=i,this.#Sn=h,this.#_n=c,this.#An=n,this.#wn=se.toDateObject(r),this.trigger=n.flatMap((t=>t.getElementsToTriggerPopup()));for(const u of this.trigger)u.addEventListener("click",this.#mn),u.addEventListener("mouseenter",this.#gn),u.addEventListener("mouseleave",this.#un),u.classList.add("popupTriggerArea");for(const u of n)u.container?.addEventListener("keydown",this.#cn);this.#mt.hidden=!0,d&&this.#vn()}render(){if(this.#Cn)return;const t=this.#Cn=document.createElement("div");if(t.className="popup",this.#bn){const e=t.style.outlineColor=xt.makeHexColor(...this.#bn);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`;else{const e=.7;t.style.backgroundColor=xt.makeHexColor(...this.#bn.map((t=>Math.floor(e*(255-t)+t))))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=this.#Tn),t.append(e),this.#wn){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:this.#wn.toLocaleDateString(),time:this.#wn.toLocaleTimeString()})),e.append(t)}const n=this.#Pn;if(n)Tn.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(this.#yn);t.append(e)}this.#mt.append(t)}get#Pn(){const t=this.#Mn,e=this.#yn;return!t?.str||e?.str&&e.str!==t.str?null:this.#Mn.html||null}get#Rn(){return this.#Pn?.attributes?.style?.fontSize||0}get#Ln(){return this.#Pn?.attributes?.style?.color||null}#In(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#Ln,fontSize:this.#Rn?`calc(${this.#Rn}px * var(--scale-factor))`:""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}_formatContents(t){let{str:e,dir:i}=t;const n=document.createElement("p");n.classList.add("popupContent"),n.dir=i;const s=e.split(/(?:\r\n?|\n)/);for(let r=0,a=s.length;r<a;++r){const t=s[r];n.append(document.createTextNode(t)),r<a-1&&n.append(document.createElement("br"))}return n}#dn(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#En)&&this.#vn()}updateEdited(t){let{rect:e,popupContent:i}=t;this.#nn||={contentsObj:this.#yn,richText:this.#Mn},e&&(this.#E=null),i&&(this.#Mn=this.#In(i),this.#yn=null),this.#Cn?.remove(),this.#Cn=null}resetEdited(){this.#nn&&(({contentsObj:this.#yn,richText:this.#Mn}=this.#nn),this.#nn=null,this.#Cn?.remove(),this.#Cn=null,this.#E=null)}#Fn(){if(null!==this.#E)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=this.#xn;let r=!!this.#_n,a=r?this.#_n:this.#Sn;for(const u of this.#An)if(!a||null!==xt.intersect(u.data.rect,a)){a=u.data.rect,r=!0;break}const o=xt.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=r?a[2]-a[0]+5:0,h=o[0]+l,c=o[1];this.#E=[100*(h-n)/e,100*(c-s)/i];const{style:d}=this.#mt;d.left=`${this.#E[0]}%`,d.top=`${this.#E[1]}%`}#vn(){this.#En=!this.#En,this.#En?(this.#fn(),this.#mt.addEventListener("click",this.#mn),this.#mt.addEventListener("keydown",this.#cn)):(this.#pn(),this.#mt.removeEventListener("click",this.#mn),this.#mt.removeEventListener("keydown",this.#cn))}#fn(){this.#Cn||this.render(),this.isVisible?this.#En&&this.#mt.classList.add("focused"):(this.#Fn(),this.#mt.hidden=!1,this.#mt.style.zIndex=parseInt(this.#mt.style.zIndex)+1e3)}#pn(){this.#mt.classList.remove("focused"),!this.#En&&this.isVisible&&(this.#mt.hidden=!0,this.#mt.style.zIndex=parseInt(this.#mt.style.zIndex)-1e3)}forceHide(){this.#kn=this.isVisible,this.#kn&&(this.#mt.hidden=!0)}maybeShow(){this.#kn&&(this.#Cn||this.#fn(),this.#kn=!1,this.#mt.hidden=!1)}get isVisible(){return!1===this.#mt.hidden}}class Wn extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=v.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class Gn extends In{#Dn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=Rn(t.rect),n=this.svgFactory.create(e,i,!0),s=this.#Dn=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Dn}addHighlightArea(){this.container.classList.add("highlightArea")}}class qn extends In{#On=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=Rn(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#On=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",s/2),r.setAttribute("y",s/2),r.setAttribute("width",e-s),r.setAttribute("height",i-s),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#On}addHighlightArea(){this.container.classList.add("highlightArea")}}class Xn extends In{#Nn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=Rn(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#Nn=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-s/2),r.setAttribute("ry",i/2-s/2),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Nn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Kn extends In{#zn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:r}=Rn(t),a=this.svgFactory.create(s,r,!0);let o=[];for(let h=0,c=e.length;h<c;h+=2){const i=e[h]-t[0],n=t[3]-e[h+1];o.push(`${i},${n}`)}o=o.join(" ");const l=this.#zn=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#zn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Yn extends Kn{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Qn extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class Jn extends In{#Bn=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=v.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:r}=Rn(t),a=this.svgFactory.create(s,r,!0);for(const o of e){let e=[];for(let i=0,n=o.length;i<n;i+=2){const n=o[i]-t[0],s=t[3]-o[i+1];e.push(`${n},${s}`)}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);this.#Bn.push(s),s.setAttribute("points",e),s.setAttribute("stroke-width",i.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!n&&this.hasPopupData&&this._createPopup(),a.append(s)}return this.container.append(a),this.container}getElementsToTriggerPopup(){return this.#Bn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Zn extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ts extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class es extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class is extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class ns extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class ss extends In{#Hn=null;constructor(t){super(t,{isRenderable:!0});const{file:e}=this.data;this.filename=e.filename,this.content=e.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...e})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#jn.bind(this)),this.#Hn=i;const{isMac:n}=wt.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#jn()})),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#Hn}addHighlightArea(){this.container.classList.add("highlightArea")}#jn(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class rs{#Vn=null;#$n=null;#Un=(()=>new Map)();constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:a}=t;this.div=e,this.#Vn=i,this.#$n=n,this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}#Wn(t,e){const i=t.firstChild||t;i.id=`${St}${e}`,this.div.append(t),this.#Vn?.moveElementInDOM(this.div,t,i,!1)}async render(t){const{annotations:e}=t,i=this.div;he(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Gt,annotationStorage:t.annotationStorage||new Me,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const r of e){if(r.noHTML)continue;const t=r.annotationType===V;if(t){const t=n.get(r.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=Rn(r.rect);if(t<=0||e<=0)continue}s.data=r;const e=Ln.create(s);if(!e.isRenderable)continue;if(!t&&r.popupRef){const t=n.get(r.popupRef);t?t.push(e):n.set(r.popupRef,[e])}const i=e.render();r.hidden&&(i.style.visibility="hidden"),this.#Wn(i,r.id),e.annotationEditorType>0&&(this.#Un.set(e.data.id,e),this._annotationEditorUIManager?.renderAnnotationElement(e))}this.#Gn()}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,he(i,{rotation:e.rotation}),this.#Gn(),i.hidden=!1}#Gn(){if(!this.#$n)return;const t=this.div;for(const[e,i]of this.#$n){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}this.#$n.clear()}getEditableAnnotations(){return Array.from(this.#Un.values())}getEditableAnnotation(t){return this.#Un.get(t)}}const as=/\r\n?|\n/g;class os extends we{#qn=this.editorDivBlur.bind(this);#Xn=this.editorDivFocus.bind(this);#Kn=this.editorDivInput.bind(this);#Yn=this.editorDivKeydown.bind(this);#Qn=this.editorDivPaste.bind(this);#bn;#Jn="";#Zn=`${this.id}-editor`;#Rn;#ts=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=os.prototype,e=t=>t.isEmpty(),i=be.TRANSLATE_SMALL,n=be.TRANSLATE_BIG;return lt(this,"_keyboardManager",new me([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}static _type="freetext";static _editorType=(()=>v.FREETEXT)();constructor(t){super({...t,name:"freeTextEditor"}),this.#bn=t.color||os._defaultColor||we._defaultLineColor,this.#Rn=t.fontSize||os._defaultFontSize}static initialize(t,e){we.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case b.FREETEXT_SIZE:os._defaultFontSize=e;break;case b.FREETEXT_COLOR:os._defaultColor=e}}updateParams(t,e){switch(t){case b.FREETEXT_SIZE:this.#es(e);break;case b.FREETEXT_COLOR:this.#is(e)}}static get defaultPropertiesToUpdate(){return[[b.FREETEXT_SIZE,os._defaultFontSize],[b.FREETEXT_COLOR,os._defaultColor||we._defaultLineColor]]}get propertiesToUpdate(){return[[b.FREETEXT_SIZE,this.#Rn],[b.FREETEXT_COLOR,this.#bn]]}#es(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#Rn)*this.parentScale),this.#Rn=t,this.#ns()},i=this.#Rn;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#is(t){const e=t=>{this.#bn=this.editorDiv.style.color=t},i=this.#bn;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-os._internalPadding*t,-(os._internalPadding+this.#Rn)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(v.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",this.#Yn,{signal:t}),this.editorDiv.addEventListener("focus",this.#Xn,{signal:t}),this.editorDiv.addEventListener("blur",this.#qn,{signal:t}),this.editorDiv.addEventListener("input",this.#Kn,{signal:t}),this.editorDiv.addEventListener("paste",this.#Qn,{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Zn),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#Yn),this.editorDiv.removeEventListener("focus",this.#Xn),this.editorDiv.removeEventListener("blur",this.#qn),this.editorDiv.removeEventListener("input",this.#Kn),this.editorDiv.removeEventListener("paste",this.#Qn),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#ss(){const t=[];this.editorDiv.normalize();for(const e of this.editorDiv.childNodes)t.push(os.#rs(e));return t.join("\n")}#ns(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#Jn,e=this.#Jn=this.#ss().trimEnd();if(t===e)return;const i=t=>{this.#Jn=t,t?(this.#as(),this._uiManager.rebuild(this),this.#ns()):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#ns()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){os._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Zn),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),we._l10nPromise.get("pdfjs-free-text-default-content").then((t=>this.editorDiv?.setAttribute("default-content",t))),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#Rn}px * var(--scale-factor))`,i.color=this.#bn,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),ue(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this.#ts;let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[h,c]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-h)/o,u=e+this.height-(s[1]-c)/l;break;case 90:d=t+(s[0]-h)/o,u=e-(s[1]-c)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-h)/o,u=e-(s[1]-c)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-h-this.height*l)/o,u=e+(s[1]-c-this.width*o)/l,[r,a]=[-a,r]}this.setAt(d*i,u*n,r,a)}else this.setAt(t*i,e*n,this.width*i,this.height*n);this.#as(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#rs(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(as,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=os.#os(e.getData("text")||"").replaceAll(as,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const r=s.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:a,startOffset:o}=r,l=[],h=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(h.push(a.nodeValue.slice(o).replaceAll(as,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(os.#rs(i)):e=h}l.push(a.nodeValue.slice(0,o).replaceAll(as,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=h),t.push(os.#rs(i))}this.#Jn=`${l.join("\n")}${n}${h.join("\n")}`,this.#as();const c=new Range;let d=l.reduce(((t,e)=>t+e.length),0);for(const{firstChild:u}of this.editorDiv.childNodes)if(u.nodeType===Node.TEXT_NODE){const t=u.nodeValue.length;if(d<=t){c.setStart(u,d),c.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(c)}#as(){if(this.editorDiv.replaceChildren(),this.#Jn)for(const t of this.#Jn.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#ls(){return this.#Jn.replaceAll("\xa0"," ")}static#os(t){return t.replaceAll(" ","\xa0")}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let n=null;if(t instanceof Wn){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a},textContent:o,textPosition:l,parent:{page:{pageNumber:h}}}=t;if(!o||0===o.length)return null;n=t={annotationType:v.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:h-1,rect:s.slice(0),rotation:r,id:a,deleted:!1}}const s=super.deserialize(t,e,i);return s.#Rn=t.fontSize,s.#bn=xt.makeHexColor(...t.color),s.#Jn=os.#os(t.value),s.annotationElementId=t.id||null,s.#ts=n,s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=os._internalPadding*this.parentScale,i=this.getRect(e,e),n=we._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#bn),s={annotationType:v.FREETEXT,color:n,fontSize:this.#Rn,value:this.#ls(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!this.#hs(s)?null:(s.id=this.annotationElementId,s)}#hs(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this.#ts;return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some(((t,e)=>t!==n[e]))||t.pageIndex!==s}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${this.#Rn}px * var(--scale-factor))`,i.color=this.#bn,e.replaceChildren();for(const s of this.#Jn.split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=os._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:this.#Jn}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class ls{#cs;#ds=[];#us=[];constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=1/0,r=-1/0,a=1/0,o=-1/0;const l=10**-4;for(const{x:f,y:m,width:v,height:b}of t){const t=Math.floor((f-e)/l)*l,i=Math.ceil((f+v+e)/l)*l,n=Math.floor((m-e)/l)*l,h=Math.ceil((m+b+e)/l)*l,c=[t,n,h,!0],d=[i,n,h,!1];this.#ds.push(c,d),s=Math.min(s,t),r=Math.max(r,i),a=Math.min(a,n),o=Math.max(o,h)}const h=r-s+2*i,c=o-a+2*i,d=s-i,u=a-i,p=this.#ds.at(n?-1:-2),g=[p[0],p[2]];for(const f of this.#ds){const[t,e,i]=f;f[0]=(t-d)/h,f[1]=(e-u)/c,f[2]=(i-u)/c}this.#cs={x:d,y:u,width:h,height:c,lastPoint:g}}getOutlines(){this.#ds.sort(((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]));const t=[];for(const e of this.#ds)e[3]?(t.push(...this.#ps(e)),this.#gs(e)):(this.#fs(e),t.push(...this.#ps(e)));return this.#ms(t)}#ms(t){const e=[],i=new Set;for(const r of t){const[t,i,n]=r;e.push([t,i,r],[t,n,r])}e.sort(((t,e)=>t[1]-e[1]||t[0]-e[0]));for(let r=0,a=e.length;r<a;r+=2){const t=e[r][2],n=e[r+1][2];t.push(n),n.push(t),i.add(t),i.add(n)}const n=[];let s;for(;i.size>0;){const t=i.values().next().value;let[e,r,a,o,l]=t;i.delete(t);let h=e,c=r;for(s=[e,a],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,r,a,o,l]=t,h!==e&&(s.push(h,c,e,c===r?r:a),h=e),c=c===r?a:r}s.push(h,c)}return new cs(n,this.#cs)}#vs(t){const e=this.#us;let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,r=e[s][0];if(r===t)return s;r<t?i=s+1:n=s-1}return n+1}#gs(t){let[,e,i]=t;const n=this.#vs(e);this.#us.splice(n,0,[e,i])}#fs(t){let[,e,i]=t;const n=this.#vs(e);for(let s=n;s<this.#us.length;s++){const[t,n]=this.#us[s];if(t!==e)break;if(t===e&&n===i)return void this.#us.splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=this.#us[s];if(t!==e)break;if(t===e&&n===i)return void this.#us.splice(s,1)}}#ps(t){const[e,i,n]=t,s=[[e,i,n]],r=this.#vs(n);for(let a=0;a<r;a++){const[t,i]=this.#us[a];for(let n=0,r=s.length;n<r;n++){const[,a,o]=s[n];if(!(i<=a||o<=t))if(a>=t)if(o>i)s[n][1]=i;else{if(1===r)return[];s.splice(n,1),n--,r--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}}class hs{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof us}}class cs extends hs{#cs;#bs;constructor(t,e){super(),this.#bs=t,this.#cs=e}toSVGPath(){const t=[];for(const e of this.#bs){let[i,n]=e;t.push(`M${i} ${n}`);for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push(`V${a}`),n=a):a===n&&(t.push(`H${r}`),i=r)}t.push("Z")}return t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=s-i,l=r-n;for(const h of this.#bs){const t=new Array(h.length);for(let e=0;e<h.length;e+=2)t[e]=i+h[e]*o,t[e+1]=r-h[e+1]*l;a.push(t)}return a}get box(){return this.#cs}}class ds{#cs;#ys=[];#ws;#As;#xs=[];#_s=(()=>new Float64Array(18))();#Es;#Cs;#Ss;#Ms;#Ts;#ks;#Ps=[];static#Rs=8;static#Ls=2;static#Is=(()=>ds.#Rs+ds.#Ls)();constructor(t,e,i,n,s){let{x:r,y:a}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.#cs=e,this.#ks=n*i,this.#As=s,this.#_s.set([NaN,NaN,NaN,NaN,r,a],6),this.#ws=o,this.#Ms=ds.#Rs*i,this.#Ss=ds.#Is*i,this.#Ts=i,this.#Ps.push(r,a)}get free(){return!0}isEmpty(){return isNaN(this.#_s[8])}#Fs(){const t=this.#_s.subarray(4,6),e=this.#_s.subarray(16,18),[i,n,s,r]=this.#cs;return[(this.#Es+(t[0]-e[0])/2-i)/s,(this.#Cs+(t[1]-e[1])/2-n)/r,(this.#Es+(e[0]-t[0])/2-i)/s,(this.#Cs+(e[1]-t[1])/2-n)/r]}add(t){let{x:e,y:i}=t;this.#Es=e,this.#Cs=i;const[n,s,r,a]=this.#cs;let[o,l,h,c]=this.#_s.subarray(8,12);const d=e-h,u=i-c,p=Math.hypot(d,u);if(p<this.#Ss)return!1;const g=p-this.#Ms,f=g/p,m=f*d,v=f*u;let b=o,y=l;o=h,l=c,h+=m,c+=v,this.#Ps?.push(e,i);const w=m/g,A=-v/g*this.#ks,x=w*this.#ks;if(this.#_s.set(this.#_s.subarray(2,8),0),this.#_s.set([h+A,c+x],4),this.#_s.set(this.#_s.subarray(14,18),12),this.#_s.set([h-A,c-x],16),isNaN(this.#_s[6]))return 0===this.#xs.length&&(this.#_s.set([o+A,l+x],2),this.#xs.push(NaN,NaN,NaN,NaN,(o+A-n)/r,(l+x-s)/a),this.#_s.set([o-A,l-x],14),this.#ys.push(NaN,NaN,NaN,NaN,(o-A-n)/r,(l-x-s)/a)),this.#_s.set([b,y,o,l,h,c],6),!this.isEmpty();this.#_s.set([b,y,o,l,h,c],6);return Math.abs(Math.atan2(y-l,b-o)-Math.atan2(v,m))<Math.PI/2?([o,l,h,c]=this.#_s.subarray(2,6),this.#xs.push(NaN,NaN,NaN,NaN,((o+h)/2-n)/r,((l+c)/2-s)/a),[o,l,b,y]=this.#_s.subarray(14,18),this.#ys.push(NaN,NaN,NaN,NaN,((b+o)/2-n)/r,((y+l)/2-s)/a),!0):([b,y,o,l,h,c]=this.#_s.subarray(0,6),this.#xs.push(((b+5*o)/6-n)/r,((y+5*l)/6-s)/a,((5*o+h)/6-n)/r,((5*l+c)/6-s)/a,((o+h)/2-n)/r,((l+c)/2-s)/a),[h,c,o,l,b,y]=this.#_s.subarray(12,18),this.#ys.push(((b+5*o)/6-n)/r,((y+5*l)/6-s)/a,((5*o+h)/6-n)/r,((5*l+c)/6-s)/a,((o+h)/2-n)/r,((l+c)/2-s)/a),!0)}toSVGPath(){if(this.isEmpty())return"";const t=this.#xs,e=this.#ys,i=this.#_s.subarray(4,6),n=this.#_s.subarray(16,18),[s,r,a,o]=this.#cs,[l,h,c,d]=this.#Fs();if(isNaN(this.#_s[6])&&!this.isEmpty())return`M${(this.#_s[2]-s)/a} ${(this.#_s[3]-r)/o} L${(this.#_s[4]-s)/a} ${(this.#_s[5]-r)/o} L${l} ${h} L${c} ${d} L${(this.#_s[16]-s)/a} ${(this.#_s[17]-r)/o} L${(this.#_s[14]-s)/a} ${(this.#_s[15]-r)/o} Z`;const u=[];u.push(`M${t[4]} ${t[5]}`);for(let p=6;p<t.length;p+=6)isNaN(t[p])?u.push(`L${t[p+4]} ${t[p+5]}`):u.push(`C${t[p]} ${t[p+1]} ${t[p+2]} ${t[p+3]} ${t[p+4]} ${t[p+5]}`);u.push(`L${(i[0]-s)/a} ${(i[1]-r)/o} L${l} ${h} L${c} ${d} L${(n[0]-s)/a} ${(n[1]-r)/o}`);for(let p=e.length-6;p>=6;p-=6)isNaN(e[p])?u.push(`L${e[p+4]} ${e[p+5]}`):u.push(`C${e[p]} ${e[p+1]} ${e[p+2]} ${e[p+3]} ${e[p+4]} ${e[p+5]}`);return u.push(`L${e[4]} ${e[5]} Z`),u.join(" ")}getOutlines(){const t=this.#xs,e=this.#ys,i=this.#_s,n=i.subarray(4,6),s=i.subarray(16,18),[r,a,o,l]=this.#cs,h=new Float64Array((this.#Ps?.length??0)+2);for(let m=0,v=h.length-2;m<v;m+=2)h[m]=(this.#Ps[m]-r)/o,h[m+1]=(this.#Ps[m+1]-a)/l;h[h.length-2]=(this.#Es-r)/o,h[h.length-1]=(this.#Cs-a)/l;const[c,d,u,p]=this.#Fs();if(isNaN(i[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(i[2]-r)/o,(i[3]-a)/l,NaN,NaN,NaN,NaN,(i[4]-r)/o,(i[5]-a)/l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,(i[16]-r)/o,(i[17]-a)/l,NaN,NaN,NaN,NaN,(i[14]-r)/o,(i[15]-a)/l],0),new us(t,h,this.#cs,this.#Ts,this.#ws,this.#As)}const g=new Float64Array(this.#xs.length+24+this.#ys.length);let f=t.length;for(let m=0;m<f;m+=2)isNaN(t[m])?g[m]=g[m+1]=NaN:(g[m]=t[m],g[m+1]=t[m+1]);g.set([NaN,NaN,NaN,NaN,(n[0]-r)/o,(n[1]-a)/l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,(s[0]-r)/o,(s[1]-a)/l],f),f+=24;for(let m=e.length-6;m>=6;m-=6)for(let t=0;t<6;t+=2)isNaN(e[m+t])?(g[f]=g[f+1]=NaN,f+=2):(g[f]=e[m+t],g[f+1]=e[m+t+1],f+=2);return g.set([NaN,NaN,NaN,NaN,e[4],e[5]],f),new us(g,h,this.#cs,this.#Ts,this.#ws,this.#As)}}class us extends hs{#cs;#Ds=null;#ws;#As;#Ps;#Ts;#Os;constructor(t,e,i,n,s,r){super(),this.#Os=t,this.#Ps=e,this.#cs=i,this.#Ts=n,this.#ws=s,this.#As=r,this.#Ns(r);const{x:a,y:o,width:l,height:h}=this.#Ds;for(let c=0,d=t.length;c<d;c+=2)t[c]=(t[c]-a)/l,t[c+1]=(t[c+1]-o)/h;for(let c=0,d=e.length;c<d;c+=2)e[c]=(e[c]-a)/l,e[c+1]=(e[c+1]-o)/h}toSVGPath(){const t=[`M${this.#Os[4]} ${this.#Os[5]}`];for(let e=6,i=this.#Os.length;e<i;e+=6)isNaN(this.#Os[e])?t.push(`L${this.#Os[e+4]} ${this.#Os[e+5]}`):t.push(`C${this.#Os[e]} ${this.#Os[e+1]} ${this.#Os[e+2]} ${this.#Os[e+3]} ${this.#Os[e+4]} ${this.#Os[e+5]}`);return t.push("Z"),t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=s-i,o=r-n;let l,h;switch(e){case 0:l=this.#zs(this.#Os,i,r,a,-o),h=this.#zs(this.#Ps,i,r,a,-o);break;case 90:l=this.#Bs(this.#Os,i,n,a,o),h=this.#Bs(this.#Ps,i,n,a,o);break;case 180:l=this.#zs(this.#Os,s,n,-a,o),h=this.#zs(this.#Ps,s,n,-a,o);break;case 270:l=this.#Bs(this.#Os,s,r,-a,-o),h=this.#Bs(this.#Ps,s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(h)]}}#zs(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a]*n,r[a+1]=i+t[a+1]*s;return r}#Bs(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a+1]*n,r[a+1]=i+t[a]*s;return r}#Ns(t){const e=this.#Os;let i=e[4],n=e[5],s=i,r=n,a=i,o=n,l=i,h=n;const c=t?Math.max:Math.min;for(let f=6,m=e.length;f<m;f+=6){if(isNaN(e[f]))s=Math.min(s,e[f+4]),r=Math.min(r,e[f+5]),a=Math.max(a,e[f+4]),o=Math.max(o,e[f+5]),h<e[f+5]?(l=e[f+4],h=e[f+5]):h===e[f+5]&&(l=c(l,e[f+4]));else{const t=xt.bezierBoundingBox(i,n,...e.slice(f,f+6));s=Math.min(s,t[0]),r=Math.min(r,t[1]),a=Math.max(a,t[2]),o=Math.max(o,t[3]),h<t[3]?(l=t[2],h=t[3]):h===t[3]&&(l=c(l,t[2]))}i=e[f+4],n=e[f+5]}const d=s-this.#ws,u=r-this.#ws,p=a-s+2*this.#ws,g=o-r+2*this.#ws;this.#Ds={x:d,y:u,width:p,height:g,lastPoint:[l,h]}}get box(){return this.#Ds}getNewOutline(t,e){const{x:i,y:n,width:s,height:r}=this.#Ds,[a,o,l,h]=this.#cs,c=s*l,d=r*h,u=i*l+a,p=n*h+o,g=new ds({x:this.#Ps[0]*c+u,y:this.#Ps[1]*d+p},this.#cs,this.#Ts,t,this.#As,e??this.#ws);for(let f=2;f<this.#Ps.length;f+=2)g.add({x:this.#Ps[f]*c+u,y:this.#Ps[f+1]*d+p});return g.getOutlines()}}class ps{#cn=this.#dn.bind(this);#Hs=this.#o.bind(this);#js=null;#Vs=null;#$s;#Us=null;#Ws=!1;#Gs=!1;#r=null;#qs;#p=null;#Xs;static get _keyboardManager(){return lt(this,"_keyboardManager",new me([[["Escape","mac+Escape"],ps.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ps.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ps.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ps.prototype._moveToPrevious],[["Home","mac+Home"],ps.prototype._moveToBeginning],[["End","mac+End"],ps.prototype._moveToEnd]]))}constructor(t){let{editor:e=null,uiManager:i=null}=t;e?(this.#Gs=!1,this.#Xs=b.HIGHLIGHT_COLOR,this.#r=e):(this.#Gs=!0,this.#Xs=b.HIGHLIGHT_DEFAULT_COLOR),this.#p=e?._uiManager||i,this.#qs=this.#p._eventBus,this.#$s=e?.color||this.#p?.highlightColors.values().next().value||"#FFFF98"}renderButton(){const t=this.#js=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=this.#p._signal;t.addEventListener("click",this.#Ks.bind(this),{signal:e}),t.addEventListener("keydown",this.#cn,{signal:e});const i=this.#Vs=document.createElement("span");return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=this.#$s,t.append(i),t}renderMainDropdown(){const t=this.#Us=this.#Ys();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#Ys(){const t=document.createElement("div"),e=this.#p._signal;t.addEventListener("contextmenu",ee,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of this.#p.highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${i}`);const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.setAttribute("aria-selected",n===this.#$s),s.addEventListener("click",this.#Qs.bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",this.#cn,{signal:e}),t}#Qs(t,e){e.stopPropagation(),this.#qs.dispatch("switchannotationeditorparams",{source:this,type:this.#Xs,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#js)return void this.#Ks(t);const e=t.target.getAttribute("data-color");e&&this.#Qs(e,t)}_moveToNext(t){this.#Js?t.target!==this.#js?t.target.nextSibling?.focus():this.#Us.firstChild?.focus():this.#Ks(t)}_moveToPrevious(t){t.target!==this.#Us?.firstChild&&t.target!==this.#js?(this.#Js||this.#Ks(t),t.target.previousSibling?.focus()):this.#Js&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#Js?this.#Us.firstChild?.focus():this.#Ks(t)}_moveToEnd(t){this.#Js?this.#Us.lastChild?.focus():this.#Ks(t)}#dn(t){ps._keyboardManager.exec(this,t)}#Ks(t){if(this.#Js)return void this.hideDropdown();if(this.#Ws=0===t.detail,window.addEventListener("pointerdown",this.#Hs,{signal:this.#p._signal}),this.#Us)return void this.#Us.classList.remove("hidden");const e=this.#Us=this.#Ys();this.#js.append(e)}#o(t){this.#Us?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#Us?.classList.add("hidden"),window.removeEventListener("pointerdown",this.#Hs)}get#Js(){return this.#Us&&!this.#Us.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#Gs||(this.#Js?(this.hideDropdown(),this.#js.focus({preventScroll:!0,focusVisible:this.#Ws})):this.#r?.unselect())}updateColor(t){if(this.#Vs&&(this.#Vs.style.backgroundColor=t),!this.#Us)return;const e=this.#p.highlightColors.values();for(const i of this.#Us.children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){this.#js?.remove(),this.#js=null,this.#Vs=null,this.#Us?.remove(),this.#Us=null}}class gs extends we{#Zs=null;#tr=0;#er;#ir=null;#s=null;#nr=null;#sr=null;#rr=0;#ar=null;#or=null;#v=null;#lr=!1;#ot=this.#hr.bind(this);#cr=null;#dr;#ur=null;#pr="";#ks;#gr="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _l10nPromise;static _type="highlight";static _editorType=(()=>v.HIGHLIGHT)();static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=gs.prototype;return lt(this,"_keyboardManager",new me([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||gs._defaultColor,this.#ks=t.thickness||gs._defaultThickness,this.#dr=t.opacity||gs._defaultOpacity,this.#er=t.boxes||null,this.#gr=t.methodOfCreation||"",this.#pr=t.text||"",this._isDraggable=!1,t.highlightId>-1?(this.#lr=!0,this.#fr(t),this.#mr()):(this.#Zs=t.anchorNode,this.#tr=t.anchorOffset,this.#sr=t.focusNode,this.#rr=t.focusOffset,this.#vr(),this.#mr(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#lr?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#ks,methodOfCreation:this.#gr}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#vr(){const t=new ls(this.#er,.001);this.#or=t.getOutlines(),({x:this.x,y:this.y,width:this.width,height:this.height}=this.#or.box);const e=new ls(this.#er,.0025,.001,"ltr"===this._uiManager.direction);this.#nr=e.getOutlines();const{lastPoint:i}=this.#nr.box;this.#cr=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#fr(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;this.#or=e;if(this.#nr=e.getNewOutline(this.#ks/2+1.5,.0025),i>=0)this.#v=i,this.#ir=n,this.parent.drawLayer.finalizeLine(i,e),this.#ur=this.parent.drawLayer.highlightOutline(this.#nr);else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#v,e),this.parent.drawLayer.updateBox(this.#v,gs.#br(this.#or.box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#ur,this.#nr),this.parent.drawLayer.updateBox(this.#ur,gs.#br(this.#nr.box,t))}const{x:s,y:r,width:a,height:o}=e.box;switch(this.rotation){case 0:this.x=s,this.y=r,this.width=a,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=r,this.y=1-s,this.width=a*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-r,this.width=a,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-r,this.y=s,this.width=a*e/t,this.height=o*t/e;break}}const{lastPoint:l}=this.#nr.box;this.#cr=[(l[0]-s)/a,(l[1]-r)/o]}static initialize(t,e){we.initialize(t,e),gs._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case b.HIGHLIGHT_DEFAULT_COLOR:gs._defaultColor=e;break;case b.HIGHLIGHT_THICKNESS:gs._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#cr}updateParams(t,e){switch(t){case b.HIGHLIGHT_COLOR:this.#is(e);break;case b.HIGHLIGHT_THICKNESS:this.#yr(e)}}static get defaultPropertiesToUpdate(){return[[b.HIGHLIGHT_DEFAULT_COLOR,gs._defaultColor],[b.HIGHLIGHT_THICKNESS,gs._defaultThickness]]}get propertiesToUpdate(){return[[b.HIGHLIGHT_COLOR,this.color||gs._defaultColor],[b.HIGHLIGHT_THICKNESS,this.#ks||gs._defaultThickness],[b.HIGHLIGHT_FREE,this.#lr]]}#is(t){const e=t=>{this.color=t,this.parent?.drawLayer.changeColor(this.#v,t),this.#s?.updateColor(t)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#yr(t){const e=this.#ks,i=t=>{this.#ks=t,this.#wr(t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(this.#s=new ps({editor:this}),t.addColorPicker(this.#s)),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#Ar())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#Ar())}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#xr(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#mr(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#xr():t&&(this.#mr(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#wr(t){if(!this.#lr)return;this.#fr({highlightOutlines:this.#or.getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}#xr(){null!==this.#v&&this.parent&&(this.parent.drawLayer.remove(this.#v),this.#v=null,this.parent.drawLayer.remove(this.#ur),this.#ur=null)}#mr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===this.#v&&(({id:this.#v,clipPathId:this.#ir}=t.drawLayer.highlight(this.#or,this.color,this.#dr)),this.#ur=t.drawLayer.highlightOutline(this.#nr),this.#ar&&(this.#ar.style.clipPath=this.#ir))}static#br(t,e){let{x:i,y:n,width:s,height:r}=t;switch(e){case 90:return{x:1-n-r,y:i,width:r,height:s};case 180:return{x:1-i-s,y:1-n-r,width:s,height:r};case 270:return{x:n,y:1-i-s,width:r,height:s}}return{x:i,y:n,width:s,height:r}}rotate(t){const{drawLayer:e}=this.parent;let i;this.#lr?(t=(t-this.rotation+360)%360,i=gs.#br(this.#or.box,t)):i=gs.#br(this,t),e.rotate(this.#v,t),e.rotate(this.#ur,t),e.updateBox(this.#v,i),e.updateBox(this.#ur,gs.#br(this.#nr.box,t))}render(){if(this.div)return this.div;const t=super.render();this.#pr&&(t.setAttribute("aria-label",this.#pr),t.setAttribute("role","mark")),this.#lr?t.classList.add("free"):this.div.addEventListener("keydown",this.#ot,{signal:this._uiManager._signal});const e=this.#ar=document.createElement("div");t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#ir;const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),ue(this,this.#ar,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(this.#ur,"hovered")}pointerleave(){this.parent.drawLayer.removeClass(this.#ur,"hovered")}#hr(t){gs._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#_r(!0);break;case 1:case 3:this.#_r(!1)}}#_r(t){if(!this.#Zs)return;const e=window.getSelection();t?e.setPosition(this.#Zs,this.#tr):e.setPosition(this.#sr,this.#rr)}select(){super.select(),this.#ur&&(this.parent?.drawLayer.removeClass(this.#ur,"hovered"),this.parent?.drawLayer.addClass(this.#ur,"selected"))}unselect(){super.unselect(),this.#ur&&(this.parent?.drawLayer.removeClass(this.#ur,"selected"),this.#lr||this.#_r(!1))}get _mustFixPosition(){return!this.#lr}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show(this.#v,t),this.parent.drawLayer.show(this.#ur,t))}#Ar(){return this.#lr?this.rotation:0}#Er(){if(this.#lr)return null;const[t,e]=this.pageDimensions,i=this.#er,n=new Float32Array(8*i.length);let s=0;for(const{x:r,y:a,width:o,height:l}of i){const i=r*t,h=(1-a-l)*e;n[s]=n[s+4]=i,n[s+1]=n[s+3]=h,n[s+2]=n[s+6]=i+o*t,n[s+5]=n[s+7]=h+l*e,s+=8}return n}#Cr(t){return this.#or.serialize(t,this.#Ar())}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:l,height:h}=n.getBoundingClientRect(),c=e=>{this.#Sr(t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},g=e=>{n.removeEventListener("pointermove",c),window.removeEventListener("blur",g),window.removeEventListener("pointerup",g),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",ee),this.#Mr(t,e)};window.addEventListener("blur",g,{signal:d}),window.addEventListener("pointerup",g,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",ee,{signal:d}),n.addEventListener("pointermove",c,{signal:d}),this._freeHighlight=new ds({x:s,y:r},[a,o,l,h],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static#Sr(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#Mr(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static deserialize(t,e,i){const n=super.deserialize(t,e,i),{rect:[s,r,a,o],color:l,quadPoints:h}=t;n.color=xt.makeHexColor(...l),n.#dr=t.opacity;const[c,d]=n.pageDimensions;n.width=(a-s)/c,n.height=(o-r)/d;const u=n.#er=[];for(let p=0;p<h.length;p+=8)u.push({x:(h[4]-a)/c,y:(o-(1-h[p+5]))/d,width:(h[p+2]-h[p])/c,height:(h[p+5]-h[p+1])/d});return n.#vr(),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;const e=this.getRect(0,0),i=we._colorManager.convert(this.color);return{annotationType:v.HIGHLIGHT,color:i,opacity:this.#dr,thickness:this.#ks,quadPoints:this.#Er(),outlines:this.#Cr(e),pageIndex:this.pageIndex,rect:e,rotation:this.#Ar(),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}class fs extends we{#Tr=0;#kr=0;#Pr=this.canvasPointermove.bind(this);#Rr=this.canvasPointerleave.bind(this);#Lr=this.canvasPointerup.bind(this);#Ir=this.canvasPointerdown.bind(this);#Fr=null;#Dr=(()=>new Path2D)();#Or=!1;#Nr=!1;#zr=!1;#Br=null;#Hr=0;#jr=0;#Vr=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=(()=>v.INK)();constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){we.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case b.INK_THICKNESS:fs._defaultThickness=e;break;case b.INK_COLOR:fs._defaultColor=e;break;case b.INK_OPACITY:fs._defaultOpacity=e/100}}updateParams(t,e){switch(t){case b.INK_THICKNESS:this.#yr(e);break;case b.INK_COLOR:this.#is(e);break;case b.INK_OPACITY:this.#$r(e)}}static get defaultPropertiesToUpdate(){return[[b.INK_THICKNESS,fs._defaultThickness],[b.INK_COLOR,fs._defaultColor||we._defaultLineColor],[b.INK_OPACITY,Math.round(100*fs._defaultOpacity)]]}get propertiesToUpdate(){return[[b.INK_THICKNESS,this.thickness||fs._defaultThickness],[b.INK_COLOR,this.color||fs._defaultColor||we._defaultLineColor],[b.INK_OPACITY,Math.round(100*(this.opacity??fs._defaultOpacity))]]}#yr(t){const e=t=>{this.thickness=t,this.#Ur()},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#is(t){const e=t=>{this.color=t,this.#Wr()},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#$r(t){const e=t=>{this.opacity=t,this.#Wr()};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#Gr(),this.#qr()),this.isAttachedToDOM||(this.parent.add(this),this.#Xr()),this.#Ur()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#Fr&&(clearTimeout(this.#Fr),this.#Fr=null),this.#Br?.disconnect(),this.#Br=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){this.#Or||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#Ir,{signal:this._uiManager._signal}))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Ir))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Kr(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}#Yr(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;t.lineWidth=n*s/r,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i)}`}#Qr(t,e){const i=this._uiManager._signal;this.canvas.addEventListener("contextmenu",ee,{signal:i}),this.canvas.addEventListener("pointerleave",this.#Rr,{signal:i}),this.canvas.addEventListener("pointermove",this.#Pr,{signal:i}),this.canvas.addEventListener("pointerup",this.#Lr,{signal:i}),this.canvas.removeEventListener("pointerdown",this.#Ir),this.isEditing=!0,this.#zr||(this.#zr=!0,this.#Xr(),this.thickness||=fs._defaultThickness,this.color||=fs._defaultColor||we._defaultLineColor,this.opacity??=fs._defaultOpacity),this.currentPath.push([t,e]),this.#Nr=!1,this.#Yr(),this.#Vr=()=>{this.#Jr(),this.#Vr&&window.requestAnimationFrame(this.#Vr)},window.requestAnimationFrame(this.#Vr)}#Zr(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let r=this.#Dr;if(s.push([t,e]),this.#Nr=!0,s.length<=2)return r.moveTo(...s[0]),void r.lineTo(t,e);3===s.length&&(this.#Dr=r=new Path2D,r.moveTo(...s[0])),this.#ta(r,...s.at(-3),...s.at(-2),t,e)}#ea(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#Dr.lineTo(...t)}#ia(t,e){let i;if(this.#Vr=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#Zr(t,e),this.#ea(),1!==this.currentPath.length)i=this.#na();else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=this.#Dr,s=this.currentPath;this.currentPath=[],this.#Dr=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Gr(),this.#qr()),this.#Ur())},mustExec:!0})}#Jr(){if(!this.#Nr)return;this.#Nr=!1;const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),i=e.map((t=>t[0])),n=e.map((t=>t[1])),{ctx:s}=(Math.min(...i),Math.max(...i),Math.min(...n),Math.max(...n),this);s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const r of this.bezierPath2D)s.stroke(r);s.stroke(this.#Dr),s.restore()}#ta(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,h=(n+r)/2,c=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,h+2*(n-h)/3,c+2*(s-c)/3,h,c)}#na(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[r,a]=t[i],[o,l]=t[i+1],h=(r+o)/2,c=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[h+2*(r-h)/3,c+2*(a-c)/3];e.push([[n,s],d,u,[h,c]]),[n,s]=[h,c]}const[r,a]=t[i],[o,l]=t[i+1],h=[n+2*(r-n)/3,s+2*(a-s)/3],c=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],h,c,[o,l]]),e}#Wr(){if(this.isEmpty())return void this.#sa();this.#Yr();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#sa();for(const i of this.bezierPath2D)e.stroke(i)}commit(){this.#Or||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Or=!0,this.div.classList.add("disabled"),this.#Ur(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#Or&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#Qr(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#Zr(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#ra(t)}canvasPointerleave(t){this.#ra(t)}#ra(t){this.canvas.removeEventListener("pointerleave",this.#Rr),this.canvas.removeEventListener("pointermove",this.#Pr),this.canvas.removeEventListener("pointerup",this.#Lr),this.canvas.addEventListener("pointerdown",this.#Ir,{signal:this._uiManager._signal}),this.#Fr&&clearTimeout(this.#Fr),this.#Fr=setTimeout((()=>{this.#Fr=null,this.canvas.removeEventListener("contextmenu",ee)}),10),this.#ia(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Gr(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#qr(){this.#Br=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),this.#Br.observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{this.#Br?.disconnect(),this.#Br=null}),{once:!0})}get isResizable(){return!this.isEmpty()&&this.#Or}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,r]=this.#Kr();if(this.setAt(i,n,0,0),this.setDims(s,r),this.#Gr(),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),this.#zr=!0,this.#Xr(),this.setDims(this.width*i,this.height*n),this.#Wr(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#qr(),this.div}#Xr(){if(!this.#zr)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#sa()}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if(this.#Hr===i&&this.#jr===n)return;this.#Hr=i,this.#jr=n,this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s,this.height=e/r,this.fixAndSetPosition(),this.#Or&&this.#aa(t,e),this.#Xr(),this.#Wr(),this.canvas.style.visibility="visible",this.fixDims()}#aa(t,e){const i=this.#oa(),n=(t-i)/this.#kr,s=(e-i)/this.#Tr;this.scaleFactor=Math.min(n,s)}#sa(){const t=this.#oa()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#la(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,r,a]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],r[0],r[1],a[0],a[1])}return e}static#ha(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t}static#ca(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t}#da(t,e,i,n){const s=[],r=this.thickness/2,a=t*e+r,o=t*i+r;for(const l of this.paths){const e=[],i=[];for(let n=0,s=l.length;n<s;n++){const[r,h,c,d]=l[n];if(r[0]===d[0]&&r[1]===d[1]&&1===s){const n=t*r[0]+a,s=t*r[1]+o;e.push(n,s),i.push(n,s);break}const u=t*r[0]+a,p=t*r[1]+o,g=t*h[0]+a,f=t*h[1]+o,m=t*c[0]+a,v=t*c[1]+o,b=t*d[0]+a,y=t*d[1]+o;0===n&&(e.push(u,p),i.push(u,p)),e.push(g,f,m,v,b,y),i.push(g,f),n===s-1&&i.push(b,y)}s.push({bezier:fs.#ha(e,n,this.rotation),points:fs.#ha(i,n,this.rotation)})}return s}#ua(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[r,a,o,l]of s){const s=xt.bezierBoundingBox(...r,...a,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]}#oa(){return this.#Or?Math.ceil(this.thickness*this.parentScale):0}#Ur(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#Or)return void this.#Wr();const e=this.#ua(),i=this.#oa();this.#kr=Math.max(we.MIN_SIZE,e[2]-e[0]),this.#Tr=Math.max(we.MIN_SIZE,e[3]-e[1]);const n=Math.ceil(i+this.#kr*this.scaleFactor),s=Math.ceil(i+this.#Tr*this.scaleFactor),[r,a]=this.parentDimensions;this.width=n/r,this.height=s/a,this.setAspectRatio(n,s);const o=this.translationX,l=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#Xr(),this.#Wr(),this.#Hr=n,this.#jr=s,this.setDims(n,s);const h=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-h,l-this.translationY-h)}static deserialize(t,e,i){if(t instanceof Jn)return null;const n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=xt.makeHexColor(...t.color),n.opacity=t.opacity;const[s,r]=n.pageDimensions,a=n.width*s,o=n.height*r,l=n.parentScale,h=t.thickness/2;n.#Or=!0,n.#Hr=Math.round(a),n.#jr=Math.round(o);const{paths:c,rect:d,rotation:u}=t;for(let{bezier:g}of c){g=fs.#ca(g,d,u);const t=[];n.paths.push(t);let e=l*(g[0]-h),i=l*(g[1]-h);for(let n=2,r=g.length;n<r;n+=6){const s=l*(g[n]-h),r=l*(g[n+1]-h),a=l*(g[n+2]-h),o=l*(g[n+3]-h),c=l*(g[n+4]-h),d=l*(g[n+5]-h);t.push([[e,i],[s,r],[a,o],[c,d]]),e=c,i=d}const s=this.#la(t);n.bezierPath2D.push(s)}const p=n.#ua();return n.#kr=Math.max(we.MIN_SIZE,p[2]-p[0]),n.#Tr=Math.max(we.MIN_SIZE,p[3]-p[1]),n.#aa(a,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=we._colorManager.convert(this.ctx.strokeStyle);return{annotationType:v.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#da(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class ms extends we{#pa=null;#ga=null;#fa=null;#ma=null;#va=null;#ba="";#ya=null;#Br=null;#wa=null;#Aa=!1;#xa=!1;static _type="stamp";static _editorType=(()=>v.STAMP)();constructor(t){super({...t,name:"stampEditor"}),this.#ma=t.bitmapUrl,this.#va=t.bitmapFile}static initialize(t,e){we.initialize(t,e)}static get supportedTypes(){return lt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>`image/${t}`)))}static get supportedTypesStr(){return lt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(v.STAMP,{bitmapFile:t.getAsFile()})}#_a(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(this.#pa=t.bitmap,e||(this.#ga=t.id,this.#Aa=t.isSvg),t.file&&(this.#ba=t.file.name),this.#Gr()):this.remove()}#Ea(){this.#fa=null,this._uiManager.enableWaiting(!1),this.#ya&&this.div.focus()}#Ca(){if(this.#ga)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#ga).then((t=>this.#_a(t,!0))).finally((()=>this.#Ea()));if(this.#ma){const t=this.#ma;return this.#ma=null,this._uiManager.enableWaiting(!0),void(this.#fa=this._uiManager.imageManager.getFromUrl(t).then((t=>this.#_a(t))).finally((()=>this.#Ea())))}if(this.#va){const t=this.#va;return this.#va=null,this._uiManager.enableWaiting(!0),void(this.#fa=this._uiManager.imageManager.getFromFile(t).then((t=>this.#_a(t))).finally((()=>this.#Ea())))}const t=document.createElement("input");t.type="file",t.accept=ms.supportedTypesStr;const e=this._uiManager._signal;this.#fa=new Promise((i=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this.#_a(e)}else this.remove();i()}),{signal:e}),t.addEventListener("cancel",(()=>{this.remove(),i()}),{signal:e})})).finally((()=>this.#Ea())),t.click()}remove(){this.#ga&&(this.#pa=null,this._uiManager.imageManager.deleteId(this.#ga),this.#ya?.remove(),this.#ya=null,this.#Br?.disconnect(),this.#Br=null,this.#wa&&(clearTimeout(this.#wa),this.#wa=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#ga&&null===this.#ya&&this.#Ca(),this.isAttachedToDOM||this.parent.add(this))):this.#ga&&this.#Ca()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#fa||this.#pa||this.#ma||this.#va||this.#ga)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),this.#pa?this.#Gr():this.#Ca(),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}#Gr(){const{div:t}=this;let{width:e,height:i}=this.#pa;const[n,s]=this.pageDimensions,r=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>r*n||i>r*s){const t=Math.min(r*n/e,r*s/i);e*=t,i*=t}const[a,o]=this.parentDimensions;this.setDims(e*a/n,i*o/s),this._uiManager.enableWaiting(!1);const l=this.#ya=document.createElement("canvas");t.append(l),t.hidden=!1,this.#Sa(e,i),this.#qr(),this.#xa||(this.parent.addUndoableEditor(this),this.#xa=!0),this._reportTelemetry({action:"inserted_image"}),this.#ba&&l.setAttribute("aria-label",this.#ba)}#Ma(t,e){const[i,n]=this.parentDimensions;this.width=t/i,this.height=e/n,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#wa&&clearTimeout(this.#wa);this.#wa=setTimeout((()=>{this.#wa=null,this.#Sa(t,e)}),200)}#Ta(t,e){const{width:i,height:n}=this.#pa;let s=i,r=n,a=this.#pa;for(;s>2*t||r>2*e;){const i=s,n=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const o=new OffscreenCanvas(s,r);o.getContext("2d").drawImage(a,0,0,i,n,0,0,s,r),a=o.transferToImageBitmap()}return a}#Sa(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=this.#ya;if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const n=this.#Aa?this.#pa:this.#Ta(t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(n,0,0,n.width,n.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then((t=>{const e=t?.output||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})}))}const s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(n,0,0,n.width,n.height,0,0,t,e)}getImageForAltText(){return this.#ya}#ka(t){if(t){if(this.#Aa){const t=this._uiManager.imageManager.getSvgUrl(this.#ga);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#pa);return t.getContext("2d").drawImage(this.#pa,0,0),t.toDataURL()}if(this.#Aa){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Vt.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*Vt.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(this.#pa,0,0,this.#pa.width,this.#pa.height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(this.#pa)}#qr(){this._uiManager._signal&&(this.#Br=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.#Ma(e.width,e.height)})),this.#Br.observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{this.#Br?.disconnect(),this.#Br=null}),{once:!0}))}static deserialize(t,e,i){if(t instanceof ns)return null;const n=super.deserialize(t,e,i),{rect:s,bitmapUrl:r,bitmapId:a,isSvg:o,accessibilityData:l}=t;a&&i.imageManager.isValidId(a)?n.#ga=a:n.#ma=r,n.#Aa=o;const[h,c]=n.pageDimensions;return n.width=(s[2]-s[0])/h,n.height=(s[3]-s[1])/c,l&&(n.altTextData=l),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const i={annotationType:v.STAMP,bitmapId:this.#ga,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Aa,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#ka(!0),i.accessibilityData=this.altTextData,i;const{decorative:n,altText:s}=this.altTextData;if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),null===e)return i;e.stamps||=new Map;const r=this.#Aa?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#ga)){if(this.#Aa){const t=e.stamps.get(this.#ga);r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=this.#ka(!1))}}else e.stamps.set(this.#ga,{area:r,serialized:i}),i.bitmap=this.#ka(!1);return i}}class vs{#Vn;#Pa=!1;#Ra=null;#La=null;#Ia=null;#Fa=null;#Da=null;#Oa=(()=>new Map)();#Na=!1;#za=!1;#Ba=!1;#Ha=null;#p;static _initialized=!1;static#N=(()=>new Map([os,fs,ms,gs].map((t=>[t._editorType,t]))))();constructor(t){let{uiManager:e,pageIndex:i,div:n,accessibilityManager:s,annotationLayer:r,drawLayer:a,textLayer:o,viewport:l,l10n:h}=t;const c=[...vs.#N.values()];if(!vs._initialized){vs._initialized=!0;for(const t of c)t.initialize(h,e)}e.registerEditorTypes(c),this.#p=e,this.pageIndex=i,this.div=n,this.#Vn=s,this.#Ra=r,this.viewport=l,this.#Ha=o,this.drawLayer=a,this.#p.addLayer(this)}get isEmpty(){return 0===this.#Oa.size}get isInvisible(){return this.isEmpty&&this.#p.getMode()===v.NONE}updateToolbar(t){this.#p.updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#p.getMode();switch(this.#ja(),t){case v.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case v.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case v.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of vs.#N.values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#Ha?.div}addInkEditorIfNeeded(t){if(this.#p.getMode()!==v.INK)return;if(!t)for(const e of this.#Oa.values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){this.#p.setEditingState(t)}addCommands(t){this.#p.addCommands(t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#Ra?.div.classList.toggle("disabled",!t)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of this.#Oa.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#p.removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!this.#Ra)return;const e=this.#Ra.getEditableAnnotations();for(const i of e){if(i.hide(),this.#p.isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){this.#Ba=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const n of this.#Oa.values())n.disableEditing(),n.annotationElementId&&(null===n.serialize()?(e.set(n.annotationElementId,n),this.getEditableAnnotation(n.annotationElementId)?.show(),n.remove()):t.set(n.annotationElementId,n));if(this.#Ra){const i=this.#Ra.getEditableAnnotations();for(const n of i){const{id:i}=n.data;if(this.#p.isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&(this.#p.addChangedExistingAnnotation(s),s.renderAnnotationElement(n),s.show(!1)),n.show())}}this.#ja(),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of vs.#N.values())i.remove(`${n._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Ba=!1}getEditableAnnotation(t){return this.#Ra?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#p.getActive()!==t&&this.#p.setActiveEditor(t)}enableTextSelection(){this.div.tabIndex=-1,this.#Ha?.div&&!this.#Fa&&(this.#Fa=this.#Va.bind(this),this.#Ha.div.addEventListener("pointerdown",this.#Fa,{signal:this.#p._signal}),this.#Ha.div.classList.add("highlighting"))}disableTextSelection(){this.div.tabIndex=0,this.#Ha?.div&&this.#Fa&&(this.#Ha.div.removeEventListener("pointerdown",this.#Fa),this.#Fa=null,this.#Ha.div.classList.remove("highlighting"))}#Va(t){if(this.#p.unselectAll(),t.target===this.#Ha.div){const{isMac:e}=wt.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#p.showAllEditors("highlight",!0,!0),this.#Ha.div.classList.add("free"),gs.startHighlighting(this,"ltr"===this.#p.direction,t),this.#Ha.div.addEventListener("pointerup",(()=>{this.#Ha.div.classList.remove("free")}),{once:!0,signal:this.#p._signal}),t.preventDefault()}}enableClick(){if(this.#Ia)return;const t=this.#p._signal;this.#Ia=this.pointerdown.bind(this),this.#La=this.pointerup.bind(this),this.div.addEventListener("pointerdown",this.#Ia,{signal:t}),this.div.addEventListener("pointerup",this.#La,{signal:t})}disableClick(){this.#Ia&&(this.div.removeEventListener("pointerdown",this.#Ia),this.div.removeEventListener("pointerup",this.#La),this.#Ia=null,this.#La=null)}attach(t){this.#Oa.set(t.id,t);const{annotationElementId:e}=t;e&&this.#p.isDeletedAnnotationElement(e)&&this.#p.removeDeletedAnnotationElement(t)}detach(t){this.#Oa.delete(t.id),this.#Vn?.removePointerInTextLayer(t.contentDiv),!this.#Ba&&t.annotationElementId&&this.#p.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#p.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,this.#za||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#p.addDeletedAnnotationElement(t.annotationElementId),we.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#p.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#p.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!this.#Da&&(t._focusEventsAllowed=!1,this.#Da=setTimeout((()=>{this.#Da=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this.#p._signal}),e.focus())}),0)),t._structTreeParentId=this.#Vn?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#p.getId()}get#$a(){return vs.#N.get(this.#p.getMode())}get _signal(){return this.#p._signal}#Ua(t){const e=this.#$a;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#$a?.canCreateNewEmptyEditor()}pasteEditor(t,e){this.#p.updateToolbar(t),this.#p.updateMode(t);const{offsetX:i,offsetY:n}=this.#Wa(),s=this.getNextId(),r=this.#Ua({parent:this,id:s,x:i,y:n,uiManager:this.#p,isCentered:!0,...e});r&&this.add(r)}deserialize(t){return vs.#N.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#p)||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=this.#Ua({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#p,isCentered:e,...i});return s&&this.add(s),s}#Wa(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),r=Math.max(0,e),a=(s+Math.min(window.innerWidth,t+i))/2-t,o=(r+Math.min(window.innerHeight,e+n))/2-e,[l,h]=this.viewport.rotation%180===0?[a,o]:[o,a];return{offsetX:l,offsetY:h}}addNewEditor(){this.createAndAddNewEditor(this.#Wa(),!0)}setSelected(t){this.#p.setSelected(t)}toggleSelected(t){this.#p.toggleSelected(t)}isSelected(t){return this.#p.isSelected(t)}unselect(t){this.#p.unselect(t)}pointerup(t){const{isMac:e}=wt.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&this.#Na&&(this.#Na=!1,this.#Pa?this.#p.getMode()!==v.STAMP?this.createAndAddNewEditor(t,!1):this.#p.unselectAll():this.#Pa=!0)}pointerdown(t){if(this.#p.getMode()===v.HIGHLIGHT&&this.enableTextSelection(),this.#Na)return void(this.#Na=!1);const{isMac:e}=wt.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#Na=!0;const i=this.#p.getActive();this.#Pa=!i||i.isEmpty()}findNewParent(t,e,i){const n=this.#p.findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){this.#p.getActive()?.parent===this&&(this.#p.commitOrRemove(),this.#p.setActiveEditor(null)),this.#Da&&(clearTimeout(this.#Da),this.#Da=null);for(const t of this.#Oa.values())this.#Vn?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Oa.clear(),this.#p.removeLayer(this)}#ja(){this.#za=!0;for(const t of this.#Oa.values())t.isEmpty()&&t.remove();this.#za=!1}render(t){let{viewport:e}=t;this.viewport=e,he(this.div,e);for(const i of this.#p.getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;this.#p.commitOrRemove(),this.#ja();const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,he(this.div,{rotation:n}),i!==n)for(const s of this.#Oa.values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#p.viewParameters.realScale}}class bs{#xn=null;#v=0;#Ga=(()=>new Map)();#qa=(()=>new Map)();constructor(t){let{pageIndex:e}=t;this.pageIndex=e}setParent(t){if(this.#xn){if(this.#xn!==t){if(this.#Ga.size>0)for(const e of this.#Ga.values())e.remove(),t.append(e);this.#xn=t}}else this.#xn=t}static get _svgFactory(){return lt(this,"_svgFactory",new Gt)}static#Xa(t){let{x:e=0,y:i=0,width:n=1,height:s=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:r}=t;r.top=100*i+"%",r.left=100*e+"%",r.width=100*n+"%",r.height=100*s+"%"}#Ka(t){const e=bs._svgFactory.create(1,1,!0);return this.#xn.append(e),e.setAttribute("aria-hidden",!0),bs.#Xa(e,t),e}#Ya(t,e){const i=bs._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=bs._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),n}highlight(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=this.#v++,r=this.#Ka(t.box);r.classList.add("highlight"),t.free&&r.classList.add("free");const a=bs._svgFactory.createElement("defs");r.append(a);const o=bs._svgFactory.createElement("path");a.append(o);const l=`path_p${this.pageIndex}_${s}`;o.setAttribute("id",l),o.setAttribute("d",t.toSVGPath()),n&&this.#qa.set(s,o);const h=this.#Ya(a,l),c=bs._svgFactory.createElement("use");return r.append(c),r.setAttribute("fill",e),r.setAttribute("fill-opacity",i),c.setAttribute("href",`#${l}`),this.#Ga.set(s,r),{id:s,clipPathId:`url(#${h})`}}highlightOutline(t){const e=this.#v++,i=this.#Ka(t.box);i.classList.add("highlightOutline");const n=bs._svgFactory.createElement("defs");i.append(n);const s=bs._svgFactory.createElement("path");n.append(s);const r=`path_p${this.pageIndex}_${e}`;let a;if(s.setAttribute("id",r),s.setAttribute("d",t.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke"),t.free){i.classList.add("free");const t=bs._svgFactory.createElement("mask");n.append(t),a=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",a),t.setAttribute("maskUnits","objectBoundingBox");const s=bs._svgFactory.createElement("rect");t.append(s),s.setAttribute("width","1"),s.setAttribute("height","1"),s.setAttribute("fill","white");const o=bs._svgFactory.createElement("use");t.append(o),o.setAttribute("href",`#${r}`),o.setAttribute("stroke","none"),o.setAttribute("fill","black"),o.setAttribute("fill-rule","nonzero"),o.classList.add("mask")}const o=bs._svgFactory.createElement("use");i.append(o),o.setAttribute("href",`#${r}`),a&&o.setAttribute("mask",`url(#${a})`);const l=o.cloneNode();return i.append(l),o.classList.add("mainOutline"),l.classList.add("secondaryOutline"),this.#Ga.set(e,i),e}finalizeLine(t,e){const i=this.#qa.get(t);this.#qa.delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){this.#Ga.get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),this.#qa.delete(t)}updatePath(t,e){this.#qa.get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){bs.#Xa(this.#Ga.get(t),e)}show(t,e){this.#Ga.get(t).classList.toggle("hidden",!e)}rotate(t,e){this.#Ga.get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){this.#Ga.get(t).setAttribute("fill",e)}changeOpacity(t,e){this.#Ga.get(t).setAttribute("fill-opacity",e)}addClass(t,e){this.#Ga.get(t).classList.add(e)}removeClass(t,e){this.#Ga.get(t).classList.remove(e)}remove(t){null!==this.#xn&&(this.#Ga.get(t).remove(),this.#Ga.delete(t))}destroy(){this.#xn=null;for(const t of this.#Ga.values())t.remove();this.#Ga.clear()}}var ys=s.AnnotationLayer,ws=s.AnnotationMode,As=s.GlobalWorkerOptions,xs=s.PDFDataRangeTransport,_s=s.TextLayer,Es=s.getDocument},13520:(t,e,i)=>{"use strict";i.d(e,{A:()=>C});var n=i(89261),s=i(94922),r=i(36294),a=i(63697),o=i(47215),l=i(64288),h=i(98677),c=Object.prototype.hasOwnProperty;function d(t,e,i){for(i of t.keys())if(u(i,e))return i}function u(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&u(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t){if((s=n)&&"object"===typeof s&&!(s=d(e,s)))return!1;if(!e.has(s))return!1}return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t){if((s=n[0])&&"object"===typeof s&&!(s=d(e,s)))return!1;if(!u(n[1],e.get(s)))return!1}return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"===typeof t){for(i in n=0,t){if(c.call(t,i)&&++n&&!c.call(e,i))return!1;if(!(i in e)||!u(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}var p=i(31079),g=i(85724),f=i(66499);class m{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),(0,l.A)(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{(0,l.A)(Array.isArray(t),`"${t}" is not a valid destination array.`);const e=t[0];new Promise((t=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{(0,l.A)(!1,`"${e}" is not a valid page reference.`)})):"number"===typeof e?t(e):(0,l.A)(!1,`"${e}" is not a valid destination reference.`)})).then((e=>{const i=e+1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(i>=1&&i<=this.pagesCount,`"${i}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(t>=1&&t<=this.pagesCount,`"${t}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const v={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var b=i(42461),y=i(42166),w=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(e){r(e)}}function o(t){try{l(n.throw(t))}catch(e){r(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))},A=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{Tm:x}=p,_=(t,e)=>{switch(e){case v.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case v.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function E(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const C=(0,s.forwardRef)((function(t,e){var{children:i,className:c,error:d="Failed to load PDF file.",externalLinkRel:v,externalLinkTarget:C,file:S,inputRef:M,imageResourcesPath:T,loading:k="Loading PDF\u2026",noData:P="No PDF file specified.",onItemClick:R,onLoadError:L,onLoadProgress:I,onLoadSuccess:F,onPassword:D=_,onSourceError:O,onSourceSuccess:N,options:z,renderMode:B,rotate:H}=t,j=A(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[V,$]=(0,y.A)(),{value:U,error:W}=V,[G,q]=(0,y.A)(),{value:X,error:K}=G,Y=(0,s.useRef)(new m),Q=(0,s.useRef)([]),J=(0,s.useRef)(void 0),Z=(0,s.useRef)(void 0);S&&S!==J.current&&E(S)&&(h(!u(S,J.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),J.current=S),z&&z!==Z.current&&(h(!u(z,Z.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),Z.current=z);const tt=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(R)return void R({dest:e,pageIndex:n,pageNumber:i});const s=Q.current[n];s?s.scrollIntoView():h(!1,`An internal link leading to page ${i} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});(0,s.useImperativeHandle)(e,(()=>({linkService:Y,pages:Q,viewer:tt})),[]),(0,s.useEffect)((function(){$({type:"RESET"})}),[S,$]);const et=(0,s.useCallback)((()=>w(this,void 0,void 0,(function*(){if(!S)return null;if("string"===typeof S){if((0,b.zL)(S)){return{data:(0,b.jA)(S)}}return(0,b.qC)(),{url:S}}if(S instanceof x)return{range:S};if((0,b.mw)(S))return{data:S};if(b.Bd&&(0,b.qf)(S)){return{data:yield(0,b.h1)(S)}}if((0,l.A)("object"===typeof S,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,l.A)(E(S),"Invalid parameter object: need either .data, .range or .url"),"url"in S&&"string"===typeof S.url){if((0,b.zL)(S.url)){const{url:t}=S,e=A(S,["url"]),i=(0,b.jA)(t);return Object.assign({data:i},e)}(0,b.qC)()}return S}))),[S]);(0,s.useEffect)((()=>{const t=(0,a.A)(et());return t.promise.then((t=>{$({type:"RESOLVE",value:t})})).catch((t=>{$({type:"REJECT",error:t})})),()=>{(0,b.xL)(t)}}),[et,$]),(0,s.useEffect)((()=>{"undefined"!==typeof U&&(!1!==U?N&&N():W&&(h(!1,W.toString()),O&&O(W)))}),[U]),(0,s.useEffect)((function(){q({type:"RESET"})}),[q,U]),(0,s.useEffect)((function(){if(!U)return;const t=z?Object.assign(Object.assign({},U),z):U,e=p.YE(t);I&&(e.onProgress=I),D&&(e.onPassword=D);const i=e,n=i.promise.then((t=>{q({type:"RESOLVE",value:t})})).catch((t=>{i.destroyed||q({type:"REJECT",error:t})}));return()=>{n.finally((()=>i.destroy()))}}),[z,q,U]),(0,s.useEffect)((()=>{"undefined"!==typeof X&&(!1!==X?X&&(F&&F(X),Q.current=new Array(X.numPages),Y.current.setDocument(X)):K&&(h(!1,K.toString()),L&&L(K)))}),[X]),(0,s.useEffect)((function(){Y.current.setViewer(tt.current),Y.current.setExternalLinkRel(v),Y.current.setExternalLinkTarget(C)}),[v,C]);const it=(0,s.useCallback)(((t,e)=>{Q.current[t]=e}),[]),nt=(0,s.useCallback)((t=>{delete Q.current[t]}),[]),st=(0,s.useMemo)((()=>({imageResourcesPath:T,linkService:Y.current,onItemClick:R,pdf:X,registerPage:it,renderMode:B,rotate:H,unregisterPage:nt})),[T,R,X,it,B,H,nt]),rt=(0,s.useMemo)((()=>(0,r.Ay)(j,(()=>X))),[j,X]);return(0,n.jsx)("div",Object.assign({className:(0,o.A)("react-pdf__Document",c),ref:M,style:{"--scale-factor":"1"}},rt,{children:S?void 0===X||null===X?(0,n.jsx)(f.A,{type:"loading",children:"function"===typeof k?k():k}):!1===X?(0,n.jsx)(f.A,{type:"error",children:"function"===typeof d?d():d}):(0,n.jsx)(g.A.Provider,{value:st,children:i}):(0,n.jsx)(f.A,{type:"no-data",children:"function"===typeof P?P():P})}))}))},85724:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=(0,i(94922).createContext)(null)},66499:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(89261);function s(t){let{children:e,type:i}=t;return(0,n.jsx)("div",{className:`react-pdf__message react-pdf__message--${i}`,children:e})}},70041:(t,e,i)=>{"use strict";i.d(e,{A:()=>F});var n=i(89261),s=i(94922),r=i(63697),a=i(36294),o=i(47215);function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){i.forEach((function(e){"function"===typeof e?e(t):e&&(e.current=t)}))}}var h=i(64288),c=i(98677);const d=(0,s.createContext)(null);var u=i(66499),p=i(31079);const g={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},f=/^H(\d+)$/;function m(t){return"children"in t}function v(t){return!!m(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function b(t){const e={};if(m(t)){const{role:i}=t,n=i.match(f);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in g}(i)){const t=g[i];t&&(e.role=t)}}return e}function y(t){const e={};if(m(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),v(t)){const[i]=t.children;if(i){const t=y(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function w(t){return t?Object.assign(Object.assign({},b(t)),y(t)):null}function A(t){let{className:e,node:i}=t;const r=(0,s.useMemo)((()=>w(i)),[i]),a=(0,s.useMemo)((()=>m(i)?v(i)?null:i.children.map(((t,e)=>(0,n.jsx)(A,{node:t},e))):null),[i]);return(0,n.jsx)("span",Object.assign({className:e},r,{children:a}))}function x(){return(0,s.useContext)(d)}var _=i(42166),E=i(42461);function C(){const t=x();(0,h.A)(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[a,o]=(0,_.A)(),{value:l,error:d}=a,{customTextRenderer:u,page:p}=t;return(0,s.useEffect)((function(){o({type:"RESET"})}),[o,p]),(0,s.useEffect)((function(){if(u)return;if(!p)return;const t=(0,r.A)(p.getStructTree()),e=t;return t.promise.then((t=>{o({type:"RESOLVE",value:t})})).catch((t=>{o({type:"REJECT",error:t})})),()=>(0,E.xL)(e)}),[u,p,o]),(0,s.useEffect)((()=>{void 0!==l&&(!1!==l?l&&i&&i(l):d&&(c(!1,d.toString()),e&&e(d)))}),[l]),l?(0,n.jsx)(A,{className:"react-pdf__Page__structTree structTree",node:l}):null}const S=p.ng;function M(t){const e=x();(0,h.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},e),t),{_className:r,canvasBackground:a,devicePixelRatio:o=(0,E.mZ)(),onRenderError:d,onRenderSuccess:u,page:p,renderForms:g,renderTextLayer:f,rotate:m,scale:v}=i,{canvasRef:b}=t;(0,h.A)(p,"Attempted to render page canvas, but no page was specified.");const y=(0,s.useRef)(null);function w(t){(0,E.UT)(t)||(c(!1,t.toString()),d&&d(t))}const A=(0,s.useMemo)((()=>p.getViewport({scale:v*o,rotation:m})),[o,p,m,v]),_=(0,s.useMemo)((()=>p.getViewport({scale:v,rotation:m})),[p,m,v]);(0,s.useEffect)((function(){if(!p)return;p.cleanup();const{current:t}=y;if(!t)return;t.width=A.width,t.height=A.height,t.style.width=`${Math.floor(_.width)}px`,t.style.height=`${Math.floor(_.height)}px`,t.style.visibility="hidden";const e={annotationMode:g?S.ENABLE_FORMS:S.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:A};a&&(e.background=a);const i=p.render(e),n=i;return i.promise.then((()=>{t.style.visibility="",p&&u&&u((0,E.vS)(p,v))})).catch(w),()=>(0,E.xL)(n)}),[a,p,g,A,_]);const M=(0,s.useCallback)((()=>{const{current:t}=y;t&&(t.width=0,t.height=0)}),[]);return(0,s.useEffect)((()=>M),[M]),(0,n.jsx)("canvas",{className:`${r}__canvas`,dir:"ltr",ref:l(b,y),style:{display:"block",userSelect:"none"},children:f?(0,n.jsx)(C,{}):null})}function T(){const t=x();(0,h.A)(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:a,onRenderTextLayerError:l,onRenderTextLayerSuccess:d,page:u,pageIndex:g,pageNumber:f,rotate:m,scale:v}=t;(0,h.A)(u,"Attempted to load page text content, but no page was specified.");const[b,y]=(0,_.A)(),{value:w,error:A}=b,C=(0,s.useRef)(null),S=(0,s.useRef)(void 0);c(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,s.useEffect)((function(){y({type:"RESET"})}),[u,y]),(0,s.useEffect)((function(){if(!u)return;const t=(0,r.A)(u.getTextContent()),e=t;return t.promise.then((t=>{y({type:"RESOLVE",value:t})})).catch((t=>{y({type:"REJECT",error:t})})),()=>(0,E.xL)(e)}),[u,y]),(0,s.useEffect)((()=>{void 0!==w&&(!1!==w?w&&a&&a(w):A&&(c(!1,A.toString()),i&&i(A)))}),[w]);const M=(0,s.useCallback)((()=>{d&&d()}),[d]),T=(0,s.useCallback)((t=>{c(!1,t.toString()),l&&l(t)}),[l]);const k=(0,s.useMemo)((()=>u.getViewport({scale:v,rotation:m})),[u,m,v]);return(0,s.useLayoutEffect)((function(){if(!u||!w)return;const{current:t}=C;if(!t)return;t.innerHTML="";const i=u.streamTextContent({includeMarkedContent:!0}),n={container:t,textContentSource:i,viewport:k},s=new p.D6(n),r=s;return s.render().then((()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),S.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;w.items.forEach(((i,s)=>{if(!function(t){return"str"in t}(i))return;const r=n[t];if(!r)return;const a=e(Object.assign({pageIndex:g,pageNumber:f,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1}))}M()})).catch(T),()=>(0,E.xL)(r)}),[e,T,M,u,g,f,w,k]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=S.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=S.current;t&&t.classList.add("active")},ref:C})}var k=i(85724);function P(){return(0,s.useContext)(k.A)}function R(){const t=P(),e=x();(0,h.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:a,linkService:l,onGetAnnotationsError:d,onGetAnnotationsSuccess:u,onRenderAnnotationLayerError:g,onRenderAnnotationLayerSuccess:f,page:m,pdf:v,renderForms:b,rotate:y,scale:w=1}=i;(0,h.A)(v,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),(0,h.A)(m,"Attempted to load page annotations, but no page was specified."),(0,h.A)(l,"Attempted to load page annotations, but no linkService was specified.");const[A,C]=(0,_.A)(),{value:S,error:M}=A,T=(0,s.useRef)(null);c(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,s.useEffect)((function(){C({type:"RESET"})}),[C,m]),(0,s.useEffect)((function(){if(!m)return;const t=(0,r.A)(m.getAnnotations()),e=t;return t.promise.then((t=>{C({type:"RESOLVE",value:t})})).catch((t=>{C({type:"REJECT",error:t})})),()=>{(0,E.xL)(e)}}),[C,m]),(0,s.useEffect)((()=>{void 0!==S&&(!1!==S?S&&u&&u(S):M&&(c(!1,M.toString()),d&&d(M)))}),[S]);const k=(0,s.useMemo)((()=>m.getViewport({scale:w,rotation:y})),[m,y,w]);return(0,s.useEffect)((function(){if(!v||!m||!l||!S)return;const{current:t}=T;if(!t)return;const e=k.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:m,viewport:e},n={annotations:S,annotationStorage:v.annotationStorage,div:t,imageResourcesPath:a,linkService:l,page:m,renderForms:b,viewport:e};t.innerHTML="";try{new p.dU(i).render(n),f&&f()}catch(s){!function(t){c(!1,`${t}`),g&&g(t)}(s)}return()=>{}}),[S,a,l,m,v,b,k]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__annotations","annotationLayer"),ref:T})}var L=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const I=1;function F(t){const e=P(),i=Object.assign(Object.assign({},e),t),{_className:p="react-pdf__Page",_enableRegisterUnregisterPage:g=!0,canvasBackground:f,canvasRef:m,children:v,className:b,customRenderer:y,customTextRenderer:w,devicePixelRatio:A,error:x="Failed to load the page.",height:C,inputRef:S,loading:k="Loading page\u2026",noData:F="No page specified.",onGetAnnotationsError:D,onGetAnnotationsSuccess:O,onGetStructTreeError:N,onGetStructTreeSuccess:z,onGetTextError:B,onGetTextSuccess:H,onLoadError:j,onLoadSuccess:V,onRenderAnnotationLayerError:$,onRenderAnnotationLayerSuccess:U,onRenderError:W,onRenderSuccess:G,onRenderTextLayerError:q,onRenderTextLayerSuccess:X,pageIndex:K,pageNumber:Y,pdf:Q,registerPage:J,renderAnnotationLayer:Z=!0,renderForms:tt=!1,renderMode:et="canvas",renderTextLayer:it=!0,rotate:nt,scale:st=I,unregisterPage:rt,width:at}=i,ot=L(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[lt,ht]=(0,_.A)(),{value:ct,error:dt}=lt,ut=(0,s.useRef)(null);(0,h.A)(Q,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const pt=(0,E.ci)(Y)?Y-1:null!==K&&void 0!==K?K:null,gt=null!==Y&&void 0!==Y?Y:(0,E.ci)(K)?K+1:null,ft=null!==nt&&void 0!==nt?nt:ct?ct.rotate:null,mt=(0,s.useMemo)((()=>{if(!ct)return null;let t=1;const e=null!==st&&void 0!==st?st:I;if(at||C){const e=ct.getViewport({scale:1,rotation:ft});at?t=at/e.width:C&&(t=C/e.height)}return e*t}),[C,ct,ft,st,at]);(0,s.useEffect)((function(){return()=>{(0,E.ci)(pt)&&g&&rt&&rt(pt)}}),[g,Q,pt,rt]),(0,s.useEffect)((function(){ht({type:"RESET"})}),[ht,Q,pt]),(0,s.useEffect)((function(){if(!Q||!gt)return;const t=(0,r.A)(Q.getPage(gt)),e=t;return t.promise.then((t=>{ht({type:"RESOLVE",value:t})})).catch((t=>{ht({type:"REJECT",error:t})})),()=>(0,E.xL)(e)}),[ht,Q,gt]),(0,s.useEffect)((()=>{void 0!==ct&&(!1!==ct?function(){if(V){if(!ct||!mt)return;V((0,E.vS)(ct,mt))}if(g&&J){if(!(0,E.ci)(pt)||!ut.current)return;J(pt,ut.current)}}():dt&&(c(!1,dt.toString()),j&&j(dt)))}),[ct,mt]);const vt=(0,s.useMemo)((()=>ct&&(0,E.ci)(pt)&&gt&&(0,E.ci)(ft)&&(0,E.ci)(mt)?{_className:p,canvasBackground:f,customTextRenderer:w,devicePixelRatio:A,onGetAnnotationsError:D,onGetAnnotationsSuccess:O,onGetStructTreeError:N,onGetStructTreeSuccess:z,onGetTextError:B,onGetTextSuccess:H,onRenderAnnotationLayerError:$,onRenderAnnotationLayerSuccess:U,onRenderError:W,onRenderSuccess:G,onRenderTextLayerError:q,onRenderTextLayerSuccess:X,page:ct,pageIndex:pt,pageNumber:gt,renderForms:tt,renderTextLayer:it,rotate:ft,scale:mt}:null),[p,f,w,A,D,O,N,z,B,H,$,U,W,G,q,X,ct,pt,gt,tt,it,ft,mt]),bt=(0,s.useMemo)((()=>(0,a.Ay)(ot,(()=>ct?mt?(0,E.vS)(ct,mt):void 0:ct))),[ot,ct,mt]),yt=`${pt}@${mt}/${ft}`;function wt(){switch(et){case"custom":return(0,h.A)(y,'renderMode was set to "custom", but no customRenderer was passed.'),(0,n.jsx)(y,{},`${yt}_custom`);case"none":return null;default:return(0,n.jsx)(M,{canvasRef:m},`${yt}_canvas`)}}return(0,n.jsx)("div",Object.assign({className:(0,o.A)(p,b),"data-page-number":gt,ref:l(S,ut),style:{"--scale-factor":`${mt}`,backgroundColor:f||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},bt,{children:gt?null===Q||void 0===ct||null===ct?(0,n.jsx)(u.A,{type:"loading",children:"function"===typeof k?k():k}):!1===Q||!1===ct?(0,n.jsx)(u.A,{type:"error",children:"function"===typeof x?x():x}):(0,n.jsxs)(d.Provider,{value:vt,children:[wt(),it?(0,n.jsx)(T,{},`${yt}_text`):null,Z?(0,n.jsx)(R,{},`${yt}_annotations`):null,v]}):(0,n.jsx)(u.A,{type:"no-data",children:"function"===typeof F?F():F})}))}},42166:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(94922);function s(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function r(){return(0,n.useReducer)(s,{value:void 0,error:void 0})}},42461:(t,e,i)=>{"use strict";i.d(e,{Bd:()=>r,UT:()=>v,ci:()=>o,h1:()=>b,jA:()=>d,mZ:()=>u,mw:()=>l,qC:()=>g,qf:()=>h,vS:()=>m,xL:()=>f,zL:()=>c});var n=i(64288),s=i(98677);const r="undefined"!==typeof window,a=r&&"file:"===window.location.protocol;function o(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function l(t){return t instanceof ArrayBuffer}function h(t){return(0,n.A)(r,"isBlob can only be used in a browser environment"),t instanceof Blob}function c(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function d(t){(0,n.A)(c(t),"Invalid data URI.");const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function u(){return r&&window.devicePixelRatio||1}const p="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function g(){s(!a,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${p}`)}function f(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function m(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function v(t){return"RenderingCancelledException"===t.name}function b(t){return new Promise(((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)}))}},64288:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=!0,s="Invariant failed";function r(t,e){if(!t){if(n)throw new Error(s);var i="function"===typeof e?e():e,r=i?"".concat(s,": ").concat(i):s;throw new Error(r)}}},68102:(t,e,i)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},n.apply(null,arguments)}i.d(e,{A:()=>n})},3141:(t,e,i)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,s,r,a,o=[],l=!0,h=!1;try{if(r=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){h=!0,s=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(h)throw s}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}i.d(e,{A:()=>s})}}]);
3
- //# sourceMappingURL=44.0f60eb2f.chunk.js.map