@kne-components/components-core 0.4.32 → 0.4.34

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.
Files changed (140) hide show
  1. package/build/asset-manifest.json +91 -91
  2. package/build/index.html +1 -1
  3. package/build/remoteEntry.js +1 -1
  4. package/build/remoteEntry.js.map +1 -1
  5. package/build/static/css/1996.9bed2329.chunk.css +2 -0
  6. package/build/static/css/{1996.1feb46e4.chunk.css.map → 1996.9bed2329.chunk.css.map} +1 -1
  7. package/build/static/css/2004.d6c55d50.chunk.css +2 -0
  8. package/build/static/css/{2004.737b39bc.chunk.css.map → 2004.d6c55d50.chunk.css.map} +1 -1
  9. package/build/static/css/206.361be49f.chunk.css +2 -0
  10. package/build/static/css/206.361be49f.chunk.css.map +1 -0
  11. package/build/static/css/254.27bad6c9.chunk.css +2 -0
  12. package/build/static/css/{254.b824e50e.chunk.css.map → 254.27bad6c9.chunk.css.map} +1 -1
  13. package/build/static/css/2628.25e3f37c.chunk.css +2 -0
  14. package/build/static/css/{2628.d7dccf55.chunk.css.map → 2628.25e3f37c.chunk.css.map} +1 -1
  15. package/build/static/css/3404.5cd6e139.chunk.css +2 -0
  16. package/build/static/css/{3404.6c847cf6.chunk.css.map → 3404.5cd6e139.chunk.css.map} +1 -1
  17. package/build/static/css/3771.7b274802.chunk.css +2 -0
  18. package/build/static/css/{3771.1fa66ff2.chunk.css.map → 3771.7b274802.chunk.css.map} +1 -1
  19. package/build/static/css/{3790.d31be1bd.chunk.css → 3790.a1dca75c.chunk.css} +2 -2
  20. package/build/static/css/{3790.d31be1bd.chunk.css.map → 3790.a1dca75c.chunk.css.map} +1 -1
  21. package/build/static/css/4741.ab17c01b.chunk.css +2 -0
  22. package/build/static/css/{4741.ae13daff.chunk.css.map → 4741.ab17c01b.chunk.css.map} +1 -1
  23. package/build/static/css/4834.5758cb4b.chunk.css +2 -0
  24. package/build/static/css/{4834.48591cce.chunk.css.map → 4834.5758cb4b.chunk.css.map} +1 -1
  25. package/build/static/css/5195.a6e0460c.chunk.css +2 -0
  26. package/build/static/css/5195.a6e0460c.chunk.css.map +1 -0
  27. package/build/static/css/6763.6a544314.chunk.css +2 -0
  28. package/build/static/css/{6763.1a96d043.chunk.css.map → 6763.6a544314.chunk.css.map} +1 -1
  29. package/build/static/css/7227.bf67f594.chunk.css +2 -0
  30. package/build/static/css/{7227.2cf2bf33.chunk.css.map → 7227.bf67f594.chunk.css.map} +1 -1
  31. package/build/static/css/7371.2715730e.chunk.css +2 -0
  32. package/build/static/css/{7371.128298a9.chunk.css.map → 7371.2715730e.chunk.css.map} +1 -1
  33. package/build/static/css/7548.1ff965d9.chunk.css +12 -0
  34. package/build/static/css/{7548.e087a24a.chunk.css.map → 7548.1ff965d9.chunk.css.map} +1 -1
  35. package/build/static/css/760.e5c2e72c.chunk.css +2 -0
  36. package/build/static/css/{760.ca58e057.chunk.css.map → 760.e5c2e72c.chunk.css.map} +1 -1
  37. package/build/static/css/833.74e553af.chunk.css +2 -0
  38. package/build/static/css/{833.3df58f30.chunk.css.map → 833.74e553af.chunk.css.map} +1 -1
  39. package/build/static/css/8593.52d4a5dc.chunk.css +2 -0
  40. package/build/static/css/{8593.5838ba2d.chunk.css.map → 8593.52d4a5dc.chunk.css.map} +1 -1
  41. package/build/static/css/9556.934cb4f3.chunk.css +2 -0
  42. package/build/static/css/{9556.6ee73384.chunk.css.map → 9556.934cb4f3.chunk.css.map} +1 -1
  43. package/build/static/js/{1353.a91edf5b.chunk.js → 1353.7388baf9.chunk.js} +3 -3
  44. package/build/static/js/1353.7388baf9.chunk.js.map +1 -0
  45. package/build/static/js/{196.8bd96f9f.chunk.js → 196.3a94bd36.chunk.js} +1 -1
  46. package/build/static/js/1996.81780952.chunk.js +2 -0
  47. package/build/static/js/{1996.9f7e6143.chunk.js.map → 1996.81780952.chunk.js.map} +1 -1
  48. package/build/static/js/{2004.c830e5a3.chunk.js → 2004.667cba21.chunk.js} +3 -3
  49. package/build/static/js/{2004.c830e5a3.chunk.js.map → 2004.667cba21.chunk.js.map} +1 -1
  50. package/build/static/js/206.debedb25.chunk.js +2 -0
  51. package/build/static/js/206.debedb25.chunk.js.map +1 -0
  52. package/build/static/js/{2242.94fc47d8.chunk.js → 2242.dbfecdb7.chunk.js} +2 -2
  53. package/build/static/js/2242.dbfecdb7.chunk.js.map +1 -0
  54. package/build/static/js/254.802450c0.chunk.js +2 -0
  55. package/build/static/js/254.802450c0.chunk.js.map +1 -0
  56. package/build/static/js/{2628.df78cca9.chunk.js → 2628.b5bdedc8.chunk.js} +2 -2
  57. package/build/static/js/{2628.df78cca9.chunk.js.map → 2628.b5bdedc8.chunk.js.map} +1 -1
  58. package/build/static/js/2995.a8e5278e.chunk.js +2 -0
  59. package/build/static/js/2995.a8e5278e.chunk.js.map +1 -0
  60. package/build/static/js/{3404.9cb3e523.chunk.js → 3404.ede50d81.chunk.js} +3 -3
  61. package/build/static/js/{3404.9cb3e523.chunk.js.map → 3404.ede50d81.chunk.js.map} +1 -1
  62. package/build/static/js/3771.a2e5aca8.chunk.js +2 -0
  63. package/build/static/js/{3771.c34bfb11.chunk.js.map → 3771.a2e5aca8.chunk.js.map} +1 -1
  64. package/build/static/js/{3790.16145fc5.chunk.js → 3790.4ff8aa89.chunk.js} +2 -2
  65. package/build/static/js/{3790.16145fc5.chunk.js.map → 3790.4ff8aa89.chunk.js.map} +1 -1
  66. package/build/static/js/3856.683070f5.chunk.js +2 -0
  67. package/build/static/js/{3856.3decac1c.chunk.js.map → 3856.683070f5.chunk.js.map} +1 -1
  68. package/build/static/js/4474.47697046.chunk.js +2 -0
  69. package/build/static/js/4474.47697046.chunk.js.map +1 -0
  70. package/build/static/js/{4834.775e30b7.chunk.js → 4834.ddb658d0.chunk.js} +2 -2
  71. package/build/static/js/{4834.775e30b7.chunk.js.map → 4834.ddb658d0.chunk.js.map} +1 -1
  72. package/build/static/js/5083.a75cd808.chunk.js +3 -0
  73. package/build/static/js/5083.a75cd808.chunk.js.map +1 -0
  74. package/build/static/js/5195.969ae76a.chunk.js +2 -0
  75. package/build/static/js/{5195.06d77bb4.chunk.js.map → 5195.969ae76a.chunk.js.map} +1 -1
  76. package/build/static/js/6763.3efba0fa.chunk.js +2 -0
  77. package/build/static/js/{6763.add67f95.chunk.js.map → 6763.3efba0fa.chunk.js.map} +1 -1
  78. package/build/static/js/{7227.b6c123d7.chunk.js → 7227.83427af0.chunk.js} +3 -3
  79. package/build/static/js/{7227.b6c123d7.chunk.js.map → 7227.83427af0.chunk.js.map} +1 -1
  80. package/build/static/js/{7371.227ccafe.chunk.js → 7371.b37a6b03.chunk.js} +2 -2
  81. package/build/static/js/{7371.227ccafe.chunk.js.map → 7371.b37a6b03.chunk.js.map} +1 -1
  82. package/build/static/js/{7548.45e5dc85.chunk.js → 7548.f0ea309c.chunk.js} +2 -2
  83. package/build/static/js/{7548.45e5dc85.chunk.js.map → 7548.f0ea309c.chunk.js.map} +1 -1
  84. package/build/static/js/{760.64f75f04.chunk.js → 760.4c6c3bd8.chunk.js} +2 -2
  85. package/build/static/js/{760.64f75f04.chunk.js.map → 760.4c6c3bd8.chunk.js.map} +1 -1
  86. package/build/static/js/833.e99f3b90.chunk.js +2 -0
  87. package/build/static/js/{833.32a27f72.chunk.js.map → 833.e99f3b90.chunk.js.map} +1 -1
  88. package/build/static/js/8593.af5c71f2.chunk.js +2 -0
  89. package/build/static/js/{8593.0af3f1bd.chunk.js.map → 8593.af5c71f2.chunk.js.map} +1 -1
  90. package/build/static/js/9556.7a7bb4d4.chunk.js +3 -0
  91. package/build/static/js/{9556.f28d3154.chunk.js.map → 9556.7a7bb4d4.chunk.js.map} +1 -1
  92. package/build/static/js/{main.3f7d3274.js → main.9960c7c0.js} +2 -2
  93. package/build/static/js/{main.3f7d3274.js.map → main.9960c7c0.js.map} +1 -1
  94. package/package.json +2 -2
  95. package/build/static/css/1996.1feb46e4.chunk.css +0 -2
  96. package/build/static/css/2004.737b39bc.chunk.css +0 -2
  97. package/build/static/css/206.710bf519.chunk.css +0 -2
  98. package/build/static/css/206.710bf519.chunk.css.map +0 -1
  99. package/build/static/css/254.b824e50e.chunk.css +0 -2
  100. package/build/static/css/2628.d7dccf55.chunk.css +0 -2
  101. package/build/static/css/3404.6c847cf6.chunk.css +0 -2
  102. package/build/static/css/3771.1fa66ff2.chunk.css +0 -2
  103. package/build/static/css/4741.ae13daff.chunk.css +0 -2
  104. package/build/static/css/4834.48591cce.chunk.css +0 -2
  105. package/build/static/css/5195.339dc2db.chunk.css +0 -2
  106. package/build/static/css/5195.339dc2db.chunk.css.map +0 -1
  107. package/build/static/css/6763.1a96d043.chunk.css +0 -2
  108. package/build/static/css/7227.2cf2bf33.chunk.css +0 -2
  109. package/build/static/css/7371.128298a9.chunk.css +0 -2
  110. package/build/static/css/7548.e087a24a.chunk.css +0 -12
  111. package/build/static/css/760.ca58e057.chunk.css +0 -2
  112. package/build/static/css/833.3df58f30.chunk.css +0 -2
  113. package/build/static/css/8593.5838ba2d.chunk.css +0 -2
  114. package/build/static/css/9556.6ee73384.chunk.css +0 -2
  115. package/build/static/js/1353.a91edf5b.chunk.js.map +0 -1
  116. package/build/static/js/1996.9f7e6143.chunk.js +0 -2
  117. package/build/static/js/206.b6813a7e.chunk.js +0 -2
  118. package/build/static/js/206.b6813a7e.chunk.js.map +0 -1
  119. package/build/static/js/2242.94fc47d8.chunk.js.map +0 -1
  120. package/build/static/js/254.13803525.chunk.js +0 -2
  121. package/build/static/js/254.13803525.chunk.js.map +0 -1
  122. package/build/static/js/2995.156074ac.chunk.js +0 -2
  123. package/build/static/js/2995.156074ac.chunk.js.map +0 -1
  124. package/build/static/js/3771.c34bfb11.chunk.js +0 -2
  125. package/build/static/js/3856.3decac1c.chunk.js +0 -2
  126. package/build/static/js/4474.e0342d87.chunk.js +0 -2
  127. package/build/static/js/4474.e0342d87.chunk.js.map +0 -1
  128. package/build/static/js/5083.4e45cda2.chunk.js +0 -3
  129. package/build/static/js/5083.4e45cda2.chunk.js.map +0 -1
  130. package/build/static/js/5195.06d77bb4.chunk.js +0 -2
  131. package/build/static/js/6763.add67f95.chunk.js +0 -2
  132. package/build/static/js/833.32a27f72.chunk.js +0 -2
  133. package/build/static/js/8593.0af3f1bd.chunk.js +0 -2
  134. package/build/static/js/9556.f28d3154.chunk.js +0 -3
  135. /package/build/static/js/{1353.a91edf5b.chunk.js.LICENSE.txt → 1353.7388baf9.chunk.js.LICENSE.txt} +0 -0
  136. /package/build/static/js/{2004.c830e5a3.chunk.js.LICENSE.txt → 2004.667cba21.chunk.js.LICENSE.txt} +0 -0
  137. /package/build/static/js/{3404.9cb3e523.chunk.js.LICENSE.txt → 3404.ede50d81.chunk.js.LICENSE.txt} +0 -0
  138. /package/build/static/js/{5083.4e45cda2.chunk.js.LICENSE.txt → 5083.a75cd808.chunk.js.LICENSE.txt} +0 -0
  139. /package/build/static/js/{7227.b6c123d7.chunk.js.LICENSE.txt → 7227.83427af0.chunk.js.LICENSE.txt} +0 -0
  140. /package/build/static/js/{9556.f28d3154.chunk.js.LICENSE.txt → 9556.7a7bb4d4.chunk.js.LICENSE.txt} +0 -0
@@ -1,3 +1,3 @@
1
- /*! For license information please see 1353.a91edf5b.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[814,1353,2273,6125,9379],{1488:(t,e,i)=>{var n=i(50149),s=i(97132),r=i(88140),a=i(35324),o=i(96614),l=i(96761),c=i(15857),h=i(68592),d=c(function(t,e){var i={};if(null==t)return i;var c=!1;e=n(e,function(e){return e=a(e,t),c||(c=e.length>1),e}),o(t,h(t),i),c&&(i=s(i,7,l));for(var d=e.length;d--;)r(i,e[d]);return i});t.exports=d},3343:t=>{t.exports=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}},3892:t=>{t.exports=function(t){return this.__data__.has(t)}},4262:(t,e,i)=>{var n=i(48895),s=i(54052);t.exports=function(t,e,i){var r=e(t);return s(t)?r:n(r,i(t))}},4757:(t,e,i)=>{var n=i(56552);t.exports=function(){return n.Date.now()}},5538:(t,e,i)=>{var n=i(97160),s=i(84545),r=i(10793),a=i(27760),o=i(3892),l=i(76788);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=s,c.prototype.delete=r,c.prototype.get=a,c.prototype.has=o,c.prototype.set=l,t.exports=c},5654:(t,e,i)=>{var n=i(87937),s=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();t.exports=s},5791:(t,e,i)=>{var n=i(26924),s=i(22761);t.exports=function(t){return s(t)&&"[object Map]"==n(t)}},6571:(t,e,i)=>{var n=i(11629),s=i(56173);t.exports=function(t){return null!=t&&s(t.length)&&!n(t)}},6806:(t,e,i)=>{var n=i(61516);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}},8195:(t,e,i)=>{"use strict";function n(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}i.d(e,{A:()=>n})},9056:()=>{},9812:(t,e,i)=>{var n=i(56552).Symbol;t.exports=n},10143:t=>{var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},10793:t=>{t.exports=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}},11295:(t,e,i)=>{var n=i(9812),s=n?n.prototype:void 0,r=s?s.valueOf:void 0;t.exports=function(t){return r?Object(r.call(t)):{}}},11629:(t,e,i)=>{var n=i(16913),s=i(46686);t.exports=function(t){if(!s(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},12322:(t,e,i)=>{var n=i(16913),s=i(85990),r=i(22761),a=Function.prototype,o=Object.prototype,l=a.toString,c=o.hasOwnProperty,h=l.call(Object);t.exports=function(t){if(!r(t)||"[object Object]"!=n(t))return!1;var e=s(t);if(null===e)return!0;var i=c.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&l.call(i)==h}},12622:(t,e,i)=>{var n=i(70705);t.exports=function(t,e){var i=t.__data__;return n(e)?i["string"==typeof e?"string":"hash"]:i.map}},13028:t=>{t.exports=function(t,e){return function(i){return t(e(i))}}},13440:(t,e,i)=>{var n=i(56552)["__core-js_shared__"];t.exports=n},14079:(t,e,i)=>{var n=i(88259),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=n(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(s,function(t,i,n,s){e.push(n?s.replace(r,"$1"):i||t)}),e});t.exports=a},14657:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},15193:(t,e,i)=>{var n=i(16913),s=i(22761);t.exports=function(t){return s(t)&&"[object Arguments]"==n(t)}},15797:(t,e,i)=>{var n=i(64816);function s(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(s.Cache||n),i}s.Cache=n,t.exports=s},15857:(t,e,i)=>{var n=i(20819),s=i(55636),r=i(46350);t.exports=function(t){return r(s(t,void 0,n),t+"")}},16095:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},16913:(t,e,i)=>{var n=i(9812),s=i(34552),r=i(16095),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?s(t):r(t)}},17529:t=>{t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,s=0,r=[];++i<n;){var a=t[i];e(a,i,t)&&(r[s++]=a)}return r}},18630:(t,e,i)=>{var n=i(61516),s=i(6806),r=i(18962),a=i(11295),o=i(38710);t.exports=function(t,e,i){var l=t.constructor;switch(e){case"[object ArrayBuffer]":return n(t);case"[object Boolean]":case"[object Date]":return new l(+t);case"[object DataView]":return s(t,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(t,i);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(t);case"[object RegExp]":return r(t);case"[object Symbol]":return a(t)}}},18962:t=>{var e=/\w*$/;t.exports=function(t){var i=new t.constructor(t.source,e.exec(t));return i.lastIndex=t.lastIndex,i}},19155:(t,e,i)=>{"use strict";i.d(e,{A:()=>h});var n=i(73884),s=i(79889),r=i.n(s),a=i(93950),o=i.n(a),l=i(96418),c=i.n(l);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=c()(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}},19841:(t,e,i)=>{var n=i(16913),s=i(22761);t.exports=function(t){return"symbol"==typeof t||s(t)&&"[object Symbol]"==n(t)}},20310:(t,e,i)=>{var n=i(21817),s=i(85990),r=i(36140);t.exports=function(t){return"function"!=typeof t.constructor||r(t)?{}:n(s(t))}},20449:(t,e,i)=>{var n=i(26924),s=i(22761);t.exports=function(t){return s(t)&&"[object Set]"==n(t)}},20794:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(73884);const s=(0,n.createContext)({})},20816:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(82284);function s(t){var e=function(t,e){if("object"!=(0,n.A)(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=(0,n.A)(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==(0,n.A)(e)?e:e+""}},20819:(t,e,i)=>{var n=i(80755);t.exports=function(t){return(null==t?0:t.length)?n(t,1):[]}},21676:(t,e,i)=>{var n=i(52969),s=i(53871);t.exports=function(t,e){return e.length<2?t:n(t,s(e,0,-1))}},21817:(t,e,i)=>{var n=i(46686),s=Object.create,r=function(){function t(){}return function(e){if(!n(e))return{};if(s)return s(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();t.exports=r},22172:(t,e,i)=>{"use strict";i.d(e,{A:()=>T});var n=i(58168),s=i(5544),r=i(64467),a=i(53986),o=i(73884),l=i.n(o),c=i(83136),h=i.n(c),d=i(8500),u=i(20794),p=i(89379),f=i(82284),g=i(80930),A=i(49134),m=i(97907);function v(t){return"object"===(0,f.A)(t)&&"string"===typeof t.name&&"string"===typeof t.theme&&("object"===(0,f.A)(t.icon)||"function"===typeof t.icon)}function b(){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 w(t,e,i){return i?l().createElement(t.tag,(0,p.A)((0,p.A)({key:e},b(t.attrs)),i),(t.children||[]).map(function(i,n){return w(i,"".concat(e,"-").concat(t.tag,"-").concat(n))})):l().createElement(t.tag,(0,p.A)({key:e},b(t.attrs)),(t.children||[]).map(function(i,n){return w(i,"".concat(e,"-").concat(t.tag,"-").concat(n))}))}function y(t){return(0,d.generate)(t)[0]}function _(t){return t?Array.isArray(t)?t:[t]:[]}var x=["icon","className","onClick","style","primaryColor","secondaryColor"],E={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var C=function(t){var e,i,n=t.icon,s=t.className,r=t.onClick,l=t.style,c=t.primaryColor,h=t.secondaryColor,d=(0,a.A)(t,x),f=o.useRef(),b=E;if(c&&(b={primaryColor:c,secondaryColor:h||y(c)}),function(t){var e=(0,o.useContext)(u.A),i=e.csp,n=e.prefixCls,s=e.layer,r="\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&&(r=r.replace(/anticon/g,n)),s&&(r="@layer ".concat(s," {\n").concat(r,"\n}")),(0,o.useEffect)(function(){var e=t.current,n=(0,A.j)(e);(0,g.BD)(r,"@ant-design-icons",{prepend:!s,csp:i,attachTo:n})},[])}(f),e=v(n),i="icon should be icon definiton, but got ".concat(n),(0,m.Ay)(e,"[@ant-design/icons] ".concat(i)),!v(n))return null;var _=n;return _&&"function"===typeof _.icon&&(_=(0,p.A)((0,p.A)({},_),{},{icon:_.icon(b.primaryColor,b.secondaryColor)})),w(_.icon,"svg-".concat(_.name),(0,p.A)((0,p.A)({className:s,onClick:r,style:l,"data-icon":_.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:f}))};C.displayName="IconReact",C.getTwoToneColors=function(){return(0,p.A)({},E)},C.setTwoToneColors=function(t){var e=t.primaryColor,i=t.secondaryColor;E.primaryColor=e,E.secondaryColor=i||y(e),E.calculated=!!i};const k=C;function S(t){var e=_(t),i=(0,s.A)(e,2),n=i[0],r=i[1];return k.setTwoToneColors({primaryColor:n,secondaryColor:r})}var M=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];S(d.blue.primary);var L=o.forwardRef(function(t,e){var i=t.className,l=t.icon,c=t.spin,d=t.rotate,p=t.tabIndex,f=t.onClick,g=t.twoToneColor,A=(0,a.A)(t,M),m=o.useContext(u.A),v=m.prefixCls,b=void 0===v?"anticon":v,w=m.rootClassName,y=h()(w,b,(0,r.A)((0,r.A)({},"".concat(b,"-").concat(l.name),!!l.name),"".concat(b,"-spin"),!!c||"loading"===l.name),i),x=p;void 0===x&&f&&(x=-1);var E=d?{msTransform:"rotate(".concat(d,"deg)"),transform:"rotate(".concat(d,"deg)")}:void 0,C=_(g),S=(0,s.A)(C,2),L=S[0],T=S[1];return o.createElement("span",(0,n.A)({role:"img","aria-label":l.name},A,{ref:e,tabIndex:x,onClick:f,className:y}),o.createElement(k,{icon:l,primaryColor:L,secondaryColor:T,style:E}))});L.displayName="AntdIcon",L.getTwoToneColor=function(){var t=k.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},L.setTwoToneColor=S;const T=L},22541:t=>{t.exports=function(t){return function(){return t}}},22662:(t,e,i)=>{var n=i(95575);t.exports=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},22761:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},22777:(t,e,i)=>{var n=i(15193),s=i(22761),r=Object.prototype,a=r.hasOwnProperty,o=r.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(t){return s(t)&&a.call(t,"callee")&&!o.call(t,"callee")};t.exports=l},22929:(t,e,i)=>{var n=i(56552).Uint8Array;t.exports=n},23253:(t,e,i)=>{var n=i(5538),s=i(63868),r=i(94258),a=i(83223),o=i(46686),l=i(30474),c=i(53737);t.exports=function t(e,i,h,d,u){e!==i&&r(i,function(r,l){if(u||(u=new n),o(r))a(e,i,l,h,t,d,u);else{var p=d?d(c(e,l),r,l+"",e,i,u):void 0;void 0===p&&(p=r),s(e,l,p)}},l)}},24190:(t,e,i)=>{var n=i(61340);t.exports=function(t){var e=this.__data__,i=n(e,t);return i<0?void 0:e[i][1]}},24558:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(26562);function s(t,e,i){return t.set((0,n.A)(t,e),i),i}},25051:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},26562:(t,e,i)=>{"use strict";function n(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}i.d(e,{A:()=>n})},26600:(t,e,i)=>{var n=i(87937)(i(56552),"WeakMap");t.exports=n},26924:(t,e,i)=>{var n=i(97685),s=i(85204),r=i(65387),a=i(72070),o=i(26600),l=i(16913),c=i(96996),h="[object Map]",d="[object Promise]",u="[object Set]",p="[object WeakMap]",f="[object DataView]",g=c(n),A=c(s),m=c(r),v=c(a),b=c(o),w=l;(n&&w(new n(new ArrayBuffer(1)))!=f||s&&w(new s)!=h||r&&w(r.resolve())!=d||a&&w(new a)!=u||o&&w(new o)!=p)&&(w=function(t){var e=l(t),i="[object Object]"==e?t.constructor:void 0,n=i?c(i):"";if(n)switch(n){case g:return f;case A:return h;case m:return d;case v:return u;case b:return p}return e}),t.exports=w},27615:(t,e,i)=>{var n=i(95575);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},27760:t=>{t.exports=function(t){return this.__data__.get(t)}},28325:(t,e,i)=>{var n=i(22541),s=i(5654),r=i(33279),a=s?function(t,e){return s(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:r;t.exports=a},28673:(t,e,i)=>{var n=i(73204),s=i(83713),r=i(6571);t.exports=function(t){return r(t)?n(t):s(t)}},29075:(t,e,i)=>{var n=i(96614),s=i(56326);t.exports=function(t,e){return n(t,s(t),e)}},29935:(t,e,i)=>{var n=i(61340),s=Array.prototype.splice;t.exports=function(t){var e=this.__data__,i=n(e,t);return!(i<0)&&(i==e.length-1?e.pop():s.call(e,i,1),--this.size,!0)}},30474:(t,e,i)=>{var n=i(73204),s=i(58122),r=i(6571);t.exports=function(t){return r(t)?n(t,!0):s(t)}},31170:t=>{t.exports=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)}},31353:(t,e,i)=>{"use strict";i.r(e),i.d(e,{AudioPreview:()=>Gm,Download:()=>xm,FileButton:()=>dv,FileInput:()=>Uv,FileList:()=>Iv,FileListOptionButtons:()=>Mv,FileModal:()=>cv,FilePreview:()=>tv,FileUpload:()=>Gv,HtmlPreview:()=>Im,Image:()=>Sv,ImagePreview:()=>Um,OSSFilePreview:()=>Jm,OfficePreview:()=>Wm,PdfPreview:()=>jm,PrintButton:()=>iv,TextPreview:()=>Bm,UnknownPreview:()=>Hm,VideoPreview:()=>Xm,computedAccept:()=>qv,default:()=>pm,defaultAccept:()=>Bv,download:()=>fm,downloadBlobFile:()=>gm,useDownload:()=>wm,useFileModal:()=>lv,useFileModalProps:()=>ov,useFileUpload:()=>Dv,withOSSFile:()=>dm});var n={};i.r(n),i.d(n,{dU:()=>mg,ng:()=>vg,EA:()=>bg,Tm:()=>wg,D6:()=>yg,YE:()=>_g});var s=i(73884),r=i.n(s),a=i(83694),o=i(87558),l=i.n(o),c=i(34677),h=i.n(c),d=i(55199),u=i(89330),p=i(58168);const f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};var g=i(22172);const A=s.forwardRef(function(t,e){return s.createElement(g.A,(0,p.A)({},t,{ref:e,icon:f}))});const m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};const v=s.forwardRef(function(t,e){return s.createElement(g.A,(0,p.A)({},t,{ref:e,icon:m}))});var b=i(76191),w=i(67407),y=i(61966);const _={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"};const x=s.forwardRef(function(t,e){return s.createElement(g.A,(0,p.A)({},t,{ref:e,icon:_}))});var E,C=i(96418),k=i.n(C),S=i(1488),M=i.n(S),L=i(52526),T=0,R=!1,P=!1,F="[iFrameSizer]",I=null,D=window.requestAnimationFrame,O=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),N={},W=null,j=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(){q("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function B(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function H(t,e,i){t.addEventListener(e,i,!1)}function z(t,e,i){t.removeEventListener(e,i,!1)}function U(t){return F+"["+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 V(t){return N[t]?N[t].log:R}function G(t,e){X("log",t,e,V(t))}function q(t,e){X("warn",t,e,!0)}function X(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](U(e),i)}function Y(t){function e(){s("Height"),s("Width"),nt(function(){it(p),$(f),d("onResized",p)},p,"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(N[f]["max"+t]),i=Number(N[f]["min"+t]),n=t.toLowerCase(),s=Number(p[n]);G(f,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,G(f,"Set "+n+" to min value")),s>e&&(s=e,G(f,"Set "+n+" to max value")),p[n]=""+s}function r(t){return u.slice(u.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){st("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=p.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,lt[s=e]||(lt[s]=setTimeout(function(){lt[s]=null,i()},n))}function o(t){var e=t.getBoundingClientRect();return J(f),{x:Math.floor(Number(e.left)+Number(I.x)),y:Math.floor(Number(e.top)+Number(I.y))}}function l(t){var e=t?o(p.iframe):{x:0,y:0},i={x:Number(p.width)+e.x,y:Number(p.height)+e.y};G(f,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(I=i,c(),G(f,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):q(f,"Unable to scroll to requested position, window.parentIFrame not found")}function c(){!1===d("onScroll",I)?tt():$(f)}function h(t){var e={};if(0===Number(p.width)&&0===Number(p.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:p.width,y:p.height};d(t,{iframe:p.iframe,screenX:Number(e.x),screenY:Number(e.y),type:p.type})}function d(t,e){return K(f,t,e)}var u=t.data,p={},f=null;"[iFrameResizerChild]Ready"===u?function(){for(var t in N)st("iFrame requested init",rt(t),N[t].iframe,t)}():F===(""+u).slice(0,13)&&u.slice(13).split(":")[0]in N?(p=function(){var t=u.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=N[t[0]]&&N[t[0]].iframe,r=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(r)+n(r),width:t[2],type:t[3]}}(),f=p.id,N[f]&&(N[f].loaded=!0),!function(){var t=p.type in{true:1,false:1,undefined:1};return t&&G(f,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return N[t]||(e=!1,q(p.type+" No settings for "+t+". Message was: "+u)),e}(f)&&(G(f,"Received: "+u),function(){var t=!0;return null===p.iframe&&(q(f,"IFrame ("+p.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=N[f]&&N[f].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(G(f,"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=N[f]&&N[f].remoteHost;return G(f,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+p.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(N[f]&&N[f].firstRun&&N[f]&&(N[f].firstRun=!1),p.type){case"close":Z(p.iframe);break;case"message":t=r(6),G(f,"onMessage passed: {iframe: "+p.iframe.id+", message: "+t+"}"),d("onMessage",{iframe:p.iframe,message:JSON.parse(t)}),G(f,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":N[f].autoResize=JSON.parse(r(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":a(N[f]&&N[f].iframe,f),function(){function t(t,n){function s(){N[i]?a(N[i].iframe,i):e()}["scroll","resize"].forEach(function(e){G(i,t+e+" listener for sendPageInfo"),n(window,e,s)})}function e(){t("Remove ",z)}var i=f;t("Add ",H),N[i]&&(N[i].stopPageInfo=e)}();break;case"pageInfoStop":N[f]&&N[f].stopPageInfo&&(N[f].stopPageInfo(),delete N[f].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=o(n);G(f,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),I={x:t.x,y:t.y},c(),G(f,"--")}():window.top===window.self?G(f,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):G(f,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":et(p);break;case"init":e(),d("onInit",p.iframe);break;default:0===Number(p.width)&&0===Number(p.height)?q("Unsupported message received ("+p.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){X("info",t,e,V(t))}(f,"Ignored: "+u)}function K(t,e,i){var n=null,s=null;if(N[t]){if("function"!==typeof(n=N[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function Q(t){var e=t.id;delete N[e]}function Z(t){var e=t.id;if(!1!==K(e,"onClose",e)){G(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){q(i)}K(e,"onClosed",e),G(e,"--"),Q(t),E&&(E.disconnect(),E=null)}else G(e,"Close iframe cancelled by onClose event")}function J(t){null===I&&G(t,"Get page position: "+(I={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+I.y)}function $(t){null!==I&&(window.scrollTo(I.x,I.y),G(t,"Set page position: "+I.x+","+I.y),tt())}function tt(){I=null}function et(t){G(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),J(t.id),nt(function(){it(t),st("reset","reset",t.iframe,t.id)},t,"reset")}function it(t){function e(e){P||"0"!==t[e]||(P=!0,G(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(N[t]&&N[t].iframe.style[e])}function i(t){return null!==t.offsetParent}N[t]&&i(N[t].iframe)&&(e("height")||e("width"))&&st("Visibility change","resize",N[t].iframe,t)}Object.keys(N).forEach(function(e){t(e)})}function e(e){G("window","Mutation observed: "+e[0].target+" "+e[0].type),ot(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=B();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",G(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):G("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;N[n]&&(N[n].sizeHeight&&i("height"),N[n].sizeWidth&&i("width"))}function nt(t,e,i){i!==e.type&&D&&!window.jasmine?(G(e.id,"Requesting animation frame"),D(t)):t()}function st(t,e,i,n,s){var r=!1;n=n||i.id,N[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=N[n]&&N[n].targetOrigin;G(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(F+e,s)}():q(n,"["+t+"] IFrame("+n+") not found"),s&&N[n]&&N[n].warningTimeout&&(N[n].msgTimeout=setTimeout(function(){!N[n]||N[n].loaded||r||(r=!0,q(n,"IFrame has not responded within "+N[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."))},N[n].warningTimeout)))}function rt(t){return t+":"+N[t].bodyMarginV1+":"+N[t].sizeWidth+":"+N[t].log+":"+N[t].interval+":"+N[t].enablePublicMethods+":"+N[t].autoResize+":"+N[t].bodyMargin+":"+N[t].heightCalculationMethod+":"+N[t].bodyBackground+":"+N[t].bodyPadding+":"+N[t].tolerance+":"+N[t].inPageLinks+":"+N[t].resizeFrom+":"+N[t].widthCalculationMethod+":"+N[t].mouseEvents}function at(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],q(n,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var n=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||j.id+T++;return null!==document.getElementById(t)&&(t+=T++),t}(),R=(e||{}).log,G(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);n in N&&"iFrameResizer"in t?q(n,"Ignored iFrame, already setup."):(!function(e){var s;e=e||{},N[n]=Object.create(null),N[n].iframe=t,N[n].firstRun=!0,N[n].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 j)Object.prototype.hasOwnProperty.call(j,e)&&(N[n][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:j[e])}(e),N[n]&&(N[n].targetOrigin=!0===N[n].checkOrigin?""===(s=N[n].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*")}(e),function(){switch(G(n,"IFrame scrolling "+(N[n]&&N[n].scrolling?"enabled":"disabled")+" for "+n),t.style.overflow=!1===(N[n]&&N[n].scrolling)?"hidden":"auto",N[n]&&N[n].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=N[n]?N[n].scrolling:"no"}}(),function(){function e(e){var i=N[n][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,G(n,"Set "+e+" = "+t.style[e]))}function i(t){if(N[n]["min"+t]>N[n]["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(N[n]&&N[n].bodyMargin)&&"0"!==(N[n]&&N[n].bodyMargin)||(N[n].bodyMarginV1=N[n].bodyMargin,N[n].bodyMargin=N[n].bodyMargin+"px"),function(e){var i=B();i&&(E=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&&Z(t)})})});return i.observe(t.parentNode,{childList:!0}),i}(i)),H(t,"load",function(){st("iFrame.onload",e,t,void 0,!0),function(){var e=N[n]&&N[n].firstRun,i=N[n]&&N[n].heightCalculationMethod in O;!e&&i&&et({iframe:t,height:0,width:0,type:"init"})}()}),st("init",e,t,void 0,!0)}(rt(n)),N[n]&&(N[n].iframe.iFrameResizer={close:Z.bind(null,N[n].iframe),removeListeners:Q.bind(null,N[n].iframe),resize:st.bind(null,"Window resize","resize",N[n].iframe),moveToAnchor:function(t){st("Move to anchor","moveToAnchor:"+t,N[n].iframe,n)},sendMessage:function(t){st("Send Message","message:"+(t=JSON.stringify(t)),N[n].iframe,n)}}))}function ot(t,e){null===W&&(W=setTimeout(function(){W=null,t()},e))}var lt={};function ct(){"hidden"!==document.visibilityState&&(G("document","Trigger event: Visibility change"),ot(function(){ht("Tab Visible","resize")},16))}function ht(t,e){Object.keys(N).forEach(function(i){(function(t){return N[t]&&"parent"===N[t].resizeFrom&&N[t].autoResize&&!N[t].firstRun})(i)&&st(t,e,N[i].iframe,i)})}function dt(){H(window,"message",Y),H(window,"resize",function(){var t;G("window","Trigger event: "+(t="resize")),ot(function(){ht("Window "+t,"resize")},16)}),H(document,"visibilitychange",ct),H(document,"-webkit-visibilitychange",ct)}var ut=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+">")}(),at(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!D;t+=1)D=window[e[t]+"RequestAnimationFrame"];D?D=D.bind(window):G("setup","RequestAnimationFrame not supported")}(),dt(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&q("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}}(),pt=i(83136),ft=i.n(pt),gt=i(89379);function At(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}var mt=i(53986),vt=i(39790),bt=i(26562);function wt(t,e,i){return i((0,bt.A)(t,e))}var yt=i(64467),_t=i(55149),xt=i(38458),Et=i(24558);const Ct=["textContentSource","container","viewport"];var kt,St,Mt,Lt,Tt,Rt,Pt,Ft,It,Dt,Ot,Nt,Wt={d:(t,e)=>{for(var i in e)Wt.o(e,i)&&!Wt.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},jt=globalThis.pdfjsLib={};Wt.d(jt,{AbortException:()=>Ze,AnnotationEditorLayer:()=>eg,AnnotationEditorParamsType:()=>$t,AnnotationEditorType:()=>Jt,AnnotationEditorUIManager:()=>Vs,AnnotationLayer:()=>ud,AnnotationMode:()=>Zt,CMapCompressionType:()=>Pe,ColorPicker:()=>Bu,DOMSVGFactory:()=>Yi,DrawLayer:()=>pg,FeatureTest:()=>ei,GlobalWorkerOptions:()=>io,ImageKind:()=>oe,InvalidPDFException:()=>Xe,MissingPDFException:()=>Ye,OPS:()=>Fe,Outliner:()=>Hd,PDFDataRangeTransport:()=>$l,PDFDateString:()=>on,PDFWorker:()=>uc,PasswordResponses:()=>Ie,PermissionFlag:()=>te,PixelsPerInch:()=>ki,RenderingCancelledException:()=>Qi,TextLayer:()=>Tl,UnexpectedResponseException:()=>Ke,Util:()=>ni,VerbosityLevel:()=>Re,XfaLayer:()=>jc,build:()=>Dc,createValidAbsoluteUrl:()=>ze,fetchData:()=>Gi,getDocument:()=>Kl,getFilenameFromUrl:()=>$i,getPdfFilenameFromUrl:()=>tn,getXfaPageViewport:()=>ln,isDataScheme:()=>Zi,isPdfFile:()=>Ji,noContextMenu:()=>sn,normalizeUnicode:()=>li,renderTextLayer:()=>Hl,setLayerDimensions:()=>un,shadow:()=>Ue,updateTextLayer:()=>zl,version:()=>Ic});const Bt="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),Ht=[1,0,0,1,0,0],zt=[.001,0,0,.001,0,0],Ut=1.35,Vt=1,Gt=2,qt=4,Xt=16,Yt=32,Kt=64,Qt=256,Zt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Jt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},$t={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},te={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ee=0,ie=1,ne=2,se=3,re=3,ae=4,oe={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},le=1,ce=2,he=3,de=4,ue=5,pe=6,fe=7,ge=8,Ae=9,me=10,ve=11,be=12,we=13,ye=14,_e=15,xe=16,Ee=17,Ce=20,ke=1,Se=2,Me=3,Le=4,Te=5,Re={ERRORS:0,WARNINGS:1,INFOS:5},Pe={NONE:0,BINARY:1},Fe={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},Ie={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let De=Re.WARNINGS;function Oe(t){Number.isInteger(t)&&(De=t)}function Ne(){return De}function We(t){De>=Re.INFOS&&console.log("Info: ".concat(t))}function je(t){De>=Re.WARNINGS&&console.log("Warning: ".concat(t))}function Be(t){throw new Error(t)}function He(t,e){t||Be(e)}function ze(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);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(n){}}const s=e?new URL(t,e):new URL(t);if(function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s))return s}catch(s){}return null}function Ue(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 Ve=function(){function t(e,i){this.constructor===t&&Be("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class Ge extends Ve{constructor(t,e){super(t,"PasswordException"),this.code=e}}class qe extends Ve{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Xe extends Ve{constructor(t){super(t,"InvalidPDFException")}}class Ye extends Ve{constructor(t){super(t,"MissingPDFException")}}class Ke extends Ve{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class Qe extends Ve{constructor(t){super(t,"FormatError")}}class Ze extends Ve{constructor(t){super(t,"AbortException")}}function Je(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||Be("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 $e(t){"string"!==typeof t&&Be("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 ti(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class ei{static get isLittleEndian(){return Ue(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return Ue(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return Ue(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){var t;return"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.platform)?Ue(this,"platform",{isMac:navigator.platform.includes("Mac")}):Ue(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,e;return Ue(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const ii=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class ni{static makeHexColor(t,e,i){return"#".concat(ii[t]).concat(ii[e]).concat(ii[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,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}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 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)],(0,bt.A)(ni,this,ri).call(this,t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),(0,bt.A)(ni,this,ri).call(this,t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l),l}}function si(t,e,i,n,s,r,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,f=h*(h*(h*s+3*l*r)+3*d*a)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],f)}function ri(t,e,i,n,s,r,a,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&(0,bt.A)(kt,this,si).call(this,t,e,i,n,s,r,a,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),f=2*l;(0,bt.A)(kt,this,si).call(this,t,e,i,n,s,r,a,o,(-c+p)/f,d),(0,bt.A)(kt,this,si).call(this,t,e,i,n,s,r,a,o,(-c-p)/f,d)}kt=ni;let ai=null,oi=null;function li(t){return ai||(ai=/([\xA0\xB5\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+)/g,oi=new Map([["\ufb05","\u017ft"]])),t.replaceAll(ai,(t,e,i)=>e?e.normalize("NFKC"):oi.get(i))}const ci="pdfjs_internal_id_",hi=0,di=1,ui=2,pi=3,fi=4,gi=5,Ai=6,mi=7,vi=8;class bi{constructor(){this.constructor===bi&&Be("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(){}}var wi=new WeakMap;class yi{constructor(){let{enableHWA:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,_t.A)(this,wi,!1),this.constructor===yi&&Be("Cannot initialize BaseCanvasFactory."),(0,Et.A)(wi,this,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:!(0,xt.A)(wi,this)})}}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){Be("Abstract method `_createCanvas` called.")}}class _i{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===_i&&Be("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?Pe.BINARY:Pe.NONE;return this._fetchData(i,n).catch(t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))})}_fetchData(t,e){Be("Abstract method `_fetchData` called.")}}class xi{constructor(t){let{baseUrl:e=null}=t;this.constructor===xi&&Be("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="".concat(this.baseUrl).concat(e);return this._fetchData(i).catch(t=>{throw new Error("Unable to load font data at: ".concat(i))})}_fetchData(t){Be("Abstract method `_fetchData` called.")}}class Ei{constructor(){this.constructor===Ei&&Be("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","".concat(t,"px")),n.setAttribute("height","".concat(e,"px"))),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Be("Abstract method `_createSVG` called.")}}const Ci="http://www.w3.org/2000/svg";class ki{}St=ki,(0,yt.A)(ki,"CSS",96),(0,yt.A)(ki,"PDF",72),(0,yt.A)(ki,"PDF_TO_CSS_UNITS",St.CSS/St.PDF);var Si=new WeakMap,Mi=new WeakMap,Li=new WeakMap,Ti=new WeakMap,Ri=new WeakMap,Pi=new WeakMap,Fi=new WeakSet;function Ii(t){return(0,xt.A)(Si,t)||(0,Et.A)(Si,t,new Map)}function Di(t){return(0,xt.A)(Ri,t)||(0,Et.A)(Ri,t,new Map)}function Oi(t){if(!(0,xt.A)(Mi,t)){const e=(0,xt.A)(Ti,t).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=(0,xt.A)(Ti,t).createElementNS(Ci,"svg");n.setAttribute("width",0),n.setAttribute("height",0),(0,Et.A)(Mi,t,(0,xt.A)(Ti,t).createElementNS(Ci,"defs")),e.append(n),n.append((0,xt.A)(Mi,t)),(0,xt.A)(Ti,t).body.append(e)}return(0,xt.A)(Mi,t)}function Ni(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(",")]}function Wi(t){const e=(0,xt.A)(Ti,this).createElementNS(Ci,"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)}function ji(t){const e=(0,xt.A)(Ti,this).createElementNS(Ci,"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)}function Bi(t){const e=(0,xt.A)(Ti,this).createElementNS(Ci,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),wt(Fi,this,Oi).append(e),e}function Hi(t,e,i){const n=(0,xt.A)(Ti,this).createElementNS(Ci,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function zi(t,e,i,n){const s=(0,xt.A)(Ti,this).createElementNS(Ci,"feComponentTransfer");n.append(s),(0,bt.A)(Fi,this,Hi).call(this,s,"feFuncR",t),(0,bt.A)(Fi,this,Hi).call(this,s,"feFuncG",e),(0,bt.A)(Fi,this,Hi).call(this,s,"feFuncB",i)}function Ui(t,e){const i=(0,xt.A)(Ti,this).createElementNS(Ci,"feComponentTransfer");e.append(i),(0,bt.A)(Fi,this,Hi).call(this,i,"feFuncA",t)}function Vi(t){return wt(Fi,this,Oi).style.color=t,cn(getComputedStyle(wt(Fi,this,Oi)).getPropertyValue("color"))}async function Gi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(nn(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 qi extends _i{_fetchData(t,e){return Gi(t,this.isCompressed?"arraybuffer":"text").then(t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):$e(t),compressionType:e}))}}class Xi extends xi{_fetchData(t){return Gi(t,"arraybuffer").then(t=>new Uint8Array(t))}}class Yi extends Ei{_createSVG(t){return document.createElementNS(Ci,t)}}class Ki{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 c,h,d,u,p,f,g,A;switch(n%=360,n<0&&(n+=360),n){case 180:c=-1,h=0,d=0,u=1;break;case 90:c=0,h=1,d=1,u=0;break;case 270:c=0,h=-1,d=-1,u=0;break;case 0:c=1,h=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===c?(p=Math.abs(l-e[1])*i+s,f=Math.abs(o-e[0])*i+r,g=(e[3]-e[1])*i,A=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,f=Math.abs(l-e[1])*i+r,g=(e[2]-e[0])*i,A=(e[3]-e[1])*i),this.transform=[c*i,h*i,d*i,u*i,p-c*i*o-d*i*l,f-h*i*o-u*i*l],this.width=g,this.height=A}get rawDims(){const{viewBox:t}=this;return Ue(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 Ki({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return ni.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=ni.applyTransform([t[0],t[1]],this.transform),i=ni.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return ni.applyInverseTransform([t,e],this.transform)}}class Qi extends Ve{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function Zi(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function Ji(t){return"string"===typeof t&&/\.pdf$/i.test(t)}function $i(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function tn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(Zi(t))return je('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(r){}return s||e}class en{constructor(){(0,yt.A)(this,"started",Object.create(null)),(0,yt.A)(this,"times",[])}time(t){t in this.started&&je("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||je("Timer has not been started for ".concat(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("".concat(i.padEnd(e)," ").concat(s-n,"ms\n"));return t.join("")}}function nn(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(i){return!1}}function sn(t){t.preventDefault()}function rn(t){console.log("Deprecated API usage: "+t)}let an;class on{static toDateObject(t){if(!t||"string"!==typeof t)return null;an||(an=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=an.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 c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(r+=c,a+=h):"+"===l&&(r-=c,a-=h),new Date(Date.UTC(i,n,s,r,a,o))}}function ln(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 Ki({viewBox:a,scale:i,rotation:n})}function cn(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):(je('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function hn(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function dn(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 un(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 Ki){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=ei.isCSSRoundSupported,o="var(--scale-factor) * ".concat(n,"px"),l="var(--scale-factor) * ".concat(s,"px"),c=a?"round(".concat(o,", 1px)"):"calc(".concat(o,")"),h=a?"round(".concat(l,", 1px)"):"calc(".concat(l,")");i&&e.rotation%180!==0?(r.width=h,r.height=c):(r.width=c,r.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}var pn=new WeakMap,fn=new WeakMap,gn=new WeakMap,An=new WeakMap,mn=new WeakSet;class vn{constructor(t){(0,vt.A)(this,mn),(0,_t.A)(this,pn,null),(0,_t.A)(this,fn,null),(0,_t.A)(this,gn,void 0),(0,_t.A)(this,An,null),(0,Et.A)(gn,this,t)}render(){const t=(0,Et.A)(pn,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=(0,xt.A)(gn,this)._uiManager._signal;t.addEventListener("contextmenu",sn,{signal:e}),t.addEventListener("pointerdown",bn,{signal:e});const i=(0,Et.A)(An,this,document.createElement("div"));i.className="buttons",t.append(i);const n=(0,xt.A)(gn,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===(0,xt.A)(gn,this)._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd="".concat(100*i,"%"),e.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return(0,bt.A)(mn,this,xn).call(this),t}hide(){var t;(0,xt.A)(pn,this).classList.add("hidden"),null===(t=(0,xt.A)(fn,this))||void 0===t||t.hideDropdown()}show(){(0,xt.A)(pn,this).classList.remove("hidden")}addAltTextButton(t){(0,bt.A)(mn,this,_n).call(this,t),(0,xt.A)(An,this).prepend(t,wt(mn,this,En))}addColorPicker(t){(0,Et.A)(fn,this,t);const e=t.renderButton();(0,bt.A)(mn,this,_n).call(this,e),(0,xt.A)(An,this).prepend(e,wt(mn,this,En))}remove(){var t;(0,xt.A)(pn,this).remove(),null===(t=(0,xt.A)(fn,this))||void 0===t||t.destroy(),(0,Et.A)(fn,this,null)}}function bn(t){t.stopPropagation()}function wn(t){(0,xt.A)(gn,this)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}function yn(t){(0,xt.A)(gn,this)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}function _n(t){const e=(0,xt.A)(gn,this)._uiManager._signal;t.addEventListener("focusin",(0,bt.A)(mn,this,wn).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",(0,bt.A)(mn,this,yn).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",sn,{signal:e})}function xn(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat((0,xt.A)(gn,this).editorType,"-button")),(0,bt.A)(mn,this,_n).call(this,t),t.addEventListener("click",t=>{(0,xt.A)(gn,this)._uiManager.delete()},{signal:(0,xt.A)(gn,this)._uiManager._signal}),(0,xt.A)(An,this).append(t)}function En(t){const e=document.createElement("div");return e.className="divider",e}var Cn=new WeakMap,kn=new WeakMap,Sn=new WeakMap,Mn=new WeakSet;class Ln{constructor(t){(0,vt.A)(this,Mn),(0,_t.A)(this,Cn,null),(0,_t.A)(this,kn,null),(0,_t.A)(this,Sn,void 0),(0,Et.A)(Sn,this,t)}show(t,e,i){const[n,s]=(0,bt.A)(Mn,this,Rn).call(this,e,i),{style:r}=(0,xt.A)(kn,this)||(0,Et.A)(kn,this,(0,bt.A)(Mn,this,Tn).call(this));t.append((0,xt.A)(kn,this)),r.insetInlineEnd="".concat(100*n,"%"),r.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){(0,xt.A)(kn,this).remove()}}function Tn(){const t=(0,Et.A)(kn,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",sn,{signal:(0,xt.A)(Sn,this)._signal});const e=(0,Et.A)(Cn,this,document.createElement("div"));return e.className="buttons",t.append(e),(0,bt.A)(Mn,this,Pn).call(this),t}function Rn(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]}function Pn(){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=(0,xt.A)(Sn,this)._signal;t.addEventListener("contextmenu",sn,{signal:i}),t.addEventListener("click",()=>{(0,xt.A)(Sn,this).highlightSelection("floating_button")},{signal:i}),(0,xt.A)(Cn,this).append(t)}function Fn(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var In=new WeakMap;class Dn{constructor(){(0,_t.A)(this,In,0)}get id(){var t,e;return"".concat("pdfjs_internal_editor_").concat(((0,Et.A)(In,this,(t=(0,xt.A)(In,this),e=t++,t)),e))}}var On=new WeakMap,Nn=new WeakMap,Wn=new WeakMap,jn=new WeakSet;class Bn{constructor(){(0,vt.A)(this,jn),(0,_t.A)(this,On,function(){var t,e;if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();const i=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.getRandomValues))crypto.getRandomValues(i);else for(let n=0;n<32;n++)i[n]=Math.floor(255*Math.random());return Je(i)}()),(0,_t.A)(this,Nn,0),(0,_t.A)(this,Wn,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 Ue(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 getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return(0,bt.A)(jn,this,Hn).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return(0,bt.A)(jn,this,Hn).call(this,t,t)}async getFromId(t){(0,xt.A)(Wn,this)||(0,Et.A)(Wn,this,new Map);const e=(0,xt.A)(Wn,this).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=(0,xt.A)(Wn,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){(0,xt.A)(Wn,this)||(0,Et.A)(Wn,this,new Map);const e=(0,xt.A)(Wn,this).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith("image_".concat((0,xt.A)(On,this),"_"))}}async function Hn(t,e){var i;(0,xt.A)(Wn,this)||(0,Et.A)(Wn,this,new Map);let n=(0,xt.A)(Wn,this).get(t);if(null===n)return null;if(null!==(i=n)&&void 0!==i&&i.bitmap)return n.refCounter+=1,n;try{var s,r;let t;if(n||(n={bitmap:null,id:"image_".concat((0,xt.A)(On,this),"_").concat(((0,Et.A)(Nn,this,(s=(0,xt.A)(Nn,this),r=s++,s)),r)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await Gi(e,"blob")):t=n.file=e,"image/svg+xml"===t.type){const e=Mt._isSVGFittingCanvas,i=new FileReader,s=new Image,r=new Promise((t,r)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,t()},i.onload=async()=>{const t=n.svgUrl=i.result;s.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},s.onerror=i.onerror=r});i.readAsDataURL(t),await r}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(a){console.error(a),n=null}return(0,xt.A)(Wn,this).set(t,n),n&&(0,xt.A)(Wn,this).set(n.id,n),n}Mt=Bn;var zn=new WeakMap,Un=new WeakMap,Vn=new WeakMap,Gn=new WeakMap;class qn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;(0,_t.A)(this,zn,[]),(0,_t.A)(this,Un,!1),(0,_t.A)(this,Vn,void 0),(0,_t.A)(this,Gn,-1),(0,Et.A)(Vn,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(),(0,xt.A)(Un,this))return;const l={cmd:e,undo:i,post:n,type:r};if(-1===(0,xt.A)(Gn,this))return(0,xt.A)(zn,this).length>0&&((0,xt.A)(zn,this).length=0),(0,Et.A)(Gn,this,0),void(0,xt.A)(zn,this).push(l);if(a&&(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)].type===r)return o&&(l.undo=(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)].undo),void((0,xt.A)(zn,this)[(0,xt.A)(Gn,this)]=l);const c=(0,xt.A)(Gn,this)+1;c===(0,xt.A)(Vn,this)?(0,xt.A)(zn,this).splice(0,1):((0,Et.A)(Gn,this,c),c<(0,xt.A)(zn,this).length&&(0,xt.A)(zn,this).splice(c)),(0,xt.A)(zn,this).push(l)}undo(){if(-1===(0,xt.A)(Gn,this))return;(0,Et.A)(Un,this,!0);const{undo:t,post:e}=(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)];t(),null===e||void 0===e||e(),(0,Et.A)(Un,this,!1),(0,Et.A)(Gn,this,(0,xt.A)(Gn,this)-1)}redo(){if((0,xt.A)(Gn,this)<(0,xt.A)(zn,this).length-1){(0,Et.A)(Gn,this,(0,xt.A)(Gn,this)+1),(0,Et.A)(Un,this,!0);const{cmd:t,post:e}=(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)];t(),null===e||void 0===e||e(),(0,Et.A)(Un,this,!1)}}hasSomethingToUndo(){return-1!==(0,xt.A)(Gn,this)}hasSomethingToRedo(){return(0,xt.A)(Gn,this)<(0,xt.A)(zn,this).length-1}destroy(){(0,Et.A)(zn,this,null)}}var Xn=new WeakSet;class Yn{constructor(t){(0,vt.A)(this,Xn),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=ei.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)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get((0,bt.A)(Xn,this,Kn).call(this,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()))}}function Kn(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}class Qn{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,cn(n))}e.remove()}(t),Ue(this,"_colors",t)}convert(t){const e=cn(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 Qn._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?ni.makeHexColor(...e):t}}(0,yt.A)(Qn,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var Zn=new WeakMap,Jn=new WeakMap,$n=new WeakMap,ts=new WeakMap,es=new WeakMap,is=new WeakMap,ns=new WeakMap,ss=new WeakMap,rs=new WeakMap,as=new WeakMap,os=new WeakMap,ls=new WeakMap,cs=new WeakMap,hs=new WeakMap,ds=new WeakMap,us=new WeakMap,ps=new WeakMap,fs=new WeakMap,gs=new WeakMap,As=new WeakMap,ms=new WeakMap,vs=new WeakMap,bs=new WeakMap,ws=new WeakMap,ys=new WeakMap,_s=new WeakMap,xs=new WeakMap,Es=new WeakMap,Cs=new WeakMap,ks=new WeakMap,Ss=new WeakMap,Ms=new WeakMap,Ls=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Ps=new WeakMap,Fs=new WeakMap,Is=new WeakMap,Ds=new WeakMap,Os=new WeakMap,Ns=new WeakMap,Ws=new WeakMap,js=new WeakMap,Bs=new WeakMap,Hs=new WeakMap,zs=new WeakMap,Us=new WeakSet;class Vs{static get _keyboardManager(){const t=Vs.prototype,e=t=>(0,xt.A)(Hs,t).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 Ue(this,"_keyboardManager",new Yn([[["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)&&(0,xt.A)(Hs,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&(0,xt.A)(Hs,t).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){(0,vt.A)(this,Us),(0,_t.A)(this,Zn,new AbortController),(0,_t.A)(this,Jn,null),(0,_t.A)(this,$n,new Map),(0,_t.A)(this,ts,new Map),(0,_t.A)(this,es,null),(0,_t.A)(this,is,null),(0,_t.A)(this,ns,null),(0,_t.A)(this,ss,new qn),(0,_t.A)(this,rs,0),(0,_t.A)(this,as,new Set),(0,_t.A)(this,os,null),(0,_t.A)(this,ls,null),(0,_t.A)(this,cs,new Set),(0,_t.A)(this,hs,!1),(0,_t.A)(this,ds,null),(0,_t.A)(this,us,null),(0,_t.A)(this,ps,null),(0,_t.A)(this,fs,!1),(0,_t.A)(this,gs,null),(0,_t.A)(this,As,new Dn),(0,_t.A)(this,ms,!1),(0,_t.A)(this,vs,!1),(0,_t.A)(this,bs,null),(0,_t.A)(this,ws,null),(0,_t.A)(this,ys,null),(0,_t.A)(this,_s,Jt.NONE),(0,_t.A)(this,xs,new Set),(0,_t.A)(this,Es,null),(0,_t.A)(this,Cs,null),(0,_t.A)(this,ks,null),(0,_t.A)(this,Ss,this.blur.bind(this)),(0,_t.A)(this,Ms,this.focus.bind(this)),(0,_t.A)(this,Ls,this.copy.bind(this)),(0,_t.A)(this,Ts,this.cut.bind(this)),(0,_t.A)(this,Rs,this.paste.bind(this)),(0,_t.A)(this,Ps,this.keydown.bind(this)),(0,_t.A)(this,Fs,this.keyup.bind(this)),(0,_t.A)(this,Is,this.onEditingAction.bind(this)),(0,_t.A)(this,Ds,this.onPageChanging.bind(this)),(0,_t.A)(this,Os,this.onScaleChanging.bind(this)),(0,_t.A)(this,Ns,this.onRotationChanging.bind(this)),(0,_t.A)(this,Ws,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),(0,_t.A)(this,js,[0,0]),(0,_t.A)(this,Bs,null),(0,_t.A)(this,Hs,null),(0,_t.A)(this,zs,null),this._signal=(0,xt.A)(Zn,this).signal,(0,Et.A)(Hs,this,t),(0,Et.A)(zs,this,e),(0,Et.A)(es,this,i),this._eventBus=n,this._eventBus._on("editingaction",(0,xt.A)(Is,this)),this._eventBus._on("pagechanging",(0,xt.A)(Ds,this)),this._eventBus._on("scalechanging",(0,xt.A)(Os,this)),this._eventBus._on("rotationchanging",(0,xt.A)(Ns,this)),(0,bt.A)(Us,this,Ks).call(this),(0,bt.A)(Us,this,ir).call(this),(0,bt.A)(Us,this,Js).call(this),(0,Et.A)(is,this,s.annotationStorage),(0,Et.A)(ds,this,s.filterFactory),(0,Et.A)(Cs,this,r),(0,Et.A)(ps,this,a||null),(0,Et.A)(hs,this,o),(0,Et.A)(ys,this,l||null),this.viewParameters={realScale:ki.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){var t,e,i;null===(t=(0,xt.A)(Zn,this))||void 0===t||t.abort(),(0,Et.A)(Zn,this,null),this._signal=null,this._eventBus._off("editingaction",(0,xt.A)(Is,this)),this._eventBus._off("pagechanging",(0,xt.A)(Ds,this)),this._eventBus._off("scalechanging",(0,xt.A)(Os,this)),this._eventBus._off("rotationchanging",(0,xt.A)(Ns,this));for(const n of(0,xt.A)(ts,this).values())n.destroy();(0,xt.A)(ts,this).clear(),(0,xt.A)($n,this).clear(),(0,xt.A)(cs,this).clear(),(0,Et.A)(Jn,this,null),(0,xt.A)(xs,this).clear(),(0,xt.A)(ss,this).destroy(),null===(e=(0,xt.A)(es,this))||void 0===e||e.destroy(),null===(i=(0,xt.A)(gs,this))||void 0===i||i.hide(),(0,Et.A)(gs,this,null),(0,xt.A)(us,this)&&(clearTimeout((0,xt.A)(us,this)),(0,Et.A)(us,this,null)),(0,xt.A)(Bs,this)&&(clearTimeout((0,xt.A)(Bs,this)),(0,Et.A)(Bs,this,null))}async mlGuess(t){var e;return(null===(e=(0,xt.A)(ys,this))||void 0===e?void 0:e.guess(t))||null}get hasMLManager(){return!!(0,xt.A)(ys,this)}get hcmFilter(){return Ue(this,"hcmFilter",(0,xt.A)(Cs,this)?(0,xt.A)(ds,this).addHCMFilter((0,xt.A)(Cs,this).foreground,(0,xt.A)(Cs,this).background):"none")}get direction(){return Ue(this,"direction",getComputedStyle((0,xt.A)(Hs,this)).direction)}get highlightColors(){return Ue(this,"highlightColors",(0,xt.A)(ps,this)?new Map((0,xt.A)(ps,this).split(",").map(t=>t.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return Ue(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){(0,Et.A)(ws,this,t)}editAltText(t){var e;null===(e=(0,xt.A)(es,this))||void 0===e||e.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;(0,Et.A)(rs,this,e-1)}focusMainContainer(){(0,xt.A)(Hs,this).focus()}findParent(t,e){for(const i of(0,xt.A)(ts,this).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];(0,xt.A)(zs,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){(0,xt.A)(cs,this).add(t)}removeShouldRescale(t){(0,xt.A)(cs,this).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*ki.PDF_TO_CSS_UNITS;for(const i of(0,xt.A)(cs,this))i.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=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=(0,bt.A)(Us,this,Gs).call(this,e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(l){e.empty(),(0,xt.A)(_s,this)===Jt.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Jt.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of(0,xt.A)(ts,this).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}}}addToAnnotationStorage(t){t.isEmpty()||!(0,xt.A)(is,this)||(0,xt.A)(is,this).has(t.id)||(0,xt.A)(is,this).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,(0,xt.A)(fs,this)&&((0,Et.A)(fs,this,!1),(0,bt.A)(Us,this,Ys).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of(0,xt.A)(xs,this))if(e.div.contains(t)){(0,Et.A)(bs,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!(0,xt.A)(bs,this))return;const[t,e]=(0,xt.A)(bs,this);(0,Et.A)(bs,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){(0,bt.A)(Us,this,Js).call(this),(0,bt.A)(Us,this,tr).call(this)}removeEditListeners(){(0,bt.A)(Us,this,$s).call(this),(0,bt.A)(Us,this,er).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of(0,xt.A)(ls,this))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(0,xt.A)(ls,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=(0,xt.A)(Jn,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of(0,xt.A)(xs,this)){const t=n.serialize(!0);t&&i.push(t)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}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(0,xt.A)(ls,this))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 je('paste: "'.concat(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)(0,bt.A)(Us,this,or).call(this,e);(0,bt.A)(Us,this,hr).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){je('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),(0,xt.A)(_s,this)===Jt.NONE||this.isEditorHandlingKeyboard||Vs._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,(0,xt.A)(fs,this)&&((0,Et.A)(fs,this,!1),(0,bt.A)(Us,this,Ys).call(this,"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")}}setEditingState(t){t?((0,bt.A)(Us,this,Qs).call(this),(0,bt.A)(Us,this,tr).call(this),(0,bt.A)(Us,this,nr).call(this,{isEditing:(0,xt.A)(_s,this)!==Jt.NONE,isEmpty:(0,bt.A)(Us,this,cr).call(this),hasSomethingToUndo:(0,xt.A)(ss,this).hasSomethingToUndo(),hasSomethingToRedo:(0,xt.A)(ss,this).hasSomethingToRedo(),hasSelectedEditor:!1})):((0,bt.A)(Us,this,Zs).call(this),(0,bt.A)(Us,this,er).call(this),(0,bt.A)(Us,this,nr).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!(0,xt.A)(ls,this)){(0,Et.A)(ls,this,t);for(const t of(0,xt.A)(ls,this))(0,bt.A)(Us,this,sr).call(this,t.defaultPropertiesToUpdate)}}getId(){return(0,xt.A)(As,this).id}get currentLayer(){return(0,xt.A)(ts,this).get((0,xt.A)(rs,this))}getLayer(t){return(0,xt.A)(ts,this).get(t)}get currentPageIndex(){return(0,xt.A)(rs,this)}addLayer(t){(0,xt.A)(ts,this).set(t.pageIndex,t),(0,xt.A)(ms,this)?t.enable():t.disable()}removeLayer(t){(0,xt.A)(ts,this).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((0,xt.A)(_s,this)!==t){if((0,Et.A)(_s,this,t),t===Jt.NONE)return this.setEditingState(!1),void(0,bt.A)(Us,this,ar).call(this);this.setEditingState(!0),(0,bt.A)(Us,this,rr).call(this),this.unselectAll();for(const e of(0,xt.A)(ts,this).values())e.updateMode(t);if(e||!i){if(e)for(const t of(0,xt.A)($n,this).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==(0,xt.A)(_s,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if((0,xt.A)(ls,this)){switch(t){case $t.CREATE:return void this.currentLayer.addNewEditor();case $t.HIGHLIGHT_DEFAULT_COLOR:null===(i=(0,xt.A)(ws,this))||void 0===i||i.updateColor(e);break;case $t.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),((0,xt.A)(ks,this)||(0,Et.A)(ks,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}for(const i of(0,xt.A)(xs,this))i.updateParams(t,e);for(const i of(0,xt.A)(ls,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of(0,xt.A)($n,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=(0,xt.A)(ks,this))||void 0===n?void 0:n.get($t.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&(0,bt.A)(Us,this,sr).call(this,[[$t.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,xt.A)(vs,this)!==t){(0,Et.A)(vs,this,t);for(const e of(0,xt.A)(ts,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of(0,xt.A)($n,this).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return(0,xt.A)($n,this).get(t)}addEditor(t){(0,xt.A)($n,this).set(t.id,t)}removeEditor(t){var e;(t.div.contains(document.activeElement)&&((0,xt.A)(us,this)&&clearTimeout((0,xt.A)(us,this)),(0,Et.A)(us,this,setTimeout(()=>{this.focusMainContainer(),(0,Et.A)(us,this,null)},0))),(0,xt.A)($n,this).delete(t.id),this.unselect(t),t.annotationElementId&&(0,xt.A)(as,this).has(t.annotationElementId))||(null===(e=(0,xt.A)(is,this))||void 0===e||e.remove(t.id))}addDeletedAnnotationElement(t){(0,xt.A)(as,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return(0,xt.A)(as,this).has(t)}removeDeletedAnnotationElement(t){(0,xt.A)(as,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){(0,xt.A)(Jn,this)!==t&&((0,Et.A)(Jn,this,t),t&&(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate))}updateUI(t){wt(Us,this,lr)===t&&(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate)}toggleSelected(t){if((0,xt.A)(xs,this).has(t))return(0,xt.A)(xs,this).delete(t),t.unselect(),void(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:this.hasSelection});(0,xt.A)(xs,this).add(t),t.select(),(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of(0,xt.A)(xs,this))e!==t&&e.unselect();(0,xt.A)(xs,this).clear(),(0,xt.A)(xs,this).add(t),t.select(),(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:!0})}isSelected(t){return(0,xt.A)(xs,this).has(t)}get firstSelectedEditor(){return(0,xt.A)(xs,this).values().next().value}unselect(t){t.unselect(),(0,xt.A)(xs,this).delete(t),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==(0,xt.A)(xs,this).size}get isEnterHandled(){return 1===(0,xt.A)(xs,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){(0,xt.A)(ss,this).undo(),(0,bt.A)(Us,this,nr).call(this,{hasSomethingToUndo:(0,xt.A)(ss,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:(0,bt.A)(Us,this,cr).call(this)})}redo(){(0,xt.A)(ss,this).redo(),(0,bt.A)(Us,this,nr).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:(0,xt.A)(ss,this).hasSomethingToRedo(),isEmpty:(0,bt.A)(Us,this,cr).call(this)})}addCommands(t){(0,xt.A)(ss,this).add(t),(0,bt.A)(Us,this,nr).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:(0,bt.A)(Us,this,cr).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...(0,xt.A)(xs,this)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)(0,bt.A)(Us,this,or).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=(0,xt.A)(Jn,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return(0,xt.A)(Jn,this)||this.hasSelection}selectAll(){for(const t of(0,xt.A)(xs,this))t.commit();(0,bt.A)(Us,this,hr).call(this,(0,xt.A)($n,this).values())}unselectAll(){if((!(0,xt.A)(Jn,this)||((0,xt.A)(Jn,this).commitOrRemove(),(0,xt.A)(_s,this)===Jt.NONE))&&this.hasSelection){for(const t of(0,xt.A)(xs,this))t.unselect();(0,xt.A)(xs,this).clear(),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;(0,xt.A)(js,this)[0]+=t,(0,xt.A)(js,this)[1]+=e;const[i,n]=(0,xt.A)(js,this),s=[...(0,xt.A)(xs,this)];(0,xt.A)(Bs,this)&&clearTimeout((0,xt.A)(Bs,this)),(0,Et.A)(Bs,this,setTimeout(()=>{(0,Et.A)(Bs,this,null),(0,xt.A)(js,this)[0]=(0,xt.A)(js,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)(0,xt.A)($n,this).has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)(0,xt.A)($n,this).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),(0,Et.A)(os,this,new Map);for(const t of(0,xt.A)(xs,this))(0,xt.A)(os,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!(0,xt.A)(os,this))return!1;this.disableUserSelect(!1);const t=(0,xt.A)(os,this);(0,Et.A)(os,this,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||(e=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if((0,xt.A)($n,this).has(t.id)){const s=(0,xt.A)(ts,this).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((0,xt.A)(os,this))for(const i of(0,xt.A)(os,this).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(){var t;return(null===(t=this.getActive())||void 0===t?void 0:t.shouldGetKeyboardEvents())||1===(0,xt.A)(xs,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return(0,xt.A)(Jn,this)===t}getActive(){return(0,xt.A)(Jn,this)}getMode(){return(0,xt.A)(_s,this)}get imageManager(){return Ue(this,"imageManager",new Bn)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,c=e.rangeCount;l<c;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,c=e.rangeCount;l<c;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;((0,xt.A)(ns,this)||(0,Et.A)(ns,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=(0,xt.A)(ns,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=(0,xt.A)(ns,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=(0,xt.A)(is,this).getRawValue(i);n&&((0,xt.A)(_s,this)!==Jt.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}}function Gs(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function qs(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=(0,bt.A)(Us,this,Gs).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&((0,xt.A)(gs,this)||(0,Et.A)(gs,this,new Ln(this)),(0,xt.A)(gs,this).show(e,i,"ltr"===this.direction))}function Xs(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if((0,xt.A)(Es,this))null===(i=(0,xt.A)(gs,this))||void 0===i||i.hide(),(0,Et.A)(Es,this,null),(0,bt.A)(Us,this,nr).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===(0,xt.A)(Es,this))return;var s;if((0,bt.A)(Us,this,Gs).call(this,e).closest(".textLayer")){if(null===(t=(0,xt.A)(gs,this))||void 0===t||t.hide(),(0,Et.A)(Es,this,n),(0,bt.A)(Us,this,nr).call(this,{hasSelectedText:!0}),((0,xt.A)(_s,this)===Jt.HIGHLIGHT||(0,xt.A)(_s,this)===Jt.NONE)&&((0,xt.A)(_s,this)===Jt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),(0,Et.A)(fs,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&&(0,bt.A)(Us,this,Ys).call(this,"main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else(0,xt.A)(Es,this)&&(null===(s=(0,xt.A)(gs,this))||void 0===s||s.hide(),(0,Et.A)(Es,this,null),(0,bt.A)(Us,this,nr).call(this,{hasSelectedText:!1}))}function Ys(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";(0,xt.A)(_s,this)===Jt.HIGHLIGHT?this.highlightSelection(t):(0,xt.A)(hs,this)&&(0,bt.A)(Us,this,qs).call(this)}function Ks(){document.addEventListener("selectionchange",(0,bt.A)(Us,this,Xs).bind(this),{signal:this._signal})}function Qs(){const t=this._signal;window.addEventListener("focus",(0,xt.A)(Ms,this),{signal:t}),window.addEventListener("blur",(0,xt.A)(Ss,this),{signal:t})}function Zs(){window.removeEventListener("focus",(0,xt.A)(Ms,this)),window.removeEventListener("blur",(0,xt.A)(Ss,this))}function Js(){const t=this._signal;window.addEventListener("keydown",(0,xt.A)(Ps,this),{signal:t}),window.addEventListener("keyup",(0,xt.A)(Fs,this),{signal:t})}function $s(){window.removeEventListener("keydown",(0,xt.A)(Ps,this)),window.removeEventListener("keyup",(0,xt.A)(Fs,this))}function tr(){const t=this._signal;document.addEventListener("copy",(0,xt.A)(Ls,this),{signal:t}),document.addEventListener("cut",(0,xt.A)(Ts,this),{signal:t}),document.addEventListener("paste",(0,xt.A)(Rs,this),{signal:t})}function er(){document.removeEventListener("copy",(0,xt.A)(Ls,this)),document.removeEventListener("cut",(0,xt.A)(Ts,this)),document.removeEventListener("paste",(0,xt.A)(Rs,this))}function ir(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function nr(t){Object.entries(t).some(t=>{let[e,i]=t;return(0,xt.A)(Ws,this)[e]!==i})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign((0,xt.A)(Ws,this),t)}),(0,xt.A)(_s,this)===Jt.HIGHLIGHT&&!1===t.hasSelectedEditor&&(0,bt.A)(Us,this,sr).call(this,[[$t.HIGHLIGHT_FREE,!0]]))}function sr(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function rr(){if(!(0,xt.A)(ms,this)){(0,Et.A)(ms,this,!0);for(const t of(0,xt.A)(ts,this).values())t.enable();for(const t of(0,xt.A)($n,this).values())t.enable()}}function ar(){if(this.unselectAll(),(0,xt.A)(ms,this)){(0,Et.A)(ms,this,!1);for(const t of(0,xt.A)(ts,this).values())t.disable();for(const t of(0,xt.A)($n,this).values())t.disable()}}function or(t){const e=(0,xt.A)(ts,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function lr(t){let e=null;for(e of(0,xt.A)(xs,t));return e}function cr(){if(0===(0,xt.A)($n,this).size)return!0;if(1===(0,xt.A)($n,this).size)for(const t of(0,xt.A)($n,this).values())return t.isEmpty();return!1}function hr(t){for(const e of(0,xt.A)(xs,this))e.unselect();(0,xt.A)(xs,this).clear();for(const e of t)e.isEmpty()||((0,xt.A)(xs,this).add(e),e.select());(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:this.hasSelection})}(0,yt.A)(Vs,"TRANSLATE_SMALL",1),(0,yt.A)(Vs,"TRANSLATE_BIG",10);var dr=new WeakMap,ur=new WeakMap,pr=new WeakMap,fr=new WeakMap,gr=new WeakMap,Ar=new WeakMap,mr=new WeakMap,vr=new WeakSet;class br{constructor(t){(0,vt.A)(this,vr),(0,_t.A)(this,dr,""),(0,_t.A)(this,ur,!1),(0,_t.A)(this,pr,null),(0,_t.A)(this,fr,null),(0,_t.A)(this,gr,null),(0,_t.A)(this,Ar,!1),(0,_t.A)(this,mr,null),(0,Et.A)(mr,this,t)}static initialize(t){br._l10nPromise||(br._l10nPromise=t)}async render(){const t=(0,Et.A)(pr,this,document.createElement("button"));t.className="altText";const e=await br._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=(0,xt.A)(mr,this)._uiManager._signal;t.addEventListener("contextmenu",sn,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),(0,xt.A)(mr,this)._uiManager.editAltText((0,xt.A)(mr,this))};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&((0,Et.A)(Ar,this,!0),n(e))},{signal:i}),await(0,bt.A)(vr,this,wr).call(this),t}finish(){(0,xt.A)(pr,this)&&((0,xt.A)(pr,this).focus({focusVisible:(0,xt.A)(Ar,this)}),(0,Et.A)(Ar,this,!1))}isEmpty(){return!(0,xt.A)(dr,this)&&!(0,xt.A)(ur,this)}get data(){return{altText:(0,xt.A)(dr,this),decorative:(0,xt.A)(ur,this)}}set data(t){let{altText:e,decorative:i}=t;(0,xt.A)(dr,this)===e&&(0,xt.A)(ur,this)===i||((0,Et.A)(dr,this,e),(0,Et.A)(ur,this,i),(0,bt.A)(vr,this,wr).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,xt.A)(pr,this)&&(!t&&(0,xt.A)(gr,this)&&(clearTimeout((0,xt.A)(gr,this)),(0,Et.A)(gr,this,null)),(0,xt.A)(pr,this).disabled=!t)}destroy(){var t;null===(t=(0,xt.A)(pr,this))||void 0===t||t.remove(),(0,Et.A)(pr,this,null),(0,Et.A)(fr,this,null)}}async function wr(){const t=(0,xt.A)(pr,this);if(!t)return;var e;if(!(0,xt.A)(dr,this)&&!(0,xt.A)(ur,this))return t.classList.remove("done"),void(null===(e=(0,xt.A)(fr,this))||void 0===e||e.remove());t.classList.add("done"),Lt._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(e=>{t.setAttribute("aria-label",e)});let i=(0,xt.A)(fr,this);if(!i){(0,Et.A)(fr,this,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip");const e=i.id="alt-text-tooltip-".concat((0,xt.A)(mr,this).id);t.setAttribute("aria-describedby",e);const n=100,s=(0,xt.A)(mr,this)._uiManager._signal;s.addEventListener("abort",()=>{clearTimeout((0,xt.A)(gr,this)),(0,Et.A)(gr,this,null)},{once:!0}),t.addEventListener("mouseenter",()=>{(0,Et.A)(gr,this,setTimeout(()=>{(0,Et.A)(gr,this,null),(0,xt.A)(fr,this).classList.add("show"),(0,xt.A)(mr,this)._reportTelemetry({action:"alt_text_tooltip"})},n))},{signal:s}),t.addEventListener("mouseleave",()=>{var t;(0,xt.A)(gr,this)&&(clearTimeout((0,xt.A)(gr,this)),(0,Et.A)(gr,this,null)),null===(t=(0,xt.A)(fr,this))||void 0===t||t.classList.remove("show")},{signal:s})}i.innerText=(0,xt.A)(ur,this)?await Lt._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):(0,xt.A)(dr,this),i.parentNode||t.append(i);const n=(0,xt.A)(mr,this).getImageForAltText();null===n||void 0===n||n.setAttribute("aria-describedby",i.id)}Lt=br,(0,yt.A)(br,"_l10nPromise",null);var yr=new WeakMap,_r=new WeakMap,xr=new WeakMap,Er=new WeakMap,Cr=new WeakMap,kr=new WeakMap,Sr=new WeakMap,Mr=new WeakMap,Lr=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Pr=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Dr=new WeakMap,Or=new WeakMap,Nr=new WeakMap,Wr=new WeakMap,jr=new WeakMap,Br=new WeakMap,Hr=new WeakMap,zr=new WeakMap,Ur=new WeakSet;class Vr{static get _resizerKeyboardManager(){const t=Vr.prototype._resizeWithKeyboard,e=Vs.TRANSLATE_SMALL,i=Vs.TRANSLATE_BIG;return Ue(this,"_resizerKeyboardManager",new Yn([[["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"],Vr.prototype._stopResizingWithKeyboard]]))}constructor(t){(0,vt.A)(this,Ur),(0,_t.A)(this,yr,null),(0,_t.A)(this,_r,null),(0,_t.A)(this,xr,null),(0,_t.A)(this,Er,!1),(0,_t.A)(this,Cr,!1),(0,_t.A)(this,kr,null),(0,_t.A)(this,Sr,null),(0,_t.A)(this,Mr,this.focusin.bind(this)),(0,_t.A)(this,Lr,this.focusout.bind(this)),(0,_t.A)(this,Tr,null),(0,_t.A)(this,Rr,""),(0,_t.A)(this,Pr,!1),(0,_t.A)(this,Fr,null),(0,_t.A)(this,Ir,!1),(0,_t.A)(this,Dr,!1),(0,_t.A)(this,Or,!1),(0,_t.A)(this,Nr,null),(0,_t.A)(this,Wr,0),(0,_t.A)(this,jr,0),(0,_t.A)(this,Br,null),(0,yt.A)(this,"_initialOptions",Object.create(null)),(0,yt.A)(this,"_isVisible",!0),(0,yt.A)(this,"_uiManager",null),(0,yt.A)(this,"_focusEventsAllowed",!0),(0,yt.A)(this,"_l10nPromise",null),(0,_t.A)(this,Hr,!1),(0,_t.A)(this,zr,Vr._zIndex++),this.constructor===Vr&&Be("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 Ue(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new ra({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(Vr._l10nPromise||(Vr._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=>"-".concat(t.toLowerCase())))]))),null!==i&&void 0!==i&&i.strings)for(const s of i.strings)Vr._l10nPromise.set(s,t.get(s));if(-1!==Vr._borderLineWidth)return;const n=getComputedStyle(document.documentElement);Vr._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Be("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return(0,xt.A)(Hr,this)}set _isDraggable(t){var e;(0,Et.A)(Hr,this,t),null===(e=this.div)||void 0===e||e.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=(0,xt.A)(zr,this)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(0,bt.A)(Ur,this,sa).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&((0,xt.A)(Pr,this)?(0,Et.A)(Pr,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;null!==i&&void 0!==i&&i.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.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()}translate(t,e){(0,bt.A)(Ur,this,Gr).call(this,this.parentDimensions,t,e)}translateInPage(t,e){(0,xt.A)(Fr,this)||(0,Et.A)(Fr,this,[this.x,this.y]),(0,bt.A)(Ur,this,Gr).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){(0,xt.A)(Fr,this)||(0,Et.A)(Fr,this,[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="".concat((100*s).toFixed(2),"%"),this.div.style.top="".concat((100*r).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!(0,xt.A)(Fr,this)&&((0,xt.A)(Fr,this)[0]!==this.x||(0,xt.A)(Fr,this)[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Vr,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:c}=this.div;c.left="".concat((100*n).toFixed(2),"%"),c.top="".concat((100*s).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return qr.call(Vr,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return qr.call(Vr,t,e,360-this.parentRotation)}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 ei.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width="".concat((100*t/i).toFixed(2),"%"),(0,xt.A)(Cr,this)||(this.div.style.height="".concat((100*e/n).toFixed(2),"%"))}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!(0,xt.A)(Cr,this)&&e.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(t.width="".concat((100*parseFloat(i)/r).toFixed(2),"%")),(0,xt.A)(Cr,this)||s||(t.height="".concat((100*parseFloat(e)/a).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}altTextFinish(){var t;null===(t=(0,xt.A)(xr,this))||void 0===t||t.finish()}async addEditToolbar(){return(0,xt.A)(Tr,this)||(0,xt.A)(Dr,this)||((0,Et.A)(Tr,this,new vn(this)),this.div.append((0,xt.A)(Tr,this).render()),(0,xt.A)(xr,this)&&(0,xt.A)(Tr,this).addAltTextButton(await(0,xt.A)(xr,this).render())),(0,xt.A)(Tr,this)}removeEditToolbar(){var t;(0,xt.A)(Tr,this)&&((0,xt.A)(Tr,this).remove(),(0,Et.A)(Tr,this,null),null===(t=(0,xt.A)(xr,this))||void 0===t||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){(0,xt.A)(xr,this)||(br.initialize(Vr._l10nPromise),(0,Et.A)(xr,this,new br(this)),(0,xt.A)(yr,this)&&((0,xt.A)(xr,this).data=(0,xt.A)(yr,this),(0,Et.A)(yr,this,null)),await this.addEditToolbar())}get altTextData(){var t;return null===(t=(0,xt.A)(xr,this))||void 0===t?void 0:t.data}set altTextData(t){(0,xt.A)(xr,this)&&((0,xt.A)(xr,this).data=t)}hasAltText(){var t;return!(null!==(t=(0,xt.A)(xr,this))&&void 0!==t&&t.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=(0,xt.A)(Er,this)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",(0,xt.A)(Mr,this),{signal:t}),this.div.addEventListener("focusout",(0,xt.A)(Lr,this),{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*i/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/i).toFixed(2),"%"));const[n,s]=this.getInitialTranslation();return this.translate(n,s),Fn(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=ei.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():((0,Et.A)(Pr,this,!0),this._isDraggable?(0,bt.A)(Ur,this,$r).call(this,t):(0,bt.A)(Ur,this,Jr).call(this,t))}moveInDOM(){(0,xt.A)(Nr,this)&&clearTimeout((0,xt.A)(Nr,this)),(0,Et.A)(Nr,this,setTimeout(()=>{var t;(0,Et.A)(Nr,this,null),null===(t=this.parent)||void 0===t||t.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,c=e/n,h=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[h+l+a,r-d-c-p+o,h+l+u+a,r-d-c+o];case 90:return[h+c+a,r-d+l+o,h+c+p+a,r-d+l+u+o];case 180:return[h-l-u+a,r-d+c+o,h-l+a,r-d+c+p+o];case 270:return[h-c-p+a,r-d-l-u+o,h-c+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(){(0,Et.A)(Dr,this,!0)}disableEditMode(){(0,Et.A)(Dr,this,!1)}isInEditMode(){return(0,xt.A)(Dr,this)}shouldGetKeyboardEvents(){return(0,xt.A)(Or,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;const i=this._uiManager._signal;null===(t=this.div)||void 0===t||t.addEventListener("focusin",(0,xt.A)(Mr,this),{signal:i}),null===(e=this.div)||void 0===e||e.addEventListener("focusout",(0,xt.A)(Lr,this),{signal:i})}rotate(t){}serialize(){Be("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,(0,Et.A)(yr,n,t.accessibilityData);const[s,r]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=c/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",(0,xt.A)(Mr,this)),this.div.removeEventListener("focusout",(0,xt.A)(Lr,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(0,xt.A)(Nr,this)&&(clearTimeout((0,xt.A)(Nr,this)),(0,Et.A)(Nr,this,null)),(0,bt.A)(Ur,this,sa).call(this),this.removeEditToolbar(),(0,xt.A)(Br,this)){for(const t of(0,xt.A)(Br,this).values())clearTimeout(t);(0,Et.A)(Br,this,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&((0,bt.A)(Ur,this,Yr).call(this),(0,xt.A)(kr,this).classList.remove("hidden"),Fn(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),(0,Et.A)(Sr,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=(0,xt.A)(kr,this).children;if(!(0,xt.A)(_r,this)){(0,Et.A)(_r,this,Array.from(e));const t=(0,bt.A)(Ur,this,ta).bind(this),i=(0,bt.A)(Ur,this,ea).bind(this),n=this._uiManager._signal;for(const e of(0,xt.A)(_r,this)){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",(0,bt.A)(Ur,this,ia).bind(this,s),{signal:n}),Vr._l10nPromise.get("pdfjs-editor-resizer-label-".concat(s)).then(t=>e.setAttribute("aria-label",t))}}const i=(0,xt.A)(_r,this)[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*((0,xt.A)(_r,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)(0,xt.A)(kr,this).append((0,xt.A)(kr,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)(0,xt.A)(kr,this).firstChild.before((0,xt.A)(kr,this).lastChild);let t=0;for(const i of e){const e=(0,xt.A)(_r,this)[t++].getAttribute("data-resizer-name");Vr._l10nPromise.get("pdfjs-editor-resizer-label-".concat(e)).then(t=>i.setAttribute("aria-label",t))}}(0,bt.A)(Ur,this,na).call(this,0),(0,Et.A)(Or,this,!0),(0,xt.A)(kr,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){(0,xt.A)(Or,this)&&(0,bt.A)(Ur,this,Zr).call(this,(0,xt.A)(Rr,this),{movementX:t,movementY:e})}_stopResizingWithKeyboard(){(0,bt.A)(Ur,this,sa).call(this),this.div.focus()}select(){var t,e;this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),(0,xt.A)(Tr,this)?null===(e=(0,xt.A)(Tr,this))||void 0===e||e.show():this.addEditToolbar().then(()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=(0,xt.A)(Tr,this))||void 0===e||e.show())})}unselect(){var t,e,i,n;null===(t=(0,xt.A)(kr,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(i=this.div)&&void 0!==i&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(n=(0,xt.A)(Tr,this))||void 0===n||n.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return(0,xt.A)(Ir,this)}set isEditing(t){(0,Et.A)(Ir,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){(0,Et.A)(Cr,this,!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]){(0,xt.A)(Br,this)||(0,Et.A)(Br,this,new Map);const{action:e}=t;let i=(0,xt.A)(Br,this).get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),(0,xt.A)(Br,this).delete(e),0===(0,xt.A)(Br,this).size&&(0,Et.A)(Br,this,null)},Vr._telemetryTimeout),void(0,xt.A)(Br,this).set(e,i)}t.type||(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),(0,Et.A)(Er,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),(0,Et.A)(Er,this,!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()}}function Gr(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}function qr(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function Xr(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]}}function Yr(){if((0,xt.A)(kr,this))return;(0,Et.A)(kr,this,document.createElement("div")),(0,xt.A)(kr,this).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");(0,xt.A)(kr,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",(0,bt.A)(Ur,this,Kr).bind(this,i),{signal:e}),t.addEventListener("contextmenu",sn,{signal:e}),t.tabIndex=-1}this.div.prepend((0,xt.A)(kr,this))}function Kr(t,e){var i;e.preventDefault();const{isMac:n}=ei.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=(0,xt.A)(xr,this))||void 0===i||i.toggle(!1);const s=(0,bt.A)(Ur,this,Zr).bind(this,t),r=this._isDraggable;this._isDraggable=!1;const a=this._uiManager._signal,o={passive:!0,capture:!0,signal:a};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",s,o),window.addEventListener("contextmenu",sn,{signal:a});const l=this.x,c=this.y,h=this.width,d=this.height,u=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const f=()=>{var t;this.parent.togglePointerEvents(!0),null===(t=(0,xt.A)(xr,this))||void 0===t||t.toggle(!0),this._isDraggable=r,window.removeEventListener("pointerup",f),window.removeEventListener("blur",f),window.removeEventListener("pointermove",s,o),window.removeEventListener("contextmenu",sn),this.parent.div.style.cursor=u,this.div.style.cursor=p,(0,bt.A)(Ur,this,Qr).call(this,l,c,h,d)};window.addEventListener("pointerup",f,{signal:a}),window.addEventListener("blur",f,{signal:a})}function Qr(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})}function Zr(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=Tt.MIN_SIZE/i,c=Tt.MIN_SIZE/n,h=t=>Math.round(1e4*t)/1e4,d=(0,bt.A)(Ur,this,Xr).call(this,this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=(0,bt.A)(Ur,this,Xr).call(this,360-this.rotation);let f,g,A=!1,m=!1;switch(t){case"topLeft":A=!0,f=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":A=!0,f=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":m=!0,f=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":A=!0,f=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":A=!0,f=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":m=!0,f=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}const v=f(a,o),b=g(a,o);let w=u(...b);const y=h(s+w[0]),_=h(r+w[1]);let x=1,E=1,[C,k]=this.screenToPageTranslation(e.movementX,e.movementY);var S,M;if([C,k]=(S=C/i,M=k/n,[p[0]*S+p[2]*M,p[1]*S+p[3]*M]),A){const t=Math.hypot(a,o);x=E=Math.max(Math.min(Math.hypot(b[0]-v[0]-C,b[1]-v[1]-k)/t,1/a,1/o),l/a,c/o)}else m?x=Math.max(l,Math.min(1,Math.abs(b[0]-v[0]-C)))/a:E=Math.max(c,Math.min(1,Math.abs(b[1]-v[1]-k)))/o;const L=h(a*x),T=h(o*E);w=u(...g(L,T));const R=y-w[0],P=_-w[1];this.width=L,this.height=T,this.x=R,this.y=P,this.setDims(i*L,n*T),this.fixAndSetPosition()}function Jr(t){const{isMac:e}=ei.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function $r(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},(0,Et.A)(Wr,this,t.clientX),(0,Et.A)(jr,this,t.clientY),n=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-(0,xt.A)(Wr,this),i-(0,xt.A)(jr,this));(0,Et.A)(Wr,this,e),(0,Et.A)(jr,this,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)),(0,Et.A)(Pr,this,!1),this._uiManager.endDragSession()||(0,bt.A)(Ur,this,Jr).call(this,t)};window.addEventListener("pointerup",r,{signal:s}),window.addEventListener("blur",r,{signal:s})}function ta(t){Tt._resizerKeyboardManager.exec(this,t)}function ea(t){var e;(0,xt.A)(Or,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==(0,xt.A)(kr,this)&&(0,bt.A)(Ur,this,sa).call(this)}function ia(t){(0,Et.A)(Rr,this,(0,xt.A)(Or,this)?t:"")}function na(t){if((0,xt.A)(_r,this))for(const e of(0,xt.A)(_r,this))e.tabIndex=t}function sa(){if((0,Et.A)(Or,this,!1),(0,bt.A)(Ur,this,na).call(this,-1),(0,xt.A)(Sr,this)){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=(0,xt.A)(Sr,this);(0,bt.A)(Ur,this,Qr).call(this,t,e,i,n),(0,Et.A)(Sr,this,null)}}Tt=Vr,(0,yt.A)(Vr,"_borderLineWidth",-1),(0,yt.A)(Vr,"_colorManager",new Qn),(0,yt.A)(Vr,"_zIndex",1),(0,yt.A)(Vr,"_telemetryTimeout",1e3);class ra extends Vr{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const aa=3285377520,oa=4294901760,la=65535;class ca{constructor(t){this.h1=t?4294967295&t:aa,this.h2=t?4294967295&t:aa}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,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let f=0;f<n;f++)1&f?(a=r[f],a=a*h&oa|a*u&la,a=a<<15|a>>>17,a=a*d&oa|a*p&la,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[f],o=o*h&oa|o*u&la,o=o<<15|o>>>17,o=o*d&oa|o*p&la,c^=o,c=c<<13|c>>>19,c=5*c+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*h&oa|a*u&la,a=a<<15|a>>>17,a=a*d&oa|a*p&la,1&n?l^=a:c^=a}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&oa|36045*t&la,e=4283543511*e&oa|(2950163797*(e<<16|t>>>16)&oa)>>>16,t^=e>>>1,t=444984403*t&oa|60499*t&la,e=3301882366*e&oa|(3120437893*(e<<16|t>>>16)&oa)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const ha=Object.freeze({map:null,hash:"",transfer:void 0});var da=new WeakMap,ua=new WeakMap,pa=new WeakSet;class fa{constructor(){(0,vt.A)(this,pa),(0,_t.A)(this,da,!1),(0,_t.A)(this,ua,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=(0,xt.A)(ua,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return(0,xt.A)(ua,this).get(t)}remove(t){if((0,xt.A)(ua,this).delete(t),0===(0,xt.A)(ua,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of(0,xt.A)(ua,this).values())if(t instanceof Vr)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=(0,xt.A)(ua,this).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,(0,xt.A)(ua,this).set(t,e);n&&(0,bt.A)(pa,this,ga).call(this),e instanceof Vr&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return(0,xt.A)(ua,this).has(t)}getAll(){return(0,xt.A)(ua,this).size>0?ti((0,xt.A)(ua,this)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return(0,xt.A)(ua,this).size}resetModified(){(0,xt.A)(da,this)&&((0,Et.A)(da,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new ma(this)}get serializable(){if(0===(0,xt.A)(ua,this).size)return ha;const t=new Map,e=new ca,i=[],n=Object.create(null);let s=!1;for(const[r,a]of(0,xt.A)(ua,this)){const i=a instanceof Vr?a.serialize(!1,n):a;i&&(t.set(r,i),e.update("".concat(r,":").concat(JSON.stringify(i))),s||(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}:ha}get editorStats(){let t=null;const e=new Map;for(const s of(0,xt.A)(ua,this).values()){var i;if(!(s instanceof Vr))continue;const r=s.telemetryFinalData;if(!r)continue;const{type:a}=r;e.has(a)||e.set(a,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const o=(i=t)[a]||(i[a]=new Map);for(const[t,e]of Object.entries(r)){var n;if("type"===t)continue;let i=o.get(t);i||(i=new Map,o.set(t,i));const s=null!==(n=i.get(e))&&void 0!==n?n:0;i.set(e,s+1)}}for(const[s,r]of e)t[s]=r.computeTelemetryFinalData(t[s]);return t}}function ga(){(0,xt.A)(da,this)||((0,Et.A)(da,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var Aa=new WeakMap;class ma extends fa{constructor(t){super(),(0,_t.A)(this,Aa,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);(0,Et.A)(Aa,this,{map:s,hash:i,transfer:n})}get print(){Be("Should not call PrintAnnotationStorage.print")}get serializable(){return(0,xt.A)(Aa,this)}}var va=new WeakMap;class ba{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;(0,_t.A)(this,va,new Set),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(),(0,xt.A)(va,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!(0,xt.A)(va,this).has(e.loadedName)){if(He(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:s,style:r}=e,a=new FontFace(t,s,r);this.addNativeFontFace(a);try{await a.load(),(0,xt.A)(va,this).add(t),null===i||void 0===i||i(e)}catch(n){je("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(a)}return}Be("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 je("Failed to load font '".concat(e.family,"': '").concat(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(){var t;return Ue(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){var t;let e=!1;return(Bt||"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),Ue(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(He(!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 Ue(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 c="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=n(h,976,c.length,c);const d=1482184792;let u=i(h,16);for(s=0,r=c.length-3;s<r;s+=4)u=u-d+i(c,s)|0;var p;s<c.length&&(u=u-d+i(c+"XXX",s)|0),h=n(h,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f="url(data:font/opentype;base64,".concat(btoa(h),");"),g='@font-face {font-family:"'.concat(c,'";src:').concat(f,"}");this.insertRule(g);const A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(const m of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=m,A.append(t)}this._document.body.append(A),function t(e,i){if(++l>30)return je("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))}(c,()=>{A.remove(),e.complete()})}}class wa{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(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null===(t=this._inspectFont)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=Je(this.data),i="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");");let n;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),n='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(i,"}")}else n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(i,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,i),n}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){je('getPathGenerator - ignoring character: "'.concat(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 hi:{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 di:{const[t,e]=i.slice(r,r+2);n.push(i=>i.moveTo(t,e)),r+=2}break;case ui:{const[t,e]=i.slice(r,r+2);n.push(i=>i.lineTo(t,e)),r+=2}break;case pi:{const[t,e,s,a]=i.slice(r,r+4);n.push(i=>i.quadraticCurveTo(t,e,s,a)),r+=4}break;case fi:n.push(t=>t.restore());break;case gi:n.push(t=>t.save());break;case Ai:He(2===n.length,"Scale command is only valid at the third position.");break;case mi:{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 vi:{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(Bt){var ya=Promise.withResolvers(),_a=null;(async()=>{const t=await i.e(3237).then(i.t.bind(i,23237,19)),e=await i.e(7492).then(i.t.bind(i,97492,19)),n=await i.e(1815).then(i.t.bind(i,31815,19)),s=await i.e(6671).then(i.t.bind(i,66671,19));return new Map(Object.entries({fs:t,http:e,https:n,url:s,canvas:undefined,path2d:undefined}))})().then(t=>{_a=t,ya.resolve()},t=>{je("loadPackages: ".concat(t)),_a=new Map,ya.resolve()})}class xa{static get promise(){return ya.promise}static get(t){var e;return null===(e=_a)||void 0===e?void 0:e.get(t)}}const Ea=function(t){return xa.get("fs").promises.readFile(t).then(t=>new Uint8Array(t))};const Ca="Fill",ka="Stroke",Sa="Shading";function Ma(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 La{constructor(){this.constructor===La&&Be("Cannot initialize BaseShadingPattern.")}getPattern(){Be("Abstract method `getPattern` called.")}}class Ta extends La{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===ka||n===Ca){const r=e.current.getClippedPathBoundingBox(n,hn(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),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),i=ni.transform(i,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Ma(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);s.setTransform(h)}else Ma(t,this._bbox),s=this._createGradient(t);return s}}function Ra(t,e,i,n,s,r,a,o){const l=e.coords,c=e.colors,h=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,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,A=(l[n+1]+e.offsetY)*e.scaleY,m=(l[s]+e.offsetX)*e.scaleX,v=(l[s+1]+e.offsetY)*e.scaleY;if(f>=v)return;const b=c[r],w=c[r+1],y=c[r+2],_=c[a],x=c[a+1],E=c[a+2],C=c[o],k=c[o+1],S=c[o+2],M=Math.round(f),L=Math.round(v);let T,R,P,F,I,D,O,N;for(let W=M;W<=L;W++){if(W<A){const t=W<f?0:(f-W)/(f-A);T=p-(p-g)*t,R=b-(b-_)*t,P=w-(w-x)*t,F=y-(y-E)*t}else{let t;t=W>v?1:A===v?0:(A-W)/(A-v),T=g-(g-m)*t,R=_-(_-C)*t,P=x-(x-k)*t,F=E-(E-S)*t}let t;t=W<f?0:W>v?1:(f-W)/(f-v),I=p-(p-m)*t,D=b-(b-C)*t,O=w-(w-k)*t,N=y-(y-S)*t;const e=Math.round(Math.min(T,I)),i=Math.round(Math.max(T,I));let n=d*W+4*e;for(let s=e;s<=i;s++)t=(T-s)/(T-I),t<0?t=0:t>1&&(t=1),h[n++]=R-(R-D)*t|0,h[n++]=P-(P-O)*t|0,h[n++]=F-(F-N)*t|0,h[n++]=255}}function Pa(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,c=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<c;r++,e++)Ra(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Ra(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)Ra(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 Fa extends La{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),c=r/o,h=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,A=g.createImageData(o,l);if(e){const t=A.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 m of this._figures)Pa(A,m,d);g.putImageData(A,2,2);return{canvas:f.canvas,offsetX:n-2*c,offsetY:s-2*h,scaleX:c,scaleY:h}}getPattern(t,e,i,n){let s;if(Ma(t,this._bbox),n===Sa)s=ni.singularValueDecompose2dScale(hn(t));else if(s=ni.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=ni.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Sa?null:this._background,e.cachedCanvases);return n!==Sa&&(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 Ia extends La{getPattern(){return"hotpink"}}const Da=1,Oa=2;class Na{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;We("TilingType: "+a);const c=i[0],h=i[1],d=i[2],u=i[3],p=ni.singularValueDecompose2dScale(this.matrix),f=ni.singularValueDecompose2dScale(this.baseTransform),g=[p[0]*f[0],p[1]*f[1]],A=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),m=this.getSizeAndScale(s,this.ctx.canvas.height,g[1]),v=t.cachedCanvases.getCanvas("pattern",A.size,m.size,!0),b=v.context,w=l.createCanvasGraphics(b);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,r,o);let y=c,_=h,x=d,E=u;return c<0&&(y=0,x+=Math.abs(c)),h<0&&(_=0,E+=Math.abs(h)),b.translate(-A.scale*y,-m.scale*_),w.transform(A.scale,0,0,m.scale,0,0),b.save(),this.clipBbox(w,y,_,x,E),w.baseTransform=hn(w.ctx),w.executeOperatorList(e),w.endDrawing(),{canvas:v.canvas,scaleX:A.scale,scaleY:m.scale,offsetX:y,offsetY:_}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(Na.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(hn(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Da:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case Oa:const r=ni.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new Qe("Unsupported paint type: ".concat(e))}}getPattern(t,e,i,n){let s=i;n!==Sa&&(s=ni.transform(s,e.baseTransform),this.matrix&&(s=ni.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 Wa(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=ei.isLittleEndian?4278190080:255,[c,h]=o?[a,l]:[l,a],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let f=0;for(let g=0;g<r;g++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[f++]=128&t?h:c,n[f++]=64&t?h:c,n[f++]=32&t?h:c,n[f++]=16&t?h:c,n[f++]=8&t?h:c,n[f++]=4&t?h:c,n[f++]=2&t?h:c,n[f++]=1&t?h:c}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[f++]=t&1<<7-e?h:c}return{srcPos:i,destPos:f}}(0,yt.A)(Na,"MAX_PATTERN_SIZE",3e3);const ja=16;class Ba{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 Ha(t,e,i,n,s,r,a,o,l,c){const[h,d,u,p,f,g]=hn(t);if(0===d&&0===u){const A=a*h+f,m=Math.round(A),v=o*p+g,b=Math.round(v),w=(a+l)*h+f,y=Math.abs(Math.round(w)-m)||1,_=(o+c)*p+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),m,b),t.drawImage(e,i,n,s,r,0,0,y,x),t.setTransform(h,d,u,p,f,g),[y,x]}if(0===h&&0===p){const A=o*u+f,m=Math.round(A),v=a*d+g,b=Math.round(v),w=(o+c)*u+f,y=Math.abs(Math.round(w)-m)||1,_=(a+l)*d+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,m,b),t.drawImage(e,i,n,s,r,0,0,x,y),t.setTransform(h,d,u,p,f,g),[x,y]}t.drawImage(e,i,n,s,r,a,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class za{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Ht,this.textMatrixScale=1,this.fontMatrix=zt,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=ee,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]=ni.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=ni.applyTransform(e,t),n=ni.applyTransform(e.slice(2),t),s=ni.applyTransform([e[0],e[3]],t),r=ni.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){ni.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,c){const h=ni.bezierBoundingBox(e,i,n,s,r,a,o,l,c);c||this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ca,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===ka){e||Be("Stroke bounding box must include transform.");const t=ni.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=ni.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]:Ca,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return ni.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Ua(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%ja,r=(i-s)/ja,a=0===s?r:r+1,o=t.createImageData(n,ja);let l,c=0;const h=e.data,d=o.data;let u,p,f,g;if(e.kind===oe.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,A=n+7>>3,m=4294967295,v=ei.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(f=u<r?ja:s,l=0,p=0;p<f;p++){const t=e-c;let s=0;const r=t>A?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=h[c++],i[l++]=128&d?m:v,i[l++]=64&d?m:v,i[l++]=32&d?m:v,i[l++]=16&d?m:v,i[l++]=8&d?m:v,i[l++]=4&d?m:v,i[l++]=2&d?m:v,i[l++]=1&d?m:v;for(;s<r;s++)0===o&&(d=h[c++],o=128),i[l++]=d&o?m:v,o>>=1}for(;l<g;)i[l++]=0;t.putImageData(o,0,u*ja)}}else if(e.kind===oe.RGBA_32BPP){for(p=0,g=n*ja*4,u=0;u<r;u++)d.set(h.subarray(c,c+g)),c+=g,t.putImageData(o,0,p),p+=ja;u<a&&(g=n*s*4,d.set(h.subarray(c,c+g)),t.putImageData(o,0,p))}else{if(e.kind!==oe.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(f=ja,g=n*f,u=0;u<a;u++){for(u>=r&&(f=s,g=n*f),l=0,p=g;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*ja)}}}function Va(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%ja,r=(i-s)/ja,a=0===s?r:r+1,o=t.createImageData(n,ja);let l=0;const c=e.data,h=o.data;for(let d=0;d<a;d++){const e=d<r?ja:s;({srcPos:l}=Wa({src:c,srcPos:l,dest:h,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*ja)}}function Ga(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 qa(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),!Bt){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function Xa(t,e){if(e)return!0;const i=ni.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*ki.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const Ya=["butt","round","square"],Ka=["miter","round","bevel"],Qa={},Za={};var Ja=new WeakSet;class $a{constructor(t,e,i,n,s,r,a,o){let{optionalContentConfig:l,markedContentStack:c=null}=r;(0,vt.A)(this,Ja),this.ctx=t,this.current=new za(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=c||[],this.optionalContentConfig=l,this.cachedCanvases=new Ba(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(...hn(this.compositeCtx))}this.ctx.save(),qa(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=hn(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,c=l?Date.now()+15:0;let h=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!==Fe.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&&++h>10){if(Date.now()>c)return i(),a;h=0}}}endDrawing(){(0,bt.A)(Ja,this,to).call(this),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(),(0,bt.A)(Ja,this,eo).call(this)}_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,c=n,h="prescale1";for(;a>2&&l>1||o>2&&c>1;){let e=l,i=c;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&c>1&&(i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/i),s=this.cachedCanvases.getCanvas(h,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,c,0,0,e,i),t=s.canvas,l=e,c=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=hn(e);let o,l,c,h;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])}}c=i}c||(h=this.cachedCanvases.getCanvas("maskCanvas",i,n),Va(h.context,t));let d=ni.transform(a,[1/i,0,0,-1/n,0,0]);d=ni.transform(d,[1,0,0,1,0,-n]);const[u,p,f,g]=ni.getAxialAlignedBoundingBox([0,0,i,n],d),A=Math.round(f-u)||1,m=Math.round(g-p)||1,v=this.cachedCanvases.getCanvas("fillCanvas",A,m),b=v.context,w=u,y=p;b.translate(-w,-y),b.transform(...d),c||(c=this._scaleImage(h.canvas,dn(b)),c=c.img,o&&r&&o.set(l,c)),b.imageSmoothingEnabled=Xa(hn(b),t.interpolate),Ha(b,c,0,0,c.width,c.height,0,0,i,n),b.globalCompositeOperation="source-in";const _=ni.transform(dn(b),[1,0,0,1,-w,-y]);return b.fillStyle=r?s.getPattern(e,this,_,Ca):s,b.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,v.canvas)),{canvas:v.canvas,offsetX:Math.round(w),offsetY:Math.round(y)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Ya[t]}setLineJoin(t){this.ctx.lineJoin=Ka[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(...hn(this.suspendedCtx)),Ga(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(),Ga(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,c,h){let d=t.canvas,u=o-c,p=l-h;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=ni.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=ni.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 f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Ga(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(),Ga(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 c=hn(n),h=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],d=h?i.slice(0):null;for(let u=0,p=0,f=t.length;u<f;u++)switch(0|t[u]){case Fe.rectangle:o=e[p++],l=e[p++];const t=e[p++],i=e[p++],u=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(u,f):(n.lineTo(u,l),n.lineTo(u,f),n.lineTo(o,f)),h||s.updateRectMinMax(c,[o,l,u,f]),n.closePath();break;case Fe.moveTo:o=e[p++],l=e[p++],n.moveTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Fe.lineTo:o=e[p++],l=e[p++],n.lineTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Fe.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(c,r,a,e[p],e[p+1],e[p+2],e[p+3],o,l,d),p+=6;break;case Fe.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(c,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 Fe.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(c,r,a,e[p],e[p+1],o,l,o,l,d),p+=4;break;case Fe.closePath:n.closePath()}h&&s.updateScalingPathMinMax(c,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&&null!==i&&void 0!==i&&i.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,dn(e),ka),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,dn(e),Ca),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=Qa}eoClip(){this.pendingClip=Za}beginText(){this.current.textMatrix=Ht,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){var i;const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error("Can't find font for ".concat(t));if(s.fontMatrix=n.fontMatrix||zt,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||je("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const r=n.loadedName||"sans-serif",a=(null===(i=n.systemFontInfo)||void 0===i?void 0:i.css)||'"'.concat(r,'", ').concat(n.fallbackName);let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=e;e<16?c=16:e>100&&(c=100),this.current.fontSizeScale=e/c,this.ctx.font="".concat(l," ").concat(o," ").concat(c,"px ").concat(a)}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,c=o&re,h=!!(o&ae),d=r.patternFill&&!a.missingFile;let u;if((a.disableFontFace||h||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),c!==ee&&c!==ne||s.fill(),c!==ie&&c!==ne||s.stroke(),s.restore()):(c!==ee&&c!==ne||s.fillText(t,e,i),c!==ie&&c!==ne||s.strokeText(t,e,i)),h){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:hn(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 Ue(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,c=e.textHScale*l,h=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],g=e.textRenderingMode===ee&&!i.disableFontFace&&!e.patternFill;let A;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(c,-1):s.scale(c,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,dn(s),Ca);A=hn(s),s.restore(),s.fillStyle=t}let m=e.lineWidth;const v=e.textMatrixScale;if(0===v||0===m){const t=e.textRenderingMode&re;t!==ie&&t!==ne||(m=this.getSinglePixelWidth())}else m/=v;if(1!==r&&(s.scale(r,r),m/=r),s.lineWidth=m,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*f*c,s.restore(),void this.compose()}let b,w=0;for(b=0;b<h;++b){const e=t[b];if("number"===typeof e){w+=u*e*n/1e3;continue}let c=!1;const h=(e.isSpace?o:0)+a,m=e.fontChar,v=e.accent;let y,_,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*f,n=t[2]*f;x=t?-t[0]:x,y=i/r,_=(w+n)/r}else y=w/r,_=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(m).width/n*r;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;c=!0,s.save(),s.scale(e,1),y/=e}else x!==t&&(y+=(x-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(g&&!v)s.fillText(m,y,_);else if(this.paintChar(m,y,_,A),v){const t=y+n*v.offset.x/r,e=_-n*v.offset.y/r;this.paintChar(v.fontChar,t,e,A)}w+=d?x*f-h*l:x*f+h*l,c&&s.restore()}d?e.y-=w:e.x+=w*c,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,o=i.charSpacing,l=i.wordSpacing,c=i.textHScale*r,h=i.fontMatrix||zt,d=t.length;let u,p,f,g;if(!(i.textRenderingMode===se)&&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),u=0;u<d;++u){if(p=t[u],"number"===typeof p){g=a*p*s/1e3,this.ctx.translate(g,0),i.x+=g*c;continue}const r=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];if(!d){je('Type3 character "'.concat(p.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...h),this.executeOperatorList(d),this.restore());f=ni.applyTransform([p.width,0],h)[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||hn(this.ctx),s={createCanvasGraphics:t=>new $a(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Na(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=ni.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=ni.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 Ta(t);case"Mesh":return new Fa(t);case"Dummy":return new Ia}throw new Error("Unknown IR type: ".concat(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,dn(e),Sa);const n=dn(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=ni.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(){Be("Should not call beginInlineImage")}beginImageData(){Be("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=hn(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(hn(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||We("TODO: Support non-isolated groups."),t.knockout&&je("Knockout groups not supported.");const i=hn(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=ni.getAxialAlignedBoundingBox(t.bbox,hn(e));const s=[0,0,e.canvas.width,e.canvas.height];n=ni.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 c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(c,o,l),d=h.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:h.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()),Ga(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=hn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=ni.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((0,bt.A)(Ja,this,to).call(this),qa(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]=ni.singularValueDecompose2dScale(hn(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),c=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:h,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-a,0,r*a),qa(this.ctx)}else qa(this.ctx),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.endPath()}this.current=new za(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),(0,bt.A)(Ja,this,eo).call(this),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 c=e+7&-8;let h=new Uint8Array(c*i),d=0;for(const g of t.data){let t=128;for(;t>0;)h[d++]=g&t?0:255,t>>=1}let u=0;for(d=0,0!==h[d]&&(l[0]=1,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[a]=h[d]?2:1,++u),d++;for(0!==h[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*c,o=r*s,h[d-c]!==h[d]&&(l[o]=h[d]?1:8,++u);let t=(h[d]?4:0)+(h[d-c]?8:0);for(a=1;a<e;a++)t=(t>>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(h[d-c]!==h[d]&&(l[o+a]=h[d]?2:4,++u),u>1e3)return null}for(d=c*(i-1),o=r*s,0!==h[d]&&(l[o]=8,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[o+a]=h[d]?4:8,++u),d++;if(0!==h[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=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;f.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),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return h=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),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=hn(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 c=0,h=r.length;c<h;c+=2){const t=ni.transform(o,[e,i,n,s,r[c],r[c+1]]),[h,d]=ni.applyTransform([0,0],t);a.drawImage(l.canvas,h,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),c=l.context;c.save();Va(c,this.getObject(t,s)),c.globalCompositeOperation="source-in",c.fillStyle=n?i.getPattern(c,this,dn(e),Ca):i,c.fillRect(0,0,r,a),c.restore(),e.save(),e.transform(...o),e.scale(1,-1),Ha(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):je("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void je("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let l=0,c=n.length;l<c;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(),!Bt){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;Ua(n,t),s=this.applyTransferMapsToCanvas(n)}const r=this._scaleImage(s,dn(n));n.imageSmoothingEnabled=Xa(hn(n),t.interpolate),Ha(n,r.img,0,0,r.paintWidth,r.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;Ua(s,t),n=this.applyTransferMapsToCanvas(s)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),Ha(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===Za?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=hn(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),c=Math.hypot(n,s);if(0===t)r=c/o,a=l/o;else{const e=t*o;r=c>e?c/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}}function to(){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)}function eo(){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}}}for(const Xv in Fe)void 0!==$a.prototype[Xv]&&($a.prototype[Fe[Xv]]=$a.prototype[Xv]);class io{static get workerPort(){return(0,bt.A)(io,this,no)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");no._=(0,bt.A)(io,this,t)}static get workerSrc(){return(0,bt.A)(io,this,so)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");so._=(0,bt.A)(io,this,t)}}var no={_:null},so={_:""};const ro=1,ao=2,oo=1,lo=2,co=3,ho=4,uo=5,po=6,fo=7,go=8;function Ao(t){switch(t instanceof Error||"object"===typeof t&&null!==t||Be('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Ze(t.message);case"MissingPDFException":return new Ye(t.message);case"PasswordException":return new Ge(t.message,t.code);case"UnexpectedResponseException":return new Ke(t.message,t.status);case"UnknownErrorException":return new qe(t.message,t.details);default:return new qe(t.message,t.toString())}}var mo=new WeakSet;class vo{constructor(t,e,i){(0,vt.A)(this,mo),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(0,bt.A)(mo,this,wo).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===ro)i.resolve(e.data);else{if(e.callback!==ao)throw new Error("Unexpected callback case");i.reject(Ao(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,s=e.sourceName;return void new Promise(function(t){t(n(e.data))}).then(function(n){i.postMessage({sourceName:t,targetName:s,callback:ro,callbackId:e.callbackId,data:n})},function(n){i.postMessage({sourceName:t,targetName:s,callback:ao,callbackId:e.callbackId,reason:Ao(n)})})}e.streamId?(0,bt.A)(mo,this,bo).call(this,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 "'.concat(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:po,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{He(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:oo,streamId:s,reason:Ao(t)}),e.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}function bo(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:ho,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:co,streamId:e}),delete r.streamSinks[e])},error(t){He(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:uo,streamId:e,reason:Ao(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:go,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:go,streamId:e,reason:Ao(t)})})}function wo(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 go:t.success?r.startCall.resolve():r.startCall.reject(Ao(t.reason));break;case fo:t.success?r.pullCall.resolve():r.pullCall.reject(Ao(t.reason));break;case po:if(!a){s.postMessage({sourceName:i,targetName:n,stream:fo,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise(function(t){var e;t(null===(e=a.onPull)||void 0===e?void 0:e.call(a))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:fo,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:fo,streamId:e,reason:Ao(t)})});break;case ho:if(He(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case co:if(He(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),(0,bt.A)(mo,this,yo).call(this,r,e);break;case uo:He(r,"error should have stream controller"),r.controller.error(Ao(t.reason)),(0,bt.A)(mo,this,yo).call(this,r,e);break;case lo:t.success?r.cancelCall.resolve():r.cancelCall.reject(Ao(t.reason)),(0,bt.A)(mo,this,yo).call(this,r,e);break;case oo:if(!a)break;new Promise(function(e){var i;e(null===(i=a.onCancel)||void 0===i?void 0:i.call(a,Ao(t.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:lo,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:lo,streamId:e,reason:Ao(t)})}),a.sinkCapability.reject(Ao(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function yo(t,e){var i,n,s;await Promise.allSettled([null===(i=t.startCall)||void 0===i?void 0:i.promise,null===(n=t.pullCall)||void 0===n?void 0:n.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}var _o=new WeakMap,xo=new WeakMap;class Eo{constructor(t){let{parsedData:e,rawData:i}=t;(0,_t.A)(this,_o,void 0),(0,_t.A)(this,xo,void 0),(0,Et.A)(_o,this,e),(0,Et.A)(xo,this,i)}getRaw(){return(0,xt.A)(xo,this)}get(t){var e;return null!==(e=(0,xt.A)(_o,this).get(t))&&void 0!==e?e:null}getAll(){return ti((0,xt.A)(_o,this))}has(t){return(0,xt.A)(_o,this).has(t)}}const Co=Symbol("INTERNAL");var ko=new WeakMap,So=new WeakMap,Mo=new WeakMap,Lo=new WeakMap;class To{constructor(t,e){let{name:i,intent:n,usage:s}=e;(0,_t.A)(this,ko,!1),(0,_t.A)(this,So,!1),(0,_t.A)(this,Mo,!1),(0,_t.A)(this,Lo,!0),(0,Et.A)(ko,this,!!(t&Gt)),(0,Et.A)(So,this,!!(t&qt)),this.name=i,this.intent=n,this.usage=s}get visible(){if((0,xt.A)(Mo,this))return(0,xt.A)(Lo,this);if(!(0,xt.A)(Lo,this))return!1;const{print:t,view:e}=this.usage;return(0,xt.A)(ko,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!(0,xt.A)(So,this)||"OFF"!==(null===t||void 0===t?void 0:t.printState)}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==Co&&Be("Internal method `_setVisible` called."),(0,Et.A)(Mo,this,i),(0,Et.A)(Lo,this,e)}}var Ro=new WeakMap,Po=new WeakMap,Fo=new WeakMap,Io=new WeakMap,Do=new WeakSet;class Oo{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt;if((0,vt.A)(this,Do),(0,_t.A)(this,Ro,null),(0,_t.A)(this,Po,new Map),(0,_t.A)(this,Fo,null),(0,_t.A)(this,Io,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,(0,Et.A)(Io,this,t.order);for(const i of t.groups)(0,xt.A)(Po,this).set(i.id,new To(e,i));if("OFF"===t.baseState)for(const t of(0,xt.A)(Po,this).values())t._setVisible(Co,!1);for(const e of t.on)(0,xt.A)(Po,this).get(e)._setVisible(Co,!0);for(const e of t.off)(0,xt.A)(Po,this).get(e)._setVisible(Co,!1);(0,Et.A)(Fo,this,this.getHash())}}isVisible(t){if(0===(0,xt.A)(Po,this).size)return!0;if(!t)return We("Optional content group not defined."),!0;if("OCG"===t.type)return(0,xt.A)(Po,this).has(t.id)?(0,xt.A)(Po,this).get(t.id).visible:(je("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return(0,bt.A)(Do,this,No).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if((0,xt.A)(Po,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if(!(0,xt.A)(Po,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if(!(0,xt.A)(Po,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if((0,xt.A)(Po,this).get(e).visible)return!1}return!0}return je("Unknown optional content policy ".concat(t.policy,".")),!0}return je("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=(0,xt.A)(Po,this).get(t);i?(i._setVisible(Co,!!e,!0),(0,Et.A)(Ro,this,null)):je("Optional content group not found: ".concat(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=(0,xt.A)(Po,this).get(s);if(t)switch(e){case"ON":t._setVisible(Co,!0);break;case"OFF":t._setVisible(Co,!1);break;case"Toggle":t._setVisible(Co,!t.visible)}}(0,Et.A)(Ro,this,null)}get hasInitialVisibility(){return null===(0,xt.A)(Fo,this)||this.getHash()===(0,xt.A)(Fo,this)}getOrder(){return(0,xt.A)(Po,this).size?(0,xt.A)(Io,this)?(0,xt.A)(Io,this).slice():[...(0,xt.A)(Po,this).keys()]:null}getGroups(){return(0,xt.A)(Po,this).size>0?ti((0,xt.A)(Po,this)):null}getGroup(t){return(0,xt.A)(Po,this).get(t)||null}getHash(){if(null!==(0,xt.A)(Ro,this))return(0,xt.A)(Ro,this);const t=new ca;for(const[e,i]of(0,xt.A)(Po,this))t.update("".concat(e,":").concat(i.visible));return(0,Et.A)(Ro,this,t.hexdigest())}}function No(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=(0,bt.A)(Do,this,No).call(this,e);else{if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;s=(0,xt.A)(Po,this).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}class Wo{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;He(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,(null===r||void 0===r?void 0: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{He(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,i,n,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded}):null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){He(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new jo(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Bo(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class jo{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=Ji(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 Bo{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 Ho(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 zo(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=$e(i);i=n.decode(s),e=!1}catch(n){}}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(r){}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(Ji(t))return t}return null}function Uo(t,e){return 404===t||0===t&&e.startsWith("file:")?new Ye('Missing PDF "'+e+'".'):new Ke("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)}function Vo(t){return 200===t||206===t}function Go(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function qo(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Xo(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(je("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class Yo{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(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return He(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Ko(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Qo(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Ko{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=qo(this._stream.httpHeaders);const i=e.url;fetch(i,Go(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!Vo(t.status))throw Uo(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=Ho({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=zo(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ze("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(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Xo(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class Qo{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=qo(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(e,"-").concat(i-1));const s=n.url;fetch(s,Go(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!Vo(t.status))throw Uo(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(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:Xo(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class Zo{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=".concat(t.begin,"-").concat(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){var i;const n=this.pendingRequests[t];n&&(null===(i=n.onProgress)||void 0===i||i.call(n,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;var s;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void(null===(s=i.onError)||void 0===s||s.call(i,n.status));const r=n.status||200;var a;if(!(200===r&&206===i.expectedStatus)&&r!==i.expectedStatus)return void(null===(a=i.onError)||void 0===a||a.call(i,n.status));const o=function(t){const e=t.response;return"string"!==typeof e?e:$e(e).buffer}(n);if(206===r){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:o})}else if(o)i.onDone({begin:0,chunk:o});else{var l;null===(l=i.onError)||void 0===l||l.call(i,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 Jo{constructor(t){this._source=t,this._manager=new Zo(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 He(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new $o(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new tl(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class $o{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}=Ho({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=zo(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=Uo(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){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{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 tl{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(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,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=Uo(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(null===(e=this.onProgress)||void 0===e||e.call(this,{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 el=/^file:\/\/\/[a-zA-Z]:\//;class il{constructor(t){this.source=t,this.url=function(t){const e=xa.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse("file:///".concat(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(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return He(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ll(this):new al(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new cl(this,t,e):new ol(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class nl{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(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).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 Ze("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class sl{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(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).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 rl(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class al extends nl{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new Ye('Missing PDF "'.concat(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}=Ho({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=zo(i)};if(this._request=null,"http:"===this._url.protocol){const i=xa.get("http");this._request=i.request(rl(this._url,t.httpHeaders),e)}else{const i=xa.get("https");this._request=i.request(rl(this._url,t.httpHeaders),e)}this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class ol extends sl{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=".concat(e,"-").concat(i-1);const n=t=>{if(404===t.statusCode){const t=new Ye('Missing PDF "'.concat(this._url,'".'));return void(this._storedError=t)}this._setReadableStream(t)};if(this._request=null,"http:"===this._url.protocol){const t=xa.get("http");this._request=t.request(rl(this._url,this._httpHeaders),n)}else{const t=xa.get("https");this._request=t.request(rl(this._url,this._httpHeaders),n)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class ll extends nl{constructor(t){super(t);let e=decodeURIComponent(this._url.path);el.test(this._url.href)&&(e=e.replace(/^\//,""));const i=xa.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 Ye('Missing PDF "'.concat(e,'".'))),this._storedError=t,this._headersCapability.reject(t)})}}class cl extends sl{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);el.test(this._url.href)&&(n=n.replace(/^\//,""));const s=xa.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const hl=30;var dl=new WeakMap,ul=new WeakMap,pl=new WeakMap,fl=new WeakMap,gl=new WeakMap,Al=new WeakMap,ml=new WeakMap,vl=new WeakMap,bl=new WeakMap,wl=new WeakMap,yl=new WeakMap,_l=new WeakMap,xl=new WeakMap,El=new WeakMap,Cl=new WeakMap,kl=new WeakMap,Sl=new WeakMap,Ml=new WeakMap,Ll=new WeakSet;class Tl{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if((0,vt.A)(this,Ll),(0,_t.A)(this,dl,Promise.withResolvers()),(0,_t.A)(this,ul,null),(0,_t.A)(this,pl,!1),(0,_t.A)(this,fl,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),(0,_t.A)(this,gl,null),(0,_t.A)(this,Al,null),(0,_t.A)(this,ml,0),(0,_t.A)(this,vl,0),(0,_t.A)(this,bl,null),(0,_t.A)(this,wl,null),(0,_t.A)(this,yl,0),(0,_t.A)(this,_l,0),(0,_t.A)(this,xl,Object.create(null)),(0,_t.A)(this,El,[]),(0,_t.A)(this,Cl,null),(0,_t.A)(this,kl,[]),(0,_t.A)(this,Sl,new WeakMap),(0,_t.A)(this,Ml,null),i instanceof ReadableStream)(0,Et.A)(Cl,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');(0,Et.A)(Cl,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}(0,Et.A)(ul,this,(0,Et.A)(wl,this,n)),(0,Et.A)(_l,this,s.scale*(globalThis.devicePixelRatio||1)),(0,Et.A)(yl,this,s.rotation),(0,Et.A)(Al,this,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:r,pageHeight:a,pageX:o,pageY:l}=s.rawDims;(0,Et.A)(Ml,this,[1,0,0,-1,-o,l+a]),(0,Et.A)(vl,this,r),(0,Et.A)(ml,this,a),Dl.call(Tl),un(n,s),(0,xt.A)(dl,this).promise.catch(()=>{}).then(()=>{Bl._.delete(this),(0,Et.A)(Al,this,null),(0,Et.A)(xl,this,null)})}render(){const t=()=>{(0,xt.A)(bl,this).read().then(e=>{var i;let{value:n,done:s}=e;s?(0,xt.A)(dl,this).resolve():(null!==(i=(0,xt.A)(gl,this))&&void 0!==i||(0,Et.A)(gl,this,n.lang),Object.assign((0,xt.A)(xl,this),n.styles),(0,bt.A)(Ll,this,Rl).call(this,n.items),t())},(0,xt.A)(dl,this).reject)};return(0,Et.A)(bl,this,(0,xt.A)(Cl,this).getReader()),Bl._.add(this),t(),(0,xt.A)(dl,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==(0,xt.A)(yl,this)&&(null===i||void 0===i||i(),(0,Et.A)(yl,this,s),un((0,xt.A)(wl,this),{rotation:s})),n!==(0,xt.A)(_l,this)){null===i||void 0===i||i(),(0,Et.A)(_l,this,n);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Il.call(Tl,(0,xt.A)(gl,this))};for(const e of(0,xt.A)(kl,this))t.properties=(0,xt.A)(Sl,this).get(e),t.div=e,(0,bt.A)(Ll,this,Fl).call(this,t)}}cancel(){var t;const e=new Ze("TextLayer task cancelled.");null===(t=(0,xt.A)(bl,this))||void 0===t||t.cancel(e).catch(()=>{}),(0,Et.A)(bl,this,null),(0,xt.A)(dl,this).reject(e)}get textDivs(){return(0,xt.A)(kl,this)}get textContentItemsStr(){return(0,xt.A)(El,this)}static cleanup(){if(!((0,bt.A)(Tl,this,Bl)._.size>0)){(0,bt.A)(Tl,this,Nl)._.clear();for(const{canvas:t}of(0,bt.A)(Tl,this,Wl)._.values())t.remove();(0,bt.A)(Tl,this,Wl)._.clear()}}}function Rl(t){var e,i;if((0,xt.A)(pl,this))return;null!==(i=(e=(0,xt.A)(Al,this)).ctx)&&void 0!==i||(e.ctx=Il.call(Rt,(0,xt.A)(gl,this)));const n=(0,xt.A)(kl,this),s=(0,xt.A)(El,this);for(const r of t){if(n.length>1e5)return je("Ignoring additional textDivs for performance reasons."),void(0,Et.A)(pl,this,!0);if(void 0!==r.str)s.push(r.str),(0,bt.A)(Ll,this,Pl).call(this,r);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){const t=(0,xt.A)(ul,this);(0,Et.A)(ul,this,document.createElement("span")),(0,xt.A)(ul,this).classList.add("markedContent"),null!==r.id&&(0,xt.A)(ul,this).setAttribute("id","".concat(r.id)),t.append((0,xt.A)(ul,this))}else"endMarkedContent"===r.type&&(0,Et.A)(ul,this,(0,xt.A)(ul,this).parentNode)}}function Pl(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};(0,xt.A)(kl,this).push(e);const n=ni.transform((0,xt.A)(Ml,this),t.transform);let s=Math.atan2(n[1],n[0]);const r=(0,xt.A)(xl,this)[t.fontName];r.vertical&&(s+=Math.PI/2);const a=(0,xt.A)(fl,this)&&r.fontSubstitution||r.fontFamily,o=Math.hypot(n[2],n[3]),l=o*Ol.call(Rt,a,(0,xt.A)(gl,this));let c,h;0===s?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(s),h=n[5]-l*Math.cos(s));const d="calc(var(--scale-factor)*",u=e.style;(0,xt.A)(ul,this)===(0,xt.A)(wl,this)?(u.left="".concat((100*c/(0,xt.A)(vl,this)).toFixed(2),"%"),u.top="".concat((100*h/(0,xt.A)(ml,this)).toFixed(2),"%")):(u.left="".concat(d).concat(c.toFixed(2),"px)"),u.top="".concat(d).concat(h.toFixed(2),"px)")),u.fontSize="".concat(d).concat((jl._*o).toFixed(2),"px)"),u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,(0,xt.A)(fl,this)&&(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),(0,xt.A)(Sl,this).set(e,i),(0,xt.A)(Al,this).div=e,(0,xt.A)(Al,this).properties=i,(0,bt.A)(Ll,this,Fl).call(this,(0,xt.A)(Al,this)),i.hasText&&(0,xt.A)(ul,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),(0,xt.A)(ul,this).append(t)}}function Fl(t){const{div:e,properties:i,ctx:n,prevFontSize:s,prevFontFamily:r}=t,{style:a}=e;let o="";if(jl._>1&&(o="scale(".concat(1/jl._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:l}=a,{canvasWidth:c,fontSize:h}=i;s===h&&r===l||(n.font="".concat(h*(0,xt.A)(_l,this),"px ").concat(l),t.prevFontSize=h,t.prevFontFamily=l);const{width:d}=n.measureText(e.textContent);d>0&&(o="scaleX(".concat(c*(0,xt.A)(_l,this)/d,") ").concat(o))}0!==i.angle&&(o="rotate(".concat(i.angle,"deg) ").concat(o)),o.length>0&&(a.transform=o)}function Il(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=(0,bt.A)(Rt,this,Wl)._.get(t||(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}),(0,bt.A)(Rt,this,Wl)._.set(t,e)}return e}function Dl(){if(null!==(0,bt.A)(Rt,this,jl)._)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),jl._=(0,bt.A)(Rt,this,t.getBoundingClientRect().height),t.remove()}function Ol(t,e){const i=(0,bt.A)(Rt,this,Nl)._.get(t);if(i)return i;const n=(0,bt.A)(Rt,this,Il).call(this,e),s=n.font;n.canvas.width=n.canvas.height=hl,n.font="".concat(hl,"px ").concat(t);const r=n.measureText("");let a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);if(a){const e=a/(a+o);return(0,bt.A)(Rt,this,Nl)._.set(t,e),n.canvas.width=n.canvas.height=0,n.font=s,e}n.strokeStyle="red",n.clearRect(0,0,hl,hl),n.strokeText("g",0,0);let l=n.getImageData(0,0,hl,hl).data;o=0;for(let h=l.length-1-3;h>=0;h-=4)if(l[h]>0){o=Math.ceil(h/4/hl);break}n.clearRect(0,0,hl,hl),n.strokeText("A",0,hl),l=n.getImageData(0,0,hl,hl).data,a=0;for(let h=0,d=l.length;h<d;h+=4)if(l[h]>0){a=hl-Math.floor(h/4/hl);break}n.canvas.width=n.canvas.height=0,n.font=s;const c=a?a/(a+o):.8;return(0,bt.A)(Rt,this,Nl)._.set(t,c),c}Rt=Tl;var Nl={_:new Map},Wl={_:new Map},jl={_:null},Bl={_:new Set};function Hl(){rn("`renderTextLayer`, please use `TextLayer` instead.");const t=arguments[0],{textContentSource:e,container:i,viewport:n}=t,s=(0,mt.A)(t,Ct),r=Object.keys(s);r.length>0&&je("Ignoring `renderTextLayer` parameters: "+r.join(", "));const a=new Tl({textContentSource:e,container:i,viewport:n}),{textDivs:o,textContentItemsStr:l}=a;return{promise:a.render(),textDivs:o,textContentItemsStr:l}}function zl(){rn("`updateTextLayer`, please use `TextLayer` instead.")}class Ul{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let s=null;const r=i.name;if("#text"===r)s=i.value;else{if(!Ul.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&n.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),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 Vl=65536,Gl=Bt?class extends yi{_createCanvas(t,e){return xa.get("canvas").createCanvas(t,e)}}:class extends yi{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}},ql=Bt?class extends _i{_fetchData(t,e){return Ea(t).then(t=>({cMapData:t,compressionType:e}))}}:qi,Xl=Bt?class extends bi{}:class extends bi{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),(0,vt.A)(this,Fi),(0,_t.A)(this,Si,void 0),(0,_t.A)(this,Mi,void 0),(0,_t.A)(this,Li,void 0),(0,_t.A)(this,Ti,void 0),(0,_t.A)(this,Ri,void 0),(0,_t.A)(this,Pi,0),(0,Et.A)(Li,this,t),(0,Et.A)(Ti,this,e)}addFilter(t){var e,i;if(!t)return"none";let n=wt(Fi,this,Ii).get(t);if(n)return n;const[s,r,a]=(0,bt.A)(Fi,this,Ni).call(this,t),o=1===t.length?s:"".concat(s).concat(r).concat(a);if(n=wt(Fi,this,Ii).get(o),n)return wt(Fi,this,Ii).set(t,n),n;const l="g_".concat((0,xt.A)(Li,this),"_transfer_map_").concat(((0,Et.A)(Pi,this,(e=(0,xt.A)(Pi,this),i=e++,e)),i)),c="url(#".concat(l,")");wt(Fi,this,Ii).set(t,c),wt(Fi,this,Ii).set(o,c);const h=(0,bt.A)(Fi,this,Bi).call(this,l);return(0,bt.A)(Fi,this,zi).call(this,s,r,a,h),c}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let r=wt(Fi,this,Di).get(s);if((null===(i=r)||void 0===i?void 0:i.key)===n)return r.url;var a;r?(null===(a=r.filter)||void 0===a||a.remove(),r.key=n,r.url="none",r.filter=null):(r={key:n,url:"none",filter:null},wt(Fi,this,Di).set(s,r));if(!t||!e)return r.url;const o=(0,bt.A)(Fi,this,Vi).call(this,t);t=ni.makeHexColor(...o);const l=(0,bt.A)(Fi,this,Vi).call(this,e);if(e=ni.makeHexColor(...l),wt(Fi,this,Oi).style.color="","#000000"===t&&"#ffffff"===e||t===e)return r.url;const c=new Array(256);for(let f=0;f<=255;f++){const t=f/255;c[f]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const h=c.join(","),d="g_".concat((0,xt.A)(Li,this),"_hcm_filter"),u=r.filter=(0,bt.A)(Fi,this,Bi).call(this,d);(0,bt.A)(Fi,this,zi).call(this,h,h,h,u),(0,bt.A)(Fi,this,ji).call(this,u);const p=(t,e)=>{const i=o[t]/255,n=l[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(0,bt.A)(Fi,this,zi).call(this,p(0,5),p(1,5),p(2,5),u),r.url="url(#".concat(d,")"),r.url}addAlphaFilter(t){var e,i;let n=wt(Fi,this,Ii).get(t);if(n)return n;const[s]=(0,bt.A)(Fi,this,Ni).call(this,[t]),r="alpha_".concat(s);if(n=wt(Fi,this,Ii).get(r),n)return wt(Fi,this,Ii).set(t,n),n;const a="g_".concat((0,xt.A)(Li,this),"_alpha_map_").concat(((0,Et.A)(Pi,this,(e=(0,xt.A)(Pi,this),i=e++,e)),i)),o="url(#".concat(a,")");wt(Fi,this,Ii).set(t,o),wt(Fi,this,Ii).set(r,o);const l=(0,bt.A)(Fi,this,Bi).call(this,a);return(0,bt.A)(Fi,this,Ui).call(this,s,l),o}addLuminosityFilter(t){var e,i;let n,s,r=wt(Fi,this,Ii).get(t||"luminosity");if(r)return r;if(t?([n]=(0,bt.A)(Fi,this,Ni).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",r=wt(Fi,this,Ii).get(s),r)return wt(Fi,this,Ii).set(t,r),r;const a="g_".concat((0,xt.A)(Li,this),"_luminosity_map_").concat(((0,Et.A)(Pi,this,(e=(0,xt.A)(Pi,this),i=e++,e)),i)),o="url(#".concat(a,")");wt(Fi,this,Ii).set(t,o),wt(Fi,this,Ii).set(s,o);const l=(0,bt.A)(Fi,this,Bi).call(this,a);return(0,bt.A)(Fi,this,Wi).call(this,l),t&&(0,bt.A)(Fi,this,Ui).call(this,n,l),o}addHighlightHCMFilter(t,e,i,n,s){var r;const a="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=wt(Fi,this,Di).get(t);if((null===(r=o)||void 0===r?void 0:r.key)===a)return o.url;var l;o?(null===(l=o.filter)||void 0===l||l.remove(),o.key=a,o.url="none",o.filter=null):(o={key:a,url:"none",filter:null},wt(Fi,this,Di).set(t,o));if(!e||!i)return o.url;const[c,h]=[e,i].map((0,bt.A)(Fi,this,Vi).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,f]=[n,s].map((0,bt.A)(Fi,this,Vi).bind(this));u<d&&([d,u,p,f]=[u,d,f,p]),wt(Fi,this,Oi).style.color="";const g=(t,e,i)=>{const n=new Array(256),s=(u-d)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(d+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(",")},A="g_".concat((0,xt.A)(Li,this),"_hcm_").concat(t,"_filter"),m=o.filter=(0,bt.A)(Fi,this,Bi).call(this,A);return(0,bt.A)(Fi,this,ji).call(this,m),(0,bt.A)(Fi,this,zi).call(this,g(p[0],f[0],5),g(p[1],f[1],5),g(p[2],f[2],5),m),o.url="url(#".concat(A,")"),o.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==wt(Fi,this,Di).size||((0,xt.A)(Mi,this)&&((0,xt.A)(Mi,this).parentNode.parentNode.remove(),(0,Et.A)(Mi,this,null)),(0,xt.A)(Si,this)&&((0,xt.A)(Si,this).clear(),(0,Et.A)(Si,this,null)),(0,Et.A)(Pi,this,0))}},Yl=Bt?class extends xi{_fetchData(t){return Ea(t)}}:Xi;function Kl(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const n=new Zl,{docId:s}=n,r=i.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(Bt&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,a=i.data?function(t){if(Bt&&"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 $e(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===t?void 0: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.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,c=null!==(t=i.password)&&void 0!==t?t:null,h=i.range instanceof $l?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:Vl;let u=i.worker instanceof uc?i.worker:null;const p=i.verbosity,f="string"!==typeof i.docBaseUrl||Zi(i.docBaseUrl)?null:i.docBaseUrl,g="string"===typeof i.cMapUrl?i.cMapUrl:null,A=!1!==i.cMapPacked,m=i.CMapReaderFactory||ql,v="string"===typeof i.standardFontDataUrl?i.standardFontDataUrl:null,b=i.StandardFontDataFactory||Yl,w=!0!==i.stopAtErrors,y=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,_=!1!==i.isEvalSupported,x="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!Bt,E=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,C="boolean"===typeof i.disableFontFace?i.disableFontFace:Bt,k=!0===i.fontExtraProperties,S=!0===i.enableXfa,M=i.ownerDocument||globalThis.document,L=!0===i.disableRange,T=!0===i.disableStream,R=!0===i.disableAutoFetch,P=!0===i.pdfBug,F=!0===i.enableHWA,I=h?h.length:null!==(e=i.length)&&void 0!==e?e:NaN,D="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!Bt&&!C,O="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:m===qi&&b===Xi&&g&&v&&nn(g,document.baseURI)&&nn(v,document.baseURI),N=i.canvasFactory||new Gl({ownerDocument:M,enableHWA:F}),W=i.filterFactory||new Xl({docId:s,ownerDocument:M});Oe(p);const j={canvasFactory:N,filterFactory:W};if(O||(j.cMapReaderFactory=new m({baseUrl:g,isCompressed:A}),j.standardFontDataFactory=new b({baseUrl:v})),!u){const t={verbosity:p,port:io.workerPort};u=t.port?uc.fromPort(t):new uc(t),n._worker=u}const B={docId:s,apiVersion:"4.4.168",data:a,password:c,disableAutoFetch:R,rangeChunkSize:d,length:I,docBaseUrl:f,enableXfa:S,evaluatorOptions:{maxImageSize:y,disableFontFace:C,ignoreErrors:w,isEvalSupported:_,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:E,fontExtraProperties:k,useSystemFonts:D,cMapUrl:O?g:null,standardFontDataUrl:O?v:null}},H={disableFontFace:C,fontExtraProperties:k,ownerDocument:M,pdfBug:P,styleElement:null,loadingParams:{disableAutoFetch:R,enableXfa:S}};return u.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",B,a?[a.buffer]:null);let e;if(h)e=new Wo(h,{disableRange:L,disableStream:T});else if(!a){if(!r)throw new Error("getDocument - no `url` parameter provided.");e=(t=>{if(Bt){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&nn(t.url)?new Yo(t):new il(t)}return nn(t.url)?new Yo(t):new Jo(t)})({url:r,length:I,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:L,disableStream:T})}return t.then(t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new vo(s,t,u.port),r=new _c(i,n,e,H,j);n._transport=r,i.send("Ready",null)})}).catch(n._capability.reject),n}function Ql(t){return"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0}class Zl{constructor(){var t,e;this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d".concat((Jl._=(t=Jl._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var t,e;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),await(null===(e=this._transport)||void 0===e?void 0:e.destroy())}catch(n){var i;throw null!==(i=this._worker)&&void 0!==i&&i.port&&delete this._worker._pendingDestroy,n}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var Jl={_:0};class $l{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){Be("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class tc{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 Ue(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()}}var ec=new WeakMap,ic=new WeakMap,nc=new WeakSet;class sc{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,vt.A)(this,nc),(0,_t.A)(this,ec,null),(0,_t.A)(this,ic,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new en:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Sc,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 Ki({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 Ue(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i;let{canvasContext:n,viewport:s,intent:r="display",annotationMode:a=Zt.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:h=null,pageColors:d=null,printAnnotationStorage:u=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const p=this._transport.getRenderingIntent(r,a,u),{renderingIntent:f,cacheKey:g}=p;(0,Et.A)(ic,this,!1),(0,bt.A)(nc,this,ac).call(this),c||(c=this._transport.getOptionalContentConfig(f));let A=this._intentStates.get(g);A||(A=Object.create(null),this._intentStates.set(g,A)),A.streamReaderCancelTimeout&&(clearTimeout(A.streamReaderCancelTimeout),A.streamReaderCancelTimeout=null);const m=!!(f&qt);var v;A.displayReadyCapability||(A.displayReadyCapability=Promise.withResolvers(),A.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(v=this._stats)||void 0===v||v.time("Page Request"),this._pumpOperatorList(p));const b=t=>{var e;(A.renderTasks.delete(w),(this._maybeCleanupAfterRender||m)&&(0,Et.A)(ic,this,!0),(0,bt.A)(nc,this,rc).call(this,!m),t?(w.capability.reject(t),this._abortOperatorList({intentState:A,reason:t instanceof Error?t:new Error(t)})):w.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(e=globalThis.Stats)&&void 0!==e&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=new Pc({callback:b,params:{canvasContext:n,viewport:s,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:A.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:d});((i=A).renderTasks||(i.renderTasks=new Set)).add(w);const y=w.task;return Promise.all([A.displayReadyCapability.promise,c]).then(t=>{var e;let[i,n]=t;if(this.destroyed)b();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");w.initializeGraphics({transparency:i,optionalContentConfig:n}),w.operatorListChanged()}}).catch(b),y}getOperatorList(){let{intent:t="display",annotationMode:e=Zt.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);var a,o;(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(),((a=r).renderTasks||(a.renderTasks=new Set)).add(s),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(n));return 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=>Ul.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){var n;let{value:r,done:a}=i;a?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=r.lang),Object.assign(s.styles,r.styles),s.items.push(...r.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(),(0,Et.A)(ic,this,!1),(0,bt.A)(nc,this,ac).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,Et.A)(ic,this,!0);const e=(0,bt.A)(nc,this,rc).call(this,!1);return t&&e&&this._stats&&(this._stats=new en),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(n=s.displayReadyCapability)||void 0===n||n.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&&(0,bt.A)(nc,this,rc).call(this,!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();(0,bt.A)(nc,this,rc).call(this,!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 Qi){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 Ze(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}}function rc(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,bt.A)(nc,this,ac).call(this),!(0,xt.A)(ic,this)||this.destroyed)return!1;if(t)return(0,Et.A)(ec,this,setTimeout(()=>{(0,Et.A)(ec,this,null),(0,bt.A)(nc,this,rc).call(this,!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(),(0,Et.A)(ic,this,!1),!0}function ac(){(0,xt.A)(ec,this)&&(clearTimeout((0,xt.A)(ec,this)),(0,Et.A)(ec,this,null))}var oc=new WeakMap,lc=new WeakMap;class cc{constructor(){(0,_t.A)(this,oc,new Set),(0,_t.A)(this,lc,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};(0,xt.A)(lc,this).then(()=>{for(const t of(0,xt.A)(oc,this))t.call(this,i)})}addEventListener(t,e){(0,xt.A)(oc,this).add(e)}removeEventListener(t,e){(0,xt.A)(oc,this).delete(e)}terminate(){(0,xt.A)(oc,this).clear()}}const hc={isWorkerDisabled:!1,fakeWorkerId:0};Bt&&(hc.isWorkerDisabled=!0,io.workerSrc||(io.workerSrc="./pdf.worker.mjs")),hc.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch(s){return!1}const n=new URL(e,i);return i.origin===n.origin},hc.createCDNWrapper=function(t){const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var dc=new WeakSet;class uc{constructor(){let{name:t=null,port:e=null,verbosity:i=Ne()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,vt.A)(this,dc),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){var n;if(null!==(n=gc._)&&void 0!==n&&n.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(gc._||(gc._=new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return Bt?Promise.all([xa.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new vo("main","worker",t),this._messageHandler.on("ready",function(){}),(0,bt.A)(dc,this,pc).call(this)}_initialize(){if(hc.isWorkerDisabled||fc(uc))return void this._setupFakeWorker();let{workerSrc:t}=uc;try{hc.isSameOrigin(window.location.href,t)||(t=hc.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new vo("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,(0,bt.A)(dc,this,pc).call(this)):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{r()}catch(e){this._setupFakeWorker()}});const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch(e){We("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){hc.isWorkerDisabled||(je("Setting up fake worker."),hc.isWorkerDisabled=!0),uc._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new cc;this._port=e;const i="fake".concat(hc.fakeWorkerId++),n=new vo(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new vo(i,i+"_worker",e),(0,bt.A)(dc,this,pc).call(this)}).catch(t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(t=gc._)||void 0===t||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null===(e=(0,bt.A)(uc,this,gc)._)||void 0===e?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new uc(t)}static get workerSrc(){if(io.workerSrc)return io.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Ue(this,"_setupFakeWorkerGlobal",(async()=>{if(wt(uc,this,fc))return wt(uc,this,fc);return(await i(50789)(this.workerSrc)).WorkerMessageHandler})())}}function pc(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}function fc(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}var gc={_:void 0},Ac=new WeakMap,mc=new WeakMap,vc=new WeakMap,bc=new WeakMap,wc=new WeakMap,yc=new WeakSet;class _c{constructor(t,e,i,n,s){(0,vt.A)(this,yc),(0,_t.A)(this,Ac,new Map),(0,_t.A)(this,mc,new Map),(0,_t.A)(this,vc,new Map),(0,_t.A)(this,bc,new Map),(0,_t.A)(this,wc,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Sc,this.fontLoader=new ba({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()}get annotationStorage(){return Ue(this,"annotationStorage",new fa)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=Gt,r=ha;switch(t){case"any":s=Vt;break;case"display":break;case"print":s=qt;break;default:je("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case Zt.DISABLE:s+=Kt;break;case Zt.ENABLE:break;case Zt.ENABLE_FORMS:s+=Xt;break;case Zt.ENABLE_STORAGE:s+=Yt;r=(s&qt&&i instanceof ma?i:this.annotationStorage).serializable;break;default:je("getRenderingIntent - invalid annotationMode: ".concat(e))}return n&&(s+=Qt),{renderingIntent:s,cacheKey:"".concat(s,"_").concat(r.hash),annotationStorageSerializable:r}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=(0,xt.A)(wc,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of(0,xt.A)(mc,this).values())e.push(n._destroy());(0,xt.A)(mc,this).clear(),(0,xt.A)(vc,this).clear(),(0,xt.A)(bc,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then(()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),(0,xt.A)(Ac,this).clear(),this.filterFactory.destroy(),Tl.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Ze("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)=>{He(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():(He(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(()=>{if(!n.isStreamingSupported||!n.isRangeSupported){var t;if(this._lastProgress)null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress);n.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{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)=>{He(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():(He(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 tc(i,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new Ge(t.message,t.code);break;case"InvalidPDFException":i=new Xe(t.message);break;case"MissingPDFException":i=new Ye(t.message);break;case"UnexpectedResponseException":i=new Ke(t.message,t.status);break;case"UnknownErrorException":i=new qe(t.message,t.details);break;default:Be("DocException - expected a valid Error.")}e._capability.reject(i)}),t.on("PasswordRequest",t=>{if((0,Et.A)(wc,this,Promise.withResolvers()),e.onPassword){const n=t=>{t instanceof Error?(0,xt.A)(wc,this).reject(t):(0,xt.A)(wc,this).resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){(0,xt.A)(wc,this).reject(i)}}else(0,xt.A)(wc,this).reject(new Ge(t.message,t.code));return(0,xt.A)(wc,this).promise}),t.on("DataLoaded",t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;(0,xt.A)(mc,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var i;let[n,s,r]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":const{disableFontFace:e,fontExtraProperties:a,pdfBug:o}=this._params;if("error"in r){const t=r.error;je("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const l=o&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,c=new wa(r,{disableFontFace:e,inspectFont:l});this.fontLoader.bind(c).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!a&&c.data&&(c.data=null),this.commonObjs.resolve(n,c)});break;case"CopyLocalImage":const{imageRef:h}=r;He(h,"The imageRef must be defined.");for(const t of(0,xt.A)(mc,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===h)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error("Got unknown common object type ".concat(s))}return null}),t.on("obj",t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=(0,xt.A)(mc,this).get(i);var a;if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":r.objs.resolve(e,s),(null===s||void 0===s?void 0:s.dataLen)>1e7&&(r._maybeCleanupAfterRender=!0);break;case"Pattern":r.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(a=s.bitmap)||void 0===a||a.close()}),t.on("DocProgress",t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{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(){var t,e;this.annotationStorage.size<=0&&je("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},n).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=(0,xt.A)(vc,this).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&&(0,xt.A)(bc,this).set(i.refStr,t);const n=new sc(e,i,this,this._params.pdfBug);return(0,xt.A)(mc,this).set(e,n),n});return(0,xt.A)(vc,this).set(e,n),n}getPageIndex(t){return Ql(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(0,bt.A)(yc,this,xc).call(this,"GetFieldObjects")}hasJSActions(){return(0,bt.A)(yc,this,xc).call(this,"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(0,bt.A)(yc,this,xc).call(this,"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(0,bt.A)(yc,this,xc).call(this,"GetOptionalContentConfig").then(e=>new Oo(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=(0,xt.A)(Ac,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>{var e,i,n,s;return{info:t[0],metadata:t[1]?new Eo(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(n=null===(s=this._fullReader)||void 0===s?void 0:s.contentLength)&&void 0!==n?n:null}});return(0,xt.A)(Ac,this).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(0,xt.A)(mc,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),(0,xt.A)(Ac,this).clear(),this.filterFactory.destroy(!0),Tl.cleanup()}}cachedPageNumber(t){var e;if(!Ql(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=(0,xt.A)(bc,this).get(i))&&void 0!==e?e:null}}function xc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=(0,xt.A)(Ac,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return(0,xt.A)(Ac,this).set(t,n),n}const Ec=Symbol("INITIAL_DATA");var Cc=new WeakMap,kc=new WeakSet;class Sc{constructor(){(0,vt.A)(this,kc),(0,_t.A)(this,Cc,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=(0,bt.A)(kc,this,Mc).call(this,t);return i.promise.then(()=>e(i.data)),null}const i=(0,xt.A)(Cc,this)[t];if(!i||i.data===Ec)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=(0,xt.A)(Cc,this)[t];return!!e&&e.data!==Ec}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=(0,bt.A)(kc,this,Mc).call(this,t);i.data=e,i.resolve()}clear(){for(const e in(0,xt.A)(Cc,this)){var t;const{data:i}=(0,xt.A)(Cc,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}(0,Et.A)(Cc,this,Object.create(null))}*[Symbol.iterator](){for(const t in(0,xt.A)(Cc,this)){const{data:e}=(0,xt.A)(Cc,this)[t];e!==Ec&&(yield[t,e])}}}function Mc(t){var e;return(e=(0,xt.A)(Cc,this))[t]||(e[t]=(0,gt.A)((0,gt.A)({},Promise.withResolvers()),{},{data:Ec}))}var Lc=new WeakMap;class Tc{constructor(t){(0,_t.A)(this,Lc,null),(0,Et.A)(Lc,this,t),this.onContinue=null}get promise(){return(0,xt.A)(Lc,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,xt.A)(Lc,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=(0,xt.A)(Lc,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=(0,xt.A)(Lc,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var Rc=new WeakMap;class Pc{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null}=t;(0,_t.A)(this,Rc,null),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=c,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Tc(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){var e,i;let{transparency:n=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(Fc._.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.");Fc._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:a,transform:o,background:l}=this.params;this.gfx=new $a(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:a,transparency:n,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),(0,xt.A)(Rc,this)&&(window.cancelAnimationFrame((0,xt.A)(Rc,this)),(0,Et.A)(Rc,this,null)),Fc._.delete(this._canvas),this.callback(e||new Qi("Rendering cancelled, page ".concat(this._pageIndex+1),i))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?(0,Et.A)(Rc,this,window.requestAnimationFrame(()=>{(0,Et.A)(Rc,this,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(),Fc._.delete(this._canvas),this.callback())))}}var Fc={_:new WeakSet};const Ic="4.4.168",Dc="19fbc8998";function Oc(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Nc(t){return Math.max(0,Math.min(255,255*t))}class Wc{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=Nc(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Oc(e);return"#".concat(i).concat(i).concat(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(Nc)}static RGB_HTML(t){return"#".concat(t.map(Oc).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[Nc(1-Math.min(1,e+s)),Nc(1-Math.min(1,n+s)),Nc(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 jc{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="".concat(a.name,"-").concat(s));for(const[l,c]of Object.entries(a))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,c)}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(".concat(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&&Ul.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,r]];for(;c.length>0;){var h,d;const[t,n,r]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const p=null!==o&&void 0!==o&&null!==(h=o.attributes)&&void 0!==h&&h.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(r.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:s,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)c.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);a&&Ul.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const Bc=1e3,Hc=new WeakSet;function zc(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Uc{static create(t){switch(t.data.annotationType){case ce:return new Zc(t);case le:return new eh(t);case Ce:switch(t.data.fieldType){case"Tx":return new nh(t);case"Btn":return t.data.radioButton?new ah(t):t.data.checkBox?new rh(t):new oh(t);case"Ch":return new lh(t);case"Sig":return new sh(t)}return new ih(t);case xe:return new ch(t);case he:return new Bh(t);case de:return new zh(t);case ue:return new Vh(t);case pe:return new qh(t);case ge:return new Yh(t);case ye:return new Qh(t);case _e:return new Jh(t);case fe:return new Kh(t);case Ae:return new $h(t);case me:return new td(t);case ve:return new ed(t);case be:return new id(t);case we:return new nd(t);case Ee:return new ad(t);default:return new Yc(t)}}}var Vc=new WeakMap,Gc=new WeakMap,qc=new WeakMap,Xc=new WeakSet;class Yc{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,vt.A)(this,Xc),(0,_t.A)(this,Vc,null),(0,_t.A)(this,Gc,!1),(0,_t.A)(this,qc,null),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!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str||null!==n&&void 0!==n&&n.str)}get hasPopupData(){return Yc._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;(0,xt.A)(Vc,this)||(0,Et.A)(Vc,this,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&(0,bt.A)(Xc,this,Kc).call(this,i),null===(e=(0,xt.A)(qc,this))||void 0===e||e.popup.updateEdited(t)}resetEdited(){var t;(0,xt.A)(Vc,this)&&((0,bt.A)(Xc,this,Kc).call(this,(0,xt.A)(Vc,this).rect),null===(t=(0,xt.A)(qc,this))||void 0===t||t.popup.resetEdited(),(0,Et.A)(Vc,this,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof ih||(s.tabIndex=Bc);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 ch){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=zc(e.rect);if(!t&&e.borderStyle.width>0){r.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(i,"px * var(--scale-factor))");r.borderRadius=e}else if(this instanceof ah){const t="calc(".concat(a,"px * var(--scale-factor)) / calc(").concat(o,"px * var(--scale-factor))");r.borderRadius=t}switch(e.borderStyle.style){case ke:r.borderStyle="solid";break;case Se:r.borderStyle="dashed";break;case Me:je("Unimplemented border style: beveled");break;case Le:je("Unimplemented border style: inset");break;case Te:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?((0,Et.A)(Gc,this,!0),r.borderColor=ni.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=ni.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:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;r.left="".concat(100*(l[0]-d)/c,"%"),r.top="".concat(100*(l[1]-u)/h,"%");const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width="".concat(100*a/c,"%"),r.height="".concat(100*o/h,"%")):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}=zc(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="".concat(a,"%"),e.style.height="".concat(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]=Wc["".concat(s,"_HTML")](r),this.annotationStorage.setValue(this.data.id,{[e]:Wc["".concat(s,"_rgb")](r)})};return Ue(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];null===s||void 0===s||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((0,xt.A)(Gc,this)){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="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0);const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p="clippath_".concat(this.data.id);u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let g=2,A=t.length;g<A;g+=8){var f;const i=t[g],n=t[g+1],r=t[g+2],h=t[g+3],d=c.createElement("rect"),p=(r-e)/o,A=(s-n)/l,m=(i-r)/o,v=(n-h)/l;d.setAttribute("x",p),d.setAttribute("y",A),d.setAttribute("width",m),d.setAttribute("height",v),u.append(d),null===(f=a)||void 0===f||f.push('<rect vector-effect="non-scaling-stroke" x="'.concat(p,'" y="').concat(A,'" width="').concat(m,'" height="').concat(v,'"/>'))}(0,xt.A)(Gc,this)&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=(0,Et.A)(qc,this,new ch({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){Be("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="'.concat(s,'"]'));!a||Hc.has(a)?i.push({id:s,exportValue:n,domElement:a}):je("_getElementsByName - element not allowed: ".concat(s))}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(Hc.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){var t;this.container&&(this.container.hidden=!1),null===(t=this.popup)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||t.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",()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}function Kc(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t);const{width:l,height:c}=zc(t);e.left="".concat(100*(t[0]-a)/s,"%"),e.top="".concat(100*(r-t[3]+o)/r,"%"),0===n?(e.width="".concat(100*l/s,"%"),e.height="".concat(100*c/r,"%")):this.setRotation(n)}var Qc=new WeakSet;class Zc extends Yc{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),(0,vt.A)(this,Qc),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?((0,bt.A)(Qc,this,$c).call(this,i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?((0,bt.A)(Qc,this,th).call(this,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}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&(0,bt.A)(Qc,this,Jc).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),(0,bt.A)(Qc,this,Jc).call(this)}_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]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}t.onclick||(t.onclick=()=>!1),(0,bt.A)(Qc,this,Jc).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),(0,bt.A)(Qc,this,Jc).call(this),!this._fieldObjects)return je('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||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="'.concat(t,'"]'));i&&(Hc.has(i)?i.dispatchEvent(new Event("resetform")):je("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function Jc(){this.container.setAttribute("data-internal-link","")}function $c(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=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,i),!1},(0,bt.A)(Qc,this,Jc).call(this)}function th(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),(0,bt.A)(Qc,this,Jc).call(this)}class eh extends Yc{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 ih extends Yc{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return ei.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.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=>{var r;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))})}_setEventListeners(t,e,i,n){for(const[o,l]of i){var s,r,a;if("Action"===l||null!==(s=this.data.actions)&&void 0!==s&&s[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Blur?"Blur"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.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":ni.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/(Ut*n))||1);r=Math.min(n,a(e/Ut))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/Ut))}s.fontSize="calc(".concat(r,"px * var(--scale-factor))"),s.color=ni.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 nh extends ih{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){var n;const r=t.getValue(e,{value:this.data.fieldValue});let a=r.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null===(n=this.data.textContent)||void 0===n?void 0:n.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const c={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",null!==l&&void 0!==l?l:a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Hc.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Bc,this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),c.formattedValue=null}),i.addEventListener("resetform",t=>{var e;const n=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=c.userValue=n,c.formattedValue=null});let h=t=>{const{formattedValue:e}=c;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;i.addEventListener("focus",t=>{var e;if(c.focused)return;const{target:i}=t;c.userValue&&(i.value=c.userValue),c.lastCommittedValue=i.value,c.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(c.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){var n;c.userValue=null!==(n=i.detail.value)&&void 0!==n?n:"",t.setValue(e,{value:c.userValue.toString()}),i.target.value=c.userValue},formattedValue(i){const{formattedValue:n}=i.detail;c.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=>{var n;const{charLimit:s}=i.detail,{target:r}=i;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=c.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=c.userValue=a,t.setValue(e,{value:a}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{var i;c.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(c.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;c.lastCommittedValue!==s&&(c.lastCommittedValue=s,c.userValue=s,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=h;h=null,i.addEventListener("blur",t=>{var i;if(!c.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(c.focused=!1);const{value:s}=t.target;var r;(c.userValue=s,c.lastCommittedValue!==s)&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:c.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));n(t)}),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&i.addEventListener("beforeinput",t=>{var i;c.lastCommittedValue=null;const{data:n,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,h=o;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(a).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(h+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(i,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(h&&i.addEventListener("blur",h),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(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 sh extends ih{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class rh extends ih{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 Hc.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=Bc,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 ah extends ih{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(Hc.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=Bc,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 oh extends Zc{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 lh extends ih{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");Hc.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=Bc;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 c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,i.value.includes(c.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){var s;null===(s=r)||void 0===s||s();const l=i.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const t of n.options)t.selected=c.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:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=r,d.value=c,h?h.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=>{var n;const s=a(!0),r=a(!1);t.setValue(e,{value:s}),i.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:r,changeEx:s,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 ch extends Yc{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Yc._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Th({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=>"".concat(ci).concat(t)).join(",")),this.container}}var hh=new WeakMap,dh=new WeakMap,uh=new WeakMap,ph=new WeakMap,fh=new WeakMap,gh=new WeakMap,Ah=new WeakMap,mh=new WeakMap,vh=new WeakMap,bh=new WeakMap,wh=new WeakMap,yh=new WeakMap,_h=new WeakMap,xh=new WeakMap,Eh=new WeakMap,Ch=new WeakMap,kh=new WeakMap,Sh=new WeakMap,Mh=new WeakMap,Lh=new WeakSet;class Th{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:d}=t;(0,vt.A)(this,Lh),(0,_t.A)(this,hh,(0,bt.A)(Lh,this,Dh).bind(this)),(0,_t.A)(this,dh,(0,bt.A)(Lh,this,jh).bind(this)),(0,_t.A)(this,uh,(0,bt.A)(Lh,this,Wh).bind(this)),(0,_t.A)(this,ph,(0,bt.A)(Lh,this,Nh).bind(this)),(0,_t.A)(this,fh,null),(0,_t.A)(this,gh,null),(0,_t.A)(this,Ah,null),(0,_t.A)(this,mh,null),(0,_t.A)(this,vh,null),(0,_t.A)(this,bh,null),(0,_t.A)(this,wh,null),(0,_t.A)(this,yh,!1),(0,_t.A)(this,_h,null),(0,_t.A)(this,xh,null),(0,_t.A)(this,Eh,null),(0,_t.A)(this,Ch,null),(0,_t.A)(this,kh,null),(0,_t.A)(this,Sh,null),(0,_t.A)(this,Mh,!1),(0,Et.A)(gh,this,e),(0,Et.A)(kh,this,s),(0,Et.A)(Ah,this,a),(0,Et.A)(Ch,this,o),(0,Et.A)(bh,this,l),(0,Et.A)(fh,this,i),(0,Et.A)(Eh,this,c),(0,Et.A)(wh,this,h),(0,Et.A)(vh,this,n),(0,Et.A)(mh,this,on.toDateObject(r)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup());for(const p of this.trigger)p.addEventListener("click",(0,xt.A)(ph,this)),p.addEventListener("mouseenter",(0,xt.A)(uh,this)),p.addEventListener("mouseleave",(0,xt.A)(dh,this)),p.classList.add("popupTriggerArea");for(const p of n){var u;null===(u=p.container)||void 0===u||u.addEventListener("keydown",(0,xt.A)(hh,this))}(0,xt.A)(gh,this).hidden=!0,d&&(0,bt.A)(Lh,this,Nh).call(this)}render(){if((0,xt.A)(_h,this))return;const t=(0,Et.A)(_h,this,document.createElement("div"));if(t.className="popup",(0,xt.A)(fh,this)){const e=t.style.outlineColor=ni.makeHexColor(...(0,xt.A)(fh,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;t.style.backgroundColor=ni.makeHexColor(...(0,xt.A)(fh,this).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}=(0,xt.A)(kh,this)),t.append(e),(0,xt.A)(mh,this)){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:(0,xt.A)(mh,this).toLocaleDateString(),time:(0,xt.A)(mh,this).toLocaleTimeString()})),e.append(t)}const n=wt(Lh,this,Rh);if(n)jc.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents((0,xt.A)(Ah,this));t.append(e)}(0,xt.A)(gh,this).append(t)}_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}updateEdited(t){var e;let{rect:i,popupContent:n}=t;(0,xt.A)(Sh,this)||(0,Et.A)(Sh,this,{contentsObj:(0,xt.A)(Ah,this),richText:(0,xt.A)(Ch,this)}),i&&(0,Et.A)(xh,this,null),n&&((0,Et.A)(Ch,this,(0,bt.A)(Lh,this,Ih).call(this,n)),(0,Et.A)(Ah,this,null)),null===(e=(0,xt.A)(_h,this))||void 0===e||e.remove(),(0,Et.A)(_h,this,null)}resetEdited(){var t;(0,xt.A)(Sh,this)&&(({contentsObj:At(Et.A,[Ah,this])._,richText:At(Et.A,[Ch,this])._}=(0,xt.A)(Sh,this)),(0,Et.A)(Sh,this,null),null===(t=(0,xt.A)(_h,this))||void 0===t||t.remove(),(0,Et.A)(_h,this,null),(0,Et.A)(xh,this,null))}forceHide(){(0,Et.A)(Mh,this,this.isVisible),(0,xt.A)(Mh,this)&&((0,xt.A)(gh,this).hidden=!0)}maybeShow(){(0,xt.A)(Mh,this)&&((0,xt.A)(_h,this)||(0,bt.A)(Lh,this,Wh).call(this),(0,Et.A)(Mh,this,!1),(0,xt.A)(gh,this).hidden=!1)}get isVisible(){return!1===(0,xt.A)(gh,this).hidden}}function Rh(t){const e=(0,xt.A)(Ch,t),i=(0,xt.A)(Ah,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:(0,xt.A)(Ch,t).html||null}function Ph(t){var e;return(null===(e=wt(Lh,t,Rh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function Fh(t){var e;return(null===(e=wt(Lh,t,Rh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function Ih(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:wt(Lh,this,Fh),fontSize:wt(Lh,this,Ph)?"calc(".concat(wt(Lh,this,Ph),"px * var(--scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function Dh(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&(0,xt.A)(yh,this))&&(0,bt.A)(Lh,this,Nh).call(this)}function Oh(){if(null!==(0,xt.A)(xh,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=(0,xt.A)(bh,this);let r=!!(0,xt.A)(wh,this),a=r?(0,xt.A)(wh,this):(0,xt.A)(Eh,this);for(const u of(0,xt.A)(vh,this))if(!a||null!==ni.intersect(u.data.rect,a)){a=u.data.rect,r=!0;break}const o=ni.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,c=o[0]+l,h=o[1];(0,Et.A)(xh,this,[100*(c-n)/e,100*(h-s)/i]);const{style:d}=(0,xt.A)(gh,this);d.left="".concat((0,xt.A)(xh,this)[0],"%"),d.top="".concat((0,xt.A)(xh,this)[1],"%")}function Nh(){(0,Et.A)(yh,this,!(0,xt.A)(yh,this)),(0,xt.A)(yh,this)?((0,bt.A)(Lh,this,Wh).call(this),(0,xt.A)(gh,this).addEventListener("click",(0,xt.A)(ph,this)),(0,xt.A)(gh,this).addEventListener("keydown",(0,xt.A)(hh,this))):((0,bt.A)(Lh,this,jh).call(this),(0,xt.A)(gh,this).removeEventListener("click",(0,xt.A)(ph,this)),(0,xt.A)(gh,this).removeEventListener("keydown",(0,xt.A)(hh,this)))}function Wh(){(0,xt.A)(_h,this)||this.render(),this.isVisible?(0,xt.A)(yh,this)&&(0,xt.A)(gh,this).classList.add("focused"):((0,bt.A)(Lh,this,Oh).call(this),(0,xt.A)(gh,this).hidden=!1,(0,xt.A)(gh,this).style.zIndex=parseInt((0,xt.A)(gh,this).style.zIndex)+1e3)}function jh(){(0,xt.A)(gh,this).classList.remove("focused"),!(0,xt.A)(yh,this)&&this.isVisible&&((0,xt.A)(gh,this).hidden=!0,(0,xt.A)(gh,this).style.zIndex=parseInt((0,xt.A)(gh,this).style.zIndex)-1e3)}class Bh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Jt.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}}var Hh=new WeakMap;class zh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Hh,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=zc(t.rect),n=this.svgFactory.create(e,i,!0),s=(0,Et.A)(Hh,this,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(0,xt.A)(Hh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Uh=new WeakMap;class Vh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Uh,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=zc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=(0,Et.A)(Uh,this,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(0,xt.A)(Uh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Gh=new WeakMap;class qh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Gh,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=zc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=(0,Et.A)(Gh,this,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(0,xt.A)(Gh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Xh=new WeakMap;class Yh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Xh,null),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}=zc(t),a=this.svgFactory.create(s,r,!0);let o=[];for(let c=0,h=e.length;c<h;c+=2){const i=e[c]-t[0],n=t[3]-e[c+1];o.push("".concat(i,",").concat(n))}o=o.join(" ");const l=(0,Et.A)(Xh,this,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(0,xt.A)(Xh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Kh extends Yh{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Qh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Zh=new WeakMap;class Jh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Zh,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Jt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:r}=zc(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("".concat(n,",").concat(s))}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);(0,xt.A)(Zh,this).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(0,xt.A)(Zh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class $h extends Yc{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 td extends Yc{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 ed extends Yc{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 id extends Yc{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 nd extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var sd=new WeakMap,rd=new WeakSet;class ad extends Yc{constructor(t){var e;super(t,{isRenderable:!0}),(0,vt.A)(this,rd),(0,_t.A)(this,sd,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",(0,gt.A)({source:this},i))}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="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(i.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),i.addEventListener("dblclick",(0,bt.A)(rd,this,od).bind(this)),(0,Et.A)(sd,this,i);const{isMac:n}=ei.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&(0,bt.A)(rd,this,od).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return(0,xt.A)(sd,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function od(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var ld=new WeakMap,cd=new WeakMap,hd=new WeakMap,dd=new WeakSet;class ud{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:a}=t;(0,vt.A)(this,dd),(0,_t.A)(this,ld,null),(0,_t.A)(this,cd,null),(0,_t.A)(this,hd,new Map),this.div=e,(0,Et.A)(ld,this,i),(0,Et.A)(cd,this,n),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}async render(t){const{annotations:e}=t,i=this.div;un(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 Yi,annotationStorage:t.annotationStorage||new fa,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of e){if(a.noHTML)continue;const t=a.annotationType===xe;if(t){const t=n.get(a.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=zc(a.rect);if(t<=0||e<=0)continue}s.data=a;const e=Uc.create(s);if(!e.isRenderable)continue;if(!t&&a.popupRef){const t=n.get(a.popupRef);t?t.push(e):n.set(a.popupRef,[e])}const i=e.render();var r;if(a.hidden&&(i.style.visibility="hidden"),(0,bt.A)(dd,this,pd).call(this,i,a.id),e.annotationEditorType>0)(0,xt.A)(hd,this).set(e.data.id,e),null===(r=this._annotationEditorUIManager)||void 0===r||r.renderAnnotationElement(e)}(0,bt.A)(dd,this,fd).call(this)}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,un(i,{rotation:e.rotation}),(0,bt.A)(dd,this,fd).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from((0,xt.A)(hd,this).values())}getEditableAnnotation(t){return(0,xt.A)(hd,this).get(t)}}function pd(t,e){var i;const n=t.firstChild||t;n.id="".concat(ci).concat(e),this.div.append(t),null===(i=(0,xt.A)(ld,this))||void 0===i||i.moveElementInDOM(this.div,t,n,!1)}function fd(){if(!(0,xt.A)(cd,this))return;const t=this.div;for(const[e,i]of(0,xt.A)(cd,this)){const n=t.querySelector('[data-annotation-id="'.concat(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)}(0,xt.A)(cd,this).clear()}const gd=/\r\n?|\n/g;var Ad=new WeakMap,md=new WeakMap,vd=new WeakMap,bd=new WeakMap,wd=new WeakMap,yd=new WeakMap,_d=new WeakMap,xd=new WeakMap,Ed=new WeakMap,Cd=new WeakMap,kd=new WeakSet;class Sd extends Vr{static get _keyboardManager(){const t=Sd.prototype,e=t=>t.isEmpty(),i=Vs.TRANSLATE_SMALL,n=Vs.TRANSLATE_BIG;return Ue(this,"_keyboardManager",new Yn([[["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}]]))}constructor(t){super((0,gt.A)((0,gt.A)({},t),{},{name:"freeTextEditor"})),(0,vt.A)(this,kd),(0,_t.A)(this,Ad,this.editorDivBlur.bind(this)),(0,_t.A)(this,md,this.editorDivFocus.bind(this)),(0,_t.A)(this,vd,this.editorDivInput.bind(this)),(0,_t.A)(this,bd,this.editorDivKeydown.bind(this)),(0,_t.A)(this,wd,this.editorDivPaste.bind(this)),(0,_t.A)(this,yd,void 0),(0,_t.A)(this,_d,""),(0,_t.A)(this,xd,"".concat(this.id,"-editor")),(0,_t.A)(this,Ed,void 0),(0,_t.A)(this,Cd,null),(0,Et.A)(yd,this,t.color||Sd._defaultColor||Vr._defaultLineColor),(0,Et.A)(Ed,this,t.fontSize||Sd._defaultFontSize)}static initialize(t,e){Vr.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 $t.FREETEXT_SIZE:Sd._defaultFontSize=e;break;case $t.FREETEXT_COLOR:Sd._defaultColor=e}}updateParams(t,e){switch(t){case $t.FREETEXT_SIZE:(0,bt.A)(kd,this,Md).call(this,e);break;case $t.FREETEXT_COLOR:(0,bt.A)(kd,this,Ld).call(this,e)}}static get defaultPropertiesToUpdate(){return[[$t.FREETEXT_SIZE,Sd._defaultFontSize],[$t.FREETEXT_COLOR,Sd._defaultColor||Vr._defaultLineColor]]}get propertiesToUpdate(){return[[$t.FREETEXT_SIZE,(0,xt.A)(Ed,this)],[$t.FREETEXT_COLOR,(0,xt.A)(yd,this)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-Sd._internalPadding*t,-(Sd._internalPadding+(0,xt.A)(Ed,this))*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(Jt.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",(0,xt.A)(bd,this),{signal:t}),this.editorDiv.addEventListener("focus",(0,xt.A)(md,this),{signal:t}),this.editorDiv.addEventListener("blur",(0,xt.A)(Ad,this),{signal:t}),this.editorDiv.addEventListener("input",(0,xt.A)(vd,this),{signal:t}),this.editorDiv.addEventListener("paste",(0,xt.A)(wd,this),{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",(0,xt.A)(xd,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",(0,xt.A)(bd,this)),this.editorDiv.removeEventListener("focus",(0,xt.A)(md,this)),this.editorDiv.removeEventListener("blur",(0,xt.A)(Ad,this)),this.editorDiv.removeEventListener("input",(0,xt.A)(vd,this)),this.editorDiv.removeEventListener("paste",(0,xt.A)(wd,this)),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(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!==(t=this._initialOptions)&&void 0!==t&&t.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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=(0,xt.A)(_d,this),e=(0,Et.A)(_d,this,(0,bt.A)(kd,this,Td).call(this).trimEnd());if(t===e)return;const i=t=>{(0,Et.A)(_d,this,t),t?((0,bt.A)(kd,this,Fd).call(this),this._uiManager.rebuild(this),(0,bt.A)(kd,this,Rd).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),(0,bt.A)(kd,this,Rd).call(this)}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){Sd._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",(0,xt.A)(xd,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),Vr._l10nPromise.get("pdfjs-free-text-default-content").then(t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)}),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize="calc(".concat((0,xt.A)(Ed,this),"px * var(--scale-factor))"),i.color=(0,xt.A)(yd,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),Fn(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=(0,xt.A)(Cd,this);let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-c)/o,u=e+this.height-(s[1]-h)/l;break;case 90:d=t+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-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);(0,bt.A)(kd,this,Fd).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=Dd.call(Sd,e.getData("text")||"").replaceAll(gd,"\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=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(gd,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(Pd.call(Sd,i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(gd,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(Pd.call(Sd,i))}(0,Et.A)(_d,this,"".concat(l.join("\n")).concat(n).concat(c.join("\n"))),(0,bt.A)(kd,this,Fd).call(this);const h=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){h.setStart(u,d),h.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(h)}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let n=null;if(t instanceof Bh){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a},textContent:o,textPosition:l,parent:{page:{pageNumber:c}}}=t;if(!o||0===o.length)return null;n=t={annotationType:Jt.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:c-1,rect:s.slice(0),rotation:r,id:a,deleted:!1}}const s=super.deserialize(t,e,i);return(0,Et.A)(Ed,s,t.fontSize),(0,Et.A)(yd,s,ni.makeHexColor(...t.color)),(0,Et.A)(_d,s,Dd.call(Sd,t.value)),s.annotationElementId=t.id||null,(0,Et.A)(Cd,s,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=Sd._internalPadding*this.parentScale,i=this.getRect(e,e),n=Vr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:(0,xt.A)(yd,this)),s={annotationType:Jt.FREETEXT,color:n,fontSize:(0,xt.A)(Ed,this),value:(0,bt.A)(kd,this,Id).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!(0,bt.A)(kd,this,Od).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize="calc(".concat((0,xt.A)(Ed,this),"px * var(--scale-factor))"),i.color=(0,xt.A)(yd,this),e.replaceChildren();for(const s of(0,xt.A)(_d,this).split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=Sd._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:(0,xt.A)(_d,this)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function Md(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))"),this.translate(0,-(t-(0,xt.A)(Ed,this))*this.parentScale),(0,Et.A)(Ed,this,t),(0,bt.A)(kd,this,Rd).call(this)},i=(0,xt.A)(Ed,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Ld(t){const e=t=>{(0,Et.A)(yd,this,this.editorDiv.style.color=t)},i=(0,xt.A)(yd,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Td(){const t=[];this.editorDiv.normalize();for(const e of this.editorDiv.childNodes)t.push(Pd.call(Pt,e));return t.join("\n")}function Rd(){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()}function Pd(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(gd,"")}function Fd(){if(this.editorDiv.replaceChildren(),(0,xt.A)(_d,this))for(const t of(0,xt.A)(_d,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function Id(){return(0,xt.A)(_d,this).replaceAll("\xa0"," ")}function Dd(t){return t.replaceAll(" ","\xa0")}function Od(t){const{value:e,fontSize:i,color:n,pageIndex:s}=(0,xt.A)(Cd,this);return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}Pt=Sd,(0,yt.A)(Sd,"_freeTextDefaultContent",""),(0,yt.A)(Sd,"_internalPadding",0),(0,yt.A)(Sd,"_defaultColor",null),(0,yt.A)(Sd,"_defaultFontSize",10),(0,yt.A)(Sd,"_type","freetext"),(0,yt.A)(Sd,"_editorType",Jt.FREETEXT);var Nd=new WeakMap,Wd=new WeakMap,jd=new WeakMap,Bd=new WeakSet;class Hd{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];(0,vt.A)(this,Bd),(0,_t.A)(this,Nd,void 0),(0,_t.A)(this,Wd,[]),(0,_t.A)(this,jd,[]);let s=1/0,r=-1/0,a=1/0,o=-1/0;const l=10**-4;for(const{x:g,y:A,width:m,height:v}of t){const t=Math.floor((g-e)/l)*l,i=Math.ceil((g+m+e)/l)*l,n=Math.floor((A-e)/l)*l,c=Math.ceil((A+v+e)/l)*l,h=[t,n,c,!0],d=[i,n,c,!1];(0,xt.A)(Wd,this).push(h,d),s=Math.min(s,t),r=Math.max(r,i),a=Math.min(a,n),o=Math.max(o,c)}const c=r-s+2*i,h=o-a+2*i,d=s-i,u=a-i,p=(0,xt.A)(Wd,this).at(n?-1:-2),f=[p[0],p[2]];for(const g of(0,xt.A)(Wd,this)){const[t,e,i]=g;g[0]=(t-d)/c,g[1]=(e-u)/h,g[2]=(i-u)/h}(0,Et.A)(Nd,this,{x:d,y:u,width:c,height:h,lastPoint:f})}getOutlines(){(0,xt.A)(Wd,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of(0,xt.A)(Wd,this))e[3]?(t.push(...(0,bt.A)(Bd,this,qd).call(this,e)),(0,bt.A)(Bd,this,Vd).call(this,e)):((0,bt.A)(Bd,this,Gd).call(this,e),t.push(...(0,bt.A)(Bd,this,qd).call(this,e)));return(0,bt.A)(Bd,this,zd).call(this,t)}}function zd(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 c=e,h=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,c!==e&&(s.push(c,h,e,h===r?r:a),c=e),h=h===r?a:r}s.push(c,h)}return new Qd(n,(0,xt.A)(Nd,this))}function Ud(t){const e=(0,xt.A)(jd,this);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}function Vd(t){let[,e,i]=t;const n=(0,bt.A)(Bd,this,Ud).call(this,e);(0,xt.A)(jd,this).splice(n,0,[e,i])}function Gd(t){let[,e,i]=t;const n=(0,bt.A)(Bd,this,Ud).call(this,e);for(let s=n;s<(0,xt.A)(jd,this).length;s++){const[t,n]=(0,xt.A)(jd,this)[s];if(t!==e)break;if(t===e&&n===i)return void(0,xt.A)(jd,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=(0,xt.A)(jd,this)[s];if(t!==e)break;if(t===e&&n===i)return void(0,xt.A)(jd,this).splice(s,1)}}function qd(t){const[e,i,n]=t,s=[[e,i,n]],r=(0,bt.A)(Bd,this,Ud).call(this,n);for(let a=0;a<r;a++){const[t,i]=(0,xt.A)(jd,this)[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 Xd{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 xu}}var Yd=new WeakMap,Kd=new WeakMap;class Qd extends Xd{constructor(t,e){super(),(0,_t.A)(this,Yd,void 0),(0,_t.A)(this,Kd,void 0),(0,Et.A)(Kd,this,t),(0,Et.A)(Yd,this,e)}toSVGPath(){const t=[];for(const e of(0,xt.A)(Kd,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push("V".concat(a)),n=a):a===n&&(t.push("H".concat(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 c of(0,xt.A)(Kd,this)){const t=new Array(c.length);for(let e=0;e<c.length;e+=2)t[e]=i+c[e]*o,t[e+1]=r-c[e+1]*l;a.push(t)}return a}get box(){return(0,xt.A)(Yd,this)}}var Zd=new WeakMap,Jd=new WeakMap,$d=new WeakMap,tu=new WeakMap,eu=new WeakMap,iu=new WeakMap,nu=new WeakMap,su=new WeakMap,ru=new WeakMap,au=new WeakMap,ou=new WeakMap,lu=new WeakMap,cu=new WeakMap,hu=new WeakSet;class du{constructor(t,e,i,n,s){let{x:r,y:a}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(0,vt.A)(this,hu),(0,_t.A)(this,Zd,void 0),(0,_t.A)(this,Jd,[]),(0,_t.A)(this,$d,void 0),(0,_t.A)(this,tu,void 0),(0,_t.A)(this,eu,[]),(0,_t.A)(this,iu,new Float64Array(18)),(0,_t.A)(this,nu,void 0),(0,_t.A)(this,su,void 0),(0,_t.A)(this,ru,void 0),(0,_t.A)(this,au,void 0),(0,_t.A)(this,ou,void 0),(0,_t.A)(this,lu,void 0),(0,_t.A)(this,cu,[]),(0,Et.A)(Zd,this,e),(0,Et.A)(lu,this,n*i),(0,Et.A)(tu,this,s),(0,xt.A)(iu,this).set([NaN,NaN,NaN,NaN,r,a],6),(0,Et.A)($d,this,o),(0,Et.A)(au,this,pu._*i),(0,Et.A)(ru,this,fu._*i),(0,Et.A)(ou,this,i),(0,xt.A)(cu,this).push(r,a)}get free(){return!0}isEmpty(){return isNaN((0,xt.A)(iu,this)[8])}add(t){var e;let{x:i,y:n}=t;(0,Et.A)(nu,this,i),(0,Et.A)(su,this,n);const[s,r,a,o]=(0,xt.A)(Zd,this);let[l,c,h,d]=(0,xt.A)(iu,this).subarray(8,12);const u=i-h,p=n-d,f=Math.hypot(u,p);if(f<(0,xt.A)(ru,this))return!1;const g=f-(0,xt.A)(au,this),A=g/f,m=A*u,v=A*p;let b=l,w=c;l=h,c=d,h+=m,d+=v,null===(e=(0,xt.A)(cu,this))||void 0===e||e.push(i,n);const y=m/g,_=-v/g*(0,xt.A)(lu,this),x=y*(0,xt.A)(lu,this);if((0,xt.A)(iu,this).set((0,xt.A)(iu,this).subarray(2,8),0),(0,xt.A)(iu,this).set([h+_,d+x],4),(0,xt.A)(iu,this).set((0,xt.A)(iu,this).subarray(14,18),12),(0,xt.A)(iu,this).set([h-_,d-x],16),isNaN((0,xt.A)(iu,this)[6]))return 0===(0,xt.A)(eu,this).length&&((0,xt.A)(iu,this).set([l+_,c+x],2),(0,xt.A)(eu,this).push(NaN,NaN,NaN,NaN,(l+_-s)/a,(c+x-r)/o),(0,xt.A)(iu,this).set([l-_,c-x],14),(0,xt.A)(Jd,this).push(NaN,NaN,NaN,NaN,(l-_-s)/a,(c-x-r)/o)),(0,xt.A)(iu,this).set([b,w,l,c,h,d],6),!this.isEmpty();(0,xt.A)(iu,this).set([b,w,l,c,h,d],6);return Math.abs(Math.atan2(w-c,b-l)-Math.atan2(v,m))<Math.PI/2?([l,c,h,d]=(0,xt.A)(iu,this).subarray(2,6),(0,xt.A)(eu,this).push(NaN,NaN,NaN,NaN,((l+h)/2-s)/a,((c+d)/2-r)/o),[l,c,b,w]=(0,xt.A)(iu,this).subarray(14,18),(0,xt.A)(Jd,this).push(NaN,NaN,NaN,NaN,((b+l)/2-s)/a,((w+c)/2-r)/o),!0):([b,w,l,c,h,d]=(0,xt.A)(iu,this).subarray(0,6),(0,xt.A)(eu,this).push(((b+5*l)/6-s)/a,((w+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),[h,d,l,c,b,w]=(0,xt.A)(iu,this).subarray(12,18),(0,xt.A)(Jd,this).push(((b+5*l)/6-s)/a,((w+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=(0,xt.A)(eu,this),e=(0,xt.A)(Jd,this),i=(0,xt.A)(iu,this).subarray(4,6),n=(0,xt.A)(iu,this).subarray(16,18),[s,r,a,o]=(0,xt.A)(Zd,this),[l,c,h,d]=(0,bt.A)(hu,this,uu).call(this);if(isNaN((0,xt.A)(iu,this)[6])&&!this.isEmpty())return"M".concat(((0,xt.A)(iu,this)[2]-s)/a," ").concat(((0,xt.A)(iu,this)[3]-r)/o," L").concat(((0,xt.A)(iu,this)[4]-s)/a," ").concat(((0,xt.A)(iu,this)[5]-r)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat(((0,xt.A)(iu,this)[16]-s)/a," ").concat(((0,xt.A)(iu,this)[17]-r)/o," L").concat(((0,xt.A)(iu,this)[14]-s)/a," ").concat(((0,xt.A)(iu,this)[15]-r)/o," Z");const u=[];u.push("M".concat(t[4]," ").concat(t[5]));for(let p=6;p<t.length;p+=6)isNaN(t[p])?u.push("L".concat(t[p+4]," ").concat(t[p+5])):u.push("C".concat(t[p]," ").concat(t[p+1]," ").concat(t[p+2]," ").concat(t[p+3]," ").concat(t[p+4]," ").concat(t[p+5]));u.push("L".concat((i[0]-s)/a," ").concat((i[1]-r)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat((n[0]-s)/a," ").concat((n[1]-r)/o));for(let p=e.length-6;p>=6;p-=6)isNaN(e[p])?u.push("L".concat(e[p+4]," ").concat(e[p+5])):u.push("C".concat(e[p]," ").concat(e[p+1]," ").concat(e[p+2]," ").concat(e[p+3]," ").concat(e[p+4]," ").concat(e[p+5]));return u.push("L".concat(e[4]," ").concat(e[5]," Z")),u.join(" ")}getOutlines(){var t,e;const i=(0,xt.A)(eu,this),n=(0,xt.A)(Jd,this),s=(0,xt.A)(iu,this),r=s.subarray(4,6),a=s.subarray(16,18),[o,l,c,h]=(0,xt.A)(Zd,this),d=new Float64Array((null!==(t=null===(e=(0,xt.A)(cu,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let v=0,b=d.length-2;v<b;v+=2)d[v]=((0,xt.A)(cu,this)[v]-o)/c,d[v+1]=((0,xt.A)(cu,this)[v+1]-l)/h;d[d.length-2]=((0,xt.A)(nu,this)-o)/c,d[d.length-1]=((0,xt.A)(su,this)-l)/h;const[u,p,f,g]=(0,bt.A)(hu,this,uu).call(this);if(isNaN(s[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(s[2]-o)/c,(s[3]-l)/h,NaN,NaN,NaN,NaN,(s[4]-o)/c,(s[5]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(s[16]-o)/c,(s[17]-l)/h,NaN,NaN,NaN,NaN,(s[14]-o)/c,(s[15]-l)/h],0),new xu(t,d,(0,xt.A)(Zd,this),(0,xt.A)(ou,this),(0,xt.A)($d,this),(0,xt.A)(tu,this))}const A=new Float64Array((0,xt.A)(eu,this).length+24+(0,xt.A)(Jd,this).length);let m=i.length;for(let v=0;v<m;v+=2)isNaN(i[v])?A[v]=A[v+1]=NaN:(A[v]=i[v],A[v+1]=i[v+1]);A.set([NaN,NaN,NaN,NaN,(r[0]-o)/c,(r[1]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(a[0]-o)/c,(a[1]-l)/h],m),m+=24;for(let v=n.length-6;v>=6;v-=6)for(let t=0;t<6;t+=2)isNaN(n[v+t])?(A[m]=A[m+1]=NaN,m+=2):(A[m]=n[v+t],A[m+1]=n[v+t+1],m+=2);return A.set([NaN,NaN,NaN,NaN,n[4],n[5]],m),new xu(A,d,(0,xt.A)(Zd,this),(0,xt.A)(ou,this),(0,xt.A)($d,this),(0,xt.A)(tu,this))}}function uu(){const t=(0,xt.A)(iu,this).subarray(4,6),e=(0,xt.A)(iu,this).subarray(16,18),[i,n,s,r]=(0,xt.A)(Zd,this);return[((0,xt.A)(nu,this)+(t[0]-e[0])/2-i)/s,((0,xt.A)(su,this)+(t[1]-e[1])/2-n)/r,((0,xt.A)(nu,this)+(e[0]-t[0])/2-i)/s,((0,xt.A)(su,this)+(e[1]-t[1])/2-n)/r]}var pu={_:8},fu={_:pu._+2},gu=new WeakMap,Au=new WeakMap,mu=new WeakMap,vu=new WeakMap,bu=new WeakMap,wu=new WeakMap,yu=new WeakMap,_u=new WeakSet;class xu extends Xd{constructor(t,e,i,n,s,r){super(),(0,vt.A)(this,_u),(0,_t.A)(this,gu,void 0),(0,_t.A)(this,Au,null),(0,_t.A)(this,mu,void 0),(0,_t.A)(this,vu,void 0),(0,_t.A)(this,bu,void 0),(0,_t.A)(this,wu,void 0),(0,_t.A)(this,yu,void 0),(0,Et.A)(yu,this,t),(0,Et.A)(bu,this,e),(0,Et.A)(gu,this,i),(0,Et.A)(wu,this,n),(0,Et.A)(mu,this,s),(0,Et.A)(vu,this,r),(0,bt.A)(_u,this,ku).call(this,r);const{x:a,y:o,width:l,height:c}=(0,xt.A)(Au,this);for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-a)/l,t[h+1]=(t[h+1]-o)/c;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-a)/l,e[h+1]=(e[h+1]-o)/c}toSVGPath(){const t=["M".concat((0,xt.A)(yu,this)[4]," ").concat((0,xt.A)(yu,this)[5])];for(let e=6,i=(0,xt.A)(yu,this).length;e<i;e+=6)isNaN((0,xt.A)(yu,this)[e])?t.push("L".concat((0,xt.A)(yu,this)[e+4]," ").concat((0,xt.A)(yu,this)[e+5])):t.push("C".concat((0,xt.A)(yu,this)[e]," ").concat((0,xt.A)(yu,this)[e+1]," ").concat((0,xt.A)(yu,this)[e+2]," ").concat((0,xt.A)(yu,this)[e+3]," ").concat((0,xt.A)(yu,this)[e+4]," ").concat((0,xt.A)(yu,this)[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,c;switch(e){case 0:l=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(yu,this),i,r,a,-o),c=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(bu,this),i,r,a,-o);break;case 90:l=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(yu,this),i,n,a,o),c=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(bu,this),i,n,a,o);break;case 180:l=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(yu,this),s,n,-a,o),c=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(bu,this),s,n,-a,o);break;case 270:l=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(yu,this),s,r,-a,-o),c=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(bu,this),s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(c)]}}get box(){return(0,xt.A)(Au,this)}getNewOutline(t,e){const{x:i,y:n,width:s,height:r}=(0,xt.A)(Au,this),[a,o,l,c]=(0,xt.A)(gu,this),h=s*l,d=r*c,u=i*l+a,p=n*c+o,f=new du({x:(0,xt.A)(bu,this)[0]*h+u,y:(0,xt.A)(bu,this)[1]*d+p},(0,xt.A)(gu,this),(0,xt.A)(wu,this),t,(0,xt.A)(vu,this),null!==e&&void 0!==e?e:(0,xt.A)(mu,this));for(let g=2;g<(0,xt.A)(bu,this).length;g+=2)f.add({x:(0,xt.A)(bu,this)[g]*h+u,y:(0,xt.A)(bu,this)[g+1]*d+p});return f.getOutlines()}}function Eu(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}function Cu(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}function ku(t){const e=(0,xt.A)(yu,this);let i=e[4],n=e[5],s=i,r=n,a=i,o=n,l=i,c=n;const h=t?Math.max:Math.min;for(let g=6,A=e.length;g<A;g+=6){if(isNaN(e[g]))s=Math.min(s,e[g+4]),r=Math.min(r,e[g+5]),a=Math.max(a,e[g+4]),o=Math.max(o,e[g+5]),c<e[g+5]?(l=e[g+4],c=e[g+5]):c===e[g+5]&&(l=h(l,e[g+4]));else{const t=ni.bezierBoundingBox(i,n,...e.slice(g,g+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]),c<t[3]?(l=t[2],c=t[3]):c===t[3]&&(l=h(l,t[2]))}i=e[g+4],n=e[g+5]}const d=s-(0,xt.A)(mu,this),u=r-(0,xt.A)(mu,this),p=a-s+2*(0,xt.A)(mu,this),f=o-r+2*(0,xt.A)(mu,this);(0,Et.A)(Au,this,{x:d,y:u,width:p,height:f,lastPoint:[l,c]})}var Su=new WeakMap,Mu=new WeakMap,Lu=new WeakMap,Tu=new WeakMap,Ru=new WeakMap,Pu=new WeakMap,Fu=new WeakMap,Iu=new WeakMap,Du=new WeakMap,Ou=new WeakMap,Nu=new WeakMap,Wu=new WeakMap,ju=new WeakSet;class Bu{static get _keyboardManager(){return Ue(this,"_keyboardManager",new Yn([[["Escape","mac+Escape"],Bu.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Bu.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Bu.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Bu.prototype._moveToPrevious],[["Home","mac+Home"],Bu.prototype._moveToBeginning],[["End","mac+End"],Bu.prototype._moveToEnd]]))}constructor(t){var e;let{editor:i=null,uiManager:n=null}=t;(0,vt.A)(this,ju),(0,_t.A)(this,Su,(0,bt.A)(ju,this,Uu).bind(this)),(0,_t.A)(this,Mu,(0,bt.A)(ju,this,Gu).bind(this)),(0,_t.A)(this,Lu,null),(0,_t.A)(this,Tu,null),(0,_t.A)(this,Ru,void 0),(0,_t.A)(this,Pu,null),(0,_t.A)(this,Fu,!1),(0,_t.A)(this,Iu,!1),(0,_t.A)(this,Du,null),(0,_t.A)(this,Ou,void 0),(0,_t.A)(this,Nu,null),(0,_t.A)(this,Wu,void 0),i?((0,Et.A)(Iu,this,!1),(0,Et.A)(Wu,this,$t.HIGHLIGHT_COLOR),(0,Et.A)(Du,this,i)):((0,Et.A)(Iu,this,!0),(0,Et.A)(Wu,this,$t.HIGHLIGHT_DEFAULT_COLOR)),(0,Et.A)(Nu,this,(null===i||void 0===i?void 0:i._uiManager)||n),(0,Et.A)(Ou,this,(0,xt.A)(Nu,this)._eventBus),(0,Et.A)(Ru,this,(null===i||void 0===i?void 0:i.color)||(null===(e=(0,xt.A)(Nu,this))||void 0===e?void 0:e.highlightColors.values().next().value)||"#FFFF98")}renderButton(){const t=(0,Et.A)(Lu,this,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=(0,xt.A)(Nu,this)._signal;t.addEventListener("click",(0,bt.A)(ju,this,Vu).bind(this),{signal:e}),t.addEventListener("keydown",(0,xt.A)(Su,this),{signal:e});const i=(0,Et.A)(Tu,this,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=(0,xt.A)(Ru,this),t.append(i),t}renderMainDropdown(){const t=(0,Et.A)(Pu,this,(0,bt.A)(ju,this,Hu).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===(0,xt.A)(Lu,this))return void(0,bt.A)(ju,this,Vu).call(this,t);const e=t.target.getAttribute("data-color");e&&(0,bt.A)(ju,this,zu).call(this,e,t)}_moveToNext(t){var e,i;wt(ju,this,qu)?t.target!==(0,xt.A)(Lu,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=(0,xt.A)(Pu,this).firstChild)||void 0===i||i.focus():(0,bt.A)(ju,this,Vu).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=(0,xt.A)(Pu,this))||void 0===e?void 0:e.firstChild)&&t.target!==(0,xt.A)(Lu,this)?(wt(ju,this,qu)||(0,bt.A)(ju,this,Vu).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):wt(ju,this,qu)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;wt(ju,this,qu)?null===(e=(0,xt.A)(Pu,this).firstChild)||void 0===e||e.focus():(0,bt.A)(ju,this,Vu).call(this,t)}_moveToEnd(t){var e;wt(ju,this,qu)?null===(e=(0,xt.A)(Pu,this).lastChild)||void 0===e||e.focus():(0,bt.A)(ju,this,Vu).call(this,t)}hideDropdown(){var t;null===(t=(0,xt.A)(Pu,this))||void 0===t||t.classList.add("hidden"),window.removeEventListener("pointerdown",(0,xt.A)(Mu,this))}_hideDropdownFromKeyboard(){var t;(0,xt.A)(Iu,this)||(wt(ju,this,qu)?(this.hideDropdown(),(0,xt.A)(Lu,this).focus({preventScroll:!0,focusVisible:(0,xt.A)(Fu,this)})):null===(t=(0,xt.A)(Du,this))||void 0===t||t.unselect())}updateColor(t){if((0,xt.A)(Tu,this)&&((0,xt.A)(Tu,this).style.backgroundColor=t),!(0,xt.A)(Pu,this))return;const e=(0,xt.A)(Nu,this).highlightColors.values();for(const i of(0,xt.A)(Pu,this).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;null===(t=(0,xt.A)(Lu,this))||void 0===t||t.remove(),(0,Et.A)(Lu,this,null),(0,Et.A)(Tu,this,null),null===(e=(0,xt.A)(Pu,this))||void 0===e||e.remove(),(0,Et.A)(Pu,this,null)}}function Hu(){const t=document.createElement("div"),e=(0,xt.A)(Nu,this)._signal;t.addEventListener("contextmenu",sn,{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(0,xt.A)(Nu,this).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-".concat(i));const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.setAttribute("aria-selected",n===(0,xt.A)(Ru,this)),s.addEventListener("click",(0,bt.A)(ju,this,zu).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",(0,xt.A)(Su,this),{signal:e}),t}function zu(t,e){e.stopPropagation(),(0,xt.A)(Ou,this).dispatch("switchannotationeditorparams",{source:this,type:(0,xt.A)(Wu,this),value:t})}function Uu(t){Ft._keyboardManager.exec(this,t)}function Vu(t){if(wt(ju,this,qu))return void this.hideDropdown();if((0,Et.A)(Fu,this,0===t.detail),window.addEventListener("pointerdown",(0,xt.A)(Mu,this),{signal:(0,xt.A)(Nu,this)._signal}),(0,xt.A)(Pu,this))return void(0,xt.A)(Pu,this).classList.remove("hidden");const e=(0,Et.A)(Pu,this,(0,bt.A)(ju,this,Hu).call(this));(0,xt.A)(Lu,this).append(e)}function Gu(t){var e;null!==(e=(0,xt.A)(Pu,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function qu(t){return(0,xt.A)(Pu,t)&&!(0,xt.A)(Pu,t).classList.contains("hidden")}Ft=Bu;var Xu=new WeakMap,Yu=new WeakMap,Ku=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,$u=new WeakMap,tp=new WeakMap,ep=new WeakMap,ip=new WeakMap,np=new WeakMap,sp=new WeakMap,rp=new WeakMap,ap=new WeakMap,op=new WeakMap,lp=new WeakMap,cp=new WeakMap,hp=new WeakMap,dp=new WeakMap,up=new WeakSet;class pp extends Vr{static get _keyboardManager(){const t=pp.prototype;return Ue(this,"_keyboardManager",new Yn([[["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((0,gt.A)((0,gt.A)({},t),{},{name:"highlightEditor"})),(0,vt.A)(this,up),(0,_t.A)(this,Xu,null),(0,_t.A)(this,Yu,0),(0,_t.A)(this,Ku,void 0),(0,_t.A)(this,Qu,null),(0,_t.A)(this,Zu,null),(0,_t.A)(this,Ju,null),(0,_t.A)(this,$u,null),(0,_t.A)(this,tp,0),(0,_t.A)(this,ep,null),(0,_t.A)(this,ip,null),(0,_t.A)(this,np,null),(0,_t.A)(this,sp,!1),(0,_t.A)(this,rp,(0,bt.A)(up,this,_p).bind(this)),(0,_t.A)(this,ap,null),(0,_t.A)(this,op,void 0),(0,_t.A)(this,lp,null),(0,_t.A)(this,cp,""),(0,_t.A)(this,hp,void 0),(0,_t.A)(this,dp,""),this.color=t.color||pp._defaultColor,(0,Et.A)(hp,this,t.thickness||pp._defaultThickness),(0,Et.A)(op,this,t.opacity||pp._defaultOpacity),(0,Et.A)(Ku,this,t.boxes||null),(0,Et.A)(dp,this,t.methodOfCreation||""),(0,Et.A)(cp,this,t.text||""),this._isDraggable=!1,t.highlightId>-1?((0,Et.A)(sp,this,!0),(0,bt.A)(up,this,gp).call(this,t),(0,bt.A)(up,this,wp).call(this)):((0,Et.A)(Xu,this,t.anchorNode),(0,Et.A)(Yu,this,t.anchorOffset),(0,Et.A)($u,this,t.focusNode),(0,Et.A)(tp,this,t.focusOffset),(0,bt.A)(up,this,fp).call(this),(0,bt.A)(up,this,wp).call(this),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:(0,xt.A)(sp,this)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:(0,xt.A)(hp,this),methodOfCreation:(0,xt.A)(dp,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;Vr.initialize(t,e),pp._defaultColor||(pp._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case $t.HIGHLIGHT_DEFAULT_COLOR:pp._defaultColor=e;break;case $t.HIGHLIGHT_THICKNESS:pp._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return(0,xt.A)(ap,this)}updateParams(t,e){switch(t){case $t.HIGHLIGHT_COLOR:(0,bt.A)(up,this,Ap).call(this,e);break;case $t.HIGHLIGHT_THICKNESS:(0,bt.A)(up,this,mp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[$t.HIGHLIGHT_DEFAULT_COLOR,pp._defaultColor],[$t.HIGHLIGHT_THICKNESS,pp._defaultThickness]]}get propertiesToUpdate(){return[[$t.HIGHLIGHT_COLOR,this.color||pp._defaultColor],[$t.HIGHLIGHT_THICKNESS,(0,xt.A)(hp,this)||pp._defaultThickness],[$t.HIGHLIGHT_FREE,(0,xt.A)(sp,this)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&((0,Et.A)(Zu,this,new Bu({editor:this})),t.addColorPicker((0,xt.A)(Zu,this))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition((0,bt.A)(up,this,Ep).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,(0,bt.A)(up,this,Ep).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){(0,bt.A)(up,this,bp).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&((0,bt.A)(up,this,wp).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)(0,bt.A)(up,this,bp).call(this);else if(t){var i;(0,bt.A)(up,this,wp).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;(0,xt.A)(sp,this)?(t=(t-this.rotation+360)%360,i=yp.call(pp,(0,xt.A)(ip,this).box,t)):i=yp.call(pp,this,t),e.rotate((0,xt.A)(np,this),t),e.rotate((0,xt.A)(lp,this),t),e.updateBox((0,xt.A)(np,this),i),e.updateBox((0,xt.A)(lp,this),yp.call(pp,(0,xt.A)(Ju,this).box,t))}render(){if(this.div)return this.div;const t=super.render();(0,xt.A)(cp,this)&&(t.setAttribute("aria-label",(0,xt.A)(cp,this)),t.setAttribute("role","mark")),(0,xt.A)(sp,this)?t.classList.add("free"):this.div.addEventListener("keydown",(0,xt.A)(rp,this),{signal:this._uiManager._signal});const e=(0,Et.A)(ep,this,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=(0,xt.A)(Qu,this);const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),Fn(this,(0,xt.A)(ep,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass((0,xt.A)(lp,this),"hovered")}pointerleave(){this.parent.drawLayer.removeClass((0,xt.A)(lp,this),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:(0,bt.A)(up,this,xp).call(this,!0);break;case 1:case 3:(0,bt.A)(up,this,xp).call(this,!1)}}select(){var t,e;super.select(),(0,xt.A)(lp,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass((0,xt.A)(lp,this),"hovered"),null===(e=this.parent)||void 0===e||e.drawLayer.addClass((0,xt.A)(lp,this),"selected"))}unselect(){var t;super.unselect(),(0,xt.A)(lp,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass((0,xt.A)(lp,this),"selected"),(0,xt.A)(sp,this)||(0,bt.A)(up,this,xp).call(this,!1))}get _mustFixPosition(){return!(0,xt.A)(sp,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show((0,xt.A)(np,this),t),this.parent.drawLayer.show((0,xt.A)(lp,this),t))}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:l,height:c}=n.getBoundingClientRect(),h=e=>{(0,bt.A)(pp,this,Sp).call(this,t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},f=e=>{n.removeEventListener("pointermove",h),window.removeEventListener("blur",f),window.removeEventListener("pointerup",f),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",sn),(0,bt.A)(pp,this,Mp).call(this,t,e)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",sn,{signal:d}),n.addEventListener("pointermove",h,{signal:d}),this._freeHighlight=new du({x:s,y:r},[a,o,l,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(t,e,i){const n=super.deserialize(t,e,i),{rect:[s,r,a,o],color:l,quadPoints:c}=t;n.color=ni.makeHexColor(...l),(0,Et.A)(op,n,t.opacity);const[h,d]=n.pageDimensions;n.width=(a-s)/h,n.height=(o-r)/d;const u=(0,Et.A)(Ku,n,[]);for(let p=0;p<c.length;p+=8)u.push({x:(c[4]-a)/h,y:(o-(1-c[p+5]))/d,width:(c[p+2]-c[p])/h,height:(c[p+5]-c[p+1])/d});return(0,bt.A)(up,n,fp).call(n),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=Vr._colorManager.convert(this.color);return{annotationType:Jt.HIGHLIGHT,color:i,opacity:(0,xt.A)(op,this),thickness:(0,xt.A)(hp,this),quadPoints:(0,bt.A)(up,this,Cp).call(this),outlines:(0,bt.A)(up,this,kp).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:(0,bt.A)(up,this,Ep).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}function fp(){const t=new Hd((0,xt.A)(Ku,this),.001);(0,Et.A)(ip,this,t.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=(0,xt.A)(ip,this).box);const e=new Hd((0,xt.A)(Ku,this),.0025,.001,"ltr"===this._uiManager.direction);(0,Et.A)(Ju,this,e.getOutlines());const{lastPoint:i}=(0,xt.A)(Ju,this).box;(0,Et.A)(ap,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function gp(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;(0,Et.A)(ip,this,e);if((0,Et.A)(Ju,this,e.getNewOutline((0,xt.A)(hp,this)/2+1.5,.0025)),i>=0)(0,Et.A)(np,this,i),(0,Et.A)(Qu,this,n),this.parent.drawLayer.finalizeLine(i,e),(0,Et.A)(lp,this,this.parent.drawLayer.highlightOutline((0,xt.A)(Ju,this)));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine((0,xt.A)(np,this),e),this.parent.drawLayer.updateBox((0,xt.A)(np,this),yp.call(It,(0,xt.A)(ip,this).box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine((0,xt.A)(lp,this),(0,xt.A)(Ju,this)),this.parent.drawLayer.updateBox((0,xt.A)(lp,this),yp.call(It,(0,xt.A)(Ju,this).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}=(0,xt.A)(Ju,this).box;(0,Et.A)(ap,this,[(l[0]-s)/a,(l[1]-r)/o])}function Ap(t){const e=t=>{var e,i;this.color=t,null===(e=this.parent)||void 0===e||e.drawLayer.changeColor((0,xt.A)(np,this),t),null===(i=(0,xt.A)(Zu,this))||void 0===i||i.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:$t.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}function mp(t){const e=(0,xt.A)(hp,this),i=t=>{(0,Et.A)(hp,this,t),(0,bt.A)(up,this,vp).call(this,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function vp(t){if(!(0,xt.A)(sp,this))return;(0,bt.A)(up,this,gp).call(this,{highlightOutlines:(0,xt.A)(ip,this).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}function bp(){null!==(0,xt.A)(np,this)&&this.parent&&(this.parent.drawLayer.remove((0,xt.A)(np,this)),(0,Et.A)(np,this,null),this.parent.drawLayer.remove((0,xt.A)(lp,this)),(0,Et.A)(lp,this,null))}function wp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===(0,xt.A)(np,this)&&(({id:At(Et.A,[np,this])._,clipPathId:At(Et.A,[Qu,this])._}=t.drawLayer.highlight((0,xt.A)(ip,this),this.color,(0,xt.A)(op,this))),(0,Et.A)(lp,this,t.drawLayer.highlightOutline((0,xt.A)(Ju,this))),(0,xt.A)(ep,this)&&((0,xt.A)(ep,this).style.clipPath=(0,xt.A)(Qu,this)))}function yp(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}}function _p(t){It._keyboardManager.exec(this,t)}function xp(t){if(!(0,xt.A)(Xu,this))return;const e=window.getSelection();t?e.setPosition((0,xt.A)(Xu,this),(0,xt.A)(Yu,this)):e.setPosition((0,xt.A)($u,this),(0,xt.A)(tp,this))}function Ep(){return(0,xt.A)(sp,this)?this.rotation:0}function Cp(){if((0,xt.A)(sp,this))return null;const[t,e]=this.pageDimensions,i=(0,xt.A)(Ku,this),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,c=(1-a-l)*e;n[s]=n[s+4]=i,n[s+1]=n[s+3]=c,n[s+2]=n[s+6]=i+o*t,n[s+5]=n[s+7]=c+l*e,s+=8}return n}function kp(t){return(0,xt.A)(ip,this).serialize(t,(0,bt.A)(up,this,Ep).call(this))}function Sp(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function Mp(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=""}It=pp,(0,yt.A)(pp,"_defaultColor",null),(0,yt.A)(pp,"_defaultOpacity",1),(0,yt.A)(pp,"_defaultThickness",12),(0,yt.A)(pp,"_l10nPromise",void 0),(0,yt.A)(pp,"_type","highlight"),(0,yt.A)(pp,"_editorType",Jt.HIGHLIGHT),(0,yt.A)(pp,"_freeHighlightId",-1),(0,yt.A)(pp,"_freeHighlight",null),(0,yt.A)(pp,"_freeHighlightClipId","");var Lp=new WeakMap,Tp=new WeakMap,Rp=new WeakMap,Pp=new WeakMap,Fp=new WeakMap,Ip=new WeakMap,Dp=new WeakMap,Op=new WeakMap,Np=new WeakMap,Wp=new WeakMap,jp=new WeakMap,Bp=new WeakMap,Hp=new WeakMap,zp=new WeakMap,Up=new WeakMap,Vp=new WeakSet;class Gp extends Vr{constructor(t){super((0,gt.A)((0,gt.A)({},t),{},{name:"inkEditor"})),(0,vt.A)(this,Vp),(0,_t.A)(this,Lp,0),(0,_t.A)(this,Tp,0),(0,_t.A)(this,Rp,this.canvasPointermove.bind(this)),(0,_t.A)(this,Pp,this.canvasPointerleave.bind(this)),(0,_t.A)(this,Fp,this.canvasPointerup.bind(this)),(0,_t.A)(this,Ip,this.canvasPointerdown.bind(this)),(0,_t.A)(this,Dp,null),(0,_t.A)(this,Op,new Path2D),(0,_t.A)(this,Np,!1),(0,_t.A)(this,Wp,!1),(0,_t.A)(this,jp,!1),(0,_t.A)(this,Bp,null),(0,_t.A)(this,Hp,0),(0,_t.A)(this,zp,0),(0,_t.A)(this,Up,null),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){Vr.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case $t.INK_THICKNESS:Gp._defaultThickness=e;break;case $t.INK_COLOR:Gp._defaultColor=e;break;case $t.INK_OPACITY:Gp._defaultOpacity=e/100}}updateParams(t,e){switch(t){case $t.INK_THICKNESS:(0,bt.A)(Vp,this,qp).call(this,e);break;case $t.INK_COLOR:(0,bt.A)(Vp,this,Xp).call(this,e);break;case $t.INK_OPACITY:(0,bt.A)(Vp,this,Yp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[$t.INK_THICKNESS,Gp._defaultThickness],[$t.INK_COLOR,Gp._defaultColor||Vr._defaultLineColor],[$t.INK_OPACITY,Math.round(100*Gp._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[$t.INK_THICKNESS,this.thickness||Gp._defaultThickness],[$t.INK_COLOR,this.color||Gp._defaultColor||Vr._defaultLineColor],[$t.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:Gp._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||((0,bt.A)(Vp,this,of).call(this),(0,bt.A)(Vp,this,lf).call(this)),this.isAttachedToDOM||(this.parent.add(this),(0,bt.A)(Vp,this,cf).call(this)),(0,bt.A)(Vp,this,vf).call(this)))}remove(){var t;null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,(0,xt.A)(Dp,this)&&(clearTimeout((0,xt.A)(Dp,this)),(0,Et.A)(Dp,this,null)),null===(t=(0,xt.A)(Bp,this))||void 0===t||t.disconnect(),(0,Et.A)(Bp,this,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(){(0,xt.A)(Np,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",(0,xt.A)(Ip,this),{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",(0,xt.A)(Ip,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){(0,xt.A)(Np,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),(0,Et.A)(Np,this,!0),this.div.classList.add("disabled"),(0,bt.A)(Vp,this,vf).call(this,!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()&&!(0,xt.A)(Np,this)&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),(0,bt.A)(Vp,this,Zp).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),(0,bt.A)(Vp,this,Jp).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),(0,bt.A)(Vp,this,af).call(this,t)}canvasPointerleave(t){(0,bt.A)(Vp,this,af).call(this,t)}get isResizable(){return!this.isEmpty()&&(0,xt.A)(Np,this)}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]=(0,bt.A)(Vp,this,Kp).call(this);if(this.setAt(i,n,0,0),this.setDims(s,r),(0,bt.A)(Vp,this,of).call(this),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),(0,Et.A)(jp,this,!0),(0,bt.A)(Vp,this,cf).call(this),this.setDims(this.width*i,this.height*n),(0,bt.A)(Vp,this,rf).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return(0,bt.A)(Vp,this,lf).call(this),this.div}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if((0,xt.A)(Hp,this)===i&&(0,xt.A)(zp,this)===n)return;(0,Et.A)(Hp,this,i),(0,Et.A)(zp,this,n),this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s,this.height=e/r,this.fixAndSetPosition(),(0,xt.A)(Np,this)&&(0,bt.A)(Vp,this,hf).call(this,t,e),(0,bt.A)(Vp,this,cf).call(this),(0,bt.A)(Vp,this,rf).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,i){if(t instanceof Jh)return null;const n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=ni.makeHexColor(...t.color),n.opacity=t.opacity;const[s,r]=n.pageDimensions,a=n.width*s,o=n.height*r,l=n.parentScale,c=t.thickness/2;(0,Et.A)(Np,n,!0),(0,Et.A)(Hp,n,Math.round(a)),(0,Et.A)(zp,n,Math.round(o));const{paths:h,rect:d,rotation:u}=t;for(let{bezier:f}of h){f=ff.call(Gp,f,d,u);const t=[];n.paths.push(t);let e=l*(f[0]-c),i=l*(f[1]-c);for(let n=2,r=f.length;n<r;n+=6){const s=l*(f[n]-c),r=l*(f[n+1]-c),a=l*(f[n+2]-c),o=l*(f[n+3]-c),h=l*(f[n+4]-c),d=l*(f[n+5]-c);t.push([[e,i],[s,r],[a,o],[h,d]]),e=h,i=d}const s=(0,bt.A)(Gp,this,uf).call(this,t);n.bezierPath2D.push(s)}const p=(0,bt.A)(Vp,n,Af).call(n);return(0,Et.A)(Tp,n,Math.max(Vr.MIN_SIZE,p[2]-p[0])),(0,Et.A)(Lp,n,Math.max(Vr.MIN_SIZE,p[3]-p[1])),(0,bt.A)(Vp,n,hf).call(n,a,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=Vr._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Jt.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:(0,bt.A)(Vp,this,gf).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}function qp(t){const e=t=>{this.thickness=t,(0,bt.A)(Vp,this,vf).call(this)},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:$t.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function Xp(t){const e=t=>{this.color=t,(0,bt.A)(Vp,this,rf).call(this)},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:$t.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Yp(t){const e=t=>{this.opacity=t,(0,bt.A)(Vp,this,rf).call(this)};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:$t.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function Kp(){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]}}function Qp(){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="".concat(e).concat(function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i))}function Zp(t,e){const i=this._uiManager._signal;var n;(this.canvas.addEventListener("contextmenu",sn,{signal:i}),this.canvas.addEventListener("pointerleave",(0,xt.A)(Pp,this),{signal:i}),this.canvas.addEventListener("pointermove",(0,xt.A)(Rp,this),{signal:i}),this.canvas.addEventListener("pointerup",(0,xt.A)(Fp,this),{signal:i}),this.canvas.removeEventListener("pointerdown",(0,xt.A)(Ip,this)),this.isEditing=!0,(0,xt.A)(jp,this))||((0,Et.A)(jp,this,!0),(0,bt.A)(Vp,this,cf).call(this),this.thickness||(this.thickness=Dt._defaultThickness),this.color||(this.color=Dt._defaultColor||Vr._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=Dt._defaultOpacity));this.currentPath.push([t,e]),(0,Et.A)(Wp,this,!1),(0,bt.A)(Vp,this,Qp).call(this),(0,Et.A)(Up,this,()=>{(0,bt.A)(Vp,this,ef).call(this),(0,xt.A)(Up,this)&&window.requestAnimationFrame((0,xt.A)(Up,this))}),window.requestAnimationFrame((0,xt.A)(Up,this))}function Jp(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=(0,xt.A)(Op,this);if(s.push([t,e]),(0,Et.A)(Wp,this,!0),s.length<=2)return r.moveTo(...s[0]),void r.lineTo(t,e);3===s.length&&((0,Et.A)(Op,this,r=new Path2D),r.moveTo(...s[0])),(0,bt.A)(Vp,this,nf).call(this,r,...s.at(-3),...s.at(-2),t,e)}function $p(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);(0,xt.A)(Op,this).lineTo(...t)}function tf(t,e){let i;if((0,Et.A)(Up,this,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),(0,bt.A)(Vp,this,Jp).call(this,t,e),(0,bt.A)(Vp,this,$p).call(this),1!==this.currentPath.length)i=(0,bt.A)(Vp,this,sf).call(this);else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=(0,xt.A)(Op,this),s=this.currentPath;this.currentPath=[],(0,Et.A)(Op,this,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||((0,bt.A)(Vp,this,of).call(this),(0,bt.A)(Vp,this,lf).call(this)),(0,bt.A)(Vp,this,vf).call(this))},mustExec:!0})}function ef(){if(!(0,xt.A)(Wp,this))return;(0,Et.A)(Wp,this,!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((0,xt.A)(Op,this)),s.restore()}function nf(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,c=(n+r)/2,h=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,c+2*(n-c)/3,h+2*(s-h)/3,c,h)}function sf(){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],c=(r+o)/2,h=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[c+2*(r-c)/3,h+2*(a-h)/3];e.push([[n,s],d,u,[c,h]]),[n,s]=[c,h]}const[r,a]=t[i],[o,l]=t[i+1],c=[n+2*(r-n)/3,s+2*(a-s)/3],h=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],c,h,[o,l]]),e}function rf(){if(this.isEmpty())return void(0,bt.A)(Vp,this,df).call(this);(0,bt.A)(Vp,this,Qp).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),(0,bt.A)(Vp,this,df).call(this);for(const i of this.bezierPath2D)e.stroke(i)}function af(t){this.canvas.removeEventListener("pointerleave",(0,xt.A)(Pp,this)),this.canvas.removeEventListener("pointermove",(0,xt.A)(Rp,this)),this.canvas.removeEventListener("pointerup",(0,xt.A)(Fp,this)),this.canvas.addEventListener("pointerdown",(0,xt.A)(Ip,this),{signal:this._uiManager._signal}),(0,xt.A)(Dp,this)&&clearTimeout((0,xt.A)(Dp,this)),(0,Et.A)(Dp,this,setTimeout(()=>{(0,Et.A)(Dp,this,null),this.canvas.removeEventListener("contextmenu",sn)},10)),(0,bt.A)(Vp,this,tf).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function of(){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")}function lf(){(0,Et.A)(Bp,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),(0,xt.A)(Bp,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=(0,xt.A)(Bp,this))||void 0===t||t.disconnect(),(0,Et.A)(Bp,this,null)},{once:!0})}function cf(){if(!(0,xt.A)(jp,this))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),(0,bt.A)(Vp,this,df).call(this)}function hf(t,e){const i=(0,bt.A)(Vp,this,mf).call(this),n=(t-i)/(0,xt.A)(Tp,this),s=(e-i)/(0,xt.A)(Lp,this);this.scaleFactor=Math.min(n,s)}function df(){const t=(0,bt.A)(Vp,this,mf).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function uf(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}function pf(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}function ff(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}function gf(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,c,h,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,f=t*c[0]+a,g=t*c[1]+o,A=t*h[0]+a,m=t*h[1]+o,v=t*d[0]+a,b=t*d[1]+o;0===n&&(e.push(u,p),i.push(u,p)),e.push(f,g,A,m,v,b),i.push(f,g),n===s-1&&i.push(v,b)}s.push({bezier:pf.call(Dt,e,n,this.rotation),points:pf.call(Dt,i,n,this.rotation)})}return s}function Af(){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=ni.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]}function mf(){return(0,xt.A)(Np,this)?Math.ceil(this.thickness*this.parentScale):0}function vf(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!(0,xt.A)(Np,this))return void(0,bt.A)(Vp,this,rf).call(this);const e=(0,bt.A)(Vp,this,Af).call(this),i=(0,bt.A)(Vp,this,mf).call(this);(0,Et.A)(Tp,this,Math.max(Vr.MIN_SIZE,e[2]-e[0])),(0,Et.A)(Lp,this,Math.max(Vr.MIN_SIZE,e[3]-e[1]));const n=Math.ceil(i+(0,xt.A)(Tp,this)*this.scaleFactor),s=Math.ceil(i+(0,xt.A)(Lp,this)*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],(0,bt.A)(Vp,this,cf).call(this),(0,bt.A)(Vp,this,rf).call(this),(0,Et.A)(Hp,this,n),(0,Et.A)(zp,this,s),this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-c,l-this.translationY-c)}Dt=Gp,(0,yt.A)(Gp,"_defaultColor",null),(0,yt.A)(Gp,"_defaultOpacity",1),(0,yt.A)(Gp,"_defaultThickness",1),(0,yt.A)(Gp,"_type","ink"),(0,yt.A)(Gp,"_editorType",Jt.INK);var bf=new WeakMap,wf=new WeakMap,yf=new WeakMap,_f=new WeakMap,xf=new WeakMap,Ef=new WeakMap,Cf=new WeakMap,kf=new WeakMap,Sf=new WeakMap,Mf=new WeakMap,Lf=new WeakMap,Tf=new WeakSet;class Rf extends Vr{constructor(t){super((0,gt.A)((0,gt.A)({},t),{},{name:"stampEditor"})),(0,vt.A)(this,Tf),(0,_t.A)(this,bf,null),(0,_t.A)(this,wf,null),(0,_t.A)(this,yf,null),(0,_t.A)(this,_f,null),(0,_t.A)(this,xf,null),(0,_t.A)(this,Ef,""),(0,_t.A)(this,Cf,null),(0,_t.A)(this,kf,null),(0,_t.A)(this,Sf,null),(0,_t.A)(this,Mf,!1),(0,_t.A)(this,Lf,!1),(0,Et.A)(_f,this,t.bitmapUrl),(0,Et.A)(xf,this,t.bitmapFile)}static initialize(t,e){Vr.initialize(t,e)}static get supportedTypes(){return Ue(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>"image/".concat(t)))}static get supportedTypesStr(){return Ue(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(Jt.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;(0,xt.A)(wf,this)&&((0,Et.A)(bf,this,null),this._uiManager.imageManager.deleteId((0,xt.A)(wf,this)),null===(t=(0,xt.A)(Cf,this))||void 0===t||t.remove(),(0,Et.A)(Cf,this,null),null===(e=(0,xt.A)(kf,this))||void 0===e||e.disconnect(),(0,Et.A)(kf,this,null),(0,xt.A)(Sf,this)&&(clearTimeout((0,xt.A)(Sf,this)),(0,Et.A)(Sf,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&((0,xt.A)(wf,this)&&null===(0,xt.A)(Cf,this)&&(0,bt.A)(Tf,this,If).call(this),this.isAttachedToDOM||this.parent.add(this))):(0,xt.A)(wf,this)&&(0,bt.A)(Tf,this,If).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!((0,xt.A)(yf,this)||(0,xt.A)(bf,this)||(0,xt.A)(_f,this)||(0,xt.A)(xf,this)||(0,xt.A)(wf,this))}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(),(0,xt.A)(bf,this)?(0,bt.A)(Tf,this,Df).call(this):(0,bt.A)(Tf,this,If).call(this),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}getImageForAltText(){return(0,xt.A)(Cf,this)}static deserialize(t,e,i){if(t instanceof nd)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)?(0,Et.A)(wf,n,a):(0,Et.A)(_f,n,r),(0,Et.A)(Mf,n,o);const[c,h]=n.pageDimensions;return n.width=(s[2]-s[0])/c,n.height=(s[3]-s[1])/h,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:Jt.STAMP,bitmapId:(0,xt.A)(wf,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:(0,xt.A)(Mf,this),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=(0,bt.A)(Tf,this,jf).call(this,!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||(e.stamps=new Map);const r=(0,xt.A)(Mf,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has((0,xt.A)(wf,this))){if((0,xt.A)(Mf,this)){const t=e.stamps.get((0,xt.A)(wf,this));r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=(0,bt.A)(Tf,this,jf).call(this,!1))}}else e.stamps.set((0,xt.A)(wf,this),{area:r,serialized:i}),i.bitmap=(0,bt.A)(Tf,this,jf).call(this,!1);return i}}function Pf(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?((0,Et.A)(bf,this,t.bitmap),e||((0,Et.A)(wf,this,t.id),(0,Et.A)(Mf,this,t.isSvg)),t.file&&(0,Et.A)(Ef,this,t.file.name),(0,bt.A)(Tf,this,Df).call(this)):this.remove()}function Ff(){(0,Et.A)(yf,this,null),this._uiManager.enableWaiting(!1),(0,xt.A)(Cf,this)&&this.div.focus()}function If(){if((0,xt.A)(wf,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId((0,xt.A)(wf,this)).then(t=>(0,bt.A)(Tf,this,Pf).call(this,t,!0)).finally(()=>(0,bt.A)(Tf,this,Ff).call(this));if((0,xt.A)(_f,this)){const t=(0,xt.A)(_f,this);return(0,Et.A)(_f,this,null),this._uiManager.enableWaiting(!0),void(0,Et.A)(yf,this,this._uiManager.imageManager.getFromUrl(t).then(t=>(0,bt.A)(Tf,this,Pf).call(this,t)).finally(()=>(0,bt.A)(Tf,this,Ff).call(this)))}if((0,xt.A)(xf,this)){const t=(0,xt.A)(xf,this);return(0,Et.A)(xf,this,null),this._uiManager.enableWaiting(!0),void(0,Et.A)(yf,this,this._uiManager.imageManager.getFromFile(t).then(t=>(0,bt.A)(Tf,this,Pf).call(this,t)).finally(()=>(0,bt.A)(Tf,this,Ff).call(this)))}const t=document.createElement("input");t.type="file",t.accept=Ot.supportedTypesStr;const e=this._uiManager._signal;(0,Et.A)(yf,this,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]);(0,bt.A)(Tf,this,Pf).call(this,e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>(0,bt.A)(Tf,this,Ff).call(this))),t.click()}function Df(){const{div:t}=this;let{width:e,height:i}=(0,xt.A)(bf,this);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=(0,Et.A)(Cf,this,document.createElement("canvas"));t.append(l),t.hidden=!1,(0,bt.A)(Tf,this,Wf).call(this,e,i),(0,bt.A)(Tf,this,Bf).call(this),(0,xt.A)(Lf,this)||(this.parent.addUndoableEditor(this),(0,Et.A)(Lf,this,!0)),this._reportTelemetry({action:"inserted_image"}),(0,xt.A)(Ef,this)&&l.setAttribute("aria-label",(0,xt.A)(Ef,this))}function Of(t,e){var i;const[n,s]=this.parentDimensions;this.width=t/n,this.height=e/s,this.setDims(t,e),null!==(i=this._initialOptions)&&void 0!==i&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==(0,xt.A)(Sf,this)&&clearTimeout((0,xt.A)(Sf,this));(0,Et.A)(Sf,this,setTimeout(()=>{(0,Et.A)(Sf,this,null),(0,bt.A)(Tf,this,Wf).call(this,t,e)},200))}function Nf(t,e){const{width:i,height:n}=(0,xt.A)(bf,this);let s=i,r=n,a=(0,xt.A)(bf,this);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}function Wf(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=(0,xt.A)(Cf,this);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const n=(0,xt.A)(Mf,this)?(0,xt.A)(bf,this):(0,bt.A)(Tf,this,Nf).call(this,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=(null===t||void 0===t?void 0: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)}function jf(t){if(t){if((0,xt.A)(Mf,this)){const t=this._uiManager.imageManager.getSvgUrl((0,xt.A)(wf,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=(0,xt.A)(bf,this));return t.getContext("2d").drawImage((0,xt.A)(bf,this),0,0),t.toDataURL()}if((0,xt.A)(Mf,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*ki.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*ki.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage((0,xt.A)(bf,this),0,0,(0,xt.A)(bf,this).width,(0,xt.A)(bf,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone((0,xt.A)(bf,this))}function Bf(){this._uiManager._signal&&((0,Et.A)(kf,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&(0,bt.A)(Tf,this,Of).call(this,e.width,e.height)})),(0,xt.A)(kf,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=(0,xt.A)(kf,this))||void 0===t||t.disconnect(),(0,Et.A)(kf,this,null)},{once:!0}))}Ot=Rf,(0,yt.A)(Rf,"_type","stamp"),(0,yt.A)(Rf,"_editorType",Jt.STAMP);var Hf=new WeakMap,zf=new WeakMap,Uf=new WeakMap,Vf=new WeakMap,Gf=new WeakMap,qf=new WeakMap,Xf=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Qf=new WeakMap,Zf=new WeakMap,Jf=new WeakMap,$f=new WeakMap,tg=new WeakSet;class eg{constructor(t){let{uiManager:e,pageIndex:i,div:n,accessibilityManager:s,annotationLayer:r,drawLayer:a,textLayer:o,viewport:l,l10n:c}=t;(0,vt.A)(this,tg),(0,_t.A)(this,Hf,void 0),(0,_t.A)(this,zf,!1),(0,_t.A)(this,Uf,null),(0,_t.A)(this,Vf,null),(0,_t.A)(this,Gf,null),(0,_t.A)(this,qf,null),(0,_t.A)(this,Xf,null),(0,_t.A)(this,Yf,new Map),(0,_t.A)(this,Kf,!1),(0,_t.A)(this,Qf,!1),(0,_t.A)(this,Zf,!1),(0,_t.A)(this,Jf,null),(0,_t.A)(this,$f,void 0);const h=[...og._.values()];if(!eg._initialized){eg._initialized=!0;for(const t of h)t.initialize(c,e)}e.registerEditorTypes(h),(0,Et.A)($f,this,e),this.pageIndex=i,this.div=n,(0,Et.A)(Hf,this,s),(0,Et.A)(Uf,this,r),this.viewport=l,(0,Et.A)(Jf,this,o),this.drawLayer=a,(0,xt.A)($f,this).addLayer(this)}get isEmpty(){return 0===(0,xt.A)(Yf,this).size}get isInvisible(){return this.isEmpty&&(0,xt.A)($f,this).getMode()===Jt.NONE}updateToolbar(t){(0,xt.A)($f,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,xt.A)($f,this).getMode();switch((0,bt.A)(tg,this,ag).call(this),t){case Jt.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Jt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Jt.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 og._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=(0,xt.A)(Jf,this))||void 0===e?void 0:e.div)}addInkEditorIfNeeded(t){if((0,xt.A)($f,this).getMode()!==Jt.INK)return;if(!t)for(const e of(0,xt.A)(Yf,this).values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){(0,xt.A)($f,this).setEditingState(t)}addCommands(t){(0,xt.A)($f,this).addCommands(t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=(0,xt.A)(Uf,this))||void 0===t||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of(0,xt.A)(Yf,this).values())i.enableEditing(),i.show(!0),i.annotationElementId&&((0,xt.A)($f,this).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!(0,xt.A)(Uf,this))return;const e=(0,xt.A)(Uf,this).getEditableAnnotations();for(const i of e){if(i.hide(),(0,xt.A)($f,this).isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){(0,Et.A)(Zf,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const s of(0,xt.A)(Yf,this).values()){var i;s.disableEditing(),s.annotationElementId&&(null===s.serialize()?(e.set(s.annotationElementId,s),null===(i=this.getEditableAnnotation(s.annotationElementId))||void 0===i||i.show(),s.remove()):t.set(s.annotationElementId,s))}if((0,xt.A)(Uf,this)){const i=(0,xt.A)(Uf,this).getEditableAnnotations();for(const n of i){const{id:i}=n.data;if((0,xt.A)($f,this).isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&((0,xt.A)($f,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(n),s.show(!1)),n.show())}}(0,bt.A)(tg,this,ag).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const s of og._.values())n.remove("".concat(s._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),(0,Et.A)(Zf,this,!1)}getEditableAnnotation(t){var e;return(null===(e=(0,xt.A)(Uf,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){(0,xt.A)($f,this).getActive()!==t&&(0,xt.A)($f,this).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!==(t=(0,xt.A)(Jf,this))&&void 0!==t&&t.div&&!(0,xt.A)(qf,this)&&((0,Et.A)(qf,this,(0,bt.A)(tg,this,ig).bind(this)),(0,xt.A)(Jf,this).div.addEventListener("pointerdown",(0,xt.A)(qf,this),{signal:(0,xt.A)($f,this)._signal}),(0,xt.A)(Jf,this).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=(0,xt.A)(Jf,this))&&void 0!==t&&t.div&&(0,xt.A)(qf,this)&&((0,xt.A)(Jf,this).div.removeEventListener("pointerdown",(0,xt.A)(qf,this)),(0,Et.A)(qf,this,null),(0,xt.A)(Jf,this).div.classList.remove("highlighting"))}enableClick(){if((0,xt.A)(Gf,this))return;const t=(0,xt.A)($f,this)._signal;(0,Et.A)(Gf,this,this.pointerdown.bind(this)),(0,Et.A)(Vf,this,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",(0,xt.A)(Gf,this),{signal:t}),this.div.addEventListener("pointerup",(0,xt.A)(Vf,this),{signal:t})}disableClick(){(0,xt.A)(Gf,this)&&(this.div.removeEventListener("pointerdown",(0,xt.A)(Gf,this)),this.div.removeEventListener("pointerup",(0,xt.A)(Vf,this)),(0,Et.A)(Gf,this,null),(0,Et.A)(Vf,this,null))}attach(t){(0,xt.A)(Yf,this).set(t.id,t);const{annotationElementId:e}=t;e&&(0,xt.A)($f,this).isDeletedAnnotationElement(e)&&(0,xt.A)($f,this).removeDeletedAnnotationElement(t)}detach(t){var e;(0,xt.A)(Yf,this).delete(t.id),null===(e=(0,xt.A)(Hf,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!(0,xt.A)(Zf,this)&&t.annotationElementId&&(0,xt.A)($f,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),(0,xt.A)($f,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,(0,xt.A)(Qf,this)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&((0,xt.A)($f,this).addDeletedAnnotationElement(t.annotationElementId),Vr.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||e.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),(0,xt.A)($f,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),(0,xt.A)($f,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!(0,xt.A)(Xf,this)&&(t._focusEventsAllowed=!1,(0,Et.A)(Xf,this,setTimeout(()=>{(0,Et.A)(Xf,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:(0,xt.A)($f,this)._signal}),i.focus())},0))),t._structTreeParentId=null===(e=(0,xt.A)(Hf,this))||void 0===e?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(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(0,xt.A)($f,this).getId()}get _signal(){return(0,xt.A)($f,this)._signal}canCreateNewEmptyEditor(){var t;return null===(t=wt(tg,this,ng))||void 0===t?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){(0,xt.A)($f,this).updateToolbar(t),(0,xt.A)($f,this).updateMode(t);const{offsetX:i,offsetY:n}=(0,bt.A)(tg,this,rg).call(this),s=this.getNextId(),r=(0,bt.A)(tg,this,sg).call(this,(0,gt.A)({parent:this,id:s,x:i,y:n,uiManager:(0,xt.A)($f,this),isCentered:!0},e));r&&this.add(r)}deserialize(t){var e,i;return(null===(e=og._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,(0,xt.A)($f,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=(0,bt.A)(tg,this,sg).call(this,(0,gt.A)({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:(0,xt.A)($f,this),isCentered:e},i));return s&&this.add(s),s}addNewEditor(){this.createAndAddNewEditor((0,bt.A)(tg,this,rg).call(this),!0)}setSelected(t){(0,xt.A)($f,this).setSelected(t)}toggleSelected(t){(0,xt.A)($f,this).toggleSelected(t)}isSelected(t){return(0,xt.A)($f,this).isSelected(t)}unselect(t){(0,xt.A)($f,this).unselect(t)}pointerup(t){const{isMac:e}=ei.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&(0,xt.A)(Kf,this)&&((0,Et.A)(Kf,this,!1),(0,xt.A)(zf,this)?(0,xt.A)($f,this).getMode()!==Jt.STAMP?this.createAndAddNewEditor(t,!1):(0,xt.A)($f,this).unselectAll():(0,Et.A)(zf,this,!0))}pointerdown(t){if((0,xt.A)($f,this).getMode()===Jt.HIGHLIGHT&&this.enableTextSelection(),(0,xt.A)(Kf,this))return void(0,Et.A)(Kf,this,!1);const{isMac:e}=ei.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;(0,Et.A)(Kf,this,!0);const i=(0,xt.A)($f,this).getActive();(0,Et.A)(zf,this,!i||i.isEmpty())}findNewParent(t,e,i){const n=(0,xt.A)($f,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){var t;(null===(t=(0,xt.A)($f,this).getActive())||void 0===t?void 0:t.parent)===this&&((0,xt.A)($f,this).commitOrRemove(),(0,xt.A)($f,this).setActiveEditor(null)),(0,xt.A)(Xf,this)&&(clearTimeout((0,xt.A)(Xf,this)),(0,Et.A)(Xf,this,null));for(const i of(0,xt.A)(Yf,this).values()){var e;null===(e=(0,xt.A)(Hf,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,(0,xt.A)(Yf,this).clear(),(0,xt.A)($f,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,un(this.div,e);for(const i of(0,xt.A)($f,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;(0,xt.A)($f,this).commitOrRemove(),(0,bt.A)(tg,this,ag).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,un(this.div,{rotation:n}),i!==n)for(const s of(0,xt.A)(Yf,this).values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return(0,xt.A)($f,this).viewParameters.realScale}}function ig(t){if((0,xt.A)($f,this).unselectAll(),t.target===(0,xt.A)(Jf,this).div){const{isMac:e}=ei.platform;if(0!==t.button||t.ctrlKey&&e)return;(0,xt.A)($f,this).showAllEditors("highlight",!0,!0),(0,xt.A)(Jf,this).div.classList.add("free"),pp.startHighlighting(this,"ltr"===(0,xt.A)($f,this).direction,t),(0,xt.A)(Jf,this).div.addEventListener("pointerup",()=>{(0,xt.A)(Jf,this).div.classList.remove("free")},{once:!0,signal:(0,xt.A)($f,this)._signal}),t.preventDefault()}}function ng(t){return og._.get((0,xt.A)($f,t).getMode())}function sg(t){const e=wt(tg,this,ng);return e?new e.prototype.constructor(t):null}function rg(){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,c]=this.viewport.rotation%180===0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}function ag(){(0,Et.A)(Qf,this,!0);for(const t of(0,xt.A)(Yf,this).values())t.isEmpty()&&t.remove();(0,Et.A)(Qf,this,!1)}(0,yt.A)(eg,"_initialized",!1);var og={_:new Map([Sd,Gp,Rf,pp].map(t=>[t._editorType,t]))},lg=new WeakMap,cg=new WeakMap,hg=new WeakMap,dg=new WeakMap,ug=new WeakSet;class pg{constructor(t){let{pageIndex:e}=t;(0,vt.A)(this,ug),(0,_t.A)(this,lg,null),(0,_t.A)(this,cg,0),(0,_t.A)(this,hg,new Map),(0,_t.A)(this,dg,new Map),this.pageIndex=e}setParent(t){if((0,xt.A)(lg,this)){if((0,xt.A)(lg,this)!==t){if((0,xt.A)(hg,this).size>0)for(const e of(0,xt.A)(hg,this).values())e.remove(),t.append(e);(0,Et.A)(lg,this,t)}}else(0,Et.A)(lg,this,t)}static get _svgFactory(){return Ue(this,"_svgFactory",new Yi)}highlight(t,e,i){var n,s;let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=((0,Et.A)(cg,this,(n=(0,xt.A)(cg,this),s=n++,n)),s),o=(0,bt.A)(ug,this,gg).call(this,t.box);o.classList.add("highlight"),t.free&&o.classList.add("free");const l=pg._svgFactory.createElement("defs");o.append(l);const c=pg._svgFactory.createElement("path");l.append(c);const h="path_p".concat(this.pageIndex,"_").concat(a);c.setAttribute("id",h),c.setAttribute("d",t.toSVGPath()),r&&(0,xt.A)(dg,this).set(a,c);const d=(0,bt.A)(ug,this,Ag).call(this,l,h),u=pg._svgFactory.createElement("use");return o.append(u),o.setAttribute("fill",e),o.setAttribute("fill-opacity",i),u.setAttribute("href","#".concat(h)),(0,xt.A)(hg,this).set(a,o),{id:a,clipPathId:"url(#".concat(d,")")}}highlightOutline(t){var e,i;const n=((0,Et.A)(cg,this,(e=(0,xt.A)(cg,this),i=e++,e)),i),s=(0,bt.A)(ug,this,gg).call(this,t.box);s.classList.add("highlightOutline");const r=pg._svgFactory.createElement("defs");s.append(r);const a=pg._svgFactory.createElement("path");r.append(a);const o="path_p".concat(this.pageIndex,"_").concat(n);let l;if(a.setAttribute("id",o),a.setAttribute("d",t.toSVGPath()),a.setAttribute("vector-effect","non-scaling-stroke"),t.free){s.classList.add("free");const t=pg._svgFactory.createElement("mask");r.append(t),l="mask_p".concat(this.pageIndex,"_").concat(n),t.setAttribute("id",l),t.setAttribute("maskUnits","objectBoundingBox");const e=pg._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=pg._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(o)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const c=pg._svgFactory.createElement("use");s.append(c),c.setAttribute("href","#".concat(o)),l&&c.setAttribute("mask","url(#".concat(l,")"));const h=c.cloneNode();return s.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),(0,xt.A)(hg,this).set(n,s),n}finalizeLine(t,e){const i=(0,xt.A)(dg,this).get(t);(0,xt.A)(dg,this).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){(0,xt.A)(hg,this).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),(0,xt.A)(dg,this).delete(t)}updatePath(t,e){(0,xt.A)(dg,this).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){fg.call(pg,(0,xt.A)(hg,this).get(t),e)}show(t,e){(0,xt.A)(hg,this).get(t).classList.toggle("hidden",!e)}rotate(t,e){(0,xt.A)(hg,this).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){(0,xt.A)(hg,this).get(t).setAttribute("fill",e)}changeOpacity(t,e){(0,xt.A)(hg,this).get(t).setAttribute("fill-opacity",e)}addClass(t,e){(0,xt.A)(hg,this).get(t).classList.add(e)}removeClass(t,e){(0,xt.A)(hg,this).get(t).classList.remove(e)}remove(t){null!==(0,xt.A)(lg,this)&&((0,xt.A)(hg,this).get(t).remove(),(0,xt.A)(hg,this).delete(t))}destroy(){(0,Et.A)(lg,this,null);for(const t of(0,xt.A)(hg,this).values())t.remove();(0,xt.A)(hg,this).clear()}}function fg(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="".concat(100*i,"%"),r.left="".concat(100*e,"%"),r.width="".concat(100*n,"%"),r.height="".concat(100*s,"%")}function gg(t){const e=Nt._svgFactory.create(1,1,!0);return(0,xt.A)(lg,this).append(e),e.setAttribute("aria-hidden",!0),fg.call(Nt,e,t),e}function Ag(t,e){const i=Nt._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=Nt._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}Nt=pg;var mg=jt.AnnotationLayer,vg=jt.AnnotationMode,bg=jt.GlobalWorkerOptions,wg=jt.PDFDataRangeTransport,yg=jt.TextLayer,_g=jt.getDocument,xg=i(70579),Eg=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))},Cg=Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg([],["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 kg(t,e){var i={};return Cg.forEach(function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)}),i}function Sg(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}}}function Mg(t){var e,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(i=Mg(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}const Lg=function(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=Mg(t))&&(n&&(n+=" "),n+=e);return n};var Tg="Invariant failed";function Rg(t,e){if(!t)throw new Error(Tg)}var Pg=i(96440),Fg=Object.prototype.hasOwnProperty;function Ig(t,e,i){for(i of t.keys())if(Dg(i,e))return i}function Dg(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--&&Dg(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=Ig(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=Ig(e,s)))return!1;if(!Dg(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(Fg.call(t,i)&&++n&&!Fg.call(e,i))return!1;if(!(i in e)||!Dg(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}const Og=(0,s.createContext)(null);function Ng(t){let{children:e,type:i}=t;return(0,xg.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}class Wg{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 Rg(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(t){Rg(this.pdfViewer),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise(e=>{Rg(this.pdfDocument),Rg(t),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{Rg(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise(t=>{Rg(this.pdfDocument),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{Rg(!1,'"'.concat(e,'" is not a valid page reference.'))}):"number"===typeof e?t(e):Rg(!1,'"'.concat(e,'" is not a valid destination reference.'))}).then(e=>{const i=e+1;Rg(this.pdfViewer),Rg(i>=1&&i<=this.pagesCount,'"'.concat(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;Rg(this.pdfViewer),Rg(t>=1&&t<=this.pagesCount,'"'.concat(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 jg={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Bg="undefined"!==typeof window,Hg=Bg&&"file:"===window.location.protocol;function zg(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function Ug(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function Vg(t){Rg(Ug(t));const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function Gg(){return Bg&&window.devicePixelRatio||1}const qg="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function Xg(){Pg(!Hg,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(qg))}function Yg(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function Kg(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 Qg(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 Zg(){return(0,s.useReducer)(Qg,{value:void 0,error:void 0})}var Jg=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())})},$g=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:tA}=n,eA=(t,e)=>{switch(e){case jg.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case jg.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function iA(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const nA=(0,s.forwardRef)(function(t,e){var{children:i,className:n,error:r="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:l,inputRef:c,imageResourcesPath:h,loading:d="Loading PDF\u2026",noData:u="No PDF file specified.",onItemClick:p,onLoadError:f,onLoadProgress:g,onLoadSuccess:A,onPassword:m=eA,onSourceError:v,onSourceSuccess:b,options:w,renderMode:y,rotate:_}=t,x=$g(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[E,C]=Zg(),{value:k,error:S}=E,[M,L]=Zg(),{value:T,error:R}=M,P=(0,s.useRef)(new Wg),F=(0,s.useRef)([]),I=(0,s.useRef)(void 0),D=(0,s.useRef)(void 0);l&&l!==I.current&&iA(l)&&(Pg(!Dg(l,I.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.'),I.current=l),w&&w!==D.current&&(Pg(!Dg(w,D.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.'),D.current=w);const O=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(p)return void p({dest:e,pageIndex:n,pageNumber:i});const s=F.current[n];s?s.scrollIntoView():Pg(!1,"An internal link leading to page ".concat(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:P,pages:F,viewer:O}),[]),(0,s.useEffect)(function(){C({type:"RESET"})},[l,C]);const N=(0,s.useCallback)(()=>Jg(this,void 0,void 0,function*(){if(!l)return null;if("string"===typeof l){if(Ug(l)){return{data:Vg(l)}}return Xg(),{url:l}}if(l instanceof tA)return{range:l};if(l instanceof ArrayBuffer)return{data:l};if(Bg&&function(t){return Rg(Bg),t instanceof Blob}(l)){const t=yield function(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)})}(l);return{data:t}}if(Rg("object"===typeof l),Rg(iA(l)),"url"in l&&"string"===typeof l.url){if(Ug(l.url)){const{url:t}=l,e=$g(l,["url"]),i=Vg(t);return Object.assign({data:i},e)}Xg()}return l}),[l]);(0,s.useEffect)(()=>{const t=Sg(N());return t.promise.then(t=>{C({type:"RESOLVE",value:t})}).catch(t=>{C({type:"REJECT",error:t})}),()=>{Yg(t)}},[N,C]),(0,s.useEffect)(()=>{"undefined"!==typeof k&&(!1!==k?b&&b():S&&(Pg(!1,S.toString()),v&&v(S)))},[k]),(0,s.useEffect)(function(){L({type:"RESET"})},[L,k]),(0,s.useEffect)(function(){if(!k)return;const t=w?Object.assign(Object.assign({},k),w):k,e=_g(t);g&&(e.onProgress=g),m&&(e.onPassword=m);const i=e,n=i.promise.then(t=>{L({type:"RESOLVE",value:t})}).catch(t=>{i.destroyed||L({type:"REJECT",error:t})});return()=>{n.finally(()=>i.destroy())}},[w,L,k]),(0,s.useEffect)(()=>{"undefined"!==typeof T&&(!1!==T?T&&(A&&A(T),F.current=new Array(T.numPages),P.current.setDocument(T)):R&&(Pg(!1,R.toString()),f&&f(R)))},[T]),(0,s.useEffect)(function(){P.current.setViewer(O.current),P.current.setExternalLinkRel(a),P.current.setExternalLinkTarget(o)},[a,o]);const W=(0,s.useCallback)((t,e)=>{F.current[t]=e},[]),j=(0,s.useCallback)(t=>{delete F.current[t]},[]),B=(0,s.useMemo)(()=>({imageResourcesPath:h,linkService:P.current,onItemClick:p,pdf:T,registerPage:W,renderMode:y,rotate:_,unregisterPage:j}),[h,p,T,W,y,_,j]),H=(0,s.useMemo)(()=>kg(x,()=>T),[x,T]);return(0,xg.jsx)("div",Object.assign({className:Lg("react-pdf__Document",n),ref:c,style:{"--scale-factor":"1"}},H,{children:l?void 0===T||null===T?(0,xg.jsx)(Ng,{type:"loading",children:"function"===typeof d?d():d}):!1===T?(0,xg.jsx)(Ng,{type:"error",children:"function"===typeof r?r():r}):(0,xg.jsx)(Og.Provider,{value:B,children:i}):(0,xg.jsx)(Ng,{type:"no-data",children:"function"===typeof u?u():u})}))});function sA(){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)})}}const rA=(0,s.createContext)(null),aA={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},oA=/^H(\d+)$/;function lA(t){return"children"in t}function cA(t){return!!lA(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function hA(t){const e={};if(lA(t)){const{role:i}=t,n=i.match(oA);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in aA}(i)){const t=aA[i];t&&(e.role=t)}}return e}function dA(t){const e={};if(lA(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),cA(t)){const[i]=t.children;if(i){const t=dA(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function uA(t){return t?Object.assign(Object.assign({},hA(t)),dA(t)):null}function pA(t){let{className:e,node:i}=t;const n=(0,s.useMemo)(()=>uA(i),[i]),r=(0,s.useMemo)(()=>lA(i)?cA(i)?null:i.children.map((t,e)=>(0,xg.jsx)(pA,{node:t},e)):null,[i]);return(0,xg.jsx)("span",Object.assign({className:e},n,{children:r}))}function fA(){return(0,s.useContext)(rA)}function gA(){const t=fA();Rg(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,r]=Zg(),{value:a,error:o}=n,{customTextRenderer:l,page:c}=t;return(0,s.useEffect)(function(){r({type:"RESET"})},[r,c]),(0,s.useEffect)(function(){if(l)return;if(!c)return;const t=Sg(c.getStructTree()),e=t;return t.promise.then(t=>{r({type:"RESOLVE",value:t})}).catch(t=>{r({type:"REJECT",error:t})}),()=>Yg(e)},[l,c,r]),(0,s.useEffect)(()=>{void 0!==a&&(!1!==a?a&&i&&i(a):o&&(Pg(!1,o.toString()),e&&e(o)))},[a]),a?(0,xg.jsx)(pA,{className:"react-pdf__Page__structTree structTree",node:a}):null}const AA=vg;function mA(t){const e=fA();Rg(e);const i=Object.assign(Object.assign({},e),t),{_className:n,canvasBackground:r,devicePixelRatio:a=Gg(),onRenderError:o,onRenderSuccess:l,page:c,renderForms:h,renderTextLayer:d,rotate:u,scale:p}=i,{canvasRef:f}=t;Rg(c);const g=(0,s.useRef)(null);function A(t){(function(t){return"RenderingCancelledException"===t.name})(t)||(Pg(!1,t.toString()),o&&o(t))}const m=(0,s.useMemo)(()=>c.getViewport({scale:p*a,rotation:u}),[a,c,u,p]),v=(0,s.useMemo)(()=>c.getViewport({scale:p,rotation:u}),[c,u,p]);(0,s.useEffect)(function(){if(!c)return;c.cleanup();const{current:t}=g;if(!t)return;t.width=m.width,t.height=m.height,t.style.width="".concat(Math.floor(v.width),"px"),t.style.height="".concat(Math.floor(v.height),"px"),t.style.visibility="hidden";const e={annotationMode:h?AA.ENABLE_FORMS:AA.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:m};r&&(e.background=r);const i=c.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",c&&l&&l(Kg(c,p))}).catch(A),()=>Yg(n)},[r,c,h,m,v]);const b=(0,s.useCallback)(()=>{const{current:t}=g;t&&(t.width=0,t.height=0)},[]);return(0,s.useEffect)(()=>b,[b]),(0,xg.jsx)("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:sA(f,g),style:{display:"block",userSelect:"none"},children:d?(0,xg.jsx)(gA,{}):null})}function vA(){const t=fA();Rg(t);const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:r,onRenderTextLayerSuccess:a,page:o,pageIndex:l,pageNumber:c,rotate:h,scale:d}=t;Rg(o);const[u,p]=Zg(),{value:f,error:g}=u,A=(0,s.useRef)(null),m=(0,s.useRef)(void 0);Pg(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(){p({type:"RESET"})},[o,p]),(0,s.useEffect)(function(){if(!o)return;const t=Sg(o.getTextContent()),e=t;return t.promise.then(t=>{p({type:"RESOLVE",value:t})}).catch(t=>{p({type:"REJECT",error:t})}),()=>Yg(e)},[o,p]),(0,s.useEffect)(()=>{void 0!==f&&(!1!==f?f&&n&&n(f):g&&(Pg(!1,g.toString()),i&&i(g)))},[f]);const v=(0,s.useCallback)(()=>{a&&a()},[a]),b=(0,s.useCallback)(t=>{Pg(!1,t.toString()),r&&r(t)},[r]);const w=(0,s.useMemo)(()=>o.getViewport({scale:d,rotation:h}),[o,h,d]);return(0,s.useLayoutEffect)(function(){if(!o||!f)return;const{current:t}=A;if(!t)return;t.innerHTML="";const i=o.streamTextContent({includeMarkedContent:!0}),n=new yg({container:t,textContentSource:i,viewport:w}),s=n;return n.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),m.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;f.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:l,pageNumber:c,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1})}v()}).catch(b),()=>Yg(s)},[e,b,v,o,l,c,f,w]),(0,xg.jsx)("div",{className:Lg("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=m.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=m.current;t&&t.classList.add("active")},ref:A})}function bA(){return(0,s.useContext)(Og)}function wA(){const t=bA(),e=fA();Rg(e);const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:r,onGetAnnotationsError:a,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:l,onRenderAnnotationLayerSuccess:c,page:h,pdf:d,renderForms:u,rotate:p,scale:f=1}=i;Rg(d),Rg(h),Rg(r);const[g,A]=Zg(),{value:m,error:v}=g,b=(0,s.useRef)(null);Pg(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(){A({type:"RESET"})},[A,h]),(0,s.useEffect)(function(){if(!h)return;const t=Sg(h.getAnnotations()),e=t;return t.promise.then(t=>{A({type:"RESOLVE",value:t})}).catch(t=>{A({type:"REJECT",error:t})}),()=>{Yg(e)}},[A,h]),(0,s.useEffect)(()=>{void 0!==m&&(!1!==m?m&&o&&o(m):v&&(Pg(!1,v.toString()),a&&a(v)))},[m]);const w=(0,s.useMemo)(()=>h.getViewport({scale:f,rotation:p}),[h,p,f]);return(0,s.useEffect)(function(){if(!d||!h||!r||!m)return;const{current:t}=b;if(!t)return;const e=w.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:h,viewport:e},s={annotations:m,annotationStorage:d.annotationStorage,div:t,imageResourcesPath:n,linkService:r,page:h,renderForms:u,viewport:e};t.innerHTML="";try{new mg(i).render(s),c&&c()}catch(a){!function(t){Pg(!1,"".concat(t)),l&&l(t)}(a)}return()=>{}},[m,n,r,h,d,u,w]),(0,xg.jsx)("div",{className:Lg("react-pdf__Page__annotations","annotationLayer"),ref:b})}var yA=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 _A=1;function xA(t){const e=bA(),i=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackground:a,canvasRef:o,children:l,className:c,customRenderer:h,customTextRenderer:d,devicePixelRatio:u,error:p="Failed to load the page.",height:f,inputRef:g,loading:A="Loading page\u2026",noData:m="No page specified.",onGetAnnotationsError:v,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:y,onGetTextError:_,onGetTextSuccess:x,onLoadError:E,onLoadSuccess:C,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,pageIndex:P,pageNumber:F,pdf:I,registerPage:D,renderAnnotationLayer:O=!0,renderForms:N=!1,renderMode:W="canvas",renderTextLayer:j=!0,rotate:B,scale:H=_A,unregisterPage:z,width:U}=i,V=yA(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"]),[G,q]=Zg(),{value:X,error:Y}=G,K=(0,s.useRef)(null);Rg(I);const Q=zg(F)?F-1:null!==P&&void 0!==P?P:null,Z=null!==F&&void 0!==F?F:zg(P)?P+1:null,J=null!==B&&void 0!==B?B:X?X.rotate:null,$=(0,s.useMemo)(()=>{if(!X)return null;let t=1;const e=null!==H&&void 0!==H?H:_A;if(U||f){const e=X.getViewport({scale:1,rotation:J});U?t=U/e.width:f&&(t=f/e.height)}return e*t},[f,X,J,H,U]);(0,s.useEffect)(function(){return()=>{zg(Q)&&r&&z&&z(Q)}},[r,I,Q,z]),(0,s.useEffect)(function(){q({type:"RESET"})},[q,I,Q]),(0,s.useEffect)(function(){if(!I||!Z)return;const t=Sg(I.getPage(Z)),e=t;return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>Yg(e)},[q,I,Z]),(0,s.useEffect)(()=>{void 0!==X&&(!1!==X?function(){if(C){if(!X||!$)return;C(Kg(X,$))}if(r&&D){if(!zg(Q)||!K.current)return;D(Q,K.current)}}():Y&&(Pg(!1,Y.toString()),E&&E(Y)))},[X,$]);const tt=(0,s.useMemo)(()=>X&&zg(Q)&&Z&&zg(J)&&zg($)?{_className:n,canvasBackground:a,customTextRenderer:d,devicePixelRatio:u,onGetAnnotationsError:v,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:y,onGetTextError:_,onGetTextSuccess:x,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,page:X,pageIndex:Q,pageNumber:Z,renderForms:N,renderTextLayer:j,rotate:J,scale:$}:null,[n,a,d,u,v,b,w,y,_,x,k,S,M,L,T,R,X,Q,Z,N,j,J,$]),et=(0,s.useMemo)(()=>kg(V,()=>X?$?Kg(X,$):void 0:X),[V,X,$]),it="".concat(Q,"@").concat($,"/").concat(J);function nt(){switch(W){case"custom":return Rg(h),(0,xg.jsx)(h,{},"".concat(it,"_custom"));case"none":return null;default:return(0,xg.jsx)(mA,{canvasRef:o},"".concat(it,"_canvas"))}}return(0,xg.jsx)("div",Object.assign({className:Lg(n,c),"data-page-number":Z,ref:sA(g,K),style:{"--scale-factor":"".concat($),backgroundColor:a||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},et,{children:Z?null===I||void 0===X||null===X?(0,xg.jsx)(Ng,{type:"loading",children:"function"===typeof A?A():A}):!1===I||!1===X?(0,xg.jsx)(Ng,{type:"error",children:"function"===typeof p?p():p}):(0,xg.jsxs)(rA.Provider,{value:tt,children:[nt(),j?(0,xg.jsx)(vA,{},"".concat(it,"_text")):null,O?(0,xg.jsx)(wA,{},"".concat(it,"_annotations")):null,l]}):(0,xg.jsx)(Ng,{type:"no-data",children:"function"===typeof m?m():m})}))}var EA,CA=i(19155),kA=i(93141),SA=i(10986),MA=i.n(SA);const LA=["title","titleId"];function TA(){return TA=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},TA.apply(null,arguments)}function RA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,LA);return s.createElement("svg",TA({t:1731465967110,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1541,xmlnsXlink:"http://www.w3.org/1999/xlink",width:200,height:200,ref:e,"aria-labelledby":n},r),i?s.createElement("title",{id:n},i):null,EA||(EA=s.createElement("path",{d:"M112 166h-7q-21 3-35 18.5T56 222v562q3 20 18.5 34.5T112 833h388l56-167-119-179-103 123-72-71-5-5q-17-13-38-11.5T183 539l-71 71V222h259l18-56H112z m388 0l-18 56h407v379L654 327l-4-5q-18-16-41.5-14.5T570 328l-72 85 169 253-55 167h277l7-1q21-2 35-18t14-37V215q-3-21-18.5-35T889 166H500zM306 277q-34 0-58.5 24.5t-24.5 59q0 34.5 24.5 59T306 444q23 0 42.5-12t30.5-31l-45-68 14-44q-19-12-42-12z",fill:"#E0E0E0","p-id":1542})))}const PA=s.forwardRef(RA);i.p;var FA,IA;const DA=["title","titleId"];function OA(){return OA=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},OA.apply(null,arguments)}function NA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,DA);return s.createElement("svg",OA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u7f16\u7ec4 10"):i?s.createElement("title",{id:n},i):null,FA||(FA=s.createElement("defs",null,s.createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1"},s.createElement("stop",{stopColor:"#F5F5F5",offset:"0%"}),s.createElement("stop",{stopColor:"#E0E0E0",offset:"100%"})))),IA||(IA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807Icon",transform:"translate(-760.000000, -2364.000000)"},s.createElement("g",{id:"\\u7F16\\u7EC4-10",transform:"translate(760.000000, 2364.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u65E0\\u6027\\u522B",fill:"url(#linearGradient-1)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",x:0,y:0,width:56,height:56})),s.createElement("g",{id:"\\u5934\\u50CF_avatar-(1)\\u5907\\u4EFD",transform:"translate(8.000000, 12.000000)",fill:"#FFFFFF",fillRule:"nonzero"},s.createElement("path",{d:"M40,41.3851428 C40,40.9828571 40,35.6022857 39,33.792 C38.4,32.5851428 37.4,31.7805714 36.2,30.976 C34.8,30.1714285 33,29.3668572 30.8,28.9645714 C30.6,28.9645714 29.2,28.7634285 28,28.3611428 C26.6,27.9588571 26,27.7577143 25.8,27.5565714 L25.8,26.3497143 C26,23.7348571 27.4,22.3268572 28.6,21.12 C29,20.7177143 29.4,20.3154285 29.8,19.712 C31.2,17.7005714 31.4,15.6891429 31.4,15.2868571 C31.4,14.8845714 31.4,14.6834286 31.2,14.2811429 C31,13.8788572 30.8,13.4765714 30.6,13.2754286 C30.6,12.672 30.8,12.0685714 30.8,11.6662857 C30.8,10.6605715 31,9.05142856 30.6,7.44228572 C30.6,7.24114285 30.6,6.83885715 30.4,6.43657145 C30,5.22971431 29.6,4.22400004 28.8,3.4194286 C28.4,3.4194286 25.6,0.603428618 18,0 L15,0 C14.6,0 14.2,0 13.8,0.201142873 C12.4,0.603428571 12.2,1.60914289 12,2.01142859 L12,3.21828573 L11.8,3.4194286 C11.6,3.62057147 9.60000004,5.43085719 9.40000002,7.84457142 C9.20000001,9.45371426 9.20000001,11.8674285 9.40000002,13.6777143 C9.20000001,14.08 8.80000002,14.4822858 8.80000002,15.488 C8.80000002,15.8902857 9,17.9017143 10.4,19.712 C10.8,20.1142857 11,20.5165715 11.6,21.12 C12.8,22.528 14.2,23.936 14.4,26.3497143 L14.4,27.5565714 C14,27.7577143 13.4,28.16 12,28.5622857 C10.6,28.9645714 9.20000001,29.1657143 9,29.1657143 C7,29.568 5.19999998,30.1714285 3.80000001,30.976 C2.60000001,31.7805714 1.60000003,32.7862857 1,33.792 C0,35.6022857 0,40.9828571 0,41.3851428 L0,42.3908571 C0,43.1954286 0.800000015,44 1.8,44 L38.2,44 C39.2,44 40,43.1954286 40,42.1897143 L40,41.3851428 Z",id:"\\u8DEF\\u5F84"})))))))}const WA=s.forwardRef(NA);i.p;var jA;const BA=["title","titleId"];function HA(){return HA=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},HA.apply(null,arguments)}function zA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,BA);return s.createElement("svg",HA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u5973"):i?s.createElement("title",{id:n},i):null,jA||(jA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -230.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u5973",transform:"translate(792.000000, 230.000000)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"\\u5973",transform:"translate(9.000000, 13.000000)",fillRule:"nonzero"},s.createElement("path",{d:"M19.1219936,0 C26.9032378,0 28.9014356,5.58612362 28.7427755,11.9244473 C28.5841154,18.262771 25.3419303,30.1526079 25.3419303,30.1526079 L19.1334908,30.1526079 L19.1219936,0 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"}),s.createElement("path",{d:"M18.5011497,0 C10.7291032,0 8.7217078,5.58612362 8.88726615,11.9244473 C9.05282451,18.262771 12.2881114,30.1526079 12.2881114,30.1526079 L18.4965509,30.1526079 L18.5011497,0 Z",id:"\\u8DEF\\u5F84",fill:"#420E04"}),s.createElement("path",{d:"M14.2564166,26.7815518 C11.9891865,29.1996673 7.8778199,30.5010196 3.9780001,31.1309294 C0.0781803048,31.7608392 0,35.9948487 0,37.2177506 L0,43 L18.5011497,43 L18.5011497,26.7815518 L14.2564166,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#EAE9E8"}),s.createElement("path",{d:"M18.5011497,21.5807577 L14.1736374,21.5807577 L14.1736374,27.196877 C14.1736374,28.0298347 15.5532906,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#EAC1A4"}),s.createElement("path",{d:"M18.5011497,3.92251556 C12.1202536,3.92251556 11.1751911,8.53723974 11.1751911,14.2502683 C11.1751911,20.0948165 16.693804,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("path",{d:"M11.0372258,13.419618 C10.5888385,11.7352436 9.97489279,11.7352436 9.71505809,12.1621056 C9.45522339,12.5889676 10.351998,14.2387315 10.3749922,15.6000751 C10.3979864,16.9614187 10.7980859,17.1552372 11.294761,16.663769 C11.7914362,16.1723009 11.0372258,13.419618 11.0372258,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"14.247219 27.1368856 11.4603194 28.8327967 15.6199739 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#F4F2F2",points:"14.247219 26.7815518 11.4603194 28.8327967 15.6199739 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M22.7642782,26.7815518 C25.0338077,29.1996673 29.1451744,30.5010196 33.0426947,31.1309294 C36.940215,31.7608392 37,35.9948487 37,37.2177506 L37,43 L18.5011497,43 L18.5011497,26.7815518 L22.7642782,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#DDDCDB"}),s.createElement("path",{d:"M18.5011497,21.5807577 L22.8263626,21.5807577 L22.8263626,27.196877 C22.8263626,28.0298347 21.4467094,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#DDB597"}),s.createElement("path",{d:"M18.5011497,3.92251556 C24.8797464,3.92251556 25.8248089,8.53723974 25.8248089,14.2502683 C25.8248089,20.0948165 20.306196,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EDC19C"}),s.createElement("path",{d:"M25.9673731,13.419618 C26.4272575,11.7352436 27.0320055,11.7352436 27.2918402,12.1621056 C27.5516748,12.5889676 26.6526008,14.2387315 26.6296066,15.6000751 C26.6066124,16.9614187 26.206513,17.1552372 25.7098378,16.663769 C25.2131626,16.1723009 25.967373,13.4196179 25.9673731,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"22.752781 27.1368856 25.5396806 28.8327967 21.3800261 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#EFEEED",points:"22.752781 26.7815518 25.5396806 28.8327967 21.3800261 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M9.10801068,29.8549582 C7.43626653,30.4331409 5.71634854,30.860165 3.96880244,31.1309294 C0.0712820906,31.7608392 0,35.9948487 0,37.2177506 L0,43 L16.3373936,43 L9.10801068,29.848036 L9.10801068,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"9.10801068 29.8549582 7.32595862 30.4110324 7.10061524 34.8896222 10.4393761 36.7216678 10.4393761 42.9976927 16.3373936 42.9976927 9.10801068 29.8549582"}),s.createElement("path",{d:"M27.8942887,29.8549582 C29.5652485,30.433138 31.2844029,30.8601635 33.0311976,31.1309294 C36.940215,31.7608392 37,35.9902339 37,37.2177506 L37,43 L20.6741036,43 L27.9034864,29.848036 L27.8942887,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"27.8942887 29.8549582 29.6763408 30.4110324 29.8993848 34.8896222 26.5629234 36.7216678 26.5629234 42.9976927 20.6626064 42.9976927"}),s.createElement("path",{d:"M10.8072836,5.07619661 C9.67366851,9.80398152 11.1062085,14.2871861 11.267168,14.7163554 C11.267168,14.7163554 12.1248524,14.8524898 13.3366478,12.6581885 C14.9140514,9.79936683 16.8041763,8.32265508 18.4459636,7.55661088 L18.4459636,0 C14.334597,0 11.6005842,1.79974245 10.8072836,5.07619661 Z",id:"\\u8DEF\\u5F84",fill:"#471207"}),s.createElement("path",{d:"M25.6224598,14.7140481 C25.7742216,14.2871861 27.2067616,9.80398157 26.0823442,5.07388927 C25.2936424,1.80204979 22.5573302,0 18.4459636,0 L18.4459636,7.55661088 C19.5462153,7.03397245 20.7468113,6.75837793 21.9640793,6.74903414 C24.4014667,8.41494958 25.6155615,11.7513952 25.6224598,14.7140481 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"})))))))}const UA=s.forwardRef(zA);i.p;var VA;const GA=["title","titleId"];function qA(){return qA=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},qA.apply(null,arguments)}function XA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,GA);return s.createElement("svg",qA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u7537"):i?s.createElement("title",{id:n},i):null,VA||(VA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -166.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u7537",transform:"translate(792.000000, 166.000000)"},s.createElement("rect",{id:"Mask",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"Group-46",transform:"translate(7.671233, 12.041096)"},s.createElement("path",{d:"M20.3287113,17.7016171 L14.8261307,17.7016171 L14.8261307,21.8854179 L14.8261307,24.6737429 C14.8261307,25.7091313 16.5713146,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-2",fill:"#DDB597"}),s.createElement("path",{d:"M18.1163052,33.9077874 C18.1163052,33.9077874 16.9107652,32.9969521 15.601989,31.3099039 C14.2932128,29.6230745 12.4333964,25.9116559 12.4333964,25.9116559 C11.796773,26.003812 11.1961258,26.0999083 10.6276562,26.2001637 L19.059062,43.7260274 L20.3287336,43.7260274 L20.3287336,29.2137349 L18.1163052,33.9077874 Z",id:"Fill-4",fill:"#EFEEED"}),s.createElement("path",{d:"M12.4334858,31.7147341 L8.64391162,30.0953254 L10.2679829,26.2654829 C4.85701892,27.2599373 2.57978853,28.6396525 1.7219446,30.5000682 C0.757736068,32.592078 0,43.7258961 0,43.7258961 L18.0757257,43.7258961 L10.3430638,38.5075824 L12.4334858,31.7147341 Z",id:"Fill-6",fill:"#1D1D1D"}),s.createElement("path",{d:"M20.3287113,17.7016171 L25.8312918,17.7016171 L25.8312918,21.8854179 L25.8312918,24.6737429 C25.8312918,25.7091313 24.0861079,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-8",fill:"#D1AC93"}),s.createElement("path",{d:"M22.5412291,33.9077874 C22.5412291,33.9077874 23.7467691,32.9969521 25.0553218,31.3099039 C26.364098,29.6230745 28.2241379,25.9116559 28.2241379,25.9116559 C28.8607613,26.003812 29.4614085,26.0999083 30.0296546,26.2001637 L21.5984722,43.7260274 L20.3288006,43.7260274 L20.3288006,29.2137349 L22.5412291,33.9077874 Z",id:"Fill-10",fill:"#DDDCDB"}),s.createElement("path",{d:"M28.2240485,31.7147341 L32.0133992,30.0953254 L30.3895513,26.2654829 C35.8005153,27.2599373 38.0777457,28.6396525 38.9353662,30.5000682 C39.8997982,32.592078 40.6575342,43.7258961 40.6575342,43.7258961 L22.5815851,43.7258961 L30.314247,38.5075824 L28.2240485,31.7147341 Z",id:"Fill-12",fill:"#0F0F0F"}),s.createElement("path",{d:"M20.3287113,3.71115593 C14.1291744,3.71115593 13.2107742,8.10203448 13.2107742,13.5180132 C13.2107742,19.5112264 15.9664218,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-14",fill:"#EBCFB7"}),s.createElement("path",{d:"M20.3287113,3.71115593 C26.5282481,3.71115593 27.4466484,8.10203448 27.4466484,13.5180132 C27.4466484,19.5112264 24.6910007,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-16",fill:"#EFC7A6"}),s.createElement("path",{d:"M13.0715617,12.7308772 C12.6353774,11.1337961 12.0383055,11.1337961 11.7858013,11.5387578 C11.5330737,11.9435005 12.4056656,13.5180351 12.4286815,14.8001217 C12.4516974,16.0824272 12.8398388,16.2752765 13.3231721,15.80771 C13.8062819,15.3399246 13.0715617,12.7308772 13.0715617,12.7308772",id:"Fill-18",fill:"#EBCFB7"}),s.createElement("path",{d:"M27.5859726,12.7308772 C28.0221568,11.1337961 28.6192287,11.1337961 28.8717329,11.5387578 C29.1242371,11.9435005 28.2516452,13.5180351 28.2288528,14.8001217 C28.2058369,16.0824272 27.817472,16.2752765 27.3343622,15.80771 C26.8510289,15.3399246 27.5859726,12.7308772 27.5859726,12.7308772",id:"Fill-20",fill:"#EBCFB7"}),s.createElement("path",{d:"M12.3795884,25.9199302 C11.7632994,26.0094596 11.1796348,26.1029291 10.6277008,26.2001199 C10.5054709,26.2217908 10.3870398,26.2436806 10.2679382,26.2655705 L8.64386693,30.0951941 L12.4334411,31.7148217 L10.3430191,38.50767 L18.075681,43.7259836 L19.0591067,43.7259836 L12.3795884,25.9199302 Z",id:"Fill-22",fill:"#3A3939"}),s.createElement("path",{d:"M32.0133992,30.0952379 L30.3895513,26.2656142 C30.2834102,26.2459134 30.1768221,26.2264315 30.0686699,26.2071684 L30.0686699,26.2069495 C30.0628601,26.205855 30.0566033,26.2051983 30.0510169,26.2041039 C30.0438664,26.2027905 29.1706041,26.0423381 28.2939899,25.9223819 L21.6763687,43.5636049 L21.6765921,43.5633861 L21.5986063,43.7260274 L22.5815851,43.7260274 L30.314247,38.5077137 L28.2240485,31.7146466 L32.0133992,30.0952379 Z",id:"Fill-24",fill:"#2D2D2D"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C16.3335585,0 13.6766779,1.70762469 12.9146962,4.81335203 C11.8139567,9.29901349 13.0521211,13.3967874 13.2000483,13.8032813 C13.8612518,13.932869 14.0167765,11.6642083 14.0167765,9.24144327 C14.0167765,3.89113401 16.7697427,6.64640537 20.3287113,6.64640537",id:"Fill-26",fill:"#370B00"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C24.3238641,0 26.9807446,1.70762469 27.7427263,4.81335203 C28.8434659,9.29901349 27.605078,13.3967874 27.4573742,13.8032813 C26.7961707,13.932869 26.640646,11.6642083 26.640646,9.24144327 C26.640646,3.89113401 23.8876798,6.64640537 20.3287113,6.64640537",id:"Fill-28",fill:"#230600"}),s.createElement("polygon",{id:"Fill-30",fill:"#2A798C",points:"20.3287113 33.2162443 18.6501169 33.2162443 19.425506 43.7259836 20.3287113 43.7259836"}),s.createElement("polygon",{id:"Fill-32",fill:"#266C77",points:"21.23214 43.7259179 22.0073056 33.2161786 20.3287113 33.2161786 20.3287113 43.7259179"}),s.createElement("polygon",{id:"Fill-34",fill:"#3691AD",points:"18.2760532 31.4385503 19.1256293 33.2162224 20.3287113 33.2162224 20.3287113 28.9930199"}),s.createElement("polygon",{id:"Fill-36",fill:"#266C77",points:"22.3812799 31.4385503 20.3286219 28.9930199 20.3286219 33.2162224 21.5317039 33.2162224"}),s.createElement("path",{d:"M23.9005061,25.9844833 L25.8313812,24.1571213 C26.8119019,24.7194707 28.2241379,25.9115902 28.2241379,25.9115902 C28.2241379,25.9115902 26.4673343,29.8497873 25.1587815,31.6071019 C23.8497818,33.3639787 22.4846949,34.4026505 22.4846949,34.4026505 L20.3288006,29.2136692 L20.4320369,29.1004989 L23.9005061,25.9844833 Z",id:"Fill-38",fill:"#CCCCCC"}),s.createElement("path",{d:"M23.7972922,25.9115902 L25.8314035,24.1571213 C26.8119243,24.6969242 28.2241602,25.9115902 28.2241602,25.9115902 C28.2241602,25.9115902 26.3641204,29.6230088 25.0553442,31.3098382 C23.7465679,32.9968864 22.5412514,33.9077218 22.5412514,33.9077218 L20.328823,29.2136692 L20.328823,28.9034905 L23.7972922,25.9115902 Z",id:"Fill-40",fill:"#F4F2F2"}),s.createElement("path",{d:"M16.7568047,25.9844833 L14.826153,24.1571213 C13.8456323,24.7194707 12.4333964,25.9115902 12.4333964,25.9115902 C12.4333964,25.9115902 14.1899765,29.8497873 15.4987527,31.6071019 C16.807529,33.3639787 18.1726158,34.4026505 18.1726158,34.4026505 L20.3287336,29.2136692 L20.2252739,29.1004989 L16.7568047,25.9844833 Z",id:"Fill-42",fill:"#CCCCCC"}),s.createElement("path",{d:"M16.8601303,25.9115902 L14.826019,24.1571213 C13.8454982,24.6969242 12.4334858,25.9115902 12.4334858,25.9115902 C12.4334858,25.9115902 14.2933021,29.6230088 15.6020784,31.3098382 C16.9108546,32.9968864 18.1163946,33.9077218 18.1163946,33.9077218 L20.3285995,29.2136692 L20.3285995,28.9034905 L16.8601303,25.9115902 Z",id:"Fill-44",fill:"#FFFFFF"})))))))}const YA=s.forwardRef(XA);i.p;var KA=i(75087),QA=i.n(KA),ZA=i(38885),JA=(i(9056),i(74065)),$A=i.n(JA),tm=i(57469),em=i.n(tm),im=i(1582),nm=i.n(im),sm=i(80111),rm=i.n(sm);function am(){return am=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},am.apply(null,arguments)}function om(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const lm=["id","url","error","apis","loading","ttl","cacheName"],cm=["paramsType","paramsName"],hm=["data"],dm=t=>e=>{var i;const n=Object.assign({},{loading:null,ttl:6e6,cacheName:"file-cache"},e),{id:s,error:o,apis:c,loading:d,ttl:u,cacheName:p}=n,f=om(n,lm),{apis:g}=(0,a.usePreset)(),A=h()({},g,c);if(!s)return null;if(null==A||null==(i=A.file)||!i.getUrl)return console.warn("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570"),null;const m=Object.assign({paramsType:"params",paramsName:"id"},A.file.getUrl),{paramsType:v,paramsName:b}=m,w=om(m,cm),y={},_=s.split("?")[0];return y[v]={[b]:_},r().createElement(l(),am({},Object.assign({},w,y),{updateType:"refresh",error:o,loading:d,cache:p,ttl:u,render:e=>{let{data:i}=e,n=om(e,hm);return r().createElement(t,am({},f,{id:_,data:i,fetchApi:n}))}}))},um=["data","children"],pm=dm(t=>{let{data:e,children:i}=t;return i(am({url:e},om(t,um)))}),fm=(t,e)=>{const i=document.createElement("a"),n=new MouseEvent("click");i.download=e,i.href=t,i.dispatchEvent(n)},gm=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",i=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error((null==i?void 0:i.notFoundFile)||"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f");if("string"===typeof t&&/blob:http(s)?:/.test(t))return void fm(t,e);if("[object Blob]"===Object.prototype.toString.call(t)){const i=new Blob([t],{type:t.type});return void fm(URL.createObjectURL(i),e)}const n=(0,o.getAjax)(),{data:s,headers:r}=await n({url:t,responseType:"blob"}),a=null==r?void 0:r["content-disposition"];if(a){const t=a.match(/filename\*?=(?:UTF-8'')?([^;]+)/i);if(t&&t[1])e=decodeURIComponent(t[1].replace(/['"]/g,""));else{const t=a.match(/filename="?([^"]+)"?/i);t&&(e=t[1])}}fm(URL.createObjectURL(new Blob([s],{type:null==s?void 0:s.type})),e)},Am=t=>{let{url:e,staticUrl:i}=t;return/^(blob:)?https?:\/\//.test(e)?e:i+e},mm=t=>{let{url:e,staticUrl:i}=t;var n;const{apis:s}=(0,a.usePreset)(),r=i||(null==(n=s.file)?void 0:n.staticUrl)||"";return Am({staticUrl:r,url:e})},vm=["paramsType","paramsName"],bm=["isLoading","data","error","refresh"],wm=t=>{let{id:e,src:i,filename:n,staticUrl:r,apis:l,onError:c,onSuccess:h}=t;var u,p;const{message:f}=d.App.useApp(),{apis:g}=(0,a.usePreset)(),A=Object.assign({},g,l),m=r||(null==(u=A.file)?void 0:u.staticUrl)||"",[v,b]=(0,s.useState)(!1),w=Object.assign({paramsType:"params",paramsName:"id"},null==(p=A.file)?void 0:p.getUrl),{paramsType:y,paramsName:_}=w,x=om(w,vm),E={};E[y]={[_]:e};const C=(0,o.useFetch)(Object.assign({},x,E,{auto:!1})),{isLoading:S,data:M,error:L,refresh:T}=C,R=om(C,bm),P=k()(c||f.error),F=k()(h),I=k()(t=>gm(Am({staticUrl:m,url:t}),n).then(F).catch(t=>{P(t.message)}));return(0,s.useEffect)(()=>{S||(L?P(L):M&&(b(!0),I(M).then(()=>{b(!1)})))},[S,L,M,P]),am({},R,{isLoading:S||v,download:()=>i?I(i):T(e?E:{})})},ym={unnamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",fileUpload:"\u4e0a\u4f20\u6587\u4ef6",uploadTips:"\u652f\u6301\u6269\u5c55\u540d{accept}\uff0c\u5355\u4e2a\u6587\u4ef6\u5927\u5c0f\u4e0d\u8d85\u8fc7{fileSize}M\uff0c\u6700\u591a\u4e0a\u4f20{maxLength}\u4e2a\u9644\u4ef6",maxLengthError:"\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf{maxLength}",fileSizeError:"\u6587\u4ef6{filename}\u4e0d\u80fd\u8d85\u8fc7{fileSize}MB!",uploadError:"\u6587\u4ef6{filename}\u4e0a\u4f20\u9519\u8bef{error}",uploadAnomaly:"\u6587\u4ef6{filename}\u4e0a\u4f20\u5f02\u5e38{error}",fileLoadedError:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25",fileNotFoundError:"\u672a\u6307\u5b9a\u6587\u4ef6",pageNotFoundError:"\u672a\u6307\u5b9a\u9875\u9762",unSupportFileType:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",unSupportFileTypeDescription:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8",uploading:"\u6b63\u5728\u4e0a\u4f20",unNamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",notFoundFile:"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f",downloadSuccess:"\u4e0b\u8f7d\u6210\u529f",pleaseSetApi:"\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570",filePreview:"\u6587\u4ef6\u9884\u89c8"},_m=["id","src","filename","api","onSuccess","onError","onClick"],xm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=Object.assign({},{filename:e({id:"unnamedDownloadFile"})},t),{id:n,src:s,filename:a,api:o,onSuccess:l,onError:c,onClick:h}=i,p=om(i,_m),{isLoading:f,download:g}=wm({id:n,src:s,filename:a,api:o,onError:c,onSuccess:l});return r().createElement(d.Button,am({icon:r().createElement(u.A,null)},M()(p,["locale"]),{loading:f,onClick:function(){h&&h(...arguments),g()}}))});xm.useDownload=wm,xm.download=fm,xm.downloadBlobFile=gm;var Em="_Cmp6z",Cm="_lmC4r",km="_-jyU7",Sm="_lN9hC",Mm="_yaqrz",Lm="_SXsiw",Tm="_15U-a",Rm="_tpRpL";const Pm=["className","url","maxWidth","ignoreContent"],Fm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{data:e,apis:i,contentWindowUrl:n}=t;var o;const l=(0,s.useRef)(null),{apis:c}=(0,a.usePreset)(),{formatMessage:h}=(0,L.useIntl)(),d=Object.assign({},c,i),u=n||(null==(o=d.file)?void 0:o.contentWindowUrl)||"https://cdn.jsdelivr.net/npm/@kne/iframe-resizer@0.1.3/dist/contentWindow.js";return(0,s.useEffect)(()=>{const t=(new DOMParser).parseFromString(e,"text/html");t.querySelectorAll("script").forEach(t=>{t.parentElement.removeChild(t)});const i=document.createElement("script");i.src=u,t.head.appendChild(i);const n=document.createElement("style");n.innerText="html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}",t.head.appendChild(n),l.current.srcdoc=t.documentElement.outerHTML},[e]),(0,s.useEffect)(()=>{ut({checkOrigin:!1},l.current)},[]),r().createElement("iframe",{title:h({id:"filePreview"}),frameBorder:"0",width:"100%",ref:l})}),Im=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=Object.assign({},t),{className:n,url:s,maxWidth:a,ignoreContent:o}=i,c=om(i,Pm),h=r().createElement("iframe",{title:e({id:"filePreview"}),src:s,width:"100%",className:Rm});return r().createElement("div",{className:ft()(n,Em),style:{maxWidth:a}},o?h:r().createElement(l(),{url:s,transformResponse:t=>{let{data:e}=t;return{data:{code:200,results:e}}},showError:!1,error:h,render:t=>{let{data:e}=t;return r().createElement(Fm,am({},c,{url:s,data:e}))}}))}),Dm=["url","filename","type"],Om=t=>{var e;let{url:i,filename:n,type:s}=t,o=om(t,Dm);const{apis:l}=(0,a.usePreset)(),c=Object.assign({},l,o.apis),h=mm({staticUrl:o.staticUrl||(null==(e=c.file)?void 0:e.staticUrl),url:i}),d=s&&Km[s]||Qm(n||h);return r().createElement(d,am({},o,{url:h}))},Nm=["url","apis","className"],Wm=t=>{var e;let{url:i,apis:n,className:s}=t,o=om(t,Nm);const{apis:c}=(0,a.usePreset)(),h=Object.assign({},c,n);return r().createElement(l(),am({},(null==(e=h.file)?void 0:e.previewOffice)||{loader:async()=>({data:[{url:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(encodeURIComponent(i)),type:"html"}]})},{render:t=>{let{data:e}=t;const{data:i}=e;return i.map(t=>{let{url:e,type:i}=t;return r().createElement(Om,am({},o,{type:i,ignoreContent:!0,url:e,className:s,key:e}))})}}))},jm=(0,s.memo)((0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{var e;const{formatMessage:i}=(0,L.useIntl)(),{url:n,apis:o,maxWidth:l,scale:c,rotate:h,className:u,pdfjsUrl:p}=Object.assign({},{autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200},t),[f,g]=(0,s.useState)(0),{apis:A}=(0,a.usePreset)(),m=Object.assign({},A,o),v=p||(null==(e=m.file)?void 0:e.pdfjsUrl)||"https://cdn.jsdelivr.net/npm/pdfjs-dist@4.4.168";bg.workerSrc=v+"/build/pdf.worker.min.mjs";const b=(0,s.useMemo)(()=>({file:n,options:{standardFontDataUrl:v+"/standard_fonts/",cMapUrl:v+"/cmaps/",cMapPacked:!0}}),[v,n]),[w,y]=(0,s.useState)(l),_=(0,CA.A)(()=>{_.current&&_.current.clientWidth&&y(Math.min(_.current.clientWidth,l))});return r().createElement("div",{ref:_,className:ft()(u,Em),style:{maxWidth:l}},r().createElement(nA,am({},b,{error:i({id:"fileLoadedError"}),loading:r().createElement("div",{className:Cm},r().createElement(d.Spin,null)),noData:i({id:"fileNotFoundError"}),onLoadSuccess:t=>{let{numPages:e}=t;g(e)}}),r().createElement(d.Flex,{vertical:!0,gap:8},f>=1&&Array.from(new Array(f),(t,e)=>r().createElement(xA,{key:"page_".concat(e),className:"preview-item",scale:c/100,rotate:h,pageNumber:e+1,width:w,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:i({id:"pageNotFoundError"})})))))})),Bm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{url:e,className:i,maxWidth:n}=t;const{formatMessage:a}=(0,L.useIntl)(),[l,c]=(0,s.useState)(""),[h,u]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(0,o.getAjax)()({url:e,method:"GET"}).then(t=>{let{data:e}=t;c(e),u(!1)},()=>{u(!1),f(!0)})},[e]),r().createElement("div",{className:ft()(i,Em),style:{maxWidth:n}},h?r().createElement("div",{className:Cm},r().createElement(d.Spin,null)):null,r().createElement("div",{className:km},p?r().createElement("div",{className:Sm},a({id:"fileLoadedError"})):r().createElement("div",{className:Mm},l)))}),Hm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{maxWidth:e}=t;const{formatMessage:i}=(0,L.useIntl)();return r().createElement("div",{className:Em,style:{maxWidth:e}},r().createElement("div",{className:km},r().createElement(d.Result,{status:"500",title:i({id:"unSupportFileType"}),subTitle:i({id:"unSupportFileTypeDescription"})})))}),zm=["url","scale","rotate","className","maxWidth","origin"],Um=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{url:e,scale:i,rotate:n,className:a,maxWidth:o,origin:l}=t,c=om(t,zm);const[h,u]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!1),{formatMessage:g}=(0,L.useIntl)();return(0,s.useEffect)(()=>{const t=new Image;t.src=e;const i=()=>{u(!1)},n=()=>{u(!1),f(!0)};return t.addEventListener("load",i),t.addEventListener("error",n),()=>{t.removeEventListener("load",i),t.removeEventListener("error",n)}},[e,i,n]),l?r().createElement("img",am({alt:g({id:"filePreview"})},c,{className:a,src:e})):r().createElement("div",{className:ft()(a,Em),style:{maxWidth:o}},h?r().createElement("div",{className:Cm},r().createElement(d.Spin,null)):null,p?r().createElement("div",{className:Sm},g({id:"fileLoadedError"})):r().createElement("img",am({alt:g({id:"filePreview"})},c,{src:e})))}),Vm=["url","maxWidth"],Gm=t=>{let{url:e,maxWidth:i}=t,n=om(t,Vm);return r().createElement("div",{className:Em,style:{maxWidth:i}},r().createElement("div",{className:Lm},r().createElement("audio",am({},n,{src:e,controls:!0}))))},qm=["url","maxWidth","origin","controls","getElement"],Xm=t=>{let{url:e,maxWidth:i,origin:n,controls:a=!0,getElement:o}=t,l=om(t,qm);const c=(0,s.useRef)(null),h=k()(o);return(0,s.useEffect)(()=>{h(c.current)},[h]),n?r().createElement("video",am({controls:a},l,{src:e,ref:c})):r().createElement("div",{className:Em,style:{maxWidth:i}},r().createElement("div",{className:Tm},r().createElement("video",am({controls:a},l,{src:e,ref:c}))))},Ym=t=>{const e=(t||"").split("?")[0].toLowerCase();return/.txt$/.test(e)?"txt":/.pdf$/.test(e)?"pdf":/.(png|jpg|jpeg)$/.test(e)?"image":/.(html|htm)$/.test(e)?"html":/.(doc|docx|xls|xlsx|ppt|pptx|csv)$/.test(e)?"office":/.(mp3|wav|ogg|aac)$/.test(e)?"audio":/.(mp4|avi|mov|mkv|flv)$/.test(e)?"video":"unknown"},Km={txt:Bm,pdf:jm,image:Um,html:Im,office:Wm,audio:Gm,video:Xm,unknown:Hm},Qm=t=>Km[Ym(t)],Zm=["data","id","staticUrl","className","fetchApi","filename","render"],Jm=dm(t=>{let{data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,render:l}=t,c=om(t,Zm);const h=mm({staticUrl:n,url:e}),d=e&&Qm(e)||o&&Qm(o);return"function"===typeof l?l({data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,url:h,component:d}):r().createElement(d,am({},c,{className:s,url:h}))}),$m=["id","src","originName","filename"],tv=t=>{let{id:e,src:i,originName:n,filename:s}=t,a=om(t,$m);return i?r().createElement(Om,am({},a,{url:i,filename:s||n})):r().createElement(Jm,am({},a,{id:e,filename:s||n}))},ev=["content","onSuccess","onError","printProps","contentRef"],iv=t=>{let{onSuccess:e,onError:i,printProps:n,contentRef:a}=t,o=om(t,ev);const[l,c]=(0,s.useState)(!1),h=(0,kA.useReactToPrint)(am({contentRef:a,bodyClass:document.body.getAttribute("class"),onBeforePrint:async()=>{c(!0)},onPrintError:function(){c(!1),i&&i(...arguments)},onAfterPrint:function(){c(!1),e&&e(...arguments)}},n));return r().createElement(d.Button,am({},o,{onClick:()=>{c(!0),h()},loading:l}))};var nv=".file-modal-outer {\n min-height: 100px;\n}\n\n.file-title {\n margin-right: 30px;\n}\n\n.ellipse {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n word-break: break-all;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLm1vZHVsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLGdCQUFnQjtFQUNoQix1QkFBdUI7RUFDdkIsb0JBQW9CO0VBQ3BCLHFCQUFxQjtFQUNyQiw0QkFBNEI7RUFDNUIscUJBQXFCO0FBQ3ZCIiwiZmlsZSI6InN0eWxlLm1vZHVsZXMuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5maWxlLW1vZGFsLW91dGVyIHtcbiAgbWluLWhlaWdodDogMTAwcHg7XG59XG5cbi5maWxlLXRpdGxlIHtcbiAgbWFyZ2luLXJpZ2h0OiAzMHB4O1xufVxuXG4uZWxsaXBzZSB7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgLXdlYmtpdC1saW5lLWNsYW1wOiAxO1xuICAtd2Via2l0LWJveC1vcmllbnQ6IHZlcnRpY2FsO1xuICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XG59Il19 */";const sv=["title","filename","originName","openDownload","openPrint","id","src","apis"],rv=["renderModal"],av=(0,L.createIntlProvider)("zh-CN",ym,"react-file"),ov=t=>{const e=Object.assign({},{footer:null,openDownload:!1,openPrint:!1},t),{title:i,filename:n,originName:a,openDownload:o,openPrint:l,id:c,src:h,apis:u}=e,p=om(e,sv),[f,g]=MA()(p,{value:"open",default:"defaultOpen",onChange:"onOpenChange"}),{message:m}=d.App.useApp(),v=(0,s.useRef)();return am({},p,{open:f,onOpenChange:g,onCancel:()=>{g(!1)},title:r().createElement(d.Space,{size:10,className:nv["file-title"]},r().createElement("span",{className:nv.ellipse},i||n||a),r().createElement("span",null,o&&r().createElement(av,null,t=>{let{formatMessage:e}=t;return r().createElement(xm,{className:"btn-no-padding",type:"link",id:c,src:h,apis:u,filename:n||a,onSuccess:()=>{m.success(e({id:"downloadSuccess"}))}})}),l&&["txt","pdf","image","html"].indexOf(Ym(n||a))>-1&&r().createElement(iv,{contentRef:v,type:"link",icon:r().createElement(A,null)}))),children:r().createElement("div",{ref:v,className:nv["file-modal-outer"]},r().createElement(tv,{id:c,src:h,filename:n||a,apis:u}))})},lv=t=>{const e=Object.assign({},{renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{renderModal:i}=e,n=om(e,rv),s=ov(n);return Object.assign({},s,{renderModal:t=>i(Object.assign({},s,t))})},cv=t=>{const{renderModal:e}=lv(t);return e()},hv=["filename","originName","id","src","title","modalProps","openDownload","openPrint","children"],dv=t=>{const[e,i]=(0,s.useState)(!1),n=Object.assign({},{icon:r().createElement(v,null)},t),{filename:a,originName:o,id:l,src:c,title:h,modalProps:u,openDownload:p,openPrint:f,children:g}=n,A=om(n,hv),m=Object.assign({},u,{filename:a||o,id:l,src:c,title:h,open:e,openPrint:f,openDownload:p,onCancel:()=>{i(!1)}});return r().createElement(r().Fragment,null,r().createElement(d.Button,am({},A,{onClick:()=>{i(!0)}}),"function"===typeof g?g(a||o):g||a||o),r().createElement(cv,am({},m,{open:e,onOpenChange:i})))},uv=t=>{let{params:e}=t;const{data:i}=e;return new Promise((t,e)=>{const n=new window.Image;n.src=i,n.addEventListener("load",()=>{t(i)}),n.addEventListener("error",t=>{e(t)})})};var pv="_H1zfc",fv="_BAe2W",gv="_9kK1I",Av="_Wwi2N";const mv=["id","src","alt","onClick","loading","error","className","apis","staticUrl"],vv=["id","src","alt","gender","loading","error","className","gap","icon","children","shape","size","width","height","defaultAvatar","apis","staticUrl"],bv=r().createElement(d.Skeleton.Avatar,{shape:"square",active:!0}),wv=r().createElement(PA,null),yv=r().createElement(WA,null),_v=r().createElement(UA,null),xv=r().createElement(YA,null),Ev=t=>{let{data:e,className:i,alt:n,innerLoading:s,loading:o,error:c,innerError:h,children:d,onClick:u,staticUrl:p}=t;var f;const{apis:g}=(0,a.usePreset)(),A=Object.assign({},g),m=mm({staticUrl:p||(null==(f=A.file)?void 0:f.staticUrl),url:e});return r().createElement(l(),{loader:uv,params:{data:m},error:h||c,loading:s||o,render:t=>{let{data:e}=t;return"function"===typeof d?d({alt:n,className:ft()(i,fv),src:e}):r().createElement("img",{alt:n,className:ft()(i,fv),src:e,onClick:u})}})},Cv=dm(Ev),kv=t=>{let{loading:e,error:i,src:n,id:s,alt:a,className:o,children:l,apis:c,onClick:h,staticUrl:d}=t;const u=(t,e)=>{const i=t.type;return!i&&t.render?t.render(Object.assign({},t.props,e)):r().createElement(i,Object.assign({},t.props,e))},p=e&&u(e,{className:gv}),f=i&&u(i,{className:Av});return n?r().createElement(Ev,{alt:a,className:o,staticUrl:d,data:n,loading:p,error:f,onClick:h},l):s?r().createElement(Cv,{alt:a,className:o,id:s,loading:p,innerLoading:p,error:f,innerError:f,apis:c,onClick:h},l):f},Sv=t=>{const e=Object.assign({},{loading:bv,error:wv},t),{id:i,src:n,alt:s,onClick:a,loading:o,error:l,className:c,apis:h,staticUrl:d}=e,u=om(e,mv);return r().createElement("div",am({},u,{className:ft()(c,pv)}),kv({loading:o,error:l,src:n,id:i,alt:s,className:c,apis:h,onClick:a,staticUrl:d}))};Sv.Avatar=t=>{const e=Object.assign({},{size:100,defaultAvatar:yv,error:wv,shape:"circle"},t),{id:i,src:n,alt:s,gender:a,loading:o,error:l,className:c,gap:h,icon:u,children:p,shape:f,size:g,width:A,height:m,defaultAvatar:v,apis:b,staticUrl:w}=e,y=om(e,vv),_=(()=>{const t=A&&m?{style:{width:A,height:m}}:{size:g};let e=f;if(A&&A!==m&&(e="square"),i||n)return kv({loading:o||r().createElement(d.Skeleton.Avatar,{shape:e,active:!0}),staticUrl:w,error:l,src:n,defaultAvatar:v,id:i,alt:s,className:c,apis:b,children:i=>r().createElement(d.Avatar,am({},i,{gap:h,shape:e},t))});if(a){const i=["F","female","f"].indexOf(a)>-1?_v:["M","male","m"].indexOf(a)>-1?xv:yv;return r().createElement(d.Avatar,am({},y,{src:i,gap:h,shape:e},t))}return r().createElement(d.Avatar,am({},y,{gap:h,icon:u,shape:e,size:g,src:v},t),p)})();return r().createElement("div",am({},y,{className:ft()(c,pv),style:{width:A&&m?A:g,height:A&&m?m:g}}),_)};const Mv=t=>{const{item:e,hasPreview:i,getPermission:n,apis:s,onEdit:a,onDelete:o,onPreview:l,renderModal:c}=Object.assign({},{hasPreview:!0,apis:{},getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{filename:h,id:u,src:p}=e,{onOpenChange:f,renderModal:g}=lv({apis:s,id:u,src:p,filename:h,renderModal:c});return r().createElement(d.Flex,{justify:"end"},i&&n("preview",e)&&r().createElement(r().Fragment,null,r().createElement(d.Button,{type:"text",icon:r().createElement(b.A,null),onClick:()=>{l?l(e):f(!0)}}),g()),n("edit",e)&&r().createElement(ZA.LoadingButton,{type:"text",icon:r().createElement(w.A,null),onClick:()=>a&&a(e)}),n("download",e)&&r().createElement(xm,{type:"text",id:u,src:p,filename:h}),n("delete",e)&&r().createElement(ZA.ConfirmButton,{type:"text",icon:r().createElement(y.A,null),onClick:()=>o&&o(e)}))};var Lv="_yRMtw",Tv="_OivOI",Rv="_doPR9",Pv="_bLeUP",Fv="_mZdoa";const Iv=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),{className:i,dataSource:n,getPermission:s,infoItemRenders:a,onDelete:o,onEdit:l,apis:c,renderModal:h}=Object.assign({},{infoItemRenders:[t=>t.userName?r().createElement(d.Typography.Text,null,t.userName):null,t=>t.date?r().createElement(d.Typography.Text,null,em()(t.date).format("YYYY-MM-DD HH:mm:ss")):null],getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t);return r().createElement(d.List,{className:i,dataSource:n.map((t,e)=>(t.index=e,t)),rowKey:t=>"item_".concat(t.uuid&&"uuid_".concat(t.uuid)||t.id&&"id_".concat(t.id)||t.src&&"src_".concat(t.src)),renderItem:t=>{const{type:i,filename:n}=t;return r().createElement(d.List.Item,{className:Lv},r().createElement(d.Row,{justify:"space-between",wrap:!1,className:Tv},r().createElement(d.Col,{flex:1},r().createElement("div",{className:Rv}),r().createElement(d.Space,{className:"is-block",align:"start",size:4},r().createElement(QA(),{type:$A()(null==n?void 0:n.split(".")),size:14}),n||"")),a&&a.map((e,n)=>r().createElement(d.Col,{span:e.span||4,key:n},"uploading"!==i&&("function"===typeof e?e:e.render)(t),r().createElement("div",{className:Rv}))),r().createElement(d.Col,{className:Fv},"uploading"!==i?r().createElement(Mv,{getPermission:s,item:t,apis:c,onDelete:o,renderModal:h,onEdit:l}):r().createElement(d.Space,{className:Pv},r().createElement(d.Spin,{size:"small"}),r().createElement(d.Typography.Link,null,e({id:"uploading"}))))))},bordered:!0})}),Dv=t=>{const{locale:e}=(0,a.useContext)(),{formatMessage:i}=(0,L.createIntl)({locale:e,namespace:"react-file"}),{multiple:n,fileSize:r,maxLength:o,value:l,concurrentCount:c,onAdd:h,onError:u,onSave:p,onChange:f,onUpload:g}=Object.assign({},{concurrentCount:1,value:[]},t),{apis:A}=(0,a.usePreset)(),{message:m}=d.App.useApp(),[v,b]=(0,s.useState)([]),w=(0,s.useRef)(c),y=(0,s.useMemo)(()=>nm()(w.current),[]),_=k()(async t=>{const e=o-l.length;1!==o&&!0===n&&t.length>e?m.error(i({id:"maxLengthError"},{maxLength:o})):await Promise.allSettled(t.map(async t=>{if(t.size>1024*r*1024)return void m.error(i({id:"fileSizeError"},{filename:t.name,fileSize:r}));const e=rm()(),s=n=>{const s=n.message||i({id:"uploadError"},{filename:t.name,error:n.message?":"+n.message:""});m.error(s),u&&u({file:t,error:n,errMsg:s}),b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i})};try{var a;b(1===o||!0!==n?[{uuid:e,type:"uploading",filename:t.name}]:i=>{const n=i.slice(0);return n.unshift({uuid:e,type:"uploading",filename:t.name}),n}),h&&await Promise.resolve(h(t));const r=g||(null==(a=A.file)?void 0:a.upload),{data:l}=await y(()=>r({file:t}));if(0!==l.code)return void s(new Error(i({id:"uploadError"},{filename:t.name,error:l.msg?":"+l.msg:""})));const c=p?await Promise.resolve(p(l,t,e)):Object.assign({},l.data,{filename:l.data.filename||l.data.originName||t.name,id:l.data.id,uuid:e});b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i}),f(1===o||!0!==n?[c]:t=>{const e=(t||[]).slice(0);return e.push(c),e})}catch(l){s(l)}}))});return{fileList:v,onFileSelected:_}};var Ov="_-hhpT",Nv="_FyygJ",Wv="_hBEXs",jv="_BMSEY";const Bv=[".pdf",".jpg",".png",".jpeg",".doc",".docx",".xls",".xlsx",".html",".msg",".eml",".zip"],Hv=["children","className","buttonText","accept","multiple","onChange"],zv=["children"],Uv=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=(0,s.useRef)(null),n=Object.assign({},{accept:Bv,buttonText:e({id:"fileUpload"}),children:t=>{let{children:e}=t,i=om(t,zv);return r().createElement(d.Button,am({icon:r().createElement(x,null)},i),l,e)}},t),{children:a,className:o,buttonText:l,accept:c,multiple:h,onChange:u}=n,p=om(n,Hv);return a(am({},p,{className:ft()(o,Ov),children:!p.disabled&&r().createElement("input",{ref:i,type:"file",accept:c,multiple:h,className:Nv,onChange:t=>{const e=[].slice.call(t.target.files,0);0!==e.length&&(i.current.setAttribute("type","text"),i.current.setAttribute("type","file"),u(e))}})}))}),Vv=["className","fileSize","maxLength","multiple","size","accept","children","renderTips","showUploadList","onSave","ossUpload","getPermission","concurrentCount","apis","renderModal"],Gv=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=Object.assign({},{defaultValue:[],accept:Bv,renderTips:t=>t,children:e({id:"fileUpload"}),multiple:!0,showUploadList:!0,maxLength:10,fileSize:30,concurrentCount:10,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{className:n,fileSize:s,maxLength:a,multiple:o,size:l,accept:c,children:h,renderTips:u,showUploadList:p,onSave:f,ossUpload:g,getPermission:A,concurrentCount:m,apis:v,renderModal:b}=i,w=om(i,Vv),[y,_]=MA()(w),x=y||[],{fileList:E,onFileSelected:C}=Dv({multiple:o,onSave:f,ossUpload:g,fileSize:s,maxLength:a,value:x,onChange:_,concurrentCount:m});c.map(t=>t.replace(/^\./,"")).join("\u3001");const k=[...x,...E],S=u(e({id:"uploadTips"},{fileSize:s,maxLength:a,accept:c.map(t=>t.replace(/^\./,"")).join(",")}),{fileSize:s,maxLength:a,accept:c});return r().createElement(d.Flex,{vertical:!0,gap:8},r().createElement(d.Flex,{gap:8},r().createElement(Uv,am({},M()(w,["value","onChange"]),{size:l,multiple:o,accept:c,className:n,buttonText:h,onChange:C})),S&&r().createElement("div",{className:jv},S)),p&&k.length>0&&r().createElement(Iv,{className:Wv,dataSource:k,infoItemRenders:[],getPermission:A||(t=>["delete","preview"].indexOf(t)>-1),onDelete:t=>{const e=x.slice(0),i=e.indexOf(t);i>-1&&e.splice(i,1),_(e)},apis:v,renderModal:b}))}),qv=(t,e)=>{if(t&&e){const i=Array.isArray(e)?e:e.split(","),n=t.name||"",s=(t.type||"").toLowerCase(),r=s.replace(/\/.*$/,"");return i.some(t=>{const e=t.trim().toLowerCase();return"."===e.charAt(0)?n.toLowerCase().endsWith(e):e.endsWith("/*")?r===e.replace(/\/.*$/,""):s===e})}return!0}},33279:t=>{t.exports=function(t){return t}},34552:(t,e,i)=>{var n=i(9812),s=Object.prototype,r=s.hasOwnProperty,a=s.toString,o=n?n.toStringTag:void 0;t.exports=function(t){var e=r.call(t,o),i=t[o];try{t[o]=void 0;var n=!0}catch(l){}var s=a.call(t);return n&&(e?t[o]=i:delete t[o]),s}},34677:(t,e,i)=>{var n=i(23253),s=i(84570)(function(t,e,i){n(t,e,i)});t.exports=s},35324:(t,e,i)=>{var n=i(54052),s=i(62597),r=i(14079),a=i(41069);t.exports=function(t,e){return n(t)?t:s(t,e)?[t]:r(a(t))}},35428:(t,e,i)=>{var n=i(16913),s=i(56173),r=i(22761),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return r(t)&&s(t.length)&&!!a[n(t)]}},36140:t=>{var e=Object.prototype;t.exports=function(t){var i=t&&t.constructor;return t===("function"==typeof i&&i.prototype||e)}},36954:(t,e,i)=>{var n=i(11629),s=i(37857),r=i(46686),a=i(96996),o=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,h=l.toString,d=c.hasOwnProperty,u=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!r(t)||s(t))&&(n(t)?u:o).test(a(t))}},37105:(t,e,i)=>{var n="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;t.exports=n},37159:(t,e,i)=>{var n=i(12622);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},37857:(t,e,i)=>{var n=i(13440),s=function(){var t=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!s&&s in t}},38268:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t){var i=t.length,n=new t.constructor(i);return i&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}},38458:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(26562);function s(t,e){return t.get((0,n.A)(t,e))}},38541:(t,e,i)=>{var n=i(9812),s=i(50149),r=i(54052),a=i(19841),o=n?n.prototype:void 0,l=o?o.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(r(e))return s(e,t)+"";if(a(e))return l?l.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}},38710:(t,e,i)=>{var n=i(61516);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}},39790:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(8195);function s(t,e){(0,n.A)(t,e),e.add(t)}},40801:(t,e,i)=>{var n=i(61141),s=i(46686),r=i(19841),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=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)?c(t.slice(2),i?2:8):a.test(t)?NaN:+t}},41069:(t,e,i)=>{var n=i(38541);t.exports=function(t){return null==t?"":n(t)}},43516:t=>{t.exports=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}},44353:(t,e,i)=>{t=i.nmd(t);var n=i(56552),s=e&&!e.nodeType&&e,r=s&&t&&!t.nodeType&&t,a=r&&r.exports===s?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var i=t.length,n=o?o(i):new t.constructor(i);return t.copy(n),n}},44543:(t,e,i)=>{t=i.nmd(t);var n=i(56552),s=i(60014),r=e&&!e.nodeType&&e,a=r&&t&&!t.nodeType&&t,o=a&&a.exports===r?n.Buffer:void 0,l=(o?o.isBuffer:void 0)||s;t.exports=l},45921:(t,e,i)=>{var n=i(20449),s=i(47574),r=i(56832),a=r&&r.isSet,o=a?s(a):n;t.exports=o},46350:(t,e,i)=>{var n=i(28325),s=i(86578)(n);t.exports=s},46686:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},47251:(t,e,i)=>{var n=i(98724),s=i(97160),r=i(85204);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(r||s),string:new n}}},47574:t=>{t.exports=function(t){return function(e){return t(e)}}},48734:(t,e,i)=>{var n=i(95575),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:s.call(e,t)}},48895:t=>{t.exports=function(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t}},49134:(t,e,i)=>{"use strict";function n(t){var e;return null===t||void 0===t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}function s(t){return function(t){return n(t)instanceof ShadowRoot}(t)?n(t):null}i.d(e,{j:()=>s})},50149:t=>{t.exports=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}},51104:(t,e,i)=>{var n=i(96614),s=i(28673);t.exports=function(t,e){return t&&n(e,s(e),t)}},51153:(t,e,i)=>{"use strict";var n=i(73884),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 c(t,e,i){var n,r={},c=null,h=null;for(n in void 0!==i&&(c=""+i),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(h=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:c,ref:h,props:r,_owner:o.current}}e.Fragment=r,e.jsx=c,e.jsxs=c},51268:(t,e,i)=>{var n=i(35428),s=i(47574),r=i(56832),a=r&&r.isTypedArray,o=a?s(a):n;t.exports=o},51946:(t,e,i)=>{var n=i(61340);t.exports=function(t){return n(this.__data__,t)>-1}},52969:(t,e,i)=>{var n=i(35324),s=i(70914);t.exports=function(t,e){for(var i=0,r=(e=n(e,t)).length;null!=t&&i<r;)t=t[s(e[i++])];return i&&i==r?t:void 0}},53737:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}},53871:t=>{t.exports=function(t,e,i){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(s);++n<s;)r[n]=t[n+e];return r}},53986:(t,e,i)=>{"use strict";function n(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}i.d(e,{A:()=>n})},54052:t=>{var e=Array.isArray;t.exports=e},55119:(t,e,i)=>{var n=i(96614),s=i(30474);t.exports=function(t,e){return t&&n(e,s(e),t)}},55149:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(8195);function s(t,e,i){(0,n.A)(t,e),e.set(t,i)}},55636:(t,e,i)=>{var n=i(31170),s=Math.max;t.exports=function(t,e,i){return e=s(void 0===e?t.length-1:e,0),function(){for(var r=arguments,a=-1,o=s(r.length-e,0),l=Array(o);++a<o;)l[a]=r[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=r[a];return c[e]=i(l),n(t,this,c)}}},55647:(t,e,i)=>{var n=i(33279),s=i(55636),r=i(46350);t.exports=function(t,e){return r(s(t,e,n),t+"")}},55906:t=>{t.exports=function(t){return function(e,i,n){for(var s=-1,r=Object(e),a=n(e),o=a.length;o--;){var l=a[t?o:++s];if(!1===i(r[l],l,r))break}return e}}},56173:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},56326:(t,e,i)=>{var n=i(48895),s=i(85990),r=i(69621),a=i(57828),o=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,r(t)),t=s(t);return e}:a;t.exports=o},56552:(t,e,i)=>{var n=i(37105),s="object"==typeof self&&self&&self.Object===Object&&self,r=n||s||Function("return this")();t.exports=r},56832:(t,e,i)=>{t=i.nmd(t);var n=i(37105),s=e&&!e.nodeType&&e,r=s&&t&&!t.nodeType&&t,a=r&&r.exports===s&&n.process,o=function(){try{var t=r&&r.require&&r.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=o},56874:(t,e,i)=>{var n=i(12622);t.exports=function(t,e){var i=n(this,t),s=i.size;return i.set(t,e),this.size+=i.size==s?0:1,this}},57828:t=>{t.exports=function(){return[]}},57887:(t,e,i)=>{var n=i(5791),s=i(47574),r=i(56832),a=r&&r.isMap,o=a?s(a):n;t.exports=o},58122:(t,e,i)=>{var n=i(46686),s=i(36140),r=i(43516),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return r(t);var e=s(t),i=[];for(var o in t)("constructor"!=o||!e&&a.call(t,o))&&i.push(o);return i}},59395:(t,e,i)=>{var n=i(4262),s=i(69621),r=i(28673);t.exports=function(t){return n(t,r,s)}},60014:t=>{t.exports=function(){return!1}},60929:(t,e,i)=>{var n=i(93211),s=i(6571),r=i(69194),a=i(46686);t.exports=function(t,e,i){if(!a(i))return!1;var o=typeof e;return!!("number"==o?s(i)&&r(e,i.length):"string"==o&&e in i)&&n(i[e],t)}},61141:(t,e,i)=>{var n=i(10143),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},61143:(t,e,i)=>{var n=i(13028)(Object.keys,Object);t.exports=n},61340:(t,e,i)=>{var n=i(93211);t.exports=function(t,e){for(var i=t.length;i--;)if(n(t[i][0],e))return i;return-1}},61516:(t,e,i)=>{var n=i(22929);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},61714:(t,e,i)=>{var n=i(61340);t.exports=function(t,e){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,e])):i[s][1]=e,this}},61966:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},62597:(t,e,i)=>{var n=i(54052),s=i(19841),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!s(t))||(a.test(t)||!r.test(t)||null!=e&&t in Object(e))}},63868:(t,e,i)=>{var n=i(71775),s=i(93211);t.exports=function(t,e,i){(void 0!==i&&!s(t[e],i)||void 0===i&&!(e in t))&&n(t,e,i)}},64467:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(20816);function s(t,e,i){return(e=(0,n.A)(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},64816:(t,e,i)=>{var n=i(47251),s=i(37159),r=i(80438),a=i(69394),o=i(56874);function l(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])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l},65387:(t,e,i)=>{var n=i(87937)(i(56552),"Promise");t.exports=n},67407:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},68592:(t,e,i)=>{var n=i(4262),s=i(56326),r=i(30474);t.exports=function(t){return n(t,r,s)}},69194:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,i){var n=typeof t;return!!(i=null==i?9007199254740991:i)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<i}},69394:(t,e,i)=>{var n=i(12622);t.exports=function(t){return n(this,t).has(t)}},69621:(t,e,i)=>{var n=i(17529),s=i(57828),r=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(t){return null==t?[]:(t=Object(t),n(a(t),function(e){return r.call(t,e)}))}:s;t.exports=o},70579:(t,e,i)=>{"use strict";t.exports=i(51153)},70705:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},70914:(t,e,i)=>{var n=i(19841);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},71775:(t,e,i)=>{var n=i(5654);t.exports=function(t,e,i){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}},72070:(t,e,i)=>{var n=i(87937)(i(56552),"Set");t.exports=n},72154:(t,e,i)=>{var n=i(95575),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return s.call(e,t)?e[t]:void 0}},73204:(t,e,i)=>{var n=i(3343),s=i(22777),r=i(54052),a=i(44543),o=i(69194),l=i(51268),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var i=r(t),h=!i&&s(t),d=!i&&!h&&a(t),u=!i&&!h&&!d&&l(t),p=i||h||d||u,f=p?n(t.length,String):[],g=f.length;for(var A in t)!e&&!c.call(t,A)||p&&("length"==A||d&&("offset"==A||"parent"==A)||u&&("buffer"==A||"byteLength"==A||"byteOffset"==A)||o(A,g))||f.push(A);return f}},74065:t=>{t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},76191:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},76272:(t,e,i)=>{var n=i(6571),s=i(22761);t.exports=function(t){return s(t)&&n(t)}},76788:(t,e,i)=>{var n=i(97160),s=i(85204),r=i(64816);t.exports=function(t,e){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!s||a.length<199)return a.push([t,e]),this.size=++i.size,this;i=this.__data__=new r(a)}return i.set(t,e),this.size=i.size,this}},77116:(t,e,i)=>{var n=i(9812),s=i(22777),r=i(54052),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return r(t)||s(t)||!!(a&&t&&t[a])}},78420:(t,e,i)=>{var n=i(71775),s=i(93211),r=Object.prototype.hasOwnProperty;t.exports=function(t,e,i){var a=t[e];r.call(t,e)&&s(a,i)&&(void 0!==i||e in t)||n(t,e,i)}},79889:(t,e,i)=>{var n=i(93950),s=i(46686);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})}},80111:(t,e,i)=>{var n=i(41069),s=0;t.exports=function(t){var e=++s;return n(t)+e}},80438:(t,e,i)=>{var n=i(12622);t.exports=function(t){return n(this,t).get(t)}},80726:t=>{t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}},80755:(t,e,i)=>{var n=i(48895),s=i(77116);t.exports=function t(e,i,r,a,o){var l=-1,c=e.length;for(r||(r=s),o||(o=[]);++l<c;){var h=e[l];i>0&&r(h)?i>1?t(h,i-1,r,a,o):n(o,h):a||(o[o.length]=h)}return o}},82284:(t,e,i)=>{"use strict";function n(t){return n="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},n(t)}i.d(e,{A:()=>n})},83223:(t,e,i)=>{var n=i(63868),s=i(44353),r=i(38710),a=i(91980),o=i(20310),l=i(22777),c=i(54052),h=i(76272),d=i(44543),u=i(11629),p=i(46686),f=i(12322),g=i(51268),A=i(53737),m=i(91609);t.exports=function(t,e,i,v,b,w,y){var _=A(t,i),x=A(e,i),E=y.get(x);if(E)n(t,i,E);else{var C=w?w(_,x,i+"",t,e,y):void 0,k=void 0===C;if(k){var S=c(x),M=!S&&d(x),L=!S&&!M&&g(x);C=x,S||M||L?c(_)?C=_:h(_)?C=a(_):M?(k=!1,C=s(x,!0)):L?(k=!1,C=r(x,!0)):C=[]:f(x)||l(x)?(C=_,l(_)?C=m(_):p(_)&&!u(_)||(C=o(x))):k=!1}k&&(y.set(x,C),b(C,x,v,w,y),y.delete(x)),n(t,i,C)}}},83713:(t,e,i)=>{var n=i(36140),s=i(61143),r=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return s(t);var e=[];for(var i in Object(t))r.call(t,i)&&"constructor"!=i&&e.push(i);return e}},84545:(t,e,i)=>{var n=i(97160);t.exports=function(){this.__data__=new n,this.size=0}},84570:(t,e,i)=>{var n=i(55647),s=i(60929);t.exports=function(t){return n(function(e,i){var n=-1,r=i.length,a=r>1?i[r-1]:void 0,o=r>2?i[2]:void 0;for(a=t.length>3&&"function"==typeof a?(r--,a):void 0,o&&s(i[0],i[1],o)&&(a=r<3?void 0:a,r=1),e=Object(e);++n<r;){var l=i[n];l&&t(e,l,n,a)}return e})}},85204:(t,e,i)=>{var n=i(87937)(i(56552),"Map");t.exports=n},85990:(t,e,i)=>{var n=i(13028)(Object.getPrototypeOf,Object);t.exports=n},86578:t=>{var e=Date.now;t.exports=function(t){var i=0,n=0;return function(){var s=e(),r=16-(s-n);if(n=s,r>0){if(++i>=800)return arguments[0]}else i=0;return t.apply(void 0,arguments)}}},87563:t=>{t.exports=function(){this.__data__=[],this.size=0}},87937:(t,e,i)=>{var n=i(36954),s=i(14657);t.exports=function(t,e){var i=s(t,e);return n(i)?i:void 0}},88140:(t,e,i)=>{var n=i(35324),s=i(74065),r=i(21676),a=i(70914);t.exports=function(t,e){return e=n(e,t),null==(t=r(t,e))||delete t[a(s(e))]}},88259:(t,e,i)=>{var n=i(15797);t.exports=function(t){var e=n(t,function(t){return 500===i.size&&i.clear(),t}),i=e.cache;return e}},89330:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},89379:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(64467);function s(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 r(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach(function(e){(0,n.A)(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}},91609:(t,e,i)=>{var n=i(96614),s=i(30474);t.exports=function(t){return n(t,s(t))}},91980:t=>{t.exports=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}},93141:function(t,e,i){var n;"undefined"!=typeof self&&self,t.exports=(n=i(73884),function(){"use strict";var t={155:function(t){t.exports=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{useReactToPrint:function(){return g}});var r=i(155);const a="printWindow";function o(t){let{level:e="error",messages:i,suppressErrors:n=!1}=t;n||("error"===e?console.error(i):"warning"===e?console.warn(i):console.debug(i))}function l(t,e){if(e||!t){const t=document.getElementById(a);t&&document.body.removeChild(t)}}function c(t){return t instanceof Error?t:new Error("Unknown Error")}function h(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:r,print:a,suppressErrors:h}=e;setTimeout(()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),l(r)}if(t.contentWindow.focus(),a)a(t).then(u).catch(t=>{s?s("print",c(t)):o({messages:["An error was thrown by the specified `print` function"],suppressErrors:h})});else{if(t.contentWindow.print){const p=null!==(d=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==d?d:"",f=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=f,t.contentDocument&&(t.contentDocument.title=p))}else o({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:h});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(t=>{var e,i;return(null!==(i=null!==(e=navigator.userAgent)&&void 0!==e?e:navigator.vendor)&&void 0!==i?i:"opera"in window&&window.opera).match(t)})?setTimeout(u,500):u()}}else o({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:h})},500)}function d(t){const e=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let n=i.nextNode();for(;n;)e.push(n),n=i.nextNode();return e}function u(t,e,i){const n=d(t),s=d(e);if(n.length===s.length)for(let r=0;r<n.length;r++){const t=n[r],e=s[r],a=t.shadowRoot;if(null!==a){const t=e.attachShadow({mode:a.mode});t.innerHTML=a.innerHTML,u(a,t,i)}}else o({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const p='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function f(t,e,i,n){var s,r,a,l,d;const{contentNode:f,clonedContentNode:g,clonedImgNodes:A,clonedVideoNodes:m,numResourcesToLoad:v,originalCanvasNodes:b}=i,{bodyClass:w,fonts:y,ignoreGlobalStyles:_,pageStyle:x,nonce:E,suppressErrors:C,copyShadowRoots:k}=n;t.onload=null;const S=null!==(s=t.contentDocument)&&void 0!==s?s:null===(r=t.contentWindow)||void 0===r?void 0:r.document;if(S){const i=S.body.appendChild(g);k&&u(f,i,!!C),y&&((null===(a=t.contentDocument)||void 0===a?void 0:a.fonts)&&(null===(l=t.contentWindow)||void 0===l?void 0:l.FontFace)?y.forEach(i=>{const n=new FontFace(i.family,i.source,{weight:i.weight,style:i.style});t.contentDocument.fonts.add(n),n.loaded.then(()=>{e(n)}).catch(t=>{e(n,["Failed loading the font:",n,"Load error:",c(t)])})}):(y.forEach(t=>{e(t)}),o({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:C})));const n=null!=x?x:p,s=S.createElement("style");E&&(s.setAttribute("nonce",E),S.head.setAttribute("nonce",E)),s.appendChild(S.createTextNode(n)),S.head.appendChild(s),w&&S.body.classList.add(...w.split(" "));const r=S.querySelectorAll("canvas");for(let t=0;t<b.length;++t){const e=b[t],i=r[t];if(void 0===i){o({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:C});continue}const n=i.getContext("2d");n&&n.drawImage(e,0,0)}for(let t=0;t<A.length;t++){const i=A[t],n=i.getAttribute("src");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,n,s,r,a)=>{e(i,["Error loading <img>",i,"Error",a])},t.src=n}else e(i,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',i])}for(let t=0;t<m.length;t++){const i=m[t];i.preload="auto";const n=i.getAttribute("poster");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,s,r,a,o)=>{e(i,["Error loading video poster",n,"for video",i,"Error:",o])},t.src=n}else i.readyState>=2?e(i):i.src?(i.onloadeddata=()=>{e(i)},i.onerror=(t,n,s,r,a)=>{e(i,["Error loading video",i,"Error",a])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const h="select",v=f.querySelectorAll(h),M=S.querySelectorAll(h);for(let t=0;t<v.length;t++)M[t].value=v[t].value;if(!_){const i=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let n=0,s=i.length;n<s;++n){const s=i[n];if("style"===s.tagName.toLowerCase()){const e=S.createElement(s.tagName),i=s.sheet;if(i){let r="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(r+="".concat(i.cssRules[e].cssText,"\r\n"))}catch(t){o({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",s,"Original error: ".concat(c(t).message)],level:"warning"})}e.setAttribute("id","react-to-print-".concat(n)),E&&e.setAttribute("nonce",E),e.appendChild(S.createTextNode(r)),S.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))o({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",s],level:"warning"}),e(s);else{const t=S.createElement(s.tagName);for(let e=0,i=s.attributes.length;e<i;++e){const i=s.attributes[e];i&&t.setAttribute(i.nodeName,null!==(d=i.nodeValue)&&void 0!==d?d:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,r,a)=>{e(t,["Failed to load",t,"Error:",a])},E&&t.setAttribute("nonce",E),S.head.appendChild(t)}else o({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",s],level:"warning"}),e(s)}}}0===v&&h(t,n)}function g(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:A,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,printIframeProps:y,suppressErrors:_}=t;const x=(0,r.useCallback)(t=>{function r(){const r={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:A,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,printIframeProps:y,suppressErrors:_},l=function(t){const e=document.createElement("iframe");return e.width="".concat(document.documentElement.clientWidth,"px"),e.height="".concat(document.documentElement.clientHeight,"px"),e.style.position="absolute",e.style.top="-".concat(document.documentElement.clientHeight+100,"px"),e.style.left="-".concat(document.documentElement.clientWidth+100,"px"),e.id=a,e.srcdoc="<!DOCTYPE html>",t&&(t.allow&&(e.allow=t.allow),void 0!==t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),void 0!==t.sandbox&&(e.sandbox=t.sandbox)),e}(y),c=function(t,e){const{contentRef:i,fonts:n,ignoreGlobalStyles:s,suppressErrors:r}=e,a=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return i&&"function"==typeof i?(e&&o({level:"warning",messages:['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']}),i()):e?e.current:void o({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n})}({contentRef:i,optionalContent:t,suppressErrors:r});if(!a)return;const l=a.cloneNode(!0),c=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),h=l.querySelectorAll("img"),d=l.querySelectorAll("video"),u=n?n.length:0;return{contentNode:a,clonedContentNode:l,clonedImgNodes:h,clonedVideoNodes:d,numResourcesToLoad:(s?0:c.length)+h.length+d.length+u,originalCanvasNodes:a.querySelectorAll("canvas")}}(t,r);if(!c)return void o({messages:["There is nothing to print"],suppressErrors:_});const x=function(t,e,i){const{suppressErrors:n}=t,s=[],r=[];return function(a,l){s.includes(a)?o({level:"debug",messages:["Tried to mark a resource that has already been handled",a],suppressErrors:n}):(l?(o({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...l],suppressErrors:n}),r.push(a)):s.push(a),s.length+r.length===e&&h(i,t))}}(r,c.numResourcesToLoad,l);!function(t,e,i,n){t.onload=()=>{f(t,e,i,n)},document.body.appendChild(t)}(l,x,c,r)}l(b,!0),A?A().then(()=>{r()}).catch(t=>{null==m||m("onBeforePrint",c(t))}):r()},[e,i,n,s,d,u,p,g,A,m,v,b,w,_]);return x}return s}())},93211:t=>{t.exports=function(t,e){return t===e||t!==t&&e!==e}},93950:(t,e,i)=>{var n=i(46686),s=i(4757),r=i(40801),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,c,h,d,u,p,f=0,g=!1,A=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var i=l,n=c;return l=c=void 0,f=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||A&&t-f>=h}function w(){var t=s();if(b(t))return y(t);u=setTimeout(w,function(t){var i=e-(t-p);return A?o(i,h-(t-f)):i}(t))}function y(t){return u=void 0,m&&l?v(t):(l=c=void 0,d)}function _(){var t=s(),i=b(t);if(l=arguments,c=this,p=t,i){if(void 0===u)return function(t){return f=t,u=setTimeout(w,e),g?v(t):d}(p);if(A)return clearTimeout(u),u=setTimeout(w,e),v(p)}return void 0===u&&(u=setTimeout(w,e)),d}return e=r(e)||0,n(i)&&(g=!!i.leading,h=(A="maxWait"in i)?a(r(i.maxWait)||0,e):h,m="trailing"in i?!!i.trailing:m),_.cancel=function(){void 0!==u&&clearTimeout(u),f=0,l=p=c=u=void 0},_.flush=function(){return void 0===u?d:y(s())},_}},94258:(t,e,i)=>{var n=i(55906)();t.exports=n},95575:(t,e,i)=>{var n=i(87937)(Object,"create");t.exports=n},96440:t=>{"use strict";var e=function(){};t.exports=e},96614:(t,e,i)=>{var n=i(78420),s=i(71775);t.exports=function(t,e,i,r){var a=!i;i||(i={});for(var o=-1,l=e.length;++o<l;){var c=e[o],h=r?r(i[c],t[c],c,i,t):void 0;void 0===h&&(h=t[c]),a?s(i,c,h):n(i,c,h)}return i}},96761:(t,e,i)=>{var n=i(12322);t.exports=function(t){return n(t)?void 0:t}},96996:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(i){}try{return t+""}catch(i){}}return""}},97132:(t,e,i)=>{var n=i(5538),s=i(80726),r=i(78420),a=i(51104),o=i(55119),l=i(44353),c=i(91980),h=i(98124),d=i(29075),u=i(59395),p=i(68592),f=i(26924),g=i(38268),A=i(18630),m=i(20310),v=i(54052),b=i(44543),w=i(57887),y=i(46686),_=i(45921),x=i(28673),E=i(30474),C="[object Arguments]",k="[object Function]",S="[object Object]",M={};M[C]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[S]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[k]=M["[object WeakMap]"]=!1,t.exports=function t(e,i,L,T,R,P){var F,I=1&i,D=2&i,O=4&i;if(L&&(F=R?L(e,T,R,P):L(e)),void 0!==F)return F;if(!y(e))return e;var N=v(e);if(N){if(F=g(e),!I)return c(e,F)}else{var W=f(e),j=W==k||"[object GeneratorFunction]"==W;if(b(e))return l(e,I);if(W==S||W==C||j&&!R){if(F=D||j?{}:m(e),!I)return D?d(e,o(F,e)):h(e,a(F,e))}else{if(!M[W])return R?e:{};F=A(e,W,I)}}P||(P=new n);var B=P.get(e);if(B)return B;P.set(e,F),_(e)?e.forEach(function(n){F.add(t(n,i,L,n,e,P))}):w(e)&&e.forEach(function(n,s){F.set(s,t(n,i,L,s,e,P))});var H=N?void 0:(O?D?p:u:D?E:x)(e);return s(H||e,function(n,s){H&&(n=e[s=n]),r(F,s,t(n,i,L,s,e,P))}),F}},97160:(t,e,i)=>{var n=i(87563),s=i(29935),r=i(24190),a=i(51946),o=i(61714);function l(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])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l},97685:(t,e,i)=>{var n=i(87937)(i(56552),"DataView");t.exports=n},98124:(t,e,i)=>{var n=i(96614),s=i(69621);t.exports=function(t,e){return n(t,s(t),e)}},98724:(t,e,i)=>{var n=i(27615),s=i(25051),r=i(72154),a=i(48734),o=i(22662);function l(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])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l}}]);
3
- //# sourceMappingURL=1353.a91edf5b.chunk.js.map
1
+ /*! For license information please see 1353.7388baf9.chunk.js.LICENSE.txt */
2
+ (self.webpackChunk_kne_components_components_core=self.webpackChunk_kne_components_components_core||[]).push([[814,1353,2273,6125,9379],{1488:(t,e,i)=>{var n=i(50149),s=i(97132),r=i(88140),a=i(35324),o=i(96614),l=i(96761),c=i(15857),h=i(68592),d=c(function(t,e){var i={};if(null==t)return i;var c=!1;e=n(e,function(e){return e=a(e,t),c||(c=e.length>1),e}),o(t,h(t),i),c&&(i=s(i,7,l));for(var d=e.length;d--;)r(i,e[d]);return i});t.exports=d},3343:t=>{t.exports=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}},3892:t=>{t.exports=function(t){return this.__data__.has(t)}},4262:(t,e,i)=>{var n=i(48895),s=i(54052);t.exports=function(t,e,i){var r=e(t);return s(t)?r:n(r,i(t))}},4757:(t,e,i)=>{var n=i(56552);t.exports=function(){return n.Date.now()}},5538:(t,e,i)=>{var n=i(97160),s=i(84545),r=i(10793),a=i(27760),o=i(3892),l=i(76788);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=s,c.prototype.delete=r,c.prototype.get=a,c.prototype.has=o,c.prototype.set=l,t.exports=c},5654:(t,e,i)=>{var n=i(87937),s=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();t.exports=s},5791:(t,e,i)=>{var n=i(26924),s=i(22761);t.exports=function(t){return s(t)&&"[object Map]"==n(t)}},6571:(t,e,i)=>{var n=i(11629),s=i(56173);t.exports=function(t){return null!=t&&s(t.length)&&!n(t)}},6806:(t,e,i)=>{var n=i(61516);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}},8195:(t,e,i)=>{"use strict";function n(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}i.d(e,{A:()=>n})},9056:()=>{},9812:(t,e,i)=>{var n=i(56552).Symbol;t.exports=n},10143:t=>{var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},10793:t=>{t.exports=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}},11295:(t,e,i)=>{var n=i(9812),s=n?n.prototype:void 0,r=s?s.valueOf:void 0;t.exports=function(t){return r?Object(r.call(t)):{}}},11629:(t,e,i)=>{var n=i(16913),s=i(46686);t.exports=function(t){if(!s(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},12322:(t,e,i)=>{var n=i(16913),s=i(85990),r=i(22761),a=Function.prototype,o=Object.prototype,l=a.toString,c=o.hasOwnProperty,h=l.call(Object);t.exports=function(t){if(!r(t)||"[object Object]"!=n(t))return!1;var e=s(t);if(null===e)return!0;var i=c.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&l.call(i)==h}},12622:(t,e,i)=>{var n=i(70705);t.exports=function(t,e){var i=t.__data__;return n(e)?i["string"==typeof e?"string":"hash"]:i.map}},13028:t=>{t.exports=function(t,e){return function(i){return t(e(i))}}},13440:(t,e,i)=>{var n=i(56552)["__core-js_shared__"];t.exports=n},14079:(t,e,i)=>{var n=i(88259),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=n(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(s,function(t,i,n,s){e.push(n?s.replace(r,"$1"):i||t)}),e});t.exports=a},14657:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},15193:(t,e,i)=>{var n=i(16913),s=i(22761);t.exports=function(t){return s(t)&&"[object Arguments]"==n(t)}},15797:(t,e,i)=>{var n=i(64816);function s(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(s.Cache||n),i}s.Cache=n,t.exports=s},15857:(t,e,i)=>{var n=i(20819),s=i(55636),r=i(46350);t.exports=function(t){return r(s(t,void 0,n),t+"")}},16095:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},16913:(t,e,i)=>{var n=i(9812),s=i(34552),r=i(16095),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?s(t):r(t)}},17529:t=>{t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length,s=0,r=[];++i<n;){var a=t[i];e(a,i,t)&&(r[s++]=a)}return r}},18630:(t,e,i)=>{var n=i(61516),s=i(6806),r=i(18962),a=i(11295),o=i(38710);t.exports=function(t,e,i){var l=t.constructor;switch(e){case"[object ArrayBuffer]":return n(t);case"[object Boolean]":case"[object Date]":return new l(+t);case"[object DataView]":return s(t,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(t,i);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(t);case"[object RegExp]":return r(t);case"[object Symbol]":return a(t)}}},18962:t=>{var e=/\w*$/;t.exports=function(t){var i=new t.constructor(t.source,e.exec(t));return i.lastIndex=t.lastIndex,i}},19155:(t,e,i)=>{"use strict";i.d(e,{A:()=>h});var n=i(73884),s=i(79889),r=i.n(s),a=i(93950),o=i.n(a),l=i(96418),c=i.n(l);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=c()(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}},19841:(t,e,i)=>{var n=i(16913),s=i(22761);t.exports=function(t){return"symbol"==typeof t||s(t)&&"[object Symbol]"==n(t)}},20310:(t,e,i)=>{var n=i(21817),s=i(85990),r=i(36140);t.exports=function(t){return"function"!=typeof t.constructor||r(t)?{}:n(s(t))}},20449:(t,e,i)=>{var n=i(26924),s=i(22761);t.exports=function(t){return s(t)&&"[object Set]"==n(t)}},20794:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(73884);const s=(0,n.createContext)({})},20816:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(82284);function s(t){var e=function(t,e){if("object"!=(0,n.A)(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=(0,n.A)(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==(0,n.A)(e)?e:e+""}},20819:(t,e,i)=>{var n=i(80755);t.exports=function(t){return(null==t?0:t.length)?n(t,1):[]}},21676:(t,e,i)=>{var n=i(52969),s=i(53871);t.exports=function(t,e){return e.length<2?t:n(t,s(e,0,-1))}},21817:(t,e,i)=>{var n=i(46686),s=Object.create,r=function(){function t(){}return function(e){if(!n(e))return{};if(s)return s(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();t.exports=r},22172:(t,e,i)=>{"use strict";i.d(e,{A:()=>T});var n=i(58168),s=i(5544),r=i(64467),a=i(53986),o=i(73884),l=i.n(o),c=i(83136),h=i.n(c),d=i(8500),u=i(20794),p=i(89379),f=i(82284),g=i(80930),A=i(49134),m=i(97907);function v(t){return"object"===(0,f.A)(t)&&"string"===typeof t.name&&"string"===typeof t.theme&&("object"===(0,f.A)(t.icon)||"function"===typeof t.icon)}function b(){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 w(t,e,i){return i?l().createElement(t.tag,(0,p.A)((0,p.A)({key:e},b(t.attrs)),i),(t.children||[]).map(function(i,n){return w(i,"".concat(e,"-").concat(t.tag,"-").concat(n))})):l().createElement(t.tag,(0,p.A)({key:e},b(t.attrs)),(t.children||[]).map(function(i,n){return w(i,"".concat(e,"-").concat(t.tag,"-").concat(n))}))}function y(t){return(0,d.generate)(t)[0]}function _(t){return t?Array.isArray(t)?t:[t]:[]}var x=["icon","className","onClick","style","primaryColor","secondaryColor"],E={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var C=function(t){var e,i,n=t.icon,s=t.className,r=t.onClick,l=t.style,c=t.primaryColor,h=t.secondaryColor,d=(0,a.A)(t,x),f=o.useRef(),b=E;if(c&&(b={primaryColor:c,secondaryColor:h||y(c)}),function(t){var e=(0,o.useContext)(u.A),i=e.csp,n=e.prefixCls,s=e.layer,r="\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&&(r=r.replace(/anticon/g,n)),s&&(r="@layer ".concat(s," {\n").concat(r,"\n}")),(0,o.useEffect)(function(){var e=t.current,n=(0,A.j)(e);(0,g.BD)(r,"@ant-design-icons",{prepend:!s,csp:i,attachTo:n})},[])}(f),e=v(n),i="icon should be icon definiton, but got ".concat(n),(0,m.Ay)(e,"[@ant-design/icons] ".concat(i)),!v(n))return null;var _=n;return _&&"function"===typeof _.icon&&(_=(0,p.A)((0,p.A)({},_),{},{icon:_.icon(b.primaryColor,b.secondaryColor)})),w(_.icon,"svg-".concat(_.name),(0,p.A)((0,p.A)({className:s,onClick:r,style:l,"data-icon":_.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:f}))};C.displayName="IconReact",C.getTwoToneColors=function(){return(0,p.A)({},E)},C.setTwoToneColors=function(t){var e=t.primaryColor,i=t.secondaryColor;E.primaryColor=e,E.secondaryColor=i||y(e),E.calculated=!!i};const k=C;function S(t){var e=_(t),i=(0,s.A)(e,2),n=i[0],r=i[1];return k.setTwoToneColors({primaryColor:n,secondaryColor:r})}var M=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];S(d.blue.primary);var L=o.forwardRef(function(t,e){var i=t.className,l=t.icon,c=t.spin,d=t.rotate,p=t.tabIndex,f=t.onClick,g=t.twoToneColor,A=(0,a.A)(t,M),m=o.useContext(u.A),v=m.prefixCls,b=void 0===v?"anticon":v,w=m.rootClassName,y=h()(w,b,(0,r.A)((0,r.A)({},"".concat(b,"-").concat(l.name),!!l.name),"".concat(b,"-spin"),!!c||"loading"===l.name),i),x=p;void 0===x&&f&&(x=-1);var E=d?{msTransform:"rotate(".concat(d,"deg)"),transform:"rotate(".concat(d,"deg)")}:void 0,C=_(g),S=(0,s.A)(C,2),L=S[0],T=S[1];return o.createElement("span",(0,n.A)({role:"img","aria-label":l.name},A,{ref:e,tabIndex:x,onClick:f,className:y}),o.createElement(k,{icon:l,primaryColor:L,secondaryColor:T,style:E}))});L.displayName="AntdIcon",L.getTwoToneColor=function(){var t=k.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},L.setTwoToneColor=S;const T=L},22541:t=>{t.exports=function(t){return function(){return t}}},22662:(t,e,i)=>{var n=i(95575);t.exports=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},22761:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},22777:(t,e,i)=>{var n=i(15193),s=i(22761),r=Object.prototype,a=r.hasOwnProperty,o=r.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(t){return s(t)&&a.call(t,"callee")&&!o.call(t,"callee")};t.exports=l},22929:(t,e,i)=>{var n=i(56552).Uint8Array;t.exports=n},23253:(t,e,i)=>{var n=i(5538),s=i(63868),r=i(94258),a=i(83223),o=i(46686),l=i(30474),c=i(53737);t.exports=function t(e,i,h,d,u){e!==i&&r(i,function(r,l){if(u||(u=new n),o(r))a(e,i,l,h,t,d,u);else{var p=d?d(c(e,l),r,l+"",e,i,u):void 0;void 0===p&&(p=r),s(e,l,p)}},l)}},24190:(t,e,i)=>{var n=i(61340);t.exports=function(t){var e=this.__data__,i=n(e,t);return i<0?void 0:e[i][1]}},24558:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(26562);function s(t,e,i){return t.set((0,n.A)(t,e),i),i}},25051:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},26562:(t,e,i)=>{"use strict";function n(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}i.d(e,{A:()=>n})},26600:(t,e,i)=>{var n=i(87937)(i(56552),"WeakMap");t.exports=n},26924:(t,e,i)=>{var n=i(97685),s=i(85204),r=i(65387),a=i(72070),o=i(26600),l=i(16913),c=i(96996),h="[object Map]",d="[object Promise]",u="[object Set]",p="[object WeakMap]",f="[object DataView]",g=c(n),A=c(s),m=c(r),v=c(a),b=c(o),w=l;(n&&w(new n(new ArrayBuffer(1)))!=f||s&&w(new s)!=h||r&&w(r.resolve())!=d||a&&w(new a)!=u||o&&w(new o)!=p)&&(w=function(t){var e=l(t),i="[object Object]"==e?t.constructor:void 0,n=i?c(i):"";if(n)switch(n){case g:return f;case A:return h;case m:return d;case v:return u;case b:return p}return e}),t.exports=w},27615:(t,e,i)=>{var n=i(95575);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},27760:t=>{t.exports=function(t){return this.__data__.get(t)}},28325:(t,e,i)=>{var n=i(22541),s=i(5654),r=i(33279),a=s?function(t,e){return s(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:r;t.exports=a},28673:(t,e,i)=>{var n=i(73204),s=i(83713),r=i(6571);t.exports=function(t){return r(t)?n(t):s(t)}},29075:(t,e,i)=>{var n=i(96614),s=i(56326);t.exports=function(t,e){return n(t,s(t),e)}},29935:(t,e,i)=>{var n=i(61340),s=Array.prototype.splice;t.exports=function(t){var e=this.__data__,i=n(e,t);return!(i<0)&&(i==e.length-1?e.pop():s.call(e,i,1),--this.size,!0)}},30474:(t,e,i)=>{var n=i(73204),s=i(58122),r=i(6571);t.exports=function(t){return r(t)?n(t,!0):s(t)}},31170:t=>{t.exports=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)}},31353:(t,e,i)=>{"use strict";i.r(e),i.d(e,{AudioPreview:()=>Gm,Download:()=>xm,FileButton:()=>dv,FileInput:()=>Uv,FileList:()=>Iv,FileListOptionButtons:()=>Mv,FileModal:()=>cv,FilePreview:()=>tv,FileUpload:()=>Gv,HtmlPreview:()=>Im,Image:()=>Sv,ImagePreview:()=>Um,OSSFilePreview:()=>Jm,OfficePreview:()=>Wm,PdfPreview:()=>jm,PrintButton:()=>iv,TextPreview:()=>Bm,UnknownPreview:()=>Hm,VideoPreview:()=>Xm,computedAccept:()=>qv,default:()=>pm,defaultAccept:()=>Bv,download:()=>fm,downloadBlobFile:()=>gm,useDownload:()=>wm,useFileModal:()=>lv,useFileModalProps:()=>ov,useFileUpload:()=>Dv,withOSSFile:()=>dm});var n={};i.r(n),i.d(n,{dU:()=>mg,ng:()=>vg,EA:()=>bg,Tm:()=>wg,D6:()=>yg,YE:()=>_g});var s=i(73884),r=i.n(s),a=i(83694),o=i(87558),l=i.n(o),c=i(34677),h=i.n(c),d=i(55199),u=i(89330),p=i(58168);const f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};var g=i(22172);const A=s.forwardRef(function(t,e){return s.createElement(g.A,(0,p.A)({},t,{ref:e,icon:f}))});const m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};const v=s.forwardRef(function(t,e){return s.createElement(g.A,(0,p.A)({},t,{ref:e,icon:m}))});var b=i(76191),w=i(67407),y=i(61966);const _={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"};const x=s.forwardRef(function(t,e){return s.createElement(g.A,(0,p.A)({},t,{ref:e,icon:_}))});var E,C=i(96418),k=i.n(C),S=i(1488),M=i.n(S),L=i(52526),T=0,R=!1,P=!1,F="[iFrameSizer]",I=null,D=window.requestAnimationFrame,O=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),N={},W=null,j=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(){q("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function B(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function H(t,e,i){t.addEventListener(e,i,!1)}function z(t,e,i){t.removeEventListener(e,i,!1)}function U(t){return F+"["+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 V(t){return N[t]?N[t].log:R}function G(t,e){X("log",t,e,V(t))}function q(t,e){X("warn",t,e,!0)}function X(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](U(e),i)}function Y(t){function e(){s("Height"),s("Width"),nt(function(){it(p),$(f),d("onResized",p)},p,"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(N[f]["max"+t]),i=Number(N[f]["min"+t]),n=t.toLowerCase(),s=Number(p[n]);G(f,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,G(f,"Set "+n+" to min value")),s>e&&(s=e,G(f,"Set "+n+" to max value")),p[n]=""+s}function r(t){return u.slice(u.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){st("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=p.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,lt[s=e]||(lt[s]=setTimeout(function(){lt[s]=null,i()},n))}function o(t){var e=t.getBoundingClientRect();return J(f),{x:Math.floor(Number(e.left)+Number(I.x)),y:Math.floor(Number(e.top)+Number(I.y))}}function l(t){var e=t?o(p.iframe):{x:0,y:0},i={x:Number(p.width)+e.x,y:Number(p.height)+e.y};G(f,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(I=i,c(),G(f,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):q(f,"Unable to scroll to requested position, window.parentIFrame not found")}function c(){!1===d("onScroll",I)?tt():$(f)}function h(t){var e={};if(0===Number(p.width)&&0===Number(p.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:p.width,y:p.height};d(t,{iframe:p.iframe,screenX:Number(e.x),screenY:Number(e.y),type:p.type})}function d(t,e){return K(f,t,e)}var u=t.data,p={},f=null;"[iFrameResizerChild]Ready"===u?function(){for(var t in N)st("iFrame requested init",rt(t),N[t].iframe,t)}():F===(""+u).slice(0,13)&&u.slice(13).split(":")[0]in N?(p=function(){var t=u.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=N[t[0]]&&N[t[0]].iframe,r=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(r)+n(r),width:t[2],type:t[3]}}(),f=p.id,N[f]&&(N[f].loaded=!0),!function(){var t=p.type in{true:1,false:1,undefined:1};return t&&G(f,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return N[t]||(e=!1,q(p.type+" No settings for "+t+". Message was: "+u)),e}(f)&&(G(f,"Received: "+u),function(){var t=!0;return null===p.iframe&&(q(f,"IFrame ("+p.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=N[f]&&N[f].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(G(f,"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=N[f]&&N[f].remoteHost;return G(f,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+p.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(N[f]&&N[f].firstRun&&N[f]&&(N[f].firstRun=!1),p.type){case"close":Z(p.iframe);break;case"message":t=r(6),G(f,"onMessage passed: {iframe: "+p.iframe.id+", message: "+t+"}"),d("onMessage",{iframe:p.iframe,message:JSON.parse(t)}),G(f,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":N[f].autoResize=JSON.parse(r(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":a(N[f]&&N[f].iframe,f),function(){function t(t,n){function s(){N[i]?a(N[i].iframe,i):e()}["scroll","resize"].forEach(function(e){G(i,t+e+" listener for sendPageInfo"),n(window,e,s)})}function e(){t("Remove ",z)}var i=f;t("Add ",H),N[i]&&(N[i].stopPageInfo=e)}();break;case"pageInfoStop":N[f]&&N[f].stopPageInfo&&(N[f].stopPageInfo(),delete N[f].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=o(n);G(f,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),I={x:t.x,y:t.y},c(),G(f,"--")}():window.top===window.self?G(f,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):G(f,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":et(p);break;case"init":e(),d("onInit",p.iframe);break;default:0===Number(p.width)&&0===Number(p.height)?q("Unsupported message received ("+p.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){X("info",t,e,V(t))}(f,"Ignored: "+u)}function K(t,e,i){var n=null,s=null;if(N[t]){if("function"!==typeof(n=N[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function Q(t){var e=t.id;delete N[e]}function Z(t){var e=t.id;if(!1!==K(e,"onClose",e)){G(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){q(i)}K(e,"onClosed",e),G(e,"--"),Q(t),E&&(E.disconnect(),E=null)}else G(e,"Close iframe cancelled by onClose event")}function J(t){null===I&&G(t,"Get page position: "+(I={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+I.y)}function $(t){null!==I&&(window.scrollTo(I.x,I.y),G(t,"Set page position: "+I.x+","+I.y),tt())}function tt(){I=null}function et(t){G(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),J(t.id),nt(function(){it(t),st("reset","reset",t.iframe,t.id)},t,"reset")}function it(t){function e(e){P||"0"!==t[e]||(P=!0,G(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(N[t]&&N[t].iframe.style[e])}function i(t){return null!==t.offsetParent}N[t]&&i(N[t].iframe)&&(e("height")||e("width"))&&st("Visibility change","resize",N[t].iframe,t)}Object.keys(N).forEach(function(e){t(e)})}function e(e){G("window","Mutation observed: "+e[0].target+" "+e[0].type),ot(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=B();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",G(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):G("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;N[n]&&(N[n].sizeHeight&&i("height"),N[n].sizeWidth&&i("width"))}function nt(t,e,i){i!==e.type&&D&&!window.jasmine?(G(e.id,"Requesting animation frame"),D(t)):t()}function st(t,e,i,n,s){var r=!1;n=n||i.id,N[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=N[n]&&N[n].targetOrigin;G(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(F+e,s)}():q(n,"["+t+"] IFrame("+n+") not found"),s&&N[n]&&N[n].warningTimeout&&(N[n].msgTimeout=setTimeout(function(){!N[n]||N[n].loaded||r||(r=!0,q(n,"IFrame has not responded within "+N[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."))},N[n].warningTimeout)))}function rt(t){return t+":"+N[t].bodyMarginV1+":"+N[t].sizeWidth+":"+N[t].log+":"+N[t].interval+":"+N[t].enablePublicMethods+":"+N[t].autoResize+":"+N[t].bodyMargin+":"+N[t].heightCalculationMethod+":"+N[t].bodyBackground+":"+N[t].bodyPadding+":"+N[t].tolerance+":"+N[t].inPageLinks+":"+N[t].resizeFrom+":"+N[t].widthCalculationMethod+":"+N[t].mouseEvents}function at(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],q(n,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var n=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||j.id+T++;return null!==document.getElementById(t)&&(t+=T++),t}(),R=(e||{}).log,G(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);n in N&&"iFrameResizer"in t?q(n,"Ignored iFrame, already setup."):(!function(e){var s;e=e||{},N[n]=Object.create(null),N[n].iframe=t,N[n].firstRun=!0,N[n].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 j)Object.prototype.hasOwnProperty.call(j,e)&&(N[n][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:j[e])}(e),N[n]&&(N[n].targetOrigin=!0===N[n].checkOrigin?""===(s=N[n].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*")}(e),function(){switch(G(n,"IFrame scrolling "+(N[n]&&N[n].scrolling?"enabled":"disabled")+" for "+n),t.style.overflow=!1===(N[n]&&N[n].scrolling)?"hidden":"auto",N[n]&&N[n].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=N[n]?N[n].scrolling:"no"}}(),function(){function e(e){var i=N[n][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,G(n,"Set "+e+" = "+t.style[e]))}function i(t){if(N[n]["min"+t]>N[n]["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(N[n]&&N[n].bodyMargin)&&"0"!==(N[n]&&N[n].bodyMargin)||(N[n].bodyMarginV1=N[n].bodyMargin,N[n].bodyMargin=N[n].bodyMargin+"px"),function(e){var i=B();i&&(E=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&&Z(t)})})});return i.observe(t.parentNode,{childList:!0}),i}(i)),H(t,"load",function(){st("iFrame.onload",e,t,void 0,!0),function(){var e=N[n]&&N[n].firstRun,i=N[n]&&N[n].heightCalculationMethod in O;!e&&i&&et({iframe:t,height:0,width:0,type:"init"})}()}),st("init",e,t,void 0,!0)}(rt(n)),N[n]&&(N[n].iframe.iFrameResizer={close:Z.bind(null,N[n].iframe),removeListeners:Q.bind(null,N[n].iframe),resize:st.bind(null,"Window resize","resize",N[n].iframe),moveToAnchor:function(t){st("Move to anchor","moveToAnchor:"+t,N[n].iframe,n)},sendMessage:function(t){st("Send Message","message:"+(t=JSON.stringify(t)),N[n].iframe,n)}}))}function ot(t,e){null===W&&(W=setTimeout(function(){W=null,t()},e))}var lt={};function ct(){"hidden"!==document.visibilityState&&(G("document","Trigger event: Visibility change"),ot(function(){ht("Tab Visible","resize")},16))}function ht(t,e){Object.keys(N).forEach(function(i){(function(t){return N[t]&&"parent"===N[t].resizeFrom&&N[t].autoResize&&!N[t].firstRun})(i)&&st(t,e,N[i].iframe,i)})}function dt(){H(window,"message",Y),H(window,"resize",function(){var t;G("window","Trigger event: "+(t="resize")),ot(function(){ht("Window "+t,"resize")},16)}),H(document,"visibilitychange",ct),H(document,"-webkit-visibilitychange",ct)}var ut=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+">")}(),at(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!D;t+=1)D=window[e[t]+"RequestAnimationFrame"];D?D=D.bind(window):G("setup","RequestAnimationFrame not supported")}(),dt(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&q("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}}(),pt=i(83136),ft=i.n(pt),gt=i(89379);function At(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}var mt=i(53986),vt=i(39790),bt=i(26562);function wt(t,e,i){return i((0,bt.A)(t,e))}var yt=i(64467),_t=i(55149),xt=i(38458),Et=i(24558);const Ct=["textContentSource","container","viewport"];var kt,St,Mt,Lt,Tt,Rt,Pt,Ft,It,Dt,Ot,Nt,Wt={d:(t,e)=>{for(var i in e)Wt.o(e,i)&&!Wt.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},jt=globalThis.pdfjsLib={};Wt.d(jt,{AbortException:()=>Ze,AnnotationEditorLayer:()=>eg,AnnotationEditorParamsType:()=>$t,AnnotationEditorType:()=>Jt,AnnotationEditorUIManager:()=>Vs,AnnotationLayer:()=>ud,AnnotationMode:()=>Zt,CMapCompressionType:()=>Pe,ColorPicker:()=>Bu,DOMSVGFactory:()=>Yi,DrawLayer:()=>pg,FeatureTest:()=>ei,GlobalWorkerOptions:()=>io,ImageKind:()=>oe,InvalidPDFException:()=>Xe,MissingPDFException:()=>Ye,OPS:()=>Fe,Outliner:()=>Hd,PDFDataRangeTransport:()=>$l,PDFDateString:()=>on,PDFWorker:()=>uc,PasswordResponses:()=>Ie,PermissionFlag:()=>te,PixelsPerInch:()=>ki,RenderingCancelledException:()=>Qi,TextLayer:()=>Tl,UnexpectedResponseException:()=>Ke,Util:()=>ni,VerbosityLevel:()=>Re,XfaLayer:()=>jc,build:()=>Dc,createValidAbsoluteUrl:()=>ze,fetchData:()=>Gi,getDocument:()=>Kl,getFilenameFromUrl:()=>$i,getPdfFilenameFromUrl:()=>tn,getXfaPageViewport:()=>ln,isDataScheme:()=>Zi,isPdfFile:()=>Ji,noContextMenu:()=>sn,normalizeUnicode:()=>li,renderTextLayer:()=>Hl,setLayerDimensions:()=>un,shadow:()=>Ue,updateTextLayer:()=>zl,version:()=>Ic});const Bt="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),Ht=[1,0,0,1,0,0],zt=[.001,0,0,.001,0,0],Ut=1.35,Vt=1,Gt=2,qt=4,Xt=16,Yt=32,Kt=64,Qt=256,Zt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Jt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},$t={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},te={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ee=0,ie=1,ne=2,se=3,re=3,ae=4,oe={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},le=1,ce=2,he=3,de=4,ue=5,pe=6,fe=7,ge=8,Ae=9,me=10,ve=11,be=12,we=13,ye=14,_e=15,xe=16,Ee=17,Ce=20,ke=1,Se=2,Me=3,Le=4,Te=5,Re={ERRORS:0,WARNINGS:1,INFOS:5},Pe={NONE:0,BINARY:1},Fe={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},Ie={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let De=Re.WARNINGS;function Oe(t){Number.isInteger(t)&&(De=t)}function Ne(){return De}function We(t){De>=Re.INFOS&&console.log("Info: ".concat(t))}function je(t){De>=Re.WARNINGS&&console.log("Warning: ".concat(t))}function Be(t){throw new Error(t)}function He(t,e){t||Be(e)}function ze(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);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(n){}}const s=e?new URL(t,e):new URL(t);if(function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s))return s}catch(s){}return null}function Ue(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 Ve=function(){function t(e,i){this.constructor===t&&Be("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class Ge extends Ve{constructor(t,e){super(t,"PasswordException"),this.code=e}}class qe extends Ve{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Xe extends Ve{constructor(t){super(t,"InvalidPDFException")}}class Ye extends Ve{constructor(t){super(t,"MissingPDFException")}}class Ke extends Ve{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class Qe extends Ve{constructor(t){super(t,"FormatError")}}class Ze extends Ve{constructor(t){super(t,"AbortException")}}function Je(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||Be("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 $e(t){"string"!==typeof t&&Be("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 ti(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class ei{static get isLittleEndian(){return Ue(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return Ue(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return Ue(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){var t;return"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.platform)?Ue(this,"platform",{isMac:navigator.platform.includes("Mac")}):Ue(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,e;return Ue(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const ii=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class ni{static makeHexColor(t,e,i){return"#".concat(ii[t]).concat(ii[e]).concat(ii[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,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}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 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)],(0,bt.A)(ni,this,ri).call(this,t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),(0,bt.A)(ni,this,ri).call(this,t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l),l}}function si(t,e,i,n,s,r,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,f=h*(h*(h*s+3*l*r)+3*d*a)+u*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],f)}function ri(t,e,i,n,s,r,a,o,l,c,h,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&(0,bt.A)(kt,this,si).call(this,t,e,i,n,s,r,a,o,-h/c,d));const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),f=2*l;(0,bt.A)(kt,this,si).call(this,t,e,i,n,s,r,a,o,(-c+p)/f,d),(0,bt.A)(kt,this,si).call(this,t,e,i,n,s,r,a,o,(-c-p)/f,d)}kt=ni;let ai=null,oi=null;function li(t){return ai||(ai=/([\xA0\xB5\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+)/g,oi=new Map([["\ufb05","\u017ft"]])),t.replaceAll(ai,(t,e,i)=>e?e.normalize("NFKC"):oi.get(i))}const ci="pdfjs_internal_id_",hi=0,di=1,ui=2,pi=3,fi=4,gi=5,Ai=6,mi=7,vi=8;class bi{constructor(){this.constructor===bi&&Be("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(){}}var wi=new WeakMap;class yi{constructor(){let{enableHWA:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,_t.A)(this,wi,!1),this.constructor===yi&&Be("Cannot initialize BaseCanvasFactory."),(0,Et.A)(wi,this,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:!(0,xt.A)(wi,this)})}}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){Be("Abstract method `_createCanvas` called.")}}class _i{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===_i&&Be("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?Pe.BINARY:Pe.NONE;return this._fetchData(i,n).catch(t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))})}_fetchData(t,e){Be("Abstract method `_fetchData` called.")}}class xi{constructor(t){let{baseUrl:e=null}=t;this.constructor===xi&&Be("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="".concat(this.baseUrl).concat(e);return this._fetchData(i).catch(t=>{throw new Error("Unable to load font data at: ".concat(i))})}_fetchData(t){Be("Abstract method `_fetchData` called.")}}class Ei{constructor(){this.constructor===Ei&&Be("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","".concat(t,"px")),n.setAttribute("height","".concat(e,"px"))),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Be("Abstract method `_createSVG` called.")}}const Ci="http://www.w3.org/2000/svg";class ki{}St=ki,(0,yt.A)(ki,"CSS",96),(0,yt.A)(ki,"PDF",72),(0,yt.A)(ki,"PDF_TO_CSS_UNITS",St.CSS/St.PDF);var Si=new WeakMap,Mi=new WeakMap,Li=new WeakMap,Ti=new WeakMap,Ri=new WeakMap,Pi=new WeakMap,Fi=new WeakSet;function Ii(t){return(0,xt.A)(Si,t)||(0,Et.A)(Si,t,new Map)}function Di(t){return(0,xt.A)(Ri,t)||(0,Et.A)(Ri,t,new Map)}function Oi(t){if(!(0,xt.A)(Mi,t)){const e=(0,xt.A)(Ti,t).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=(0,xt.A)(Ti,t).createElementNS(Ci,"svg");n.setAttribute("width",0),n.setAttribute("height",0),(0,Et.A)(Mi,t,(0,xt.A)(Ti,t).createElementNS(Ci,"defs")),e.append(n),n.append((0,xt.A)(Mi,t)),(0,xt.A)(Ti,t).body.append(e)}return(0,xt.A)(Mi,t)}function Ni(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(",")]}function Wi(t){const e=(0,xt.A)(Ti,this).createElementNS(Ci,"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)}function ji(t){const e=(0,xt.A)(Ti,this).createElementNS(Ci,"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)}function Bi(t){const e=(0,xt.A)(Ti,this).createElementNS(Ci,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),wt(Fi,this,Oi).append(e),e}function Hi(t,e,i){const n=(0,xt.A)(Ti,this).createElementNS(Ci,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function zi(t,e,i,n){const s=(0,xt.A)(Ti,this).createElementNS(Ci,"feComponentTransfer");n.append(s),(0,bt.A)(Fi,this,Hi).call(this,s,"feFuncR",t),(0,bt.A)(Fi,this,Hi).call(this,s,"feFuncG",e),(0,bt.A)(Fi,this,Hi).call(this,s,"feFuncB",i)}function Ui(t,e){const i=(0,xt.A)(Ti,this).createElementNS(Ci,"feComponentTransfer");e.append(i),(0,bt.A)(Fi,this,Hi).call(this,i,"feFuncA",t)}function Vi(t){return wt(Fi,this,Oi).style.color=t,cn(getComputedStyle(wt(Fi,this,Oi)).getPropertyValue("color"))}async function Gi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(nn(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 qi extends _i{_fetchData(t,e){return Gi(t,this.isCompressed?"arraybuffer":"text").then(t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):$e(t),compressionType:e}))}}class Xi extends xi{_fetchData(t){return Gi(t,"arraybuffer").then(t=>new Uint8Array(t))}}class Yi extends Ei{_createSVG(t){return document.createElementNS(Ci,t)}}class Ki{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 c,h,d,u,p,f,g,A;switch(n%=360,n<0&&(n+=360),n){case 180:c=-1,h=0,d=0,u=1;break;case 90:c=0,h=1,d=1,u=0;break;case 270:c=0,h=-1,d=-1,u=0;break;case 0:c=1,h=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===c?(p=Math.abs(l-e[1])*i+s,f=Math.abs(o-e[0])*i+r,g=(e[3]-e[1])*i,A=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,f=Math.abs(l-e[1])*i+r,g=(e[2]-e[0])*i,A=(e[3]-e[1])*i),this.transform=[c*i,h*i,d*i,u*i,p-c*i*o-d*i*l,f-h*i*o-u*i*l],this.width=g,this.height=A}get rawDims(){const{viewBox:t}=this;return Ue(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 Ki({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return ni.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=ni.applyTransform([t[0],t[1]],this.transform),i=ni.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return ni.applyInverseTransform([t,e],this.transform)}}class Qi extends Ve{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function Zi(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function Ji(t){return"string"===typeof t&&/\.pdf$/i.test(t)}function $i(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function tn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(Zi(t))return je('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(r){}return s||e}class en{constructor(){(0,yt.A)(this,"started",Object.create(null)),(0,yt.A)(this,"times",[])}time(t){t in this.started&&je("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||je("Timer has not been started for ".concat(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("".concat(i.padEnd(e)," ").concat(s-n,"ms\n"));return t.join("")}}function nn(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(i){return!1}}function sn(t){t.preventDefault()}function rn(t){console.log("Deprecated API usage: "+t)}let an;class on{static toDateObject(t){if(!t||"string"!==typeof t)return null;an||(an=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=an.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 c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(r+=c,a+=h):"+"===l&&(r-=c,a-=h),new Date(Date.UTC(i,n,s,r,a,o))}}function ln(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 Ki({viewBox:a,scale:i,rotation:n})}function cn(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):(je('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function hn(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function dn(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 un(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 Ki){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=ei.isCSSRoundSupported,o="var(--scale-factor) * ".concat(n,"px"),l="var(--scale-factor) * ".concat(s,"px"),c=a?"round(".concat(o,", 1px)"):"calc(".concat(o,")"),h=a?"round(".concat(l,", 1px)"):"calc(".concat(l,")");i&&e.rotation%180!==0?(r.width=h,r.height=c):(r.width=c,r.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}var pn=new WeakMap,fn=new WeakMap,gn=new WeakMap,An=new WeakMap,mn=new WeakSet;class vn{constructor(t){(0,vt.A)(this,mn),(0,_t.A)(this,pn,null),(0,_t.A)(this,fn,null),(0,_t.A)(this,gn,void 0),(0,_t.A)(this,An,null),(0,Et.A)(gn,this,t)}render(){const t=(0,Et.A)(pn,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=(0,xt.A)(gn,this)._uiManager._signal;t.addEventListener("contextmenu",sn,{signal:e}),t.addEventListener("pointerdown",bn,{signal:e});const i=(0,Et.A)(An,this,document.createElement("div"));i.className="buttons",t.append(i);const n=(0,xt.A)(gn,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===(0,xt.A)(gn,this)._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd="".concat(100*i,"%"),e.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return(0,bt.A)(mn,this,xn).call(this),t}hide(){var t;(0,xt.A)(pn,this).classList.add("hidden"),null===(t=(0,xt.A)(fn,this))||void 0===t||t.hideDropdown()}show(){(0,xt.A)(pn,this).classList.remove("hidden")}addAltTextButton(t){(0,bt.A)(mn,this,_n).call(this,t),(0,xt.A)(An,this).prepend(t,wt(mn,this,En))}addColorPicker(t){(0,Et.A)(fn,this,t);const e=t.renderButton();(0,bt.A)(mn,this,_n).call(this,e),(0,xt.A)(An,this).prepend(e,wt(mn,this,En))}remove(){var t;(0,xt.A)(pn,this).remove(),null===(t=(0,xt.A)(fn,this))||void 0===t||t.destroy(),(0,Et.A)(fn,this,null)}}function bn(t){t.stopPropagation()}function wn(t){(0,xt.A)(gn,this)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}function yn(t){(0,xt.A)(gn,this)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}function _n(t){const e=(0,xt.A)(gn,this)._uiManager._signal;t.addEventListener("focusin",(0,bt.A)(mn,this,wn).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",(0,bt.A)(mn,this,yn).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",sn,{signal:e})}function xn(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat((0,xt.A)(gn,this).editorType,"-button")),(0,bt.A)(mn,this,_n).call(this,t),t.addEventListener("click",t=>{(0,xt.A)(gn,this)._uiManager.delete()},{signal:(0,xt.A)(gn,this)._uiManager._signal}),(0,xt.A)(An,this).append(t)}function En(t){const e=document.createElement("div");return e.className="divider",e}var Cn=new WeakMap,kn=new WeakMap,Sn=new WeakMap,Mn=new WeakSet;class Ln{constructor(t){(0,vt.A)(this,Mn),(0,_t.A)(this,Cn,null),(0,_t.A)(this,kn,null),(0,_t.A)(this,Sn,void 0),(0,Et.A)(Sn,this,t)}show(t,e,i){const[n,s]=(0,bt.A)(Mn,this,Rn).call(this,e,i),{style:r}=(0,xt.A)(kn,this)||(0,Et.A)(kn,this,(0,bt.A)(Mn,this,Tn).call(this));t.append((0,xt.A)(kn,this)),r.insetInlineEnd="".concat(100*n,"%"),r.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){(0,xt.A)(kn,this).remove()}}function Tn(){const t=(0,Et.A)(kn,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",sn,{signal:(0,xt.A)(Sn,this)._signal});const e=(0,Et.A)(Cn,this,document.createElement("div"));return e.className="buttons",t.append(e),(0,bt.A)(Mn,this,Pn).call(this),t}function Rn(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]}function Pn(){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=(0,xt.A)(Sn,this)._signal;t.addEventListener("contextmenu",sn,{signal:i}),t.addEventListener("click",()=>{(0,xt.A)(Sn,this).highlightSelection("floating_button")},{signal:i}),(0,xt.A)(Cn,this).append(t)}function Fn(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var In=new WeakMap;class Dn{constructor(){(0,_t.A)(this,In,0)}get id(){var t,e;return"".concat("pdfjs_internal_editor_").concat(((0,Et.A)(In,this,(t=(0,xt.A)(In,this),e=t++,t)),e))}}var On=new WeakMap,Nn=new WeakMap,Wn=new WeakMap,jn=new WeakSet;class Bn{constructor(){(0,vt.A)(this,jn),(0,_t.A)(this,On,function(){var t,e;if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();const i=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.getRandomValues))crypto.getRandomValues(i);else for(let n=0;n<32;n++)i[n]=Math.floor(255*Math.random());return Je(i)}()),(0,_t.A)(this,Nn,0),(0,_t.A)(this,Wn,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 Ue(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 getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return(0,bt.A)(jn,this,Hn).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return(0,bt.A)(jn,this,Hn).call(this,t,t)}async getFromId(t){(0,xt.A)(Wn,this)||(0,Et.A)(Wn,this,new Map);const e=(0,xt.A)(Wn,this).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=(0,xt.A)(Wn,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){(0,xt.A)(Wn,this)||(0,Et.A)(Wn,this,new Map);const e=(0,xt.A)(Wn,this).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith("image_".concat((0,xt.A)(On,this),"_"))}}async function Hn(t,e){var i;(0,xt.A)(Wn,this)||(0,Et.A)(Wn,this,new Map);let n=(0,xt.A)(Wn,this).get(t);if(null===n)return null;if(null!==(i=n)&&void 0!==i&&i.bitmap)return n.refCounter+=1,n;try{var s,r;let t;if(n||(n={bitmap:null,id:"image_".concat((0,xt.A)(On,this),"_").concat(((0,Et.A)(Nn,this,(s=(0,xt.A)(Nn,this),r=s++,s)),r)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await Gi(e,"blob")):t=n.file=e,"image/svg+xml"===t.type){const e=Mt._isSVGFittingCanvas,i=new FileReader,s=new Image,r=new Promise((t,r)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,t()},i.onload=async()=>{const t=n.svgUrl=i.result;s.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},s.onerror=i.onerror=r});i.readAsDataURL(t),await r}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(a){console.error(a),n=null}return(0,xt.A)(Wn,this).set(t,n),n&&(0,xt.A)(Wn,this).set(n.id,n),n}Mt=Bn;var zn=new WeakMap,Un=new WeakMap,Vn=new WeakMap,Gn=new WeakMap;class qn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;(0,_t.A)(this,zn,[]),(0,_t.A)(this,Un,!1),(0,_t.A)(this,Vn,void 0),(0,_t.A)(this,Gn,-1),(0,Et.A)(Vn,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(),(0,xt.A)(Un,this))return;const l={cmd:e,undo:i,post:n,type:r};if(-1===(0,xt.A)(Gn,this))return(0,xt.A)(zn,this).length>0&&((0,xt.A)(zn,this).length=0),(0,Et.A)(Gn,this,0),void(0,xt.A)(zn,this).push(l);if(a&&(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)].type===r)return o&&(l.undo=(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)].undo),void((0,xt.A)(zn,this)[(0,xt.A)(Gn,this)]=l);const c=(0,xt.A)(Gn,this)+1;c===(0,xt.A)(Vn,this)?(0,xt.A)(zn,this).splice(0,1):((0,Et.A)(Gn,this,c),c<(0,xt.A)(zn,this).length&&(0,xt.A)(zn,this).splice(c)),(0,xt.A)(zn,this).push(l)}undo(){if(-1===(0,xt.A)(Gn,this))return;(0,Et.A)(Un,this,!0);const{undo:t,post:e}=(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)];t(),null===e||void 0===e||e(),(0,Et.A)(Un,this,!1),(0,Et.A)(Gn,this,(0,xt.A)(Gn,this)-1)}redo(){if((0,xt.A)(Gn,this)<(0,xt.A)(zn,this).length-1){(0,Et.A)(Gn,this,(0,xt.A)(Gn,this)+1),(0,Et.A)(Un,this,!0);const{cmd:t,post:e}=(0,xt.A)(zn,this)[(0,xt.A)(Gn,this)];t(),null===e||void 0===e||e(),(0,Et.A)(Un,this,!1)}}hasSomethingToUndo(){return-1!==(0,xt.A)(Gn,this)}hasSomethingToRedo(){return(0,xt.A)(Gn,this)<(0,xt.A)(zn,this).length-1}destroy(){(0,Et.A)(zn,this,null)}}var Xn=new WeakSet;class Yn{constructor(t){(0,vt.A)(this,Xn),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=ei.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)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get((0,bt.A)(Xn,this,Kn).call(this,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()))}}function Kn(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}class Qn{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,cn(n))}e.remove()}(t),Ue(this,"_colors",t)}convert(t){const e=cn(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 Qn._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?ni.makeHexColor(...e):t}}(0,yt.A)(Qn,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var Zn=new WeakMap,Jn=new WeakMap,$n=new WeakMap,ts=new WeakMap,es=new WeakMap,is=new WeakMap,ns=new WeakMap,ss=new WeakMap,rs=new WeakMap,as=new WeakMap,os=new WeakMap,ls=new WeakMap,cs=new WeakMap,hs=new WeakMap,ds=new WeakMap,us=new WeakMap,ps=new WeakMap,fs=new WeakMap,gs=new WeakMap,As=new WeakMap,ms=new WeakMap,vs=new WeakMap,bs=new WeakMap,ws=new WeakMap,ys=new WeakMap,_s=new WeakMap,xs=new WeakMap,Es=new WeakMap,Cs=new WeakMap,ks=new WeakMap,Ss=new WeakMap,Ms=new WeakMap,Ls=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Ps=new WeakMap,Fs=new WeakMap,Is=new WeakMap,Ds=new WeakMap,Os=new WeakMap,Ns=new WeakMap,Ws=new WeakMap,js=new WeakMap,Bs=new WeakMap,Hs=new WeakMap,zs=new WeakMap,Us=new WeakSet;class Vs{static get _keyboardManager(){const t=Vs.prototype,e=t=>(0,xt.A)(Hs,t).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 Ue(this,"_keyboardManager",new Yn([[["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)&&(0,xt.A)(Hs,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&(0,xt.A)(Hs,t).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){(0,vt.A)(this,Us),(0,_t.A)(this,Zn,new AbortController),(0,_t.A)(this,Jn,null),(0,_t.A)(this,$n,new Map),(0,_t.A)(this,ts,new Map),(0,_t.A)(this,es,null),(0,_t.A)(this,is,null),(0,_t.A)(this,ns,null),(0,_t.A)(this,ss,new qn),(0,_t.A)(this,rs,0),(0,_t.A)(this,as,new Set),(0,_t.A)(this,os,null),(0,_t.A)(this,ls,null),(0,_t.A)(this,cs,new Set),(0,_t.A)(this,hs,!1),(0,_t.A)(this,ds,null),(0,_t.A)(this,us,null),(0,_t.A)(this,ps,null),(0,_t.A)(this,fs,!1),(0,_t.A)(this,gs,null),(0,_t.A)(this,As,new Dn),(0,_t.A)(this,ms,!1),(0,_t.A)(this,vs,!1),(0,_t.A)(this,bs,null),(0,_t.A)(this,ws,null),(0,_t.A)(this,ys,null),(0,_t.A)(this,_s,Jt.NONE),(0,_t.A)(this,xs,new Set),(0,_t.A)(this,Es,null),(0,_t.A)(this,Cs,null),(0,_t.A)(this,ks,null),(0,_t.A)(this,Ss,this.blur.bind(this)),(0,_t.A)(this,Ms,this.focus.bind(this)),(0,_t.A)(this,Ls,this.copy.bind(this)),(0,_t.A)(this,Ts,this.cut.bind(this)),(0,_t.A)(this,Rs,this.paste.bind(this)),(0,_t.A)(this,Ps,this.keydown.bind(this)),(0,_t.A)(this,Fs,this.keyup.bind(this)),(0,_t.A)(this,Is,this.onEditingAction.bind(this)),(0,_t.A)(this,Ds,this.onPageChanging.bind(this)),(0,_t.A)(this,Os,this.onScaleChanging.bind(this)),(0,_t.A)(this,Ns,this.onRotationChanging.bind(this)),(0,_t.A)(this,Ws,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),(0,_t.A)(this,js,[0,0]),(0,_t.A)(this,Bs,null),(0,_t.A)(this,Hs,null),(0,_t.A)(this,zs,null),this._signal=(0,xt.A)(Zn,this).signal,(0,Et.A)(Hs,this,t),(0,Et.A)(zs,this,e),(0,Et.A)(es,this,i),this._eventBus=n,this._eventBus._on("editingaction",(0,xt.A)(Is,this)),this._eventBus._on("pagechanging",(0,xt.A)(Ds,this)),this._eventBus._on("scalechanging",(0,xt.A)(Os,this)),this._eventBus._on("rotationchanging",(0,xt.A)(Ns,this)),(0,bt.A)(Us,this,Ks).call(this),(0,bt.A)(Us,this,ir).call(this),(0,bt.A)(Us,this,Js).call(this),(0,Et.A)(is,this,s.annotationStorage),(0,Et.A)(ds,this,s.filterFactory),(0,Et.A)(Cs,this,r),(0,Et.A)(ps,this,a||null),(0,Et.A)(hs,this,o),(0,Et.A)(ys,this,l||null),this.viewParameters={realScale:ki.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){var t,e,i;null===(t=(0,xt.A)(Zn,this))||void 0===t||t.abort(),(0,Et.A)(Zn,this,null),this._signal=null,this._eventBus._off("editingaction",(0,xt.A)(Is,this)),this._eventBus._off("pagechanging",(0,xt.A)(Ds,this)),this._eventBus._off("scalechanging",(0,xt.A)(Os,this)),this._eventBus._off("rotationchanging",(0,xt.A)(Ns,this));for(const n of(0,xt.A)(ts,this).values())n.destroy();(0,xt.A)(ts,this).clear(),(0,xt.A)($n,this).clear(),(0,xt.A)(cs,this).clear(),(0,Et.A)(Jn,this,null),(0,xt.A)(xs,this).clear(),(0,xt.A)(ss,this).destroy(),null===(e=(0,xt.A)(es,this))||void 0===e||e.destroy(),null===(i=(0,xt.A)(gs,this))||void 0===i||i.hide(),(0,Et.A)(gs,this,null),(0,xt.A)(us,this)&&(clearTimeout((0,xt.A)(us,this)),(0,Et.A)(us,this,null)),(0,xt.A)(Bs,this)&&(clearTimeout((0,xt.A)(Bs,this)),(0,Et.A)(Bs,this,null))}async mlGuess(t){var e;return(null===(e=(0,xt.A)(ys,this))||void 0===e?void 0:e.guess(t))||null}get hasMLManager(){return!!(0,xt.A)(ys,this)}get hcmFilter(){return Ue(this,"hcmFilter",(0,xt.A)(Cs,this)?(0,xt.A)(ds,this).addHCMFilter((0,xt.A)(Cs,this).foreground,(0,xt.A)(Cs,this).background):"none")}get direction(){return Ue(this,"direction",getComputedStyle((0,xt.A)(Hs,this)).direction)}get highlightColors(){return Ue(this,"highlightColors",(0,xt.A)(ps,this)?new Map((0,xt.A)(ps,this).split(",").map(t=>t.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return Ue(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){(0,Et.A)(ws,this,t)}editAltText(t){var e;null===(e=(0,xt.A)(es,this))||void 0===e||e.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;(0,Et.A)(rs,this,e-1)}focusMainContainer(){(0,xt.A)(Hs,this).focus()}findParent(t,e){for(const i of(0,xt.A)(ts,this).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];(0,xt.A)(zs,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){(0,xt.A)(cs,this).add(t)}removeShouldRescale(t){(0,xt.A)(cs,this).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*ki.PDF_TO_CSS_UNITS;for(const i of(0,xt.A)(cs,this))i.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=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=(0,bt.A)(Us,this,Gs).call(this,e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(l){e.empty(),(0,xt.A)(_s,this)===Jt.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:Jt.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of(0,xt.A)(ts,this).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}}}addToAnnotationStorage(t){t.isEmpty()||!(0,xt.A)(is,this)||(0,xt.A)(is,this).has(t.id)||(0,xt.A)(is,this).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,(0,xt.A)(fs,this)&&((0,Et.A)(fs,this,!1),(0,bt.A)(Us,this,Ys).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of(0,xt.A)(xs,this))if(e.div.contains(t)){(0,Et.A)(bs,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!(0,xt.A)(bs,this))return;const[t,e]=(0,xt.A)(bs,this);(0,Et.A)(bs,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){(0,bt.A)(Us,this,Js).call(this),(0,bt.A)(Us,this,tr).call(this)}removeEditListeners(){(0,bt.A)(Us,this,$s).call(this),(0,bt.A)(Us,this,er).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of(0,xt.A)(ls,this))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(0,xt.A)(ls,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=(0,xt.A)(Jn,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of(0,xt.A)(xs,this)){const t=n.serialize(!0);t&&i.push(t)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}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(0,xt.A)(ls,this))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 je('paste: "'.concat(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)(0,bt.A)(Us,this,or).call(this,e);(0,bt.A)(Us,this,hr).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){je('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),(0,xt.A)(_s,this)===Jt.NONE||this.isEditorHandlingKeyboard||Vs._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,(0,xt.A)(fs,this)&&((0,Et.A)(fs,this,!1),(0,bt.A)(Us,this,Ys).call(this,"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")}}setEditingState(t){t?((0,bt.A)(Us,this,Qs).call(this),(0,bt.A)(Us,this,tr).call(this),(0,bt.A)(Us,this,nr).call(this,{isEditing:(0,xt.A)(_s,this)!==Jt.NONE,isEmpty:(0,bt.A)(Us,this,cr).call(this),hasSomethingToUndo:(0,xt.A)(ss,this).hasSomethingToUndo(),hasSomethingToRedo:(0,xt.A)(ss,this).hasSomethingToRedo(),hasSelectedEditor:!1})):((0,bt.A)(Us,this,Zs).call(this),(0,bt.A)(Us,this,er).call(this),(0,bt.A)(Us,this,nr).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!(0,xt.A)(ls,this)){(0,Et.A)(ls,this,t);for(const t of(0,xt.A)(ls,this))(0,bt.A)(Us,this,sr).call(this,t.defaultPropertiesToUpdate)}}getId(){return(0,xt.A)(As,this).id}get currentLayer(){return(0,xt.A)(ts,this).get((0,xt.A)(rs,this))}getLayer(t){return(0,xt.A)(ts,this).get(t)}get currentPageIndex(){return(0,xt.A)(rs,this)}addLayer(t){(0,xt.A)(ts,this).set(t.pageIndex,t),(0,xt.A)(ms,this)?t.enable():t.disable()}removeLayer(t){(0,xt.A)(ts,this).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((0,xt.A)(_s,this)!==t){if((0,Et.A)(_s,this,t),t===Jt.NONE)return this.setEditingState(!1),void(0,bt.A)(Us,this,ar).call(this);this.setEditingState(!0),(0,bt.A)(Us,this,rr).call(this),this.unselectAll();for(const e of(0,xt.A)(ts,this).values())e.updateMode(t);if(e||!i){if(e)for(const t of(0,xt.A)($n,this).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==(0,xt.A)(_s,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if((0,xt.A)(ls,this)){switch(t){case $t.CREATE:return void this.currentLayer.addNewEditor();case $t.HIGHLIGHT_DEFAULT_COLOR:null===(i=(0,xt.A)(ws,this))||void 0===i||i.updateColor(e);break;case $t.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),((0,xt.A)(ks,this)||(0,Et.A)(ks,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}for(const i of(0,xt.A)(xs,this))i.updateParams(t,e);for(const i of(0,xt.A)(ls,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of(0,xt.A)($n,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=(0,xt.A)(ks,this))||void 0===n?void 0:n.get($t.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&(0,bt.A)(Us,this,sr).call(this,[[$t.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,xt.A)(vs,this)!==t){(0,Et.A)(vs,this,t);for(const e of(0,xt.A)(ts,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of(0,xt.A)($n,this).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return(0,xt.A)($n,this).get(t)}addEditor(t){(0,xt.A)($n,this).set(t.id,t)}removeEditor(t){var e;(t.div.contains(document.activeElement)&&((0,xt.A)(us,this)&&clearTimeout((0,xt.A)(us,this)),(0,Et.A)(us,this,setTimeout(()=>{this.focusMainContainer(),(0,Et.A)(us,this,null)},0))),(0,xt.A)($n,this).delete(t.id),this.unselect(t),t.annotationElementId&&(0,xt.A)(as,this).has(t.annotationElementId))||(null===(e=(0,xt.A)(is,this))||void 0===e||e.remove(t.id))}addDeletedAnnotationElement(t){(0,xt.A)(as,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return(0,xt.A)(as,this).has(t)}removeDeletedAnnotationElement(t){(0,xt.A)(as,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){(0,xt.A)(Jn,this)!==t&&((0,Et.A)(Jn,this,t),t&&(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate))}updateUI(t){wt(Us,this,lr)===t&&(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate)}toggleSelected(t){if((0,xt.A)(xs,this).has(t))return(0,xt.A)(xs,this).delete(t),t.unselect(),void(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:this.hasSelection});(0,xt.A)(xs,this).add(t),t.select(),(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of(0,xt.A)(xs,this))e!==t&&e.unselect();(0,xt.A)(xs,this).clear(),(0,xt.A)(xs,this).add(t),t.select(),(0,bt.A)(Us,this,sr).call(this,t.propertiesToUpdate),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:!0})}isSelected(t){return(0,xt.A)(xs,this).has(t)}get firstSelectedEditor(){return(0,xt.A)(xs,this).values().next().value}unselect(t){t.unselect(),(0,xt.A)(xs,this).delete(t),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==(0,xt.A)(xs,this).size}get isEnterHandled(){return 1===(0,xt.A)(xs,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){(0,xt.A)(ss,this).undo(),(0,bt.A)(Us,this,nr).call(this,{hasSomethingToUndo:(0,xt.A)(ss,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:(0,bt.A)(Us,this,cr).call(this)})}redo(){(0,xt.A)(ss,this).redo(),(0,bt.A)(Us,this,nr).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:(0,xt.A)(ss,this).hasSomethingToRedo(),isEmpty:(0,bt.A)(Us,this,cr).call(this)})}addCommands(t){(0,xt.A)(ss,this).add(t),(0,bt.A)(Us,this,nr).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:(0,bt.A)(Us,this,cr).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...(0,xt.A)(xs,this)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)(0,bt.A)(Us,this,or).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=(0,xt.A)(Jn,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return(0,xt.A)(Jn,this)||this.hasSelection}selectAll(){for(const t of(0,xt.A)(xs,this))t.commit();(0,bt.A)(Us,this,hr).call(this,(0,xt.A)($n,this).values())}unselectAll(){if((!(0,xt.A)(Jn,this)||((0,xt.A)(Jn,this).commitOrRemove(),(0,xt.A)(_s,this)===Jt.NONE))&&this.hasSelection){for(const t of(0,xt.A)(xs,this))t.unselect();(0,xt.A)(xs,this).clear(),(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;(0,xt.A)(js,this)[0]+=t,(0,xt.A)(js,this)[1]+=e;const[i,n]=(0,xt.A)(js,this),s=[...(0,xt.A)(xs,this)];(0,xt.A)(Bs,this)&&clearTimeout((0,xt.A)(Bs,this)),(0,Et.A)(Bs,this,setTimeout(()=>{(0,Et.A)(Bs,this,null),(0,xt.A)(js,this)[0]=(0,xt.A)(js,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)(0,xt.A)($n,this).has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)(0,xt.A)($n,this).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),(0,Et.A)(os,this,new Map);for(const t of(0,xt.A)(xs,this))(0,xt.A)(os,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!(0,xt.A)(os,this))return!1;this.disableUserSelect(!1);const t=(0,xt.A)(os,this);(0,Et.A)(os,this,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||(e=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if((0,xt.A)($n,this).has(t.id)){const s=(0,xt.A)(ts,this).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((0,xt.A)(os,this))for(const i of(0,xt.A)(os,this).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(){var t;return(null===(t=this.getActive())||void 0===t?void 0:t.shouldGetKeyboardEvents())||1===(0,xt.A)(xs,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return(0,xt.A)(Jn,this)===t}getActive(){return(0,xt.A)(Jn,this)}getMode(){return(0,xt.A)(_s,this)}get imageManager(){return Ue(this,"imageManager",new Bn)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,c=e.rangeCount;l<c;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,c=e.rangeCount;l<c;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;((0,xt.A)(ns,this)||(0,Et.A)(ns,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=(0,xt.A)(ns,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=(0,xt.A)(ns,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=(0,xt.A)(is,this).getRawValue(i);n&&((0,xt.A)(_s,this)!==Jt.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}}function Gs(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function qs(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=(0,bt.A)(Us,this,Gs).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&((0,xt.A)(gs,this)||(0,Et.A)(gs,this,new Ln(this)),(0,xt.A)(gs,this).show(e,i,"ltr"===this.direction))}function Xs(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if((0,xt.A)(Es,this))null===(i=(0,xt.A)(gs,this))||void 0===i||i.hide(),(0,Et.A)(Es,this,null),(0,bt.A)(Us,this,nr).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===(0,xt.A)(Es,this))return;var s;if((0,bt.A)(Us,this,Gs).call(this,e).closest(".textLayer")){if(null===(t=(0,xt.A)(gs,this))||void 0===t||t.hide(),(0,Et.A)(Es,this,n),(0,bt.A)(Us,this,nr).call(this,{hasSelectedText:!0}),((0,xt.A)(_s,this)===Jt.HIGHLIGHT||(0,xt.A)(_s,this)===Jt.NONE)&&((0,xt.A)(_s,this)===Jt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),(0,Et.A)(fs,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&&(0,bt.A)(Us,this,Ys).call(this,"main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else(0,xt.A)(Es,this)&&(null===(s=(0,xt.A)(gs,this))||void 0===s||s.hide(),(0,Et.A)(Es,this,null),(0,bt.A)(Us,this,nr).call(this,{hasSelectedText:!1}))}function Ys(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";(0,xt.A)(_s,this)===Jt.HIGHLIGHT?this.highlightSelection(t):(0,xt.A)(hs,this)&&(0,bt.A)(Us,this,qs).call(this)}function Ks(){document.addEventListener("selectionchange",(0,bt.A)(Us,this,Xs).bind(this),{signal:this._signal})}function Qs(){const t=this._signal;window.addEventListener("focus",(0,xt.A)(Ms,this),{signal:t}),window.addEventListener("blur",(0,xt.A)(Ss,this),{signal:t})}function Zs(){window.removeEventListener("focus",(0,xt.A)(Ms,this)),window.removeEventListener("blur",(0,xt.A)(Ss,this))}function Js(){const t=this._signal;window.addEventListener("keydown",(0,xt.A)(Ps,this),{signal:t}),window.addEventListener("keyup",(0,xt.A)(Fs,this),{signal:t})}function $s(){window.removeEventListener("keydown",(0,xt.A)(Ps,this)),window.removeEventListener("keyup",(0,xt.A)(Fs,this))}function tr(){const t=this._signal;document.addEventListener("copy",(0,xt.A)(Ls,this),{signal:t}),document.addEventListener("cut",(0,xt.A)(Ts,this),{signal:t}),document.addEventListener("paste",(0,xt.A)(Rs,this),{signal:t})}function er(){document.removeEventListener("copy",(0,xt.A)(Ls,this)),document.removeEventListener("cut",(0,xt.A)(Ts,this)),document.removeEventListener("paste",(0,xt.A)(Rs,this))}function ir(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function nr(t){Object.entries(t).some(t=>{let[e,i]=t;return(0,xt.A)(Ws,this)[e]!==i})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign((0,xt.A)(Ws,this),t)}),(0,xt.A)(_s,this)===Jt.HIGHLIGHT&&!1===t.hasSelectedEditor&&(0,bt.A)(Us,this,sr).call(this,[[$t.HIGHLIGHT_FREE,!0]]))}function sr(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function rr(){if(!(0,xt.A)(ms,this)){(0,Et.A)(ms,this,!0);for(const t of(0,xt.A)(ts,this).values())t.enable();for(const t of(0,xt.A)($n,this).values())t.enable()}}function ar(){if(this.unselectAll(),(0,xt.A)(ms,this)){(0,Et.A)(ms,this,!1);for(const t of(0,xt.A)(ts,this).values())t.disable();for(const t of(0,xt.A)($n,this).values())t.disable()}}function or(t){const e=(0,xt.A)(ts,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function lr(t){let e=null;for(e of(0,xt.A)(xs,t));return e}function cr(){if(0===(0,xt.A)($n,this).size)return!0;if(1===(0,xt.A)($n,this).size)for(const t of(0,xt.A)($n,this).values())return t.isEmpty();return!1}function hr(t){for(const e of(0,xt.A)(xs,this))e.unselect();(0,xt.A)(xs,this).clear();for(const e of t)e.isEmpty()||((0,xt.A)(xs,this).add(e),e.select());(0,bt.A)(Us,this,nr).call(this,{hasSelectedEditor:this.hasSelection})}(0,yt.A)(Vs,"TRANSLATE_SMALL",1),(0,yt.A)(Vs,"TRANSLATE_BIG",10);var dr=new WeakMap,ur=new WeakMap,pr=new WeakMap,fr=new WeakMap,gr=new WeakMap,Ar=new WeakMap,mr=new WeakMap,vr=new WeakSet;class br{constructor(t){(0,vt.A)(this,vr),(0,_t.A)(this,dr,""),(0,_t.A)(this,ur,!1),(0,_t.A)(this,pr,null),(0,_t.A)(this,fr,null),(0,_t.A)(this,gr,null),(0,_t.A)(this,Ar,!1),(0,_t.A)(this,mr,null),(0,Et.A)(mr,this,t)}static initialize(t){br._l10nPromise||(br._l10nPromise=t)}async render(){const t=(0,Et.A)(pr,this,document.createElement("button"));t.className="altText";const e=await br._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=(0,xt.A)(mr,this)._uiManager._signal;t.addEventListener("contextmenu",sn,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),(0,xt.A)(mr,this)._uiManager.editAltText((0,xt.A)(mr,this))};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&((0,Et.A)(Ar,this,!0),n(e))},{signal:i}),await(0,bt.A)(vr,this,wr).call(this),t}finish(){(0,xt.A)(pr,this)&&((0,xt.A)(pr,this).focus({focusVisible:(0,xt.A)(Ar,this)}),(0,Et.A)(Ar,this,!1))}isEmpty(){return!(0,xt.A)(dr,this)&&!(0,xt.A)(ur,this)}get data(){return{altText:(0,xt.A)(dr,this),decorative:(0,xt.A)(ur,this)}}set data(t){let{altText:e,decorative:i}=t;(0,xt.A)(dr,this)===e&&(0,xt.A)(ur,this)===i||((0,Et.A)(dr,this,e),(0,Et.A)(ur,this,i),(0,bt.A)(vr,this,wr).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,xt.A)(pr,this)&&(!t&&(0,xt.A)(gr,this)&&(clearTimeout((0,xt.A)(gr,this)),(0,Et.A)(gr,this,null)),(0,xt.A)(pr,this).disabled=!t)}destroy(){var t;null===(t=(0,xt.A)(pr,this))||void 0===t||t.remove(),(0,Et.A)(pr,this,null),(0,Et.A)(fr,this,null)}}async function wr(){const t=(0,xt.A)(pr,this);if(!t)return;var e;if(!(0,xt.A)(dr,this)&&!(0,xt.A)(ur,this))return t.classList.remove("done"),void(null===(e=(0,xt.A)(fr,this))||void 0===e||e.remove());t.classList.add("done"),Lt._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(e=>{t.setAttribute("aria-label",e)});let i=(0,xt.A)(fr,this);if(!i){(0,Et.A)(fr,this,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip");const e=i.id="alt-text-tooltip-".concat((0,xt.A)(mr,this).id);t.setAttribute("aria-describedby",e);const n=100,s=(0,xt.A)(mr,this)._uiManager._signal;s.addEventListener("abort",()=>{clearTimeout((0,xt.A)(gr,this)),(0,Et.A)(gr,this,null)},{once:!0}),t.addEventListener("mouseenter",()=>{(0,Et.A)(gr,this,setTimeout(()=>{(0,Et.A)(gr,this,null),(0,xt.A)(fr,this).classList.add("show"),(0,xt.A)(mr,this)._reportTelemetry({action:"alt_text_tooltip"})},n))},{signal:s}),t.addEventListener("mouseleave",()=>{var t;(0,xt.A)(gr,this)&&(clearTimeout((0,xt.A)(gr,this)),(0,Et.A)(gr,this,null)),null===(t=(0,xt.A)(fr,this))||void 0===t||t.classList.remove("show")},{signal:s})}i.innerText=(0,xt.A)(ur,this)?await Lt._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):(0,xt.A)(dr,this),i.parentNode||t.append(i);const n=(0,xt.A)(mr,this).getImageForAltText();null===n||void 0===n||n.setAttribute("aria-describedby",i.id)}Lt=br,(0,yt.A)(br,"_l10nPromise",null);var yr=new WeakMap,_r=new WeakMap,xr=new WeakMap,Er=new WeakMap,Cr=new WeakMap,kr=new WeakMap,Sr=new WeakMap,Mr=new WeakMap,Lr=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Pr=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Dr=new WeakMap,Or=new WeakMap,Nr=new WeakMap,Wr=new WeakMap,jr=new WeakMap,Br=new WeakMap,Hr=new WeakMap,zr=new WeakMap,Ur=new WeakSet;class Vr{static get _resizerKeyboardManager(){const t=Vr.prototype._resizeWithKeyboard,e=Vs.TRANSLATE_SMALL,i=Vs.TRANSLATE_BIG;return Ue(this,"_resizerKeyboardManager",new Yn([[["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"],Vr.prototype._stopResizingWithKeyboard]]))}constructor(t){(0,vt.A)(this,Ur),(0,_t.A)(this,yr,null),(0,_t.A)(this,_r,null),(0,_t.A)(this,xr,null),(0,_t.A)(this,Er,!1),(0,_t.A)(this,Cr,!1),(0,_t.A)(this,kr,null),(0,_t.A)(this,Sr,null),(0,_t.A)(this,Mr,this.focusin.bind(this)),(0,_t.A)(this,Lr,this.focusout.bind(this)),(0,_t.A)(this,Tr,null),(0,_t.A)(this,Rr,""),(0,_t.A)(this,Pr,!1),(0,_t.A)(this,Fr,null),(0,_t.A)(this,Ir,!1),(0,_t.A)(this,Dr,!1),(0,_t.A)(this,Or,!1),(0,_t.A)(this,Nr,null),(0,_t.A)(this,Wr,0),(0,_t.A)(this,jr,0),(0,_t.A)(this,Br,null),(0,yt.A)(this,"_initialOptions",Object.create(null)),(0,yt.A)(this,"_isVisible",!0),(0,yt.A)(this,"_uiManager",null),(0,yt.A)(this,"_focusEventsAllowed",!0),(0,yt.A)(this,"_l10nPromise",null),(0,_t.A)(this,Hr,!1),(0,_t.A)(this,zr,Vr._zIndex++),this.constructor===Vr&&Be("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 Ue(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new ra({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(Vr._l10nPromise||(Vr._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=>"-".concat(t.toLowerCase())))]))),null!==i&&void 0!==i&&i.strings)for(const s of i.strings)Vr._l10nPromise.set(s,t.get(s));if(-1!==Vr._borderLineWidth)return;const n=getComputedStyle(document.documentElement);Vr._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Be("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return(0,xt.A)(Hr,this)}set _isDraggable(t){var e;(0,Et.A)(Hr,this,t),null===(e=this.div)||void 0===e||e.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=(0,xt.A)(zr,this)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(0,bt.A)(Ur,this,sa).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&((0,xt.A)(Pr,this)?(0,Et.A)(Pr,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;null!==i&&void 0!==i&&i.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.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()}translate(t,e){(0,bt.A)(Ur,this,Gr).call(this,this.parentDimensions,t,e)}translateInPage(t,e){(0,xt.A)(Fr,this)||(0,Et.A)(Fr,this,[this.x,this.y]),(0,bt.A)(Ur,this,Gr).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){(0,xt.A)(Fr,this)||(0,Et.A)(Fr,this,[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="".concat((100*s).toFixed(2),"%"),this.div.style.top="".concat((100*r).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!(0,xt.A)(Fr,this)&&((0,xt.A)(Fr,this)[0]!==this.x||(0,xt.A)(Fr,this)[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Vr,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:c}=this.div;c.left="".concat((100*n).toFixed(2),"%"),c.top="".concat((100*s).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return qr.call(Vr,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return qr.call(Vr,t,e,360-this.parentRotation)}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 ei.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width="".concat((100*t/i).toFixed(2),"%"),(0,xt.A)(Cr,this)||(this.div.style.height="".concat((100*e/n).toFixed(2),"%"))}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!(0,xt.A)(Cr,this)&&e.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(t.width="".concat((100*parseFloat(i)/r).toFixed(2),"%")),(0,xt.A)(Cr,this)||s||(t.height="".concat((100*parseFloat(e)/a).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}altTextFinish(){var t;null===(t=(0,xt.A)(xr,this))||void 0===t||t.finish()}async addEditToolbar(){return(0,xt.A)(Tr,this)||(0,xt.A)(Dr,this)||((0,Et.A)(Tr,this,new vn(this)),this.div.append((0,xt.A)(Tr,this).render()),(0,xt.A)(xr,this)&&(0,xt.A)(Tr,this).addAltTextButton(await(0,xt.A)(xr,this).render())),(0,xt.A)(Tr,this)}removeEditToolbar(){var t;(0,xt.A)(Tr,this)&&((0,xt.A)(Tr,this).remove(),(0,Et.A)(Tr,this,null),null===(t=(0,xt.A)(xr,this))||void 0===t||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){(0,xt.A)(xr,this)||(br.initialize(Vr._l10nPromise),(0,Et.A)(xr,this,new br(this)),(0,xt.A)(yr,this)&&((0,xt.A)(xr,this).data=(0,xt.A)(yr,this),(0,Et.A)(yr,this,null)),await this.addEditToolbar())}get altTextData(){var t;return null===(t=(0,xt.A)(xr,this))||void 0===t?void 0:t.data}set altTextData(t){(0,xt.A)(xr,this)&&((0,xt.A)(xr,this).data=t)}hasAltText(){var t;return!(null!==(t=(0,xt.A)(xr,this))&&void 0!==t&&t.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=(0,xt.A)(Er,this)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",(0,xt.A)(Mr,this),{signal:t}),this.div.addEventListener("focusout",(0,xt.A)(Lr,this),{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*i/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/i).toFixed(2),"%"));const[n,s]=this.getInitialTranslation();return this.translate(n,s),Fn(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=ei.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():((0,Et.A)(Pr,this,!0),this._isDraggable?(0,bt.A)(Ur,this,$r).call(this,t):(0,bt.A)(Ur,this,Jr).call(this,t))}moveInDOM(){(0,xt.A)(Nr,this)&&clearTimeout((0,xt.A)(Nr,this)),(0,Et.A)(Nr,this,setTimeout(()=>{var t;(0,Et.A)(Nr,this,null),null===(t=this.parent)||void 0===t||t.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,c=e/n,h=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[h+l+a,r-d-c-p+o,h+l+u+a,r-d-c+o];case 90:return[h+c+a,r-d+l+o,h+c+p+a,r-d+l+u+o];case 180:return[h-l-u+a,r-d+c+o,h-l+a,r-d+c+p+o];case 270:return[h-c-p+a,r-d-l-u+o,h-c+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(){(0,Et.A)(Dr,this,!0)}disableEditMode(){(0,Et.A)(Dr,this,!1)}isInEditMode(){return(0,xt.A)(Dr,this)}shouldGetKeyboardEvents(){return(0,xt.A)(Or,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;const i=this._uiManager._signal;null===(t=this.div)||void 0===t||t.addEventListener("focusin",(0,xt.A)(Mr,this),{signal:i}),null===(e=this.div)||void 0===e||e.addEventListener("focusout",(0,xt.A)(Lr,this),{signal:i})}rotate(t){}serialize(){Be("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,(0,Et.A)(yr,n,t.accessibilityData);const[s,r]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=c/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",(0,xt.A)(Mr,this)),this.div.removeEventListener("focusout",(0,xt.A)(Lr,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(0,xt.A)(Nr,this)&&(clearTimeout((0,xt.A)(Nr,this)),(0,Et.A)(Nr,this,null)),(0,bt.A)(Ur,this,sa).call(this),this.removeEditToolbar(),(0,xt.A)(Br,this)){for(const t of(0,xt.A)(Br,this).values())clearTimeout(t);(0,Et.A)(Br,this,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&((0,bt.A)(Ur,this,Yr).call(this),(0,xt.A)(kr,this).classList.remove("hidden"),Fn(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),(0,Et.A)(Sr,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=(0,xt.A)(kr,this).children;if(!(0,xt.A)(_r,this)){(0,Et.A)(_r,this,Array.from(e));const t=(0,bt.A)(Ur,this,ta).bind(this),i=(0,bt.A)(Ur,this,ea).bind(this),n=this._uiManager._signal;for(const e of(0,xt.A)(_r,this)){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",(0,bt.A)(Ur,this,ia).bind(this,s),{signal:n}),Vr._l10nPromise.get("pdfjs-editor-resizer-label-".concat(s)).then(t=>e.setAttribute("aria-label",t))}}const i=(0,xt.A)(_r,this)[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*((0,xt.A)(_r,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)(0,xt.A)(kr,this).append((0,xt.A)(kr,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)(0,xt.A)(kr,this).firstChild.before((0,xt.A)(kr,this).lastChild);let t=0;for(const i of e){const e=(0,xt.A)(_r,this)[t++].getAttribute("data-resizer-name");Vr._l10nPromise.get("pdfjs-editor-resizer-label-".concat(e)).then(t=>i.setAttribute("aria-label",t))}}(0,bt.A)(Ur,this,na).call(this,0),(0,Et.A)(Or,this,!0),(0,xt.A)(kr,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){(0,xt.A)(Or,this)&&(0,bt.A)(Ur,this,Zr).call(this,(0,xt.A)(Rr,this),{movementX:t,movementY:e})}_stopResizingWithKeyboard(){(0,bt.A)(Ur,this,sa).call(this),this.div.focus()}select(){var t,e;this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),(0,xt.A)(Tr,this)?null===(e=(0,xt.A)(Tr,this))||void 0===e||e.show():this.addEditToolbar().then(()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=(0,xt.A)(Tr,this))||void 0===e||e.show())})}unselect(){var t,e,i,n;null===(t=(0,xt.A)(kr,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(i=this.div)&&void 0!==i&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(n=(0,xt.A)(Tr,this))||void 0===n||n.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return(0,xt.A)(Ir,this)}set isEditing(t){(0,Et.A)(Ir,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){(0,Et.A)(Cr,this,!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]){(0,xt.A)(Br,this)||(0,Et.A)(Br,this,new Map);const{action:e}=t;let i=(0,xt.A)(Br,this).get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),(0,xt.A)(Br,this).delete(e),0===(0,xt.A)(Br,this).size&&(0,Et.A)(Br,this,null)},Vr._telemetryTimeout),void(0,xt.A)(Br,this).set(e,i)}t.type||(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),(0,Et.A)(Er,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),(0,Et.A)(Er,this,!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()}}function Gr(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}function qr(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function Xr(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]}}function Yr(){if((0,xt.A)(kr,this))return;(0,Et.A)(kr,this,document.createElement("div")),(0,xt.A)(kr,this).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");(0,xt.A)(kr,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",(0,bt.A)(Ur,this,Kr).bind(this,i),{signal:e}),t.addEventListener("contextmenu",sn,{signal:e}),t.tabIndex=-1}this.div.prepend((0,xt.A)(kr,this))}function Kr(t,e){var i;e.preventDefault();const{isMac:n}=ei.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=(0,xt.A)(xr,this))||void 0===i||i.toggle(!1);const s=(0,bt.A)(Ur,this,Zr).bind(this,t),r=this._isDraggable;this._isDraggable=!1;const a=this._uiManager._signal,o={passive:!0,capture:!0,signal:a};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",s,o),window.addEventListener("contextmenu",sn,{signal:a});const l=this.x,c=this.y,h=this.width,d=this.height,u=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const f=()=>{var t;this.parent.togglePointerEvents(!0),null===(t=(0,xt.A)(xr,this))||void 0===t||t.toggle(!0),this._isDraggable=r,window.removeEventListener("pointerup",f),window.removeEventListener("blur",f),window.removeEventListener("pointermove",s,o),window.removeEventListener("contextmenu",sn),this.parent.div.style.cursor=u,this.div.style.cursor=p,(0,bt.A)(Ur,this,Qr).call(this,l,c,h,d)};window.addEventListener("pointerup",f,{signal:a}),window.addEventListener("blur",f,{signal:a})}function Qr(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})}function Zr(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=Tt.MIN_SIZE/i,c=Tt.MIN_SIZE/n,h=t=>Math.round(1e4*t)/1e4,d=(0,bt.A)(Ur,this,Xr).call(this,this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=(0,bt.A)(Ur,this,Xr).call(this,360-this.rotation);let f,g,A=!1,m=!1;switch(t){case"topLeft":A=!0,f=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":A=!0,f=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":m=!0,f=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":A=!0,f=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":A=!0,f=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":m=!0,f=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}const v=f(a,o),b=g(a,o);let w=u(...b);const y=h(s+w[0]),_=h(r+w[1]);let x=1,E=1,[C,k]=this.screenToPageTranslation(e.movementX,e.movementY);var S,M;if([C,k]=(S=C/i,M=k/n,[p[0]*S+p[2]*M,p[1]*S+p[3]*M]),A){const t=Math.hypot(a,o);x=E=Math.max(Math.min(Math.hypot(b[0]-v[0]-C,b[1]-v[1]-k)/t,1/a,1/o),l/a,c/o)}else m?x=Math.max(l,Math.min(1,Math.abs(b[0]-v[0]-C)))/a:E=Math.max(c,Math.min(1,Math.abs(b[1]-v[1]-k)))/o;const L=h(a*x),T=h(o*E);w=u(...g(L,T));const R=y-w[0],P=_-w[1];this.width=L,this.height=T,this.x=R,this.y=P,this.setDims(i*L,n*T),this.fixAndSetPosition()}function Jr(t){const{isMac:e}=ei.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function $r(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},(0,Et.A)(Wr,this,t.clientX),(0,Et.A)(jr,this,t.clientY),n=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-(0,xt.A)(Wr,this),i-(0,xt.A)(jr,this));(0,Et.A)(Wr,this,e),(0,Et.A)(jr,this,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)),(0,Et.A)(Pr,this,!1),this._uiManager.endDragSession()||(0,bt.A)(Ur,this,Jr).call(this,t)};window.addEventListener("pointerup",r,{signal:s}),window.addEventListener("blur",r,{signal:s})}function ta(t){Tt._resizerKeyboardManager.exec(this,t)}function ea(t){var e;(0,xt.A)(Or,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==(0,xt.A)(kr,this)&&(0,bt.A)(Ur,this,sa).call(this)}function ia(t){(0,Et.A)(Rr,this,(0,xt.A)(Or,this)?t:"")}function na(t){if((0,xt.A)(_r,this))for(const e of(0,xt.A)(_r,this))e.tabIndex=t}function sa(){if((0,Et.A)(Or,this,!1),(0,bt.A)(Ur,this,na).call(this,-1),(0,xt.A)(Sr,this)){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=(0,xt.A)(Sr,this);(0,bt.A)(Ur,this,Qr).call(this,t,e,i,n),(0,Et.A)(Sr,this,null)}}Tt=Vr,(0,yt.A)(Vr,"_borderLineWidth",-1),(0,yt.A)(Vr,"_colorManager",new Qn),(0,yt.A)(Vr,"_zIndex",1),(0,yt.A)(Vr,"_telemetryTimeout",1e3);class ra extends Vr{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const aa=3285377520,oa=4294901760,la=65535;class ca{constructor(t){this.h1=t?4294967295&t:aa,this.h2=t?4294967295&t:aa}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,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let f=0;f<n;f++)1&f?(a=r[f],a=a*h&oa|a*u&la,a=a<<15|a>>>17,a=a*d&oa|a*p&la,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[f],o=o*h&oa|o*u&la,o=o<<15|o>>>17,o=o*d&oa|o*p&la,c^=o,c=c<<13|c>>>19,c=5*c+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*h&oa|a*u&la,a=a<<15|a>>>17,a=a*d&oa|a*p&la,1&n?l^=a:c^=a}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&oa|36045*t&la,e=4283543511*e&oa|(2950163797*(e<<16|t>>>16)&oa)>>>16,t^=e>>>1,t=444984403*t&oa|60499*t&la,e=3301882366*e&oa|(3120437893*(e<<16|t>>>16)&oa)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const ha=Object.freeze({map:null,hash:"",transfer:void 0});var da=new WeakMap,ua=new WeakMap,pa=new WeakSet;class fa{constructor(){(0,vt.A)(this,pa),(0,_t.A)(this,da,!1),(0,_t.A)(this,ua,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=(0,xt.A)(ua,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return(0,xt.A)(ua,this).get(t)}remove(t){if((0,xt.A)(ua,this).delete(t),0===(0,xt.A)(ua,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of(0,xt.A)(ua,this).values())if(t instanceof Vr)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=(0,xt.A)(ua,this).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,(0,xt.A)(ua,this).set(t,e);n&&(0,bt.A)(pa,this,ga).call(this),e instanceof Vr&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return(0,xt.A)(ua,this).has(t)}getAll(){return(0,xt.A)(ua,this).size>0?ti((0,xt.A)(ua,this)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return(0,xt.A)(ua,this).size}resetModified(){(0,xt.A)(da,this)&&((0,Et.A)(da,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new ma(this)}get serializable(){if(0===(0,xt.A)(ua,this).size)return ha;const t=new Map,e=new ca,i=[],n=Object.create(null);let s=!1;for(const[r,a]of(0,xt.A)(ua,this)){const i=a instanceof Vr?a.serialize(!1,n):a;i&&(t.set(r,i),e.update("".concat(r,":").concat(JSON.stringify(i))),s||(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}:ha}get editorStats(){let t=null;const e=new Map;for(const s of(0,xt.A)(ua,this).values()){var i;if(!(s instanceof Vr))continue;const r=s.telemetryFinalData;if(!r)continue;const{type:a}=r;e.has(a)||e.set(a,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const o=(i=t)[a]||(i[a]=new Map);for(const[t,e]of Object.entries(r)){var n;if("type"===t)continue;let i=o.get(t);i||(i=new Map,o.set(t,i));const s=null!==(n=i.get(e))&&void 0!==n?n:0;i.set(e,s+1)}}for(const[s,r]of e)t[s]=r.computeTelemetryFinalData(t[s]);return t}}function ga(){(0,xt.A)(da,this)||((0,Et.A)(da,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var Aa=new WeakMap;class ma extends fa{constructor(t){super(),(0,_t.A)(this,Aa,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);(0,Et.A)(Aa,this,{map:s,hash:i,transfer:n})}get print(){Be("Should not call PrintAnnotationStorage.print")}get serializable(){return(0,xt.A)(Aa,this)}}var va=new WeakMap;class ba{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;(0,_t.A)(this,va,new Set),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(),(0,xt.A)(va,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!(0,xt.A)(va,this).has(e.loadedName)){if(He(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:s,style:r}=e,a=new FontFace(t,s,r);this.addNativeFontFace(a);try{await a.load(),(0,xt.A)(va,this).add(t),null===i||void 0===i||i(e)}catch(n){je("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(a)}return}Be("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 je("Failed to load font '".concat(e.family,"': '").concat(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(){var t;return Ue(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){var t;let e=!1;return(Bt||"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),Ue(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(He(!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 Ue(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 c="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=n(h,976,c.length,c);const d=1482184792;let u=i(h,16);for(s=0,r=c.length-3;s<r;s+=4)u=u-d+i(c,s)|0;var p;s<c.length&&(u=u-d+i(c+"XXX",s)|0),h=n(h,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f="url(data:font/opentype;base64,".concat(btoa(h),");"),g='@font-face {font-family:"'.concat(c,'";src:').concat(f,"}");this.insertRule(g);const A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(const m of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=m,A.append(t)}this._document.body.append(A),function t(e,i){if(++l>30)return je("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))}(c,()=>{A.remove(),e.complete()})}}class wa{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(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null===(t=this._inspectFont)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=Je(this.data),i="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");");let n;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),n='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(i,"}")}else n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(i,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,i),n}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){je('getPathGenerator - ignoring character: "'.concat(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 hi:{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 di:{const[t,e]=i.slice(r,r+2);n.push(i=>i.moveTo(t,e)),r+=2}break;case ui:{const[t,e]=i.slice(r,r+2);n.push(i=>i.lineTo(t,e)),r+=2}break;case pi:{const[t,e,s,a]=i.slice(r,r+4);n.push(i=>i.quadraticCurveTo(t,e,s,a)),r+=4}break;case fi:n.push(t=>t.restore());break;case gi:n.push(t=>t.save());break;case Ai:He(2===n.length,"Scale command is only valid at the third position.");break;case mi:{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 vi:{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(Bt){var ya=Promise.withResolvers(),_a=null;(async()=>{const t=await i.e(3237).then(i.t.bind(i,23237,19)),e=await i.e(7492).then(i.t.bind(i,97492,19)),n=await i.e(1815).then(i.t.bind(i,31815,19)),s=await i.e(6671).then(i.t.bind(i,66671,19));return new Map(Object.entries({fs:t,http:e,https:n,url:s,canvas:undefined,path2d:undefined}))})().then(t=>{_a=t,ya.resolve()},t=>{je("loadPackages: ".concat(t)),_a=new Map,ya.resolve()})}class xa{static get promise(){return ya.promise}static get(t){var e;return null===(e=_a)||void 0===e?void 0:e.get(t)}}const Ea=function(t){return xa.get("fs").promises.readFile(t).then(t=>new Uint8Array(t))};const Ca="Fill",ka="Stroke",Sa="Shading";function Ma(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 La{constructor(){this.constructor===La&&Be("Cannot initialize BaseShadingPattern.")}getPattern(){Be("Abstract method `getPattern` called.")}}class Ta extends La{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===ka||n===Ca){const r=e.current.getClippedPathBoundingBox(n,hn(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),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),i=ni.transform(i,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Ma(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);s.setTransform(h)}else Ma(t,this._bbox),s=this._createGradient(t);return s}}function Ra(t,e,i,n,s,r,a,o){const l=e.coords,c=e.colors,h=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,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,A=(l[n+1]+e.offsetY)*e.scaleY,m=(l[s]+e.offsetX)*e.scaleX,v=(l[s+1]+e.offsetY)*e.scaleY;if(f>=v)return;const b=c[r],w=c[r+1],y=c[r+2],_=c[a],x=c[a+1],E=c[a+2],C=c[o],k=c[o+1],S=c[o+2],M=Math.round(f),L=Math.round(v);let T,R,P,F,I,D,O,N;for(let W=M;W<=L;W++){if(W<A){const t=W<f?0:(f-W)/(f-A);T=p-(p-g)*t,R=b-(b-_)*t,P=w-(w-x)*t,F=y-(y-E)*t}else{let t;t=W>v?1:A===v?0:(A-W)/(A-v),T=g-(g-m)*t,R=_-(_-C)*t,P=x-(x-k)*t,F=E-(E-S)*t}let t;t=W<f?0:W>v?1:(f-W)/(f-v),I=p-(p-m)*t,D=b-(b-C)*t,O=w-(w-k)*t,N=y-(y-S)*t;const e=Math.round(Math.min(T,I)),i=Math.round(Math.max(T,I));let n=d*W+4*e;for(let s=e;s<=i;s++)t=(T-s)/(T-I),t<0?t=0:t>1&&(t=1),h[n++]=R-(R-D)*t|0,h[n++]=P-(P-O)*t|0,h[n++]=F-(F-N)*t|0,h[n++]=255}}function Pa(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,c=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<c;r++,e++)Ra(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Ra(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)Ra(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 Fa extends La{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),c=r/o,h=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,A=g.createImageData(o,l);if(e){const t=A.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 m of this._figures)Pa(A,m,d);g.putImageData(A,2,2);return{canvas:f.canvas,offsetX:n-2*c,offsetY:s-2*h,scaleX:c,scaleY:h}}getPattern(t,e,i,n){let s;if(Ma(t,this._bbox),n===Sa)s=ni.singularValueDecompose2dScale(hn(t));else if(s=ni.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=ni.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Sa?null:this._background,e.cachedCanvases);return n!==Sa&&(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 Ia extends La{getPattern(){return"hotpink"}}const Da=1,Oa=2;class Na{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;We("TilingType: "+a);const c=i[0],h=i[1],d=i[2],u=i[3],p=ni.singularValueDecompose2dScale(this.matrix),f=ni.singularValueDecompose2dScale(this.baseTransform),g=[p[0]*f[0],p[1]*f[1]],A=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),m=this.getSizeAndScale(s,this.ctx.canvas.height,g[1]),v=t.cachedCanvases.getCanvas("pattern",A.size,m.size,!0),b=v.context,w=l.createCanvasGraphics(b);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,r,o);let y=c,_=h,x=d,E=u;return c<0&&(y=0,x+=Math.abs(c)),h<0&&(_=0,E+=Math.abs(h)),b.translate(-A.scale*y,-m.scale*_),w.transform(A.scale,0,0,m.scale,0,0),b.save(),this.clipBbox(w,y,_,x,E),w.baseTransform=hn(w.ctx),w.executeOperatorList(e),w.endDrawing(),{canvas:v.canvas,scaleX:A.scale,scaleY:m.scale,offsetX:y,offsetY:_}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(Na.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(hn(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Da:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case Oa:const r=ni.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new Qe("Unsupported paint type: ".concat(e))}}getPattern(t,e,i,n){let s=i;n!==Sa&&(s=ni.transform(s,e.baseTransform),this.matrix&&(s=ni.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 Wa(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=ei.isLittleEndian?4278190080:255,[c,h]=o?[a,l]:[l,a],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let f=0;for(let g=0;g<r;g++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[f++]=128&t?h:c,n[f++]=64&t?h:c,n[f++]=32&t?h:c,n[f++]=16&t?h:c,n[f++]=8&t?h:c,n[f++]=4&t?h:c,n[f++]=2&t?h:c,n[f++]=1&t?h:c}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[f++]=t&1<<7-e?h:c}return{srcPos:i,destPos:f}}(0,yt.A)(Na,"MAX_PATTERN_SIZE",3e3);const ja=16;class Ba{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 Ha(t,e,i,n,s,r,a,o,l,c){const[h,d,u,p,f,g]=hn(t);if(0===d&&0===u){const A=a*h+f,m=Math.round(A),v=o*p+g,b=Math.round(v),w=(a+l)*h+f,y=Math.abs(Math.round(w)-m)||1,_=(o+c)*p+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),m,b),t.drawImage(e,i,n,s,r,0,0,y,x),t.setTransform(h,d,u,p,f,g),[y,x]}if(0===h&&0===p){const A=o*u+f,m=Math.round(A),v=a*d+g,b=Math.round(v),w=(o+c)*u+f,y=Math.abs(Math.round(w)-m)||1,_=(a+l)*d+g,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,m,b),t.drawImage(e,i,n,s,r,0,0,x,y),t.setTransform(h,d,u,p,f,g),[x,y]}t.drawImage(e,i,n,s,r,a,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class za{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Ht,this.textMatrixScale=1,this.fontMatrix=zt,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=ee,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]=ni.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=ni.applyTransform(e,t),n=ni.applyTransform(e.slice(2),t),s=ni.applyTransform([e[0],e[3]],t),r=ni.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){ni.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,c){const h=ni.bezierBoundingBox(e,i,n,s,r,a,o,l,c);c||this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ca,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===ka){e||Be("Stroke bounding box must include transform.");const t=ni.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=ni.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]:Ca,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return ni.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Ua(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%ja,r=(i-s)/ja,a=0===s?r:r+1,o=t.createImageData(n,ja);let l,c=0;const h=e.data,d=o.data;let u,p,f,g;if(e.kind===oe.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,A=n+7>>3,m=4294967295,v=ei.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(f=u<r?ja:s,l=0,p=0;p<f;p++){const t=e-c;let s=0;const r=t>A?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=h[c++],i[l++]=128&d?m:v,i[l++]=64&d?m:v,i[l++]=32&d?m:v,i[l++]=16&d?m:v,i[l++]=8&d?m:v,i[l++]=4&d?m:v,i[l++]=2&d?m:v,i[l++]=1&d?m:v;for(;s<r;s++)0===o&&(d=h[c++],o=128),i[l++]=d&o?m:v,o>>=1}for(;l<g;)i[l++]=0;t.putImageData(o,0,u*ja)}}else if(e.kind===oe.RGBA_32BPP){for(p=0,g=n*ja*4,u=0;u<r;u++)d.set(h.subarray(c,c+g)),c+=g,t.putImageData(o,0,p),p+=ja;u<a&&(g=n*s*4,d.set(h.subarray(c,c+g)),t.putImageData(o,0,p))}else{if(e.kind!==oe.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(f=ja,g=n*f,u=0;u<a;u++){for(u>=r&&(f=s,g=n*f),l=0,p=g;p--;)d[l++]=h[c++],d[l++]=h[c++],d[l++]=h[c++],d[l++]=255;t.putImageData(o,0,u*ja)}}}function Va(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%ja,r=(i-s)/ja,a=0===s?r:r+1,o=t.createImageData(n,ja);let l=0;const c=e.data,h=o.data;for(let d=0;d<a;d++){const e=d<r?ja:s;({srcPos:l}=Wa({src:c,srcPos:l,dest:h,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*ja)}}function Ga(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 qa(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),!Bt){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function Xa(t,e){if(e)return!0;const i=ni.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*ki.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const Ya=["butt","round","square"],Ka=["miter","round","bevel"],Qa={},Za={};var Ja=new WeakSet;class $a{constructor(t,e,i,n,s,r,a,o){let{optionalContentConfig:l,markedContentStack:c=null}=r;(0,vt.A)(this,Ja),this.ctx=t,this.current=new za(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=c||[],this.optionalContentConfig=l,this.cachedCanvases=new Ba(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(...hn(this.compositeCtx))}this.ctx.save(),qa(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=hn(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,c=l?Date.now()+15:0;let h=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!==Fe.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&&++h>10){if(Date.now()>c)return i(),a;h=0}}}endDrawing(){(0,bt.A)(Ja,this,to).call(this),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(),(0,bt.A)(Ja,this,eo).call(this)}_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,c=n,h="prescale1";for(;a>2&&l>1||o>2&&c>1;){let e=l,i=c;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&c>1&&(i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/i),s=this.cachedCanvases.getCanvas(h,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,c,0,0,e,i),t=s.canvas,l=e,c=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=hn(e);let o,l,c,h;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])}}c=i}c||(h=this.cachedCanvases.getCanvas("maskCanvas",i,n),Va(h.context,t));let d=ni.transform(a,[1/i,0,0,-1/n,0,0]);d=ni.transform(d,[1,0,0,1,0,-n]);const[u,p,f,g]=ni.getAxialAlignedBoundingBox([0,0,i,n],d),A=Math.round(f-u)||1,m=Math.round(g-p)||1,v=this.cachedCanvases.getCanvas("fillCanvas",A,m),b=v.context,w=u,y=p;b.translate(-w,-y),b.transform(...d),c||(c=this._scaleImage(h.canvas,dn(b)),c=c.img,o&&r&&o.set(l,c)),b.imageSmoothingEnabled=Xa(hn(b),t.interpolate),Ha(b,c,0,0,c.width,c.height,0,0,i,n),b.globalCompositeOperation="source-in";const _=ni.transform(dn(b),[1,0,0,1,-w,-y]);return b.fillStyle=r?s.getPattern(e,this,_,Ca):s,b.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,v.canvas)),{canvas:v.canvas,offsetX:Math.round(w),offsetY:Math.round(y)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Ya[t]}setLineJoin(t){this.ctx.lineJoin=Ka[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(...hn(this.suspendedCtx)),Ga(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(),Ga(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,c,h){let d=t.canvas,u=o-c,p=l-h;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=ni.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=ni.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 f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Ga(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(),Ga(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 c=hn(n),h=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],d=h?i.slice(0):null;for(let u=0,p=0,f=t.length;u<f;u++)switch(0|t[u]){case Fe.rectangle:o=e[p++],l=e[p++];const t=e[p++],i=e[p++],u=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(u,f):(n.lineTo(u,l),n.lineTo(u,f),n.lineTo(o,f)),h||s.updateRectMinMax(c,[o,l,u,f]),n.closePath();break;case Fe.moveTo:o=e[p++],l=e[p++],n.moveTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Fe.lineTo:o=e[p++],l=e[p++],n.lineTo(o,l),h||s.updatePathMinMax(c,o,l);break;case Fe.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(c,r,a,e[p],e[p+1],e[p+2],e[p+3],o,l,d),p+=6;break;case Fe.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(c,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 Fe.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(c,r,a,e[p],e[p+1],o,l,o,l,d),p+=4;break;case Fe.closePath:n.closePath()}h&&s.updateScalingPathMinMax(c,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&&null!==i&&void 0!==i&&i.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,dn(e),ka),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,dn(e),Ca),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=Qa}eoClip(){this.pendingClip=Za}beginText(){this.current.textMatrix=Ht,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){var i;const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error("Can't find font for ".concat(t));if(s.fontMatrix=n.fontMatrix||zt,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||je("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const r=n.loadedName||"sans-serif",a=(null===(i=n.systemFontInfo)||void 0===i?void 0:i.css)||'"'.concat(r,'", ').concat(n.fallbackName);let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=e;e<16?c=16:e>100&&(c=100),this.current.fontSizeScale=e/c,this.ctx.font="".concat(l," ").concat(o," ").concat(c,"px ").concat(a)}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,c=o&re,h=!!(o&ae),d=r.patternFill&&!a.missingFile;let u;if((a.disableFontFace||h||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),c!==ee&&c!==ne||s.fill(),c!==ie&&c!==ne||s.stroke(),s.restore()):(c!==ee&&c!==ne||s.fillText(t,e,i),c!==ie&&c!==ne||s.strokeText(t,e,i)),h){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:hn(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 Ue(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,c=e.textHScale*l,h=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],g=e.textRenderingMode===ee&&!i.disableFontFace&&!e.patternFill;let A;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(c,-1):s.scale(c,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,dn(s),Ca);A=hn(s),s.restore(),s.fillStyle=t}let m=e.lineWidth;const v=e.textMatrixScale;if(0===v||0===m){const t=e.textRenderingMode&re;t!==ie&&t!==ne||(m=this.getSinglePixelWidth())}else m/=v;if(1!==r&&(s.scale(r,r),m/=r),s.lineWidth=m,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*f*c,s.restore(),void this.compose()}let b,w=0;for(b=0;b<h;++b){const e=t[b];if("number"===typeof e){w+=u*e*n/1e3;continue}let c=!1;const h=(e.isSpace?o:0)+a,m=e.fontChar,v=e.accent;let y,_,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*f,n=t[2]*f;x=t?-t[0]:x,y=i/r,_=(w+n)/r}else y=w/r,_=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(m).width/n*r;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;c=!0,s.save(),s.scale(e,1),y/=e}else x!==t&&(y+=(x-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(g&&!v)s.fillText(m,y,_);else if(this.paintChar(m,y,_,A),v){const t=y+n*v.offset.x/r,e=_-n*v.offset.y/r;this.paintChar(v.fontChar,t,e,A)}w+=d?x*f-h*l:x*f+h*l,c&&s.restore()}d?e.y-=w:e.x+=w*c,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,o=i.charSpacing,l=i.wordSpacing,c=i.textHScale*r,h=i.fontMatrix||zt,d=t.length;let u,p,f,g;if(!(i.textRenderingMode===se)&&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),u=0;u<d;++u){if(p=t[u],"number"===typeof p){g=a*p*s/1e3,this.ctx.translate(g,0),i.x+=g*c;continue}const r=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];if(!d){je('Type3 character "'.concat(p.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...h),this.executeOperatorList(d),this.restore());f=ni.applyTransform([p.width,0],h)[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||hn(this.ctx),s={createCanvasGraphics:t=>new $a(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Na(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=ni.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=ni.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 Ta(t);case"Mesh":return new Fa(t);case"Dummy":return new Ia}throw new Error("Unknown IR type: ".concat(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,dn(e),Sa);const n=dn(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=ni.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(){Be("Should not call beginInlineImage")}beginImageData(){Be("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=hn(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(hn(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||We("TODO: Support non-isolated groups."),t.knockout&&je("Knockout groups not supported.");const i=hn(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=ni.getAxialAlignedBoundingBox(t.bbox,hn(e));const s=[0,0,e.canvas.width,e.canvas.height];n=ni.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 c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(c,o,l),d=h.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:h.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()),Ga(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=hn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=ni.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((0,bt.A)(Ja,this,to).call(this),qa(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]=ni.singularValueDecompose2dScale(hn(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),c=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:h,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-a,0,r*a),qa(this.ctx)}else qa(this.ctx),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.endPath()}this.current=new za(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),(0,bt.A)(Ja,this,eo).call(this),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 c=e+7&-8;let h=new Uint8Array(c*i),d=0;for(const g of t.data){let t=128;for(;t>0;)h[d++]=g&t?0:255,t>>=1}let u=0;for(d=0,0!==h[d]&&(l[0]=1,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[a]=h[d]?2:1,++u),d++;for(0!==h[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*c,o=r*s,h[d-c]!==h[d]&&(l[o]=h[d]?1:8,++u);let t=(h[d]?4:0)+(h[d-c]?8:0);for(a=1;a<e;a++)t=(t>>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(h[d-c]!==h[d]&&(l[o+a]=h[d]?2:4,++u),u>1e3)return null}for(d=c*(i-1),o=r*s,0!==h[d]&&(l[o]=8,++u),a=1;a<e;a++)h[d]!==h[d+1]&&(l[o+a]=h[d]?4:8,++u),d++;if(0!==h[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=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;f.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),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return h=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),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=hn(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 c=0,h=r.length;c<h;c+=2){const t=ni.transform(o,[e,i,n,s,r[c],r[c+1]]),[h,d]=ni.applyTransform([0,0],t);a.drawImage(l.canvas,h,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),c=l.context;c.save();Va(c,this.getObject(t,s)),c.globalCompositeOperation="source-in",c.fillStyle=n?i.getPattern(c,this,dn(e),Ca):i,c.fillRect(0,0,r,a),c.restore(),e.save(),e.transform(...o),e.scale(1,-1),Ha(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):je("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void je("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let l=0,c=n.length;l<c;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(),!Bt){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;Ua(n,t),s=this.applyTransferMapsToCanvas(n)}const r=this._scaleImage(s,dn(n));n.imageSmoothingEnabled=Xa(hn(n),t.interpolate),Ha(n,r.img,0,0,r.paintWidth,r.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;Ua(s,t),n=this.applyTransferMapsToCanvas(s)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),Ha(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===Za?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=hn(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),c=Math.hypot(n,s);if(0===t)r=c/o,a=l/o;else{const e=t*o;r=c>e?c/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}}function to(){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)}function eo(){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}}}for(const Xv in Fe)void 0!==$a.prototype[Xv]&&($a.prototype[Fe[Xv]]=$a.prototype[Xv]);class io{static get workerPort(){return(0,bt.A)(io,this,no)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");no._=(0,bt.A)(io,this,t)}static get workerSrc(){return(0,bt.A)(io,this,so)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");so._=(0,bt.A)(io,this,t)}}var no={_:null},so={_:""};const ro=1,ao=2,oo=1,lo=2,co=3,ho=4,uo=5,po=6,fo=7,go=8;function Ao(t){switch(t instanceof Error||"object"===typeof t&&null!==t||Be('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Ze(t.message);case"MissingPDFException":return new Ye(t.message);case"PasswordException":return new Ge(t.message,t.code);case"UnexpectedResponseException":return new Ke(t.message,t.status);case"UnknownErrorException":return new qe(t.message,t.details);default:return new qe(t.message,t.toString())}}var mo=new WeakSet;class vo{constructor(t,e,i){(0,vt.A)(this,mo),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(0,bt.A)(mo,this,wo).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===ro)i.resolve(e.data);else{if(e.callback!==ao)throw new Error("Unexpected callback case");i.reject(Ao(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,s=e.sourceName;return void new Promise(function(t){t(n(e.data))}).then(function(n){i.postMessage({sourceName:t,targetName:s,callback:ro,callbackId:e.callbackId,data:n})},function(n){i.postMessage({sourceName:t,targetName:s,callback:ao,callbackId:e.callbackId,reason:Ao(n)})})}e.streamId?(0,bt.A)(mo,this,bo).call(this,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 "'.concat(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:po,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{He(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:oo,streamId:s,reason:Ao(t)}),e.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}function bo(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:ho,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:co,streamId:e}),delete r.streamSinks[e])},error(t){He(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:uo,streamId:e,reason:Ao(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:go,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:go,streamId:e,reason:Ao(t)})})}function wo(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 go:t.success?r.startCall.resolve():r.startCall.reject(Ao(t.reason));break;case fo:t.success?r.pullCall.resolve():r.pullCall.reject(Ao(t.reason));break;case po:if(!a){s.postMessage({sourceName:i,targetName:n,stream:fo,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise(function(t){var e;t(null===(e=a.onPull)||void 0===e?void 0:e.call(a))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:fo,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:fo,streamId:e,reason:Ao(t)})});break;case ho:if(He(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case co:if(He(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),(0,bt.A)(mo,this,yo).call(this,r,e);break;case uo:He(r,"error should have stream controller"),r.controller.error(Ao(t.reason)),(0,bt.A)(mo,this,yo).call(this,r,e);break;case lo:t.success?r.cancelCall.resolve():r.cancelCall.reject(Ao(t.reason)),(0,bt.A)(mo,this,yo).call(this,r,e);break;case oo:if(!a)break;new Promise(function(e){var i;e(null===(i=a.onCancel)||void 0===i?void 0:i.call(a,Ao(t.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:lo,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:lo,streamId:e,reason:Ao(t)})}),a.sinkCapability.reject(Ao(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function yo(t,e){var i,n,s;await Promise.allSettled([null===(i=t.startCall)||void 0===i?void 0:i.promise,null===(n=t.pullCall)||void 0===n?void 0:n.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}var _o=new WeakMap,xo=new WeakMap;class Eo{constructor(t){let{parsedData:e,rawData:i}=t;(0,_t.A)(this,_o,void 0),(0,_t.A)(this,xo,void 0),(0,Et.A)(_o,this,e),(0,Et.A)(xo,this,i)}getRaw(){return(0,xt.A)(xo,this)}get(t){var e;return null!==(e=(0,xt.A)(_o,this).get(t))&&void 0!==e?e:null}getAll(){return ti((0,xt.A)(_o,this))}has(t){return(0,xt.A)(_o,this).has(t)}}const Co=Symbol("INTERNAL");var ko=new WeakMap,So=new WeakMap,Mo=new WeakMap,Lo=new WeakMap;class To{constructor(t,e){let{name:i,intent:n,usage:s}=e;(0,_t.A)(this,ko,!1),(0,_t.A)(this,So,!1),(0,_t.A)(this,Mo,!1),(0,_t.A)(this,Lo,!0),(0,Et.A)(ko,this,!!(t&Gt)),(0,Et.A)(So,this,!!(t&qt)),this.name=i,this.intent=n,this.usage=s}get visible(){if((0,xt.A)(Mo,this))return(0,xt.A)(Lo,this);if(!(0,xt.A)(Lo,this))return!1;const{print:t,view:e}=this.usage;return(0,xt.A)(ko,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!(0,xt.A)(So,this)||"OFF"!==(null===t||void 0===t?void 0:t.printState)}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==Co&&Be("Internal method `_setVisible` called."),(0,Et.A)(Mo,this,i),(0,Et.A)(Lo,this,e)}}var Ro=new WeakMap,Po=new WeakMap,Fo=new WeakMap,Io=new WeakMap,Do=new WeakSet;class Oo{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt;if((0,vt.A)(this,Do),(0,_t.A)(this,Ro,null),(0,_t.A)(this,Po,new Map),(0,_t.A)(this,Fo,null),(0,_t.A)(this,Io,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,(0,Et.A)(Io,this,t.order);for(const i of t.groups)(0,xt.A)(Po,this).set(i.id,new To(e,i));if("OFF"===t.baseState)for(const t of(0,xt.A)(Po,this).values())t._setVisible(Co,!1);for(const e of t.on)(0,xt.A)(Po,this).get(e)._setVisible(Co,!0);for(const e of t.off)(0,xt.A)(Po,this).get(e)._setVisible(Co,!1);(0,Et.A)(Fo,this,this.getHash())}}isVisible(t){if(0===(0,xt.A)(Po,this).size)return!0;if(!t)return We("Optional content group not defined."),!0;if("OCG"===t.type)return(0,xt.A)(Po,this).has(t.id)?(0,xt.A)(Po,this).get(t.id).visible:(je("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return(0,bt.A)(Do,this,No).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if((0,xt.A)(Po,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if(!(0,xt.A)(Po,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if(!(0,xt.A)(Po,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;if((0,xt.A)(Po,this).get(e).visible)return!1}return!0}return je("Unknown optional content policy ".concat(t.policy,".")),!0}return je("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=(0,xt.A)(Po,this).get(t);i?(i._setVisible(Co,!!e,!0),(0,Et.A)(Ro,this,null)):je("Optional content group not found: ".concat(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=(0,xt.A)(Po,this).get(s);if(t)switch(e){case"ON":t._setVisible(Co,!0);break;case"OFF":t._setVisible(Co,!1);break;case"Toggle":t._setVisible(Co,!t.visible)}}(0,Et.A)(Ro,this,null)}get hasInitialVisibility(){return null===(0,xt.A)(Fo,this)||this.getHash()===(0,xt.A)(Fo,this)}getOrder(){return(0,xt.A)(Po,this).size?(0,xt.A)(Io,this)?(0,xt.A)(Io,this).slice():[...(0,xt.A)(Po,this).keys()]:null}getGroups(){return(0,xt.A)(Po,this).size>0?ti((0,xt.A)(Po,this)):null}getGroup(t){return(0,xt.A)(Po,this).get(t)||null}getHash(){if(null!==(0,xt.A)(Ro,this))return(0,xt.A)(Ro,this);const t=new ca;for(const[e,i]of(0,xt.A)(Po,this))t.update("".concat(e,":").concat(i.visible));return(0,Et.A)(Ro,this,t.hexdigest())}}function No(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=(0,bt.A)(Do,this,No).call(this,e);else{if(!(0,xt.A)(Po,this).has(e))return je("Optional content group not found: ".concat(e)),!0;s=(0,xt.A)(Po,this).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}class Wo{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;He(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,(null===r||void 0===r?void 0: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{He(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,i,n,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded}):null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){He(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new jo(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Bo(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class jo{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=Ji(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 Bo{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 Ho(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 zo(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=$e(i);i=n.decode(s),e=!1}catch(n){}}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(r){}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(Ji(t))return t}return null}function Uo(t,e){return 404===t||0===t&&e.startsWith("file:")?new Ye('Missing PDF "'+e+'".'):new Ke("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)}function Vo(t){return 200===t||206===t}function Go(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function qo(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Xo(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(je("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class Yo{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(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return He(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Ko(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Qo(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Ko{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=qo(this._stream.httpHeaders);const i=e.url;fetch(i,Go(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!Vo(t.status))throw Uo(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=Ho({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=zo(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ze("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(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Xo(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class Qo{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=qo(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(e,"-").concat(i-1));const s=n.url;fetch(s,Go(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!Vo(t.status))throw Uo(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(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:Xo(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class Zo{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=".concat(t.begin,"-").concat(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){var i;const n=this.pendingRequests[t];n&&(null===(i=n.onProgress)||void 0===i||i.call(n,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;var s;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void(null===(s=i.onError)||void 0===s||s.call(i,n.status));const r=n.status||200;var a;if(!(200===r&&206===i.expectedStatus)&&r!==i.expectedStatus)return void(null===(a=i.onError)||void 0===a||a.call(i,n.status));const o=function(t){const e=t.response;return"string"!==typeof e?e:$e(e).buffer}(n);if(206===r){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:o})}else if(o)i.onDone({begin:0,chunk:o});else{var l;null===(l=i.onError)||void 0===l||l.call(i,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 Jo{constructor(t){this._source=t,this._manager=new Zo(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 He(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new $o(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new tl(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class $o{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}=Ho({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=zo(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=Uo(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){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{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 tl{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(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,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=Uo(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(null===(e=this.onProgress)||void 0===e||e.call(this,{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 el=/^file:\/\/\/[a-zA-Z]:\//;class il{constructor(t){this.source=t,this.url=function(t){const e=xa.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse("file:///".concat(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(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return He(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ll(this):new al(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new cl(this,t,e):new ol(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class nl{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(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).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 Ze("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class sl{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(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).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 rl(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class al extends nl{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new Ye('Missing PDF "'.concat(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}=Ho({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=zo(i)};if(this._request=null,"http:"===this._url.protocol){const i=xa.get("http");this._request=i.request(rl(this._url,t.httpHeaders),e)}else{const i=xa.get("https");this._request=i.request(rl(this._url,t.httpHeaders),e)}this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class ol extends sl{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=".concat(e,"-").concat(i-1);const n=t=>{if(404===t.statusCode){const t=new Ye('Missing PDF "'.concat(this._url,'".'));return void(this._storedError=t)}this._setReadableStream(t)};if(this._request=null,"http:"===this._url.protocol){const t=xa.get("http");this._request=t.request(rl(this._url,this._httpHeaders),n)}else{const t=xa.get("https");this._request=t.request(rl(this._url,this._httpHeaders),n)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class ll extends nl{constructor(t){super(t);let e=decodeURIComponent(this._url.path);el.test(this._url.href)&&(e=e.replace(/^\//,""));const i=xa.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 Ye('Missing PDF "'.concat(e,'".'))),this._storedError=t,this._headersCapability.reject(t)})}}class cl extends sl{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);el.test(this._url.href)&&(n=n.replace(/^\//,""));const s=xa.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const hl=30;var dl=new WeakMap,ul=new WeakMap,pl=new WeakMap,fl=new WeakMap,gl=new WeakMap,Al=new WeakMap,ml=new WeakMap,vl=new WeakMap,bl=new WeakMap,wl=new WeakMap,yl=new WeakMap,_l=new WeakMap,xl=new WeakMap,El=new WeakMap,Cl=new WeakMap,kl=new WeakMap,Sl=new WeakMap,Ml=new WeakMap,Ll=new WeakSet;class Tl{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if((0,vt.A)(this,Ll),(0,_t.A)(this,dl,Promise.withResolvers()),(0,_t.A)(this,ul,null),(0,_t.A)(this,pl,!1),(0,_t.A)(this,fl,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),(0,_t.A)(this,gl,null),(0,_t.A)(this,Al,null),(0,_t.A)(this,ml,0),(0,_t.A)(this,vl,0),(0,_t.A)(this,bl,null),(0,_t.A)(this,wl,null),(0,_t.A)(this,yl,0),(0,_t.A)(this,_l,0),(0,_t.A)(this,xl,Object.create(null)),(0,_t.A)(this,El,[]),(0,_t.A)(this,Cl,null),(0,_t.A)(this,kl,[]),(0,_t.A)(this,Sl,new WeakMap),(0,_t.A)(this,Ml,null),i instanceof ReadableStream)(0,Et.A)(Cl,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');(0,Et.A)(Cl,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}(0,Et.A)(ul,this,(0,Et.A)(wl,this,n)),(0,Et.A)(_l,this,s.scale*(globalThis.devicePixelRatio||1)),(0,Et.A)(yl,this,s.rotation),(0,Et.A)(Al,this,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:r,pageHeight:a,pageX:o,pageY:l}=s.rawDims;(0,Et.A)(Ml,this,[1,0,0,-1,-o,l+a]),(0,Et.A)(vl,this,r),(0,Et.A)(ml,this,a),Dl.call(Tl),un(n,s),(0,xt.A)(dl,this).promise.catch(()=>{}).then(()=>{Bl._.delete(this),(0,Et.A)(Al,this,null),(0,Et.A)(xl,this,null)})}render(){const t=()=>{(0,xt.A)(bl,this).read().then(e=>{var i;let{value:n,done:s}=e;s?(0,xt.A)(dl,this).resolve():(null!==(i=(0,xt.A)(gl,this))&&void 0!==i||(0,Et.A)(gl,this,n.lang),Object.assign((0,xt.A)(xl,this),n.styles),(0,bt.A)(Ll,this,Rl).call(this,n.items),t())},(0,xt.A)(dl,this).reject)};return(0,Et.A)(bl,this,(0,xt.A)(Cl,this).getReader()),Bl._.add(this),t(),(0,xt.A)(dl,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==(0,xt.A)(yl,this)&&(null===i||void 0===i||i(),(0,Et.A)(yl,this,s),un((0,xt.A)(wl,this),{rotation:s})),n!==(0,xt.A)(_l,this)){null===i||void 0===i||i(),(0,Et.A)(_l,this,n);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Il.call(Tl,(0,xt.A)(gl,this))};for(const e of(0,xt.A)(kl,this))t.properties=(0,xt.A)(Sl,this).get(e),t.div=e,(0,bt.A)(Ll,this,Fl).call(this,t)}}cancel(){var t;const e=new Ze("TextLayer task cancelled.");null===(t=(0,xt.A)(bl,this))||void 0===t||t.cancel(e).catch(()=>{}),(0,Et.A)(bl,this,null),(0,xt.A)(dl,this).reject(e)}get textDivs(){return(0,xt.A)(kl,this)}get textContentItemsStr(){return(0,xt.A)(El,this)}static cleanup(){if(!((0,bt.A)(Tl,this,Bl)._.size>0)){(0,bt.A)(Tl,this,Nl)._.clear();for(const{canvas:t}of(0,bt.A)(Tl,this,Wl)._.values())t.remove();(0,bt.A)(Tl,this,Wl)._.clear()}}}function Rl(t){var e,i;if((0,xt.A)(pl,this))return;null!==(i=(e=(0,xt.A)(Al,this)).ctx)&&void 0!==i||(e.ctx=Il.call(Rt,(0,xt.A)(gl,this)));const n=(0,xt.A)(kl,this),s=(0,xt.A)(El,this);for(const r of t){if(n.length>1e5)return je("Ignoring additional textDivs for performance reasons."),void(0,Et.A)(pl,this,!0);if(void 0!==r.str)s.push(r.str),(0,bt.A)(Ll,this,Pl).call(this,r);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){const t=(0,xt.A)(ul,this);(0,Et.A)(ul,this,document.createElement("span")),(0,xt.A)(ul,this).classList.add("markedContent"),null!==r.id&&(0,xt.A)(ul,this).setAttribute("id","".concat(r.id)),t.append((0,xt.A)(ul,this))}else"endMarkedContent"===r.type&&(0,Et.A)(ul,this,(0,xt.A)(ul,this).parentNode)}}function Pl(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};(0,xt.A)(kl,this).push(e);const n=ni.transform((0,xt.A)(Ml,this),t.transform);let s=Math.atan2(n[1],n[0]);const r=(0,xt.A)(xl,this)[t.fontName];r.vertical&&(s+=Math.PI/2);const a=(0,xt.A)(fl,this)&&r.fontSubstitution||r.fontFamily,o=Math.hypot(n[2],n[3]),l=o*Ol.call(Rt,a,(0,xt.A)(gl,this));let c,h;0===s?(c=n[4],h=n[5]-l):(c=n[4]+l*Math.sin(s),h=n[5]-l*Math.cos(s));const d="calc(var(--scale-factor)*",u=e.style;(0,xt.A)(ul,this)===(0,xt.A)(wl,this)?(u.left="".concat((100*c/(0,xt.A)(vl,this)).toFixed(2),"%"),u.top="".concat((100*h/(0,xt.A)(ml,this)).toFixed(2),"%")):(u.left="".concat(d).concat(c.toFixed(2),"px)"),u.top="".concat(d).concat(h.toFixed(2),"px)")),u.fontSize="".concat(d).concat((jl._*o).toFixed(2),"px)"),u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,(0,xt.A)(fl,this)&&(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),(0,xt.A)(Sl,this).set(e,i),(0,xt.A)(Al,this).div=e,(0,xt.A)(Al,this).properties=i,(0,bt.A)(Ll,this,Fl).call(this,(0,xt.A)(Al,this)),i.hasText&&(0,xt.A)(ul,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),(0,xt.A)(ul,this).append(t)}}function Fl(t){const{div:e,properties:i,ctx:n,prevFontSize:s,prevFontFamily:r}=t,{style:a}=e;let o="";if(jl._>1&&(o="scale(".concat(1/jl._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:l}=a,{canvasWidth:c,fontSize:h}=i;s===h&&r===l||(n.font="".concat(h*(0,xt.A)(_l,this),"px ").concat(l),t.prevFontSize=h,t.prevFontFamily=l);const{width:d}=n.measureText(e.textContent);d>0&&(o="scaleX(".concat(c*(0,xt.A)(_l,this)/d,") ").concat(o))}0!==i.angle&&(o="rotate(".concat(i.angle,"deg) ").concat(o)),o.length>0&&(a.transform=o)}function Il(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=(0,bt.A)(Rt,this,Wl)._.get(t||(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}),(0,bt.A)(Rt,this,Wl)._.set(t,e)}return e}function Dl(){if(null!==(0,bt.A)(Rt,this,jl)._)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),jl._=(0,bt.A)(Rt,this,t.getBoundingClientRect().height),t.remove()}function Ol(t,e){const i=(0,bt.A)(Rt,this,Nl)._.get(t);if(i)return i;const n=(0,bt.A)(Rt,this,Il).call(this,e),s=n.font;n.canvas.width=n.canvas.height=hl,n.font="".concat(hl,"px ").concat(t);const r=n.measureText("");let a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);if(a){const e=a/(a+o);return(0,bt.A)(Rt,this,Nl)._.set(t,e),n.canvas.width=n.canvas.height=0,n.font=s,e}n.strokeStyle="red",n.clearRect(0,0,hl,hl),n.strokeText("g",0,0);let l=n.getImageData(0,0,hl,hl).data;o=0;for(let h=l.length-1-3;h>=0;h-=4)if(l[h]>0){o=Math.ceil(h/4/hl);break}n.clearRect(0,0,hl,hl),n.strokeText("A",0,hl),l=n.getImageData(0,0,hl,hl).data,a=0;for(let h=0,d=l.length;h<d;h+=4)if(l[h]>0){a=hl-Math.floor(h/4/hl);break}n.canvas.width=n.canvas.height=0,n.font=s;const c=a?a/(a+o):.8;return(0,bt.A)(Rt,this,Nl)._.set(t,c),c}Rt=Tl;var Nl={_:new Map},Wl={_:new Map},jl={_:null},Bl={_:new Set};function Hl(){rn("`renderTextLayer`, please use `TextLayer` instead.");const t=arguments[0],{textContentSource:e,container:i,viewport:n}=t,s=(0,mt.A)(t,Ct),r=Object.keys(s);r.length>0&&je("Ignoring `renderTextLayer` parameters: "+r.join(", "));const a=new Tl({textContentSource:e,container:i,viewport:n}),{textDivs:o,textContentItemsStr:l}=a;return{promise:a.render(),textDivs:o,textContentItemsStr:l}}function zl(){rn("`updateTextLayer`, please use `TextLayer` instead.")}class Ul{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let s=null;const r=i.name;if("#text"===r)s=i.value;else{if(!Ul.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&n.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),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 Vl=65536,Gl=Bt?class extends yi{_createCanvas(t,e){return xa.get("canvas").createCanvas(t,e)}}:class extends yi{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}},ql=Bt?class extends _i{_fetchData(t,e){return Ea(t).then(t=>({cMapData:t,compressionType:e}))}}:qi,Xl=Bt?class extends bi{}:class extends bi{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),(0,vt.A)(this,Fi),(0,_t.A)(this,Si,void 0),(0,_t.A)(this,Mi,void 0),(0,_t.A)(this,Li,void 0),(0,_t.A)(this,Ti,void 0),(0,_t.A)(this,Ri,void 0),(0,_t.A)(this,Pi,0),(0,Et.A)(Li,this,t),(0,Et.A)(Ti,this,e)}addFilter(t){var e,i;if(!t)return"none";let n=wt(Fi,this,Ii).get(t);if(n)return n;const[s,r,a]=(0,bt.A)(Fi,this,Ni).call(this,t),o=1===t.length?s:"".concat(s).concat(r).concat(a);if(n=wt(Fi,this,Ii).get(o),n)return wt(Fi,this,Ii).set(t,n),n;const l="g_".concat((0,xt.A)(Li,this),"_transfer_map_").concat(((0,Et.A)(Pi,this,(e=(0,xt.A)(Pi,this),i=e++,e)),i)),c="url(#".concat(l,")");wt(Fi,this,Ii).set(t,c),wt(Fi,this,Ii).set(o,c);const h=(0,bt.A)(Fi,this,Bi).call(this,l);return(0,bt.A)(Fi,this,zi).call(this,s,r,a,h),c}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let r=wt(Fi,this,Di).get(s);if((null===(i=r)||void 0===i?void 0:i.key)===n)return r.url;var a;r?(null===(a=r.filter)||void 0===a||a.remove(),r.key=n,r.url="none",r.filter=null):(r={key:n,url:"none",filter:null},wt(Fi,this,Di).set(s,r));if(!t||!e)return r.url;const o=(0,bt.A)(Fi,this,Vi).call(this,t);t=ni.makeHexColor(...o);const l=(0,bt.A)(Fi,this,Vi).call(this,e);if(e=ni.makeHexColor(...l),wt(Fi,this,Oi).style.color="","#000000"===t&&"#ffffff"===e||t===e)return r.url;const c=new Array(256);for(let f=0;f<=255;f++){const t=f/255;c[f]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const h=c.join(","),d="g_".concat((0,xt.A)(Li,this),"_hcm_filter"),u=r.filter=(0,bt.A)(Fi,this,Bi).call(this,d);(0,bt.A)(Fi,this,zi).call(this,h,h,h,u),(0,bt.A)(Fi,this,ji).call(this,u);const p=(t,e)=>{const i=o[t]/255,n=l[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(0,bt.A)(Fi,this,zi).call(this,p(0,5),p(1,5),p(2,5),u),r.url="url(#".concat(d,")"),r.url}addAlphaFilter(t){var e,i;let n=wt(Fi,this,Ii).get(t);if(n)return n;const[s]=(0,bt.A)(Fi,this,Ni).call(this,[t]),r="alpha_".concat(s);if(n=wt(Fi,this,Ii).get(r),n)return wt(Fi,this,Ii).set(t,n),n;const a="g_".concat((0,xt.A)(Li,this),"_alpha_map_").concat(((0,Et.A)(Pi,this,(e=(0,xt.A)(Pi,this),i=e++,e)),i)),o="url(#".concat(a,")");wt(Fi,this,Ii).set(t,o),wt(Fi,this,Ii).set(r,o);const l=(0,bt.A)(Fi,this,Bi).call(this,a);return(0,bt.A)(Fi,this,Ui).call(this,s,l),o}addLuminosityFilter(t){var e,i;let n,s,r=wt(Fi,this,Ii).get(t||"luminosity");if(r)return r;if(t?([n]=(0,bt.A)(Fi,this,Ni).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",r=wt(Fi,this,Ii).get(s),r)return wt(Fi,this,Ii).set(t,r),r;const a="g_".concat((0,xt.A)(Li,this),"_luminosity_map_").concat(((0,Et.A)(Pi,this,(e=(0,xt.A)(Pi,this),i=e++,e)),i)),o="url(#".concat(a,")");wt(Fi,this,Ii).set(t,o),wt(Fi,this,Ii).set(s,o);const l=(0,bt.A)(Fi,this,Bi).call(this,a);return(0,bt.A)(Fi,this,Wi).call(this,l),t&&(0,bt.A)(Fi,this,Ui).call(this,n,l),o}addHighlightHCMFilter(t,e,i,n,s){var r;const a="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=wt(Fi,this,Di).get(t);if((null===(r=o)||void 0===r?void 0:r.key)===a)return o.url;var l;o?(null===(l=o.filter)||void 0===l||l.remove(),o.key=a,o.url="none",o.filter=null):(o={key:a,url:"none",filter:null},wt(Fi,this,Di).set(t,o));if(!e||!i)return o.url;const[c,h]=[e,i].map((0,bt.A)(Fi,this,Vi).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,f]=[n,s].map((0,bt.A)(Fi,this,Vi).bind(this));u<d&&([d,u,p,f]=[u,d,f,p]),wt(Fi,this,Oi).style.color="";const g=(t,e,i)=>{const n=new Array(256),s=(u-d)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(d+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(",")},A="g_".concat((0,xt.A)(Li,this),"_hcm_").concat(t,"_filter"),m=o.filter=(0,bt.A)(Fi,this,Bi).call(this,A);return(0,bt.A)(Fi,this,ji).call(this,m),(0,bt.A)(Fi,this,zi).call(this,g(p[0],f[0],5),g(p[1],f[1],5),g(p[2],f[2],5),m),o.url="url(#".concat(A,")"),o.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==wt(Fi,this,Di).size||((0,xt.A)(Mi,this)&&((0,xt.A)(Mi,this).parentNode.parentNode.remove(),(0,Et.A)(Mi,this,null)),(0,xt.A)(Si,this)&&((0,xt.A)(Si,this).clear(),(0,Et.A)(Si,this,null)),(0,Et.A)(Pi,this,0))}},Yl=Bt?class extends xi{_fetchData(t){return Ea(t)}}:Xi;function Kl(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const n=new Zl,{docId:s}=n,r=i.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(Bt&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,a=i.data?function(t){if(Bt&&"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 $e(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===t?void 0: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.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,c=null!==(t=i.password)&&void 0!==t?t:null,h=i.range instanceof $l?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:Vl;let u=i.worker instanceof uc?i.worker:null;const p=i.verbosity,f="string"!==typeof i.docBaseUrl||Zi(i.docBaseUrl)?null:i.docBaseUrl,g="string"===typeof i.cMapUrl?i.cMapUrl:null,A=!1!==i.cMapPacked,m=i.CMapReaderFactory||ql,v="string"===typeof i.standardFontDataUrl?i.standardFontDataUrl:null,b=i.StandardFontDataFactory||Yl,w=!0!==i.stopAtErrors,y=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,_=!1!==i.isEvalSupported,x="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!Bt,E=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,C="boolean"===typeof i.disableFontFace?i.disableFontFace:Bt,k=!0===i.fontExtraProperties,S=!0===i.enableXfa,M=i.ownerDocument||globalThis.document,L=!0===i.disableRange,T=!0===i.disableStream,R=!0===i.disableAutoFetch,P=!0===i.pdfBug,F=!0===i.enableHWA,I=h?h.length:null!==(e=i.length)&&void 0!==e?e:NaN,D="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!Bt&&!C,O="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:m===qi&&b===Xi&&g&&v&&nn(g,document.baseURI)&&nn(v,document.baseURI),N=i.canvasFactory||new Gl({ownerDocument:M,enableHWA:F}),W=i.filterFactory||new Xl({docId:s,ownerDocument:M});Oe(p);const j={canvasFactory:N,filterFactory:W};if(O||(j.cMapReaderFactory=new m({baseUrl:g,isCompressed:A}),j.standardFontDataFactory=new b({baseUrl:v})),!u){const t={verbosity:p,port:io.workerPort};u=t.port?uc.fromPort(t):new uc(t),n._worker=u}const B={docId:s,apiVersion:"4.4.168",data:a,password:c,disableAutoFetch:R,rangeChunkSize:d,length:I,docBaseUrl:f,enableXfa:S,evaluatorOptions:{maxImageSize:y,disableFontFace:C,ignoreErrors:w,isEvalSupported:_,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:E,fontExtraProperties:k,useSystemFonts:D,cMapUrl:O?g:null,standardFontDataUrl:O?v:null}},H={disableFontFace:C,fontExtraProperties:k,ownerDocument:M,pdfBug:P,styleElement:null,loadingParams:{disableAutoFetch:R,enableXfa:S}};return u.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",B,a?[a.buffer]:null);let e;if(h)e=new Wo(h,{disableRange:L,disableStream:T});else if(!a){if(!r)throw new Error("getDocument - no `url` parameter provided.");e=(t=>{if(Bt){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&nn(t.url)?new Yo(t):new il(t)}return nn(t.url)?new Yo(t):new Jo(t)})({url:r,length:I,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:L,disableStream:T})}return t.then(t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new vo(s,t,u.port),r=new _c(i,n,e,H,j);n._transport=r,i.send("Ready",null)})}).catch(n._capability.reject),n}function Ql(t){return"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0}class Zl{constructor(){var t,e;this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d".concat((Jl._=(t=Jl._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var t,e;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),await(null===(e=this._transport)||void 0===e?void 0:e.destroy())}catch(n){var i;throw null!==(i=this._worker)&&void 0!==i&&i.port&&delete this._worker._pendingDestroy,n}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var Jl={_:0};class $l{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){Be("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class tc{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 Ue(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()}}var ec=new WeakMap,ic=new WeakMap,nc=new WeakSet;class sc{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,vt.A)(this,nc),(0,_t.A)(this,ec,null),(0,_t.A)(this,ic,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new en:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Sc,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 Ki({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 Ue(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i;let{canvasContext:n,viewport:s,intent:r="display",annotationMode:a=Zt.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:h=null,pageColors:d=null,printAnnotationStorage:u=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const p=this._transport.getRenderingIntent(r,a,u),{renderingIntent:f,cacheKey:g}=p;(0,Et.A)(ic,this,!1),(0,bt.A)(nc,this,ac).call(this),c||(c=this._transport.getOptionalContentConfig(f));let A=this._intentStates.get(g);A||(A=Object.create(null),this._intentStates.set(g,A)),A.streamReaderCancelTimeout&&(clearTimeout(A.streamReaderCancelTimeout),A.streamReaderCancelTimeout=null);const m=!!(f&qt);var v;A.displayReadyCapability||(A.displayReadyCapability=Promise.withResolvers(),A.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(v=this._stats)||void 0===v||v.time("Page Request"),this._pumpOperatorList(p));const b=t=>{var e;(A.renderTasks.delete(w),(this._maybeCleanupAfterRender||m)&&(0,Et.A)(ic,this,!0),(0,bt.A)(nc,this,rc).call(this,!m),t?(w.capability.reject(t),this._abortOperatorList({intentState:A,reason:t instanceof Error?t:new Error(t)})):w.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(e=globalThis.Stats)&&void 0!==e&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=new Pc({callback:b,params:{canvasContext:n,viewport:s,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:A.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:d});((i=A).renderTasks||(i.renderTasks=new Set)).add(w);const y=w.task;return Promise.all([A.displayReadyCapability.promise,c]).then(t=>{var e;let[i,n]=t;if(this.destroyed)b();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");w.initializeGraphics({transparency:i,optionalContentConfig:n}),w.operatorListChanged()}}).catch(b),y}getOperatorList(){let{intent:t="display",annotationMode:e=Zt.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);var a,o;(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(),((a=r).renderTasks||(a.renderTasks=new Set)).add(s),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(n));return 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=>Ul.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){var n;let{value:r,done:a}=i;a?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=r.lang),Object.assign(s.styles,r.styles),s.items.push(...r.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(),(0,Et.A)(ic,this,!1),(0,bt.A)(nc,this,ac).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,Et.A)(ic,this,!0);const e=(0,bt.A)(nc,this,rc).call(this,!1);return t&&e&&this._stats&&(this._stats=new en),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(n=s.displayReadyCapability)||void 0===n||n.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&&(0,bt.A)(nc,this,rc).call(this,!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();(0,bt.A)(nc,this,rc).call(this,!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 Qi){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 Ze(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}}function rc(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,bt.A)(nc,this,ac).call(this),!(0,xt.A)(ic,this)||this.destroyed)return!1;if(t)return(0,Et.A)(ec,this,setTimeout(()=>{(0,Et.A)(ec,this,null),(0,bt.A)(nc,this,rc).call(this,!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(),(0,Et.A)(ic,this,!1),!0}function ac(){(0,xt.A)(ec,this)&&(clearTimeout((0,xt.A)(ec,this)),(0,Et.A)(ec,this,null))}var oc=new WeakMap,lc=new WeakMap;class cc{constructor(){(0,_t.A)(this,oc,new Set),(0,_t.A)(this,lc,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};(0,xt.A)(lc,this).then(()=>{for(const t of(0,xt.A)(oc,this))t.call(this,i)})}addEventListener(t,e){(0,xt.A)(oc,this).add(e)}removeEventListener(t,e){(0,xt.A)(oc,this).delete(e)}terminate(){(0,xt.A)(oc,this).clear()}}const hc={isWorkerDisabled:!1,fakeWorkerId:0};Bt&&(hc.isWorkerDisabled=!0,io.workerSrc||(io.workerSrc="./pdf.worker.mjs")),hc.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch(s){return!1}const n=new URL(e,i);return i.origin===n.origin},hc.createCDNWrapper=function(t){const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var dc=new WeakSet;class uc{constructor(){let{name:t=null,port:e=null,verbosity:i=Ne()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,vt.A)(this,dc),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){var n;if(null!==(n=gc._)&&void 0!==n&&n.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(gc._||(gc._=new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return Bt?Promise.all([xa.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new vo("main","worker",t),this._messageHandler.on("ready",function(){}),(0,bt.A)(dc,this,pc).call(this)}_initialize(){if(hc.isWorkerDisabled||fc(uc))return void this._setupFakeWorker();let{workerSrc:t}=uc;try{hc.isSameOrigin(window.location.href,t)||(t=hc.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new vo("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,(0,bt.A)(dc,this,pc).call(this)):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{r()}catch(e){this._setupFakeWorker()}});const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch(e){We("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){hc.isWorkerDisabled||(je("Setting up fake worker."),hc.isWorkerDisabled=!0),uc._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new cc;this._port=e;const i="fake".concat(hc.fakeWorkerId++),n=new vo(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new vo(i,i+"_worker",e),(0,bt.A)(dc,this,pc).call(this)}).catch(t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(t=gc._)||void 0===t||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null===(e=(0,bt.A)(uc,this,gc)._)||void 0===e?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new uc(t)}static get workerSrc(){if(io.workerSrc)return io.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Ue(this,"_setupFakeWorkerGlobal",(async()=>{if(wt(uc,this,fc))return wt(uc,this,fc);return(await i(50789)(this.workerSrc)).WorkerMessageHandler})())}}function pc(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}function fc(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}var gc={_:void 0},Ac=new WeakMap,mc=new WeakMap,vc=new WeakMap,bc=new WeakMap,wc=new WeakMap,yc=new WeakSet;class _c{constructor(t,e,i,n,s){(0,vt.A)(this,yc),(0,_t.A)(this,Ac,new Map),(0,_t.A)(this,mc,new Map),(0,_t.A)(this,vc,new Map),(0,_t.A)(this,bc,new Map),(0,_t.A)(this,wc,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Sc,this.fontLoader=new ba({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()}get annotationStorage(){return Ue(this,"annotationStorage",new fa)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=Gt,r=ha;switch(t){case"any":s=Vt;break;case"display":break;case"print":s=qt;break;default:je("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case Zt.DISABLE:s+=Kt;break;case Zt.ENABLE:break;case Zt.ENABLE_FORMS:s+=Xt;break;case Zt.ENABLE_STORAGE:s+=Yt;r=(s&qt&&i instanceof ma?i:this.annotationStorage).serializable;break;default:je("getRenderingIntent - invalid annotationMode: ".concat(e))}return n&&(s+=Qt),{renderingIntent:s,cacheKey:"".concat(s,"_").concat(r.hash),annotationStorageSerializable:r}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=(0,xt.A)(wc,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of(0,xt.A)(mc,this).values())e.push(n._destroy());(0,xt.A)(mc,this).clear(),(0,xt.A)(vc,this).clear(),(0,xt.A)(bc,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then(()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),(0,xt.A)(Ac,this).clear(),this.filterFactory.destroy(),Tl.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Ze("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)=>{He(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():(He(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(()=>{if(!n.isStreamingSupported||!n.isRangeSupported){var t;if(this._lastProgress)null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress);n.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{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)=>{He(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():(He(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 tc(i,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new Ge(t.message,t.code);break;case"InvalidPDFException":i=new Xe(t.message);break;case"MissingPDFException":i=new Ye(t.message);break;case"UnexpectedResponseException":i=new Ke(t.message,t.status);break;case"UnknownErrorException":i=new qe(t.message,t.details);break;default:Be("DocException - expected a valid Error.")}e._capability.reject(i)}),t.on("PasswordRequest",t=>{if((0,Et.A)(wc,this,Promise.withResolvers()),e.onPassword){const n=t=>{t instanceof Error?(0,xt.A)(wc,this).reject(t):(0,xt.A)(wc,this).resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){(0,xt.A)(wc,this).reject(i)}}else(0,xt.A)(wc,this).reject(new Ge(t.message,t.code));return(0,xt.A)(wc,this).promise}),t.on("DataLoaded",t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;(0,xt.A)(mc,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var i;let[n,s,r]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":const{disableFontFace:e,fontExtraProperties:a,pdfBug:o}=this._params;if("error"in r){const t=r.error;je("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const l=o&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,c=new wa(r,{disableFontFace:e,inspectFont:l});this.fontLoader.bind(c).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!a&&c.data&&(c.data=null),this.commonObjs.resolve(n,c)});break;case"CopyLocalImage":const{imageRef:h}=r;He(h,"The imageRef must be defined.");for(const t of(0,xt.A)(mc,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===h)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error("Got unknown common object type ".concat(s))}return null}),t.on("obj",t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=(0,xt.A)(mc,this).get(i);var a;if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":r.objs.resolve(e,s),(null===s||void 0===s?void 0:s.dataLen)>1e7&&(r._maybeCleanupAfterRender=!0);break;case"Pattern":r.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(a=s.bitmap)||void 0===a||a.close()}),t.on("DocProgress",t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{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(){var t,e;this.annotationStorage.size<=0&&je("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},n).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=(0,xt.A)(vc,this).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&&(0,xt.A)(bc,this).set(i.refStr,t);const n=new sc(e,i,this,this._params.pdfBug);return(0,xt.A)(mc,this).set(e,n),n});return(0,xt.A)(vc,this).set(e,n),n}getPageIndex(t){return Ql(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(0,bt.A)(yc,this,xc).call(this,"GetFieldObjects")}hasJSActions(){return(0,bt.A)(yc,this,xc).call(this,"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(0,bt.A)(yc,this,xc).call(this,"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(0,bt.A)(yc,this,xc).call(this,"GetOptionalContentConfig").then(e=>new Oo(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=(0,xt.A)(Ac,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>{var e,i,n,s;return{info:t[0],metadata:t[1]?new Eo(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(n=null===(s=this._fullReader)||void 0===s?void 0:s.contentLength)&&void 0!==n?n:null}});return(0,xt.A)(Ac,this).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(0,xt.A)(mc,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),(0,xt.A)(Ac,this).clear(),this.filterFactory.destroy(!0),Tl.cleanup()}}cachedPageNumber(t){var e;if(!Ql(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=(0,xt.A)(bc,this).get(i))&&void 0!==e?e:null}}function xc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=(0,xt.A)(Ac,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return(0,xt.A)(Ac,this).set(t,n),n}const Ec=Symbol("INITIAL_DATA");var Cc=new WeakMap,kc=new WeakSet;class Sc{constructor(){(0,vt.A)(this,kc),(0,_t.A)(this,Cc,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=(0,bt.A)(kc,this,Mc).call(this,t);return i.promise.then(()=>e(i.data)),null}const i=(0,xt.A)(Cc,this)[t];if(!i||i.data===Ec)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=(0,xt.A)(Cc,this)[t];return!!e&&e.data!==Ec}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=(0,bt.A)(kc,this,Mc).call(this,t);i.data=e,i.resolve()}clear(){for(const e in(0,xt.A)(Cc,this)){var t;const{data:i}=(0,xt.A)(Cc,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}(0,Et.A)(Cc,this,Object.create(null))}*[Symbol.iterator](){for(const t in(0,xt.A)(Cc,this)){const{data:e}=(0,xt.A)(Cc,this)[t];e!==Ec&&(yield[t,e])}}}function Mc(t){var e;return(e=(0,xt.A)(Cc,this))[t]||(e[t]=(0,gt.A)((0,gt.A)({},Promise.withResolvers()),{},{data:Ec}))}var Lc=new WeakMap;class Tc{constructor(t){(0,_t.A)(this,Lc,null),(0,Et.A)(Lc,this,t),this.onContinue=null}get promise(){return(0,xt.A)(Lc,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,xt.A)(Lc,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=(0,xt.A)(Lc,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=(0,xt.A)(Lc,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var Rc=new WeakMap;class Pc{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null}=t;(0,_t.A)(this,Rc,null),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=c,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Tc(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){var e,i;let{transparency:n=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(Fc._.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.");Fc._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:a,transform:o,background:l}=this.params;this.gfx=new $a(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:a,transparency:n,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),(0,xt.A)(Rc,this)&&(window.cancelAnimationFrame((0,xt.A)(Rc,this)),(0,Et.A)(Rc,this,null)),Fc._.delete(this._canvas),this.callback(e||new Qi("Rendering cancelled, page ".concat(this._pageIndex+1),i))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?(0,Et.A)(Rc,this,window.requestAnimationFrame(()=>{(0,Et.A)(Rc,this,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(),Fc._.delete(this._canvas),this.callback())))}}var Fc={_:new WeakSet};const Ic="4.4.168",Dc="19fbc8998";function Oc(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Nc(t){return Math.max(0,Math.min(255,255*t))}class Wc{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=Nc(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Oc(e);return"#".concat(i).concat(i).concat(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(Nc)}static RGB_HTML(t){return"#".concat(t.map(Oc).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[Nc(1-Math.min(1,e+s)),Nc(1-Math.min(1,n+s)),Nc(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 jc{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="".concat(a.name,"-").concat(s));for(const[l,c]of Object.entries(a))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,c)}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(".concat(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&&Ul.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,r]];for(;c.length>0;){var h,d;const[t,n,r]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const p=null!==o&&void 0!==o&&null!==(h=o.attributes)&&void 0!==h&&h.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(r.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:s,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)c.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);a&&Ul.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const Bc=1e3,Hc=new WeakSet;function zc(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Uc{static create(t){switch(t.data.annotationType){case ce:return new Zc(t);case le:return new eh(t);case Ce:switch(t.data.fieldType){case"Tx":return new nh(t);case"Btn":return t.data.radioButton?new ah(t):t.data.checkBox?new rh(t):new oh(t);case"Ch":return new lh(t);case"Sig":return new sh(t)}return new ih(t);case xe:return new ch(t);case he:return new Bh(t);case de:return new zh(t);case ue:return new Vh(t);case pe:return new qh(t);case ge:return new Yh(t);case ye:return new Qh(t);case _e:return new Jh(t);case fe:return new Kh(t);case Ae:return new $h(t);case me:return new td(t);case ve:return new ed(t);case be:return new id(t);case we:return new nd(t);case Ee:return new ad(t);default:return new Yc(t)}}}var Vc=new WeakMap,Gc=new WeakMap,qc=new WeakMap,Xc=new WeakSet;class Yc{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,vt.A)(this,Xc),(0,_t.A)(this,Vc,null),(0,_t.A)(this,Gc,!1),(0,_t.A)(this,qc,null),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!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str||null!==n&&void 0!==n&&n.str)}get hasPopupData(){return Yc._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;(0,xt.A)(Vc,this)||(0,Et.A)(Vc,this,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&(0,bt.A)(Xc,this,Kc).call(this,i),null===(e=(0,xt.A)(qc,this))||void 0===e||e.popup.updateEdited(t)}resetEdited(){var t;(0,xt.A)(Vc,this)&&((0,bt.A)(Xc,this,Kc).call(this,(0,xt.A)(Vc,this).rect),null===(t=(0,xt.A)(qc,this))||void 0===t||t.popup.resetEdited(),(0,Et.A)(Vc,this,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof ih||(s.tabIndex=Bc);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 ch){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=zc(e.rect);if(!t&&e.borderStyle.width>0){r.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(i,"px * var(--scale-factor))");r.borderRadius=e}else if(this instanceof ah){const t="calc(".concat(a,"px * var(--scale-factor)) / calc(").concat(o,"px * var(--scale-factor))");r.borderRadius=t}switch(e.borderStyle.style){case ke:r.borderStyle="solid";break;case Se:r.borderStyle="dashed";break;case Me:je("Unimplemented border style: beveled");break;case Le:je("Unimplemented border style: inset");break;case Te:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?((0,Et.A)(Gc,this,!0),r.borderColor=ni.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=ni.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:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;r.left="".concat(100*(l[0]-d)/c,"%"),r.top="".concat(100*(l[1]-u)/h,"%");const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width="".concat(100*a/c,"%"),r.height="".concat(100*o/h,"%")):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}=zc(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="".concat(a,"%"),e.style.height="".concat(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]=Wc["".concat(s,"_HTML")](r),this.annotationStorage.setValue(this.data.id,{[e]:Wc["".concat(s,"_rgb")](r)})};return Ue(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];null===s||void 0===s||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((0,xt.A)(Gc,this)){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="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0);const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p="clippath_".concat(this.data.id);u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let g=2,A=t.length;g<A;g+=8){var f;const i=t[g],n=t[g+1],r=t[g+2],h=t[g+3],d=c.createElement("rect"),p=(r-e)/o,A=(s-n)/l,m=(i-r)/o,v=(n-h)/l;d.setAttribute("x",p),d.setAttribute("y",A),d.setAttribute("width",m),d.setAttribute("height",v),u.append(d),null===(f=a)||void 0===f||f.push('<rect vector-effect="non-scaling-stroke" x="'.concat(p,'" y="').concat(A,'" width="').concat(m,'" height="').concat(v,'"/>'))}(0,xt.A)(Gc,this)&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=(0,Et.A)(qc,this,new ch({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){Be("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="'.concat(s,'"]'));!a||Hc.has(a)?i.push({id:s,exportValue:n,domElement:a}):je("_getElementsByName - element not allowed: ".concat(s))}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(Hc.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){var t;this.container&&(this.container.hidden=!1),null===(t=this.popup)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||t.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",()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}function Kc(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t);const{width:l,height:c}=zc(t);e.left="".concat(100*(t[0]-a)/s,"%"),e.top="".concat(100*(r-t[3]+o)/r,"%"),0===n?(e.width="".concat(100*l/s,"%"),e.height="".concat(100*c/r,"%")):this.setRotation(n)}var Qc=new WeakSet;class Zc extends Yc{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),(0,vt.A)(this,Qc),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?((0,bt.A)(Qc,this,$c).call(this,i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?((0,bt.A)(Qc,this,th).call(this,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}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&(0,bt.A)(Qc,this,Jc).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),(0,bt.A)(Qc,this,Jc).call(this)}_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]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}t.onclick||(t.onclick=()=>!1),(0,bt.A)(Qc,this,Jc).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),(0,bt.A)(Qc,this,Jc).call(this),!this._fieldObjects)return je('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||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="'.concat(t,'"]'));i&&(Hc.has(i)?i.dispatchEvent(new Event("resetform")):je("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function Jc(){this.container.setAttribute("data-internal-link","")}function $c(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=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,i),!1},(0,bt.A)(Qc,this,Jc).call(this)}function th(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),(0,bt.A)(Qc,this,Jc).call(this)}class eh extends Yc{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 ih extends Yc{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return ei.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.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=>{var r;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))})}_setEventListeners(t,e,i,n){for(const[o,l]of i){var s,r,a;if("Action"===l||null!==(s=this.data.actions)&&void 0!==s&&s[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Blur?"Blur"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.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":ni.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/(Ut*n))||1);r=Math.min(n,a(e/Ut))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/Ut))}s.fontSize="calc(".concat(r,"px * var(--scale-factor))"),s.color=ni.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 nh extends ih{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){var n;const r=t.getValue(e,{value:this.data.fieldValue});let a=r.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null===(n=this.data.textContent)||void 0===n?void 0:n.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const c={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",null!==l&&void 0!==l?l:a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Hc.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Bc,this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),c.formattedValue=null}),i.addEventListener("resetform",t=>{var e;const n=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=c.userValue=n,c.formattedValue=null});let h=t=>{const{formattedValue:e}=c;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;i.addEventListener("focus",t=>{var e;if(c.focused)return;const{target:i}=t;c.userValue&&(i.value=c.userValue),c.lastCommittedValue=i.value,c.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(c.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){var n;c.userValue=null!==(n=i.detail.value)&&void 0!==n?n:"",t.setValue(e,{value:c.userValue.toString()}),i.target.value=c.userValue},formattedValue(i){const{formattedValue:n}=i.detail;c.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=>{var n;const{charLimit:s}=i.detail,{target:r}=i;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=c.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=c.userValue=a,t.setValue(e,{value:a}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{var i;c.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(c.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;c.lastCommittedValue!==s&&(c.lastCommittedValue=s,c.userValue=s,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=h;h=null,i.addEventListener("blur",t=>{var i;if(!c.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(c.focused=!1);const{value:s}=t.target;var r;(c.userValue=s,c.lastCommittedValue!==s)&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:c.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));n(t)}),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&i.addEventListener("beforeinput",t=>{var i;c.lastCommittedValue=null;const{data:n,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,h=o;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(a).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(h+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(i,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(h&&i.addEventListener("blur",h),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(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 sh extends ih{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class rh extends ih{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 Hc.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=Bc,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 ah extends ih{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(Hc.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=Bc,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 oh extends Zc{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 lh extends ih{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");Hc.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=Bc;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 c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,i.value.includes(c.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){var s;null===(s=r)||void 0===s||s();const l=i.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const t of n.options)t.selected=c.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:c}=i.detail.insert,h=n.children[s],d=document.createElement("option");d.textContent=r,d.value=c,h?h.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=>{var n;const s=a(!0),r=a(!1);t.setValue(e,{value:s}),i.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:r,changeEx:s,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 ch extends Yc{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Yc._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Th({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=>"".concat(ci).concat(t)).join(",")),this.container}}var hh=new WeakMap,dh=new WeakMap,uh=new WeakMap,ph=new WeakMap,fh=new WeakMap,gh=new WeakMap,Ah=new WeakMap,mh=new WeakMap,vh=new WeakMap,bh=new WeakMap,wh=new WeakMap,yh=new WeakMap,_h=new WeakMap,xh=new WeakMap,Eh=new WeakMap,Ch=new WeakMap,kh=new WeakMap,Sh=new WeakMap,Mh=new WeakMap,Lh=new WeakSet;class Th{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:d}=t;(0,vt.A)(this,Lh),(0,_t.A)(this,hh,(0,bt.A)(Lh,this,Dh).bind(this)),(0,_t.A)(this,dh,(0,bt.A)(Lh,this,jh).bind(this)),(0,_t.A)(this,uh,(0,bt.A)(Lh,this,Wh).bind(this)),(0,_t.A)(this,ph,(0,bt.A)(Lh,this,Nh).bind(this)),(0,_t.A)(this,fh,null),(0,_t.A)(this,gh,null),(0,_t.A)(this,Ah,null),(0,_t.A)(this,mh,null),(0,_t.A)(this,vh,null),(0,_t.A)(this,bh,null),(0,_t.A)(this,wh,null),(0,_t.A)(this,yh,!1),(0,_t.A)(this,_h,null),(0,_t.A)(this,xh,null),(0,_t.A)(this,Eh,null),(0,_t.A)(this,Ch,null),(0,_t.A)(this,kh,null),(0,_t.A)(this,Sh,null),(0,_t.A)(this,Mh,!1),(0,Et.A)(gh,this,e),(0,Et.A)(kh,this,s),(0,Et.A)(Ah,this,a),(0,Et.A)(Ch,this,o),(0,Et.A)(bh,this,l),(0,Et.A)(fh,this,i),(0,Et.A)(Eh,this,c),(0,Et.A)(wh,this,h),(0,Et.A)(vh,this,n),(0,Et.A)(mh,this,on.toDateObject(r)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup());for(const p of this.trigger)p.addEventListener("click",(0,xt.A)(ph,this)),p.addEventListener("mouseenter",(0,xt.A)(uh,this)),p.addEventListener("mouseleave",(0,xt.A)(dh,this)),p.classList.add("popupTriggerArea");for(const p of n){var u;null===(u=p.container)||void 0===u||u.addEventListener("keydown",(0,xt.A)(hh,this))}(0,xt.A)(gh,this).hidden=!0,d&&(0,bt.A)(Lh,this,Nh).call(this)}render(){if((0,xt.A)(_h,this))return;const t=(0,Et.A)(_h,this,document.createElement("div"));if(t.className="popup",(0,xt.A)(fh,this)){const e=t.style.outlineColor=ni.makeHexColor(...(0,xt.A)(fh,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;t.style.backgroundColor=ni.makeHexColor(...(0,xt.A)(fh,this).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}=(0,xt.A)(kh,this)),t.append(e),(0,xt.A)(mh,this)){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:(0,xt.A)(mh,this).toLocaleDateString(),time:(0,xt.A)(mh,this).toLocaleTimeString()})),e.append(t)}const n=wt(Lh,this,Rh);if(n)jc.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents((0,xt.A)(Ah,this));t.append(e)}(0,xt.A)(gh,this).append(t)}_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}updateEdited(t){var e;let{rect:i,popupContent:n}=t;(0,xt.A)(Sh,this)||(0,Et.A)(Sh,this,{contentsObj:(0,xt.A)(Ah,this),richText:(0,xt.A)(Ch,this)}),i&&(0,Et.A)(xh,this,null),n&&((0,Et.A)(Ch,this,(0,bt.A)(Lh,this,Ih).call(this,n)),(0,Et.A)(Ah,this,null)),null===(e=(0,xt.A)(_h,this))||void 0===e||e.remove(),(0,Et.A)(_h,this,null)}resetEdited(){var t;(0,xt.A)(Sh,this)&&(({contentsObj:At(Et.A,[Ah,this])._,richText:At(Et.A,[Ch,this])._}=(0,xt.A)(Sh,this)),(0,Et.A)(Sh,this,null),null===(t=(0,xt.A)(_h,this))||void 0===t||t.remove(),(0,Et.A)(_h,this,null),(0,Et.A)(xh,this,null))}forceHide(){(0,Et.A)(Mh,this,this.isVisible),(0,xt.A)(Mh,this)&&((0,xt.A)(gh,this).hidden=!0)}maybeShow(){(0,xt.A)(Mh,this)&&((0,xt.A)(_h,this)||(0,bt.A)(Lh,this,Wh).call(this),(0,Et.A)(Mh,this,!1),(0,xt.A)(gh,this).hidden=!1)}get isVisible(){return!1===(0,xt.A)(gh,this).hidden}}function Rh(t){const e=(0,xt.A)(Ch,t),i=(0,xt.A)(Ah,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:(0,xt.A)(Ch,t).html||null}function Ph(t){var e;return(null===(e=wt(Lh,t,Rh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function Fh(t){var e;return(null===(e=wt(Lh,t,Rh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function Ih(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:wt(Lh,this,Fh),fontSize:wt(Lh,this,Ph)?"calc(".concat(wt(Lh,this,Ph),"px * var(--scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function Dh(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&(0,xt.A)(yh,this))&&(0,bt.A)(Lh,this,Nh).call(this)}function Oh(){if(null!==(0,xt.A)(xh,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=(0,xt.A)(bh,this);let r=!!(0,xt.A)(wh,this),a=r?(0,xt.A)(wh,this):(0,xt.A)(Eh,this);for(const u of(0,xt.A)(vh,this))if(!a||null!==ni.intersect(u.data.rect,a)){a=u.data.rect,r=!0;break}const o=ni.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,c=o[0]+l,h=o[1];(0,Et.A)(xh,this,[100*(c-n)/e,100*(h-s)/i]);const{style:d}=(0,xt.A)(gh,this);d.left="".concat((0,xt.A)(xh,this)[0],"%"),d.top="".concat((0,xt.A)(xh,this)[1],"%")}function Nh(){(0,Et.A)(yh,this,!(0,xt.A)(yh,this)),(0,xt.A)(yh,this)?((0,bt.A)(Lh,this,Wh).call(this),(0,xt.A)(gh,this).addEventListener("click",(0,xt.A)(ph,this)),(0,xt.A)(gh,this).addEventListener("keydown",(0,xt.A)(hh,this))):((0,bt.A)(Lh,this,jh).call(this),(0,xt.A)(gh,this).removeEventListener("click",(0,xt.A)(ph,this)),(0,xt.A)(gh,this).removeEventListener("keydown",(0,xt.A)(hh,this)))}function Wh(){(0,xt.A)(_h,this)||this.render(),this.isVisible?(0,xt.A)(yh,this)&&(0,xt.A)(gh,this).classList.add("focused"):((0,bt.A)(Lh,this,Oh).call(this),(0,xt.A)(gh,this).hidden=!1,(0,xt.A)(gh,this).style.zIndex=parseInt((0,xt.A)(gh,this).style.zIndex)+1e3)}function jh(){(0,xt.A)(gh,this).classList.remove("focused"),!(0,xt.A)(yh,this)&&this.isVisible&&((0,xt.A)(gh,this).hidden=!0,(0,xt.A)(gh,this).style.zIndex=parseInt((0,xt.A)(gh,this).style.zIndex)-1e3)}class Bh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Jt.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}}var Hh=new WeakMap;class zh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Hh,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=zc(t.rect),n=this.svgFactory.create(e,i,!0),s=(0,Et.A)(Hh,this,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(0,xt.A)(Hh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Uh=new WeakMap;class Vh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Uh,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=zc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=(0,Et.A)(Uh,this,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(0,xt.A)(Uh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Gh=new WeakMap;class qh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Gh,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=zc(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=(0,Et.A)(Gh,this,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(0,xt.A)(Gh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Xh=new WeakMap;class Yh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Xh,null),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}=zc(t),a=this.svgFactory.create(s,r,!0);let o=[];for(let c=0,h=e.length;c<h;c+=2){const i=e[c]-t[0],n=t[3]-e[c+1];o.push("".concat(i,",").concat(n))}o=o.join(" ");const l=(0,Et.A)(Xh,this,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(0,xt.A)(Xh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Kh extends Yh{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Qh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Zh=new WeakMap;class Jh extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),(0,_t.A)(this,Zh,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=Jt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:r}=zc(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("".concat(n,",").concat(s))}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);(0,xt.A)(Zh,this).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(0,xt.A)(Zh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class $h extends Yc{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 td extends Yc{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 ed extends Yc{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 id extends Yc{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 nd extends Yc{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var sd=new WeakMap,rd=new WeakSet;class ad extends Yc{constructor(t){var e;super(t,{isRenderable:!0}),(0,vt.A)(this,rd),(0,_t.A)(this,sd,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",(0,gt.A)({source:this},i))}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="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(i.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),i.addEventListener("dblclick",(0,bt.A)(rd,this,od).bind(this)),(0,Et.A)(sd,this,i);const{isMac:n}=ei.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&(0,bt.A)(rd,this,od).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return(0,xt.A)(sd,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function od(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var ld=new WeakMap,cd=new WeakMap,hd=new WeakMap,dd=new WeakSet;class ud{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:a}=t;(0,vt.A)(this,dd),(0,_t.A)(this,ld,null),(0,_t.A)(this,cd,null),(0,_t.A)(this,hd,new Map),this.div=e,(0,Et.A)(ld,this,i),(0,Et.A)(cd,this,n),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}async render(t){const{annotations:e}=t,i=this.div;un(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 Yi,annotationStorage:t.annotationStorage||new fa,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of e){if(a.noHTML)continue;const t=a.annotationType===xe;if(t){const t=n.get(a.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=zc(a.rect);if(t<=0||e<=0)continue}s.data=a;const e=Uc.create(s);if(!e.isRenderable)continue;if(!t&&a.popupRef){const t=n.get(a.popupRef);t?t.push(e):n.set(a.popupRef,[e])}const i=e.render();var r;if(a.hidden&&(i.style.visibility="hidden"),(0,bt.A)(dd,this,pd).call(this,i,a.id),e.annotationEditorType>0)(0,xt.A)(hd,this).set(e.data.id,e),null===(r=this._annotationEditorUIManager)||void 0===r||r.renderAnnotationElement(e)}(0,bt.A)(dd,this,fd).call(this)}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,un(i,{rotation:e.rotation}),(0,bt.A)(dd,this,fd).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from((0,xt.A)(hd,this).values())}getEditableAnnotation(t){return(0,xt.A)(hd,this).get(t)}}function pd(t,e){var i;const n=t.firstChild||t;n.id="".concat(ci).concat(e),this.div.append(t),null===(i=(0,xt.A)(ld,this))||void 0===i||i.moveElementInDOM(this.div,t,n,!1)}function fd(){if(!(0,xt.A)(cd,this))return;const t=this.div;for(const[e,i]of(0,xt.A)(cd,this)){const n=t.querySelector('[data-annotation-id="'.concat(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)}(0,xt.A)(cd,this).clear()}const gd=/\r\n?|\n/g;var Ad=new WeakMap,md=new WeakMap,vd=new WeakMap,bd=new WeakMap,wd=new WeakMap,yd=new WeakMap,_d=new WeakMap,xd=new WeakMap,Ed=new WeakMap,Cd=new WeakMap,kd=new WeakSet;class Sd extends Vr{static get _keyboardManager(){const t=Sd.prototype,e=t=>t.isEmpty(),i=Vs.TRANSLATE_SMALL,n=Vs.TRANSLATE_BIG;return Ue(this,"_keyboardManager",new Yn([[["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}]]))}constructor(t){super((0,gt.A)((0,gt.A)({},t),{},{name:"freeTextEditor"})),(0,vt.A)(this,kd),(0,_t.A)(this,Ad,this.editorDivBlur.bind(this)),(0,_t.A)(this,md,this.editorDivFocus.bind(this)),(0,_t.A)(this,vd,this.editorDivInput.bind(this)),(0,_t.A)(this,bd,this.editorDivKeydown.bind(this)),(0,_t.A)(this,wd,this.editorDivPaste.bind(this)),(0,_t.A)(this,yd,void 0),(0,_t.A)(this,_d,""),(0,_t.A)(this,xd,"".concat(this.id,"-editor")),(0,_t.A)(this,Ed,void 0),(0,_t.A)(this,Cd,null),(0,Et.A)(yd,this,t.color||Sd._defaultColor||Vr._defaultLineColor),(0,Et.A)(Ed,this,t.fontSize||Sd._defaultFontSize)}static initialize(t,e){Vr.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 $t.FREETEXT_SIZE:Sd._defaultFontSize=e;break;case $t.FREETEXT_COLOR:Sd._defaultColor=e}}updateParams(t,e){switch(t){case $t.FREETEXT_SIZE:(0,bt.A)(kd,this,Md).call(this,e);break;case $t.FREETEXT_COLOR:(0,bt.A)(kd,this,Ld).call(this,e)}}static get defaultPropertiesToUpdate(){return[[$t.FREETEXT_SIZE,Sd._defaultFontSize],[$t.FREETEXT_COLOR,Sd._defaultColor||Vr._defaultLineColor]]}get propertiesToUpdate(){return[[$t.FREETEXT_SIZE,(0,xt.A)(Ed,this)],[$t.FREETEXT_COLOR,(0,xt.A)(yd,this)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-Sd._internalPadding*t,-(Sd._internalPadding+(0,xt.A)(Ed,this))*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(Jt.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",(0,xt.A)(bd,this),{signal:t}),this.editorDiv.addEventListener("focus",(0,xt.A)(md,this),{signal:t}),this.editorDiv.addEventListener("blur",(0,xt.A)(Ad,this),{signal:t}),this.editorDiv.addEventListener("input",(0,xt.A)(vd,this),{signal:t}),this.editorDiv.addEventListener("paste",(0,xt.A)(wd,this),{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",(0,xt.A)(xd,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",(0,xt.A)(bd,this)),this.editorDiv.removeEventListener("focus",(0,xt.A)(md,this)),this.editorDiv.removeEventListener("blur",(0,xt.A)(Ad,this)),this.editorDiv.removeEventListener("input",(0,xt.A)(vd,this)),this.editorDiv.removeEventListener("paste",(0,xt.A)(wd,this)),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(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!==(t=this._initialOptions)&&void 0!==t&&t.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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=(0,xt.A)(_d,this),e=(0,Et.A)(_d,this,(0,bt.A)(kd,this,Td).call(this).trimEnd());if(t===e)return;const i=t=>{(0,Et.A)(_d,this,t),t?((0,bt.A)(kd,this,Fd).call(this),this._uiManager.rebuild(this),(0,bt.A)(kd,this,Rd).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),(0,bt.A)(kd,this,Rd).call(this)}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){Sd._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",(0,xt.A)(xd,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),Vr._l10nPromise.get("pdfjs-free-text-default-content").then(t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)}),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize="calc(".concat((0,xt.A)(Ed,this),"px * var(--scale-factor))"),i.color=(0,xt.A)(yd,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),Fn(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=(0,xt.A)(Cd,this);let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-c)/o,u=e+this.height-(s[1]-h)/l;break;case 90:d=t+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-c)/o,u=e-(s[1]-h)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-c-this.height*l)/o,u=e+(s[1]-h-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);(0,bt.A)(kd,this,Fd).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=Dd.call(Sd,e.getData("text")||"").replaceAll(gd,"\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=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(gd,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(Pd.call(Sd,i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(gd,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(Pd.call(Sd,i))}(0,Et.A)(_d,this,"".concat(l.join("\n")).concat(n).concat(c.join("\n"))),(0,bt.A)(kd,this,Fd).call(this);const h=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){h.setStart(u,d),h.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(h)}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let n=null;if(t instanceof Bh){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a},textContent:o,textPosition:l,parent:{page:{pageNumber:c}}}=t;if(!o||0===o.length)return null;n=t={annotationType:Jt.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:c-1,rect:s.slice(0),rotation:r,id:a,deleted:!1}}const s=super.deserialize(t,e,i);return(0,Et.A)(Ed,s,t.fontSize),(0,Et.A)(yd,s,ni.makeHexColor(...t.color)),(0,Et.A)(_d,s,Dd.call(Sd,t.value)),s.annotationElementId=t.id||null,(0,Et.A)(Cd,s,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=Sd._internalPadding*this.parentScale,i=this.getRect(e,e),n=Vr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:(0,xt.A)(yd,this)),s={annotationType:Jt.FREETEXT,color:n,fontSize:(0,xt.A)(Ed,this),value:(0,bt.A)(kd,this,Id).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!(0,bt.A)(kd,this,Od).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize="calc(".concat((0,xt.A)(Ed,this),"px * var(--scale-factor))"),i.color=(0,xt.A)(yd,this),e.replaceChildren();for(const s of(0,xt.A)(_d,this).split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=Sd._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:(0,xt.A)(_d,this)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function Md(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))"),this.translate(0,-(t-(0,xt.A)(Ed,this))*this.parentScale),(0,Et.A)(Ed,this,t),(0,bt.A)(kd,this,Rd).call(this)},i=(0,xt.A)(Ed,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Ld(t){const e=t=>{(0,Et.A)(yd,this,this.editorDiv.style.color=t)},i=(0,xt.A)(yd,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Td(){const t=[];this.editorDiv.normalize();for(const e of this.editorDiv.childNodes)t.push(Pd.call(Pt,e));return t.join("\n")}function Rd(){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()}function Pd(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(gd,"")}function Fd(){if(this.editorDiv.replaceChildren(),(0,xt.A)(_d,this))for(const t of(0,xt.A)(_d,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function Id(){return(0,xt.A)(_d,this).replaceAll("\xa0"," ")}function Dd(t){return t.replaceAll(" ","\xa0")}function Od(t){const{value:e,fontSize:i,color:n,pageIndex:s}=(0,xt.A)(Cd,this);return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}Pt=Sd,(0,yt.A)(Sd,"_freeTextDefaultContent",""),(0,yt.A)(Sd,"_internalPadding",0),(0,yt.A)(Sd,"_defaultColor",null),(0,yt.A)(Sd,"_defaultFontSize",10),(0,yt.A)(Sd,"_type","freetext"),(0,yt.A)(Sd,"_editorType",Jt.FREETEXT);var Nd=new WeakMap,Wd=new WeakMap,jd=new WeakMap,Bd=new WeakSet;class Hd{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];(0,vt.A)(this,Bd),(0,_t.A)(this,Nd,void 0),(0,_t.A)(this,Wd,[]),(0,_t.A)(this,jd,[]);let s=1/0,r=-1/0,a=1/0,o=-1/0;const l=10**-4;for(const{x:g,y:A,width:m,height:v}of t){const t=Math.floor((g-e)/l)*l,i=Math.ceil((g+m+e)/l)*l,n=Math.floor((A-e)/l)*l,c=Math.ceil((A+v+e)/l)*l,h=[t,n,c,!0],d=[i,n,c,!1];(0,xt.A)(Wd,this).push(h,d),s=Math.min(s,t),r=Math.max(r,i),a=Math.min(a,n),o=Math.max(o,c)}const c=r-s+2*i,h=o-a+2*i,d=s-i,u=a-i,p=(0,xt.A)(Wd,this).at(n?-1:-2),f=[p[0],p[2]];for(const g of(0,xt.A)(Wd,this)){const[t,e,i]=g;g[0]=(t-d)/c,g[1]=(e-u)/h,g[2]=(i-u)/h}(0,Et.A)(Nd,this,{x:d,y:u,width:c,height:h,lastPoint:f})}getOutlines(){(0,xt.A)(Wd,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of(0,xt.A)(Wd,this))e[3]?(t.push(...(0,bt.A)(Bd,this,qd).call(this,e)),(0,bt.A)(Bd,this,Vd).call(this,e)):((0,bt.A)(Bd,this,Gd).call(this,e),t.push(...(0,bt.A)(Bd,this,qd).call(this,e)));return(0,bt.A)(Bd,this,zd).call(this,t)}}function zd(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 c=e,h=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,c!==e&&(s.push(c,h,e,h===r?r:a),c=e),h=h===r?a:r}s.push(c,h)}return new Qd(n,(0,xt.A)(Nd,this))}function Ud(t){const e=(0,xt.A)(jd,this);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}function Vd(t){let[,e,i]=t;const n=(0,bt.A)(Bd,this,Ud).call(this,e);(0,xt.A)(jd,this).splice(n,0,[e,i])}function Gd(t){let[,e,i]=t;const n=(0,bt.A)(Bd,this,Ud).call(this,e);for(let s=n;s<(0,xt.A)(jd,this).length;s++){const[t,n]=(0,xt.A)(jd,this)[s];if(t!==e)break;if(t===e&&n===i)return void(0,xt.A)(jd,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=(0,xt.A)(jd,this)[s];if(t!==e)break;if(t===e&&n===i)return void(0,xt.A)(jd,this).splice(s,1)}}function qd(t){const[e,i,n]=t,s=[[e,i,n]],r=(0,bt.A)(Bd,this,Ud).call(this,n);for(let a=0;a<r;a++){const[t,i]=(0,xt.A)(jd,this)[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 Xd{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 xu}}var Yd=new WeakMap,Kd=new WeakMap;class Qd extends Xd{constructor(t,e){super(),(0,_t.A)(this,Yd,void 0),(0,_t.A)(this,Kd,void 0),(0,Et.A)(Kd,this,t),(0,Et.A)(Yd,this,e)}toSVGPath(){const t=[];for(const e of(0,xt.A)(Kd,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push("V".concat(a)),n=a):a===n&&(t.push("H".concat(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 c of(0,xt.A)(Kd,this)){const t=new Array(c.length);for(let e=0;e<c.length;e+=2)t[e]=i+c[e]*o,t[e+1]=r-c[e+1]*l;a.push(t)}return a}get box(){return(0,xt.A)(Yd,this)}}var Zd=new WeakMap,Jd=new WeakMap,$d=new WeakMap,tu=new WeakMap,eu=new WeakMap,iu=new WeakMap,nu=new WeakMap,su=new WeakMap,ru=new WeakMap,au=new WeakMap,ou=new WeakMap,lu=new WeakMap,cu=new WeakMap,hu=new WeakSet;class du{constructor(t,e,i,n,s){let{x:r,y:a}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(0,vt.A)(this,hu),(0,_t.A)(this,Zd,void 0),(0,_t.A)(this,Jd,[]),(0,_t.A)(this,$d,void 0),(0,_t.A)(this,tu,void 0),(0,_t.A)(this,eu,[]),(0,_t.A)(this,iu,new Float64Array(18)),(0,_t.A)(this,nu,void 0),(0,_t.A)(this,su,void 0),(0,_t.A)(this,ru,void 0),(0,_t.A)(this,au,void 0),(0,_t.A)(this,ou,void 0),(0,_t.A)(this,lu,void 0),(0,_t.A)(this,cu,[]),(0,Et.A)(Zd,this,e),(0,Et.A)(lu,this,n*i),(0,Et.A)(tu,this,s),(0,xt.A)(iu,this).set([NaN,NaN,NaN,NaN,r,a],6),(0,Et.A)($d,this,o),(0,Et.A)(au,this,pu._*i),(0,Et.A)(ru,this,fu._*i),(0,Et.A)(ou,this,i),(0,xt.A)(cu,this).push(r,a)}get free(){return!0}isEmpty(){return isNaN((0,xt.A)(iu,this)[8])}add(t){var e;let{x:i,y:n}=t;(0,Et.A)(nu,this,i),(0,Et.A)(su,this,n);const[s,r,a,o]=(0,xt.A)(Zd,this);let[l,c,h,d]=(0,xt.A)(iu,this).subarray(8,12);const u=i-h,p=n-d,f=Math.hypot(u,p);if(f<(0,xt.A)(ru,this))return!1;const g=f-(0,xt.A)(au,this),A=g/f,m=A*u,v=A*p;let b=l,w=c;l=h,c=d,h+=m,d+=v,null===(e=(0,xt.A)(cu,this))||void 0===e||e.push(i,n);const y=m/g,_=-v/g*(0,xt.A)(lu,this),x=y*(0,xt.A)(lu,this);if((0,xt.A)(iu,this).set((0,xt.A)(iu,this).subarray(2,8),0),(0,xt.A)(iu,this).set([h+_,d+x],4),(0,xt.A)(iu,this).set((0,xt.A)(iu,this).subarray(14,18),12),(0,xt.A)(iu,this).set([h-_,d-x],16),isNaN((0,xt.A)(iu,this)[6]))return 0===(0,xt.A)(eu,this).length&&((0,xt.A)(iu,this).set([l+_,c+x],2),(0,xt.A)(eu,this).push(NaN,NaN,NaN,NaN,(l+_-s)/a,(c+x-r)/o),(0,xt.A)(iu,this).set([l-_,c-x],14),(0,xt.A)(Jd,this).push(NaN,NaN,NaN,NaN,(l-_-s)/a,(c-x-r)/o)),(0,xt.A)(iu,this).set([b,w,l,c,h,d],6),!this.isEmpty();(0,xt.A)(iu,this).set([b,w,l,c,h,d],6);return Math.abs(Math.atan2(w-c,b-l)-Math.atan2(v,m))<Math.PI/2?([l,c,h,d]=(0,xt.A)(iu,this).subarray(2,6),(0,xt.A)(eu,this).push(NaN,NaN,NaN,NaN,((l+h)/2-s)/a,((c+d)/2-r)/o),[l,c,b,w]=(0,xt.A)(iu,this).subarray(14,18),(0,xt.A)(Jd,this).push(NaN,NaN,NaN,NaN,((b+l)/2-s)/a,((w+c)/2-r)/o),!0):([b,w,l,c,h,d]=(0,xt.A)(iu,this).subarray(0,6),(0,xt.A)(eu,this).push(((b+5*l)/6-s)/a,((w+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),[h,d,l,c,b,w]=(0,xt.A)(iu,this).subarray(12,18),(0,xt.A)(Jd,this).push(((b+5*l)/6-s)/a,((w+5*c)/6-r)/o,((5*l+h)/6-s)/a,((5*c+d)/6-r)/o,((l+h)/2-s)/a,((c+d)/2-r)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=(0,xt.A)(eu,this),e=(0,xt.A)(Jd,this),i=(0,xt.A)(iu,this).subarray(4,6),n=(0,xt.A)(iu,this).subarray(16,18),[s,r,a,o]=(0,xt.A)(Zd,this),[l,c,h,d]=(0,bt.A)(hu,this,uu).call(this);if(isNaN((0,xt.A)(iu,this)[6])&&!this.isEmpty())return"M".concat(((0,xt.A)(iu,this)[2]-s)/a," ").concat(((0,xt.A)(iu,this)[3]-r)/o," L").concat(((0,xt.A)(iu,this)[4]-s)/a," ").concat(((0,xt.A)(iu,this)[5]-r)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat(((0,xt.A)(iu,this)[16]-s)/a," ").concat(((0,xt.A)(iu,this)[17]-r)/o," L").concat(((0,xt.A)(iu,this)[14]-s)/a," ").concat(((0,xt.A)(iu,this)[15]-r)/o," Z");const u=[];u.push("M".concat(t[4]," ").concat(t[5]));for(let p=6;p<t.length;p+=6)isNaN(t[p])?u.push("L".concat(t[p+4]," ").concat(t[p+5])):u.push("C".concat(t[p]," ").concat(t[p+1]," ").concat(t[p+2]," ").concat(t[p+3]," ").concat(t[p+4]," ").concat(t[p+5]));u.push("L".concat((i[0]-s)/a," ").concat((i[1]-r)/o," L").concat(l," ").concat(c," L").concat(h," ").concat(d," L").concat((n[0]-s)/a," ").concat((n[1]-r)/o));for(let p=e.length-6;p>=6;p-=6)isNaN(e[p])?u.push("L".concat(e[p+4]," ").concat(e[p+5])):u.push("C".concat(e[p]," ").concat(e[p+1]," ").concat(e[p+2]," ").concat(e[p+3]," ").concat(e[p+4]," ").concat(e[p+5]));return u.push("L".concat(e[4]," ").concat(e[5]," Z")),u.join(" ")}getOutlines(){var t,e;const i=(0,xt.A)(eu,this),n=(0,xt.A)(Jd,this),s=(0,xt.A)(iu,this),r=s.subarray(4,6),a=s.subarray(16,18),[o,l,c,h]=(0,xt.A)(Zd,this),d=new Float64Array((null!==(t=null===(e=(0,xt.A)(cu,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let v=0,b=d.length-2;v<b;v+=2)d[v]=((0,xt.A)(cu,this)[v]-o)/c,d[v+1]=((0,xt.A)(cu,this)[v+1]-l)/h;d[d.length-2]=((0,xt.A)(nu,this)-o)/c,d[d.length-1]=((0,xt.A)(su,this)-l)/h;const[u,p,f,g]=(0,bt.A)(hu,this,uu).call(this);if(isNaN(s[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(s[2]-o)/c,(s[3]-l)/h,NaN,NaN,NaN,NaN,(s[4]-o)/c,(s[5]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(s[16]-o)/c,(s[17]-l)/h,NaN,NaN,NaN,NaN,(s[14]-o)/c,(s[15]-l)/h],0),new xu(t,d,(0,xt.A)(Zd,this),(0,xt.A)(ou,this),(0,xt.A)($d,this),(0,xt.A)(tu,this))}const A=new Float64Array((0,xt.A)(eu,this).length+24+(0,xt.A)(Jd,this).length);let m=i.length;for(let v=0;v<m;v+=2)isNaN(i[v])?A[v]=A[v+1]=NaN:(A[v]=i[v],A[v+1]=i[v+1]);A.set([NaN,NaN,NaN,NaN,(r[0]-o)/c,(r[1]-l)/h,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,(a[0]-o)/c,(a[1]-l)/h],m),m+=24;for(let v=n.length-6;v>=6;v-=6)for(let t=0;t<6;t+=2)isNaN(n[v+t])?(A[m]=A[m+1]=NaN,m+=2):(A[m]=n[v+t],A[m+1]=n[v+t+1],m+=2);return A.set([NaN,NaN,NaN,NaN,n[4],n[5]],m),new xu(A,d,(0,xt.A)(Zd,this),(0,xt.A)(ou,this),(0,xt.A)($d,this),(0,xt.A)(tu,this))}}function uu(){const t=(0,xt.A)(iu,this).subarray(4,6),e=(0,xt.A)(iu,this).subarray(16,18),[i,n,s,r]=(0,xt.A)(Zd,this);return[((0,xt.A)(nu,this)+(t[0]-e[0])/2-i)/s,((0,xt.A)(su,this)+(t[1]-e[1])/2-n)/r,((0,xt.A)(nu,this)+(e[0]-t[0])/2-i)/s,((0,xt.A)(su,this)+(e[1]-t[1])/2-n)/r]}var pu={_:8},fu={_:pu._+2},gu=new WeakMap,Au=new WeakMap,mu=new WeakMap,vu=new WeakMap,bu=new WeakMap,wu=new WeakMap,yu=new WeakMap,_u=new WeakSet;class xu extends Xd{constructor(t,e,i,n,s,r){super(),(0,vt.A)(this,_u),(0,_t.A)(this,gu,void 0),(0,_t.A)(this,Au,null),(0,_t.A)(this,mu,void 0),(0,_t.A)(this,vu,void 0),(0,_t.A)(this,bu,void 0),(0,_t.A)(this,wu,void 0),(0,_t.A)(this,yu,void 0),(0,Et.A)(yu,this,t),(0,Et.A)(bu,this,e),(0,Et.A)(gu,this,i),(0,Et.A)(wu,this,n),(0,Et.A)(mu,this,s),(0,Et.A)(vu,this,r),(0,bt.A)(_u,this,ku).call(this,r);const{x:a,y:o,width:l,height:c}=(0,xt.A)(Au,this);for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-a)/l,t[h+1]=(t[h+1]-o)/c;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-a)/l,e[h+1]=(e[h+1]-o)/c}toSVGPath(){const t=["M".concat((0,xt.A)(yu,this)[4]," ").concat((0,xt.A)(yu,this)[5])];for(let e=6,i=(0,xt.A)(yu,this).length;e<i;e+=6)isNaN((0,xt.A)(yu,this)[e])?t.push("L".concat((0,xt.A)(yu,this)[e+4]," ").concat((0,xt.A)(yu,this)[e+5])):t.push("C".concat((0,xt.A)(yu,this)[e]," ").concat((0,xt.A)(yu,this)[e+1]," ").concat((0,xt.A)(yu,this)[e+2]," ").concat((0,xt.A)(yu,this)[e+3]," ").concat((0,xt.A)(yu,this)[e+4]," ").concat((0,xt.A)(yu,this)[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,c;switch(e){case 0:l=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(yu,this),i,r,a,-o),c=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(bu,this),i,r,a,-o);break;case 90:l=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(yu,this),i,n,a,o),c=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(bu,this),i,n,a,o);break;case 180:l=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(yu,this),s,n,-a,o),c=(0,bt.A)(_u,this,Eu).call(this,(0,xt.A)(bu,this),s,n,-a,o);break;case 270:l=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(yu,this),s,r,-a,-o),c=(0,bt.A)(_u,this,Cu).call(this,(0,xt.A)(bu,this),s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(c)]}}get box(){return(0,xt.A)(Au,this)}getNewOutline(t,e){const{x:i,y:n,width:s,height:r}=(0,xt.A)(Au,this),[a,o,l,c]=(0,xt.A)(gu,this),h=s*l,d=r*c,u=i*l+a,p=n*c+o,f=new du({x:(0,xt.A)(bu,this)[0]*h+u,y:(0,xt.A)(bu,this)[1]*d+p},(0,xt.A)(gu,this),(0,xt.A)(wu,this),t,(0,xt.A)(vu,this),null!==e&&void 0!==e?e:(0,xt.A)(mu,this));for(let g=2;g<(0,xt.A)(bu,this).length;g+=2)f.add({x:(0,xt.A)(bu,this)[g]*h+u,y:(0,xt.A)(bu,this)[g+1]*d+p});return f.getOutlines()}}function Eu(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}function Cu(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}function ku(t){const e=(0,xt.A)(yu,this);let i=e[4],n=e[5],s=i,r=n,a=i,o=n,l=i,c=n;const h=t?Math.max:Math.min;for(let g=6,A=e.length;g<A;g+=6){if(isNaN(e[g]))s=Math.min(s,e[g+4]),r=Math.min(r,e[g+5]),a=Math.max(a,e[g+4]),o=Math.max(o,e[g+5]),c<e[g+5]?(l=e[g+4],c=e[g+5]):c===e[g+5]&&(l=h(l,e[g+4]));else{const t=ni.bezierBoundingBox(i,n,...e.slice(g,g+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]),c<t[3]?(l=t[2],c=t[3]):c===t[3]&&(l=h(l,t[2]))}i=e[g+4],n=e[g+5]}const d=s-(0,xt.A)(mu,this),u=r-(0,xt.A)(mu,this),p=a-s+2*(0,xt.A)(mu,this),f=o-r+2*(0,xt.A)(mu,this);(0,Et.A)(Au,this,{x:d,y:u,width:p,height:f,lastPoint:[l,c]})}var Su=new WeakMap,Mu=new WeakMap,Lu=new WeakMap,Tu=new WeakMap,Ru=new WeakMap,Pu=new WeakMap,Fu=new WeakMap,Iu=new WeakMap,Du=new WeakMap,Ou=new WeakMap,Nu=new WeakMap,Wu=new WeakMap,ju=new WeakSet;class Bu{static get _keyboardManager(){return Ue(this,"_keyboardManager",new Yn([[["Escape","mac+Escape"],Bu.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Bu.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Bu.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Bu.prototype._moveToPrevious],[["Home","mac+Home"],Bu.prototype._moveToBeginning],[["End","mac+End"],Bu.prototype._moveToEnd]]))}constructor(t){var e;let{editor:i=null,uiManager:n=null}=t;(0,vt.A)(this,ju),(0,_t.A)(this,Su,(0,bt.A)(ju,this,Uu).bind(this)),(0,_t.A)(this,Mu,(0,bt.A)(ju,this,Gu).bind(this)),(0,_t.A)(this,Lu,null),(0,_t.A)(this,Tu,null),(0,_t.A)(this,Ru,void 0),(0,_t.A)(this,Pu,null),(0,_t.A)(this,Fu,!1),(0,_t.A)(this,Iu,!1),(0,_t.A)(this,Du,null),(0,_t.A)(this,Ou,void 0),(0,_t.A)(this,Nu,null),(0,_t.A)(this,Wu,void 0),i?((0,Et.A)(Iu,this,!1),(0,Et.A)(Wu,this,$t.HIGHLIGHT_COLOR),(0,Et.A)(Du,this,i)):((0,Et.A)(Iu,this,!0),(0,Et.A)(Wu,this,$t.HIGHLIGHT_DEFAULT_COLOR)),(0,Et.A)(Nu,this,(null===i||void 0===i?void 0:i._uiManager)||n),(0,Et.A)(Ou,this,(0,xt.A)(Nu,this)._eventBus),(0,Et.A)(Ru,this,(null===i||void 0===i?void 0:i.color)||(null===(e=(0,xt.A)(Nu,this))||void 0===e?void 0:e.highlightColors.values().next().value)||"#FFFF98")}renderButton(){const t=(0,Et.A)(Lu,this,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=(0,xt.A)(Nu,this)._signal;t.addEventListener("click",(0,bt.A)(ju,this,Vu).bind(this),{signal:e}),t.addEventListener("keydown",(0,xt.A)(Su,this),{signal:e});const i=(0,Et.A)(Tu,this,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=(0,xt.A)(Ru,this),t.append(i),t}renderMainDropdown(){const t=(0,Et.A)(Pu,this,(0,bt.A)(ju,this,Hu).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===(0,xt.A)(Lu,this))return void(0,bt.A)(ju,this,Vu).call(this,t);const e=t.target.getAttribute("data-color");e&&(0,bt.A)(ju,this,zu).call(this,e,t)}_moveToNext(t){var e,i;wt(ju,this,qu)?t.target!==(0,xt.A)(Lu,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=(0,xt.A)(Pu,this).firstChild)||void 0===i||i.focus():(0,bt.A)(ju,this,Vu).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=(0,xt.A)(Pu,this))||void 0===e?void 0:e.firstChild)&&t.target!==(0,xt.A)(Lu,this)?(wt(ju,this,qu)||(0,bt.A)(ju,this,Vu).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):wt(ju,this,qu)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;wt(ju,this,qu)?null===(e=(0,xt.A)(Pu,this).firstChild)||void 0===e||e.focus():(0,bt.A)(ju,this,Vu).call(this,t)}_moveToEnd(t){var e;wt(ju,this,qu)?null===(e=(0,xt.A)(Pu,this).lastChild)||void 0===e||e.focus():(0,bt.A)(ju,this,Vu).call(this,t)}hideDropdown(){var t;null===(t=(0,xt.A)(Pu,this))||void 0===t||t.classList.add("hidden"),window.removeEventListener("pointerdown",(0,xt.A)(Mu,this))}_hideDropdownFromKeyboard(){var t;(0,xt.A)(Iu,this)||(wt(ju,this,qu)?(this.hideDropdown(),(0,xt.A)(Lu,this).focus({preventScroll:!0,focusVisible:(0,xt.A)(Fu,this)})):null===(t=(0,xt.A)(Du,this))||void 0===t||t.unselect())}updateColor(t){if((0,xt.A)(Tu,this)&&((0,xt.A)(Tu,this).style.backgroundColor=t),!(0,xt.A)(Pu,this))return;const e=(0,xt.A)(Nu,this).highlightColors.values();for(const i of(0,xt.A)(Pu,this).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;null===(t=(0,xt.A)(Lu,this))||void 0===t||t.remove(),(0,Et.A)(Lu,this,null),(0,Et.A)(Tu,this,null),null===(e=(0,xt.A)(Pu,this))||void 0===e||e.remove(),(0,Et.A)(Pu,this,null)}}function Hu(){const t=document.createElement("div"),e=(0,xt.A)(Nu,this)._signal;t.addEventListener("contextmenu",sn,{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(0,xt.A)(Nu,this).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-".concat(i));const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.setAttribute("aria-selected",n===(0,xt.A)(Ru,this)),s.addEventListener("click",(0,bt.A)(ju,this,zu).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",(0,xt.A)(Su,this),{signal:e}),t}function zu(t,e){e.stopPropagation(),(0,xt.A)(Ou,this).dispatch("switchannotationeditorparams",{source:this,type:(0,xt.A)(Wu,this),value:t})}function Uu(t){Ft._keyboardManager.exec(this,t)}function Vu(t){if(wt(ju,this,qu))return void this.hideDropdown();if((0,Et.A)(Fu,this,0===t.detail),window.addEventListener("pointerdown",(0,xt.A)(Mu,this),{signal:(0,xt.A)(Nu,this)._signal}),(0,xt.A)(Pu,this))return void(0,xt.A)(Pu,this).classList.remove("hidden");const e=(0,Et.A)(Pu,this,(0,bt.A)(ju,this,Hu).call(this));(0,xt.A)(Lu,this).append(e)}function Gu(t){var e;null!==(e=(0,xt.A)(Pu,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function qu(t){return(0,xt.A)(Pu,t)&&!(0,xt.A)(Pu,t).classList.contains("hidden")}Ft=Bu;var Xu=new WeakMap,Yu=new WeakMap,Ku=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,$u=new WeakMap,tp=new WeakMap,ep=new WeakMap,ip=new WeakMap,np=new WeakMap,sp=new WeakMap,rp=new WeakMap,ap=new WeakMap,op=new WeakMap,lp=new WeakMap,cp=new WeakMap,hp=new WeakMap,dp=new WeakMap,up=new WeakSet;class pp extends Vr{static get _keyboardManager(){const t=pp.prototype;return Ue(this,"_keyboardManager",new Yn([[["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((0,gt.A)((0,gt.A)({},t),{},{name:"highlightEditor"})),(0,vt.A)(this,up),(0,_t.A)(this,Xu,null),(0,_t.A)(this,Yu,0),(0,_t.A)(this,Ku,void 0),(0,_t.A)(this,Qu,null),(0,_t.A)(this,Zu,null),(0,_t.A)(this,Ju,null),(0,_t.A)(this,$u,null),(0,_t.A)(this,tp,0),(0,_t.A)(this,ep,null),(0,_t.A)(this,ip,null),(0,_t.A)(this,np,null),(0,_t.A)(this,sp,!1),(0,_t.A)(this,rp,(0,bt.A)(up,this,_p).bind(this)),(0,_t.A)(this,ap,null),(0,_t.A)(this,op,void 0),(0,_t.A)(this,lp,null),(0,_t.A)(this,cp,""),(0,_t.A)(this,hp,void 0),(0,_t.A)(this,dp,""),this.color=t.color||pp._defaultColor,(0,Et.A)(hp,this,t.thickness||pp._defaultThickness),(0,Et.A)(op,this,t.opacity||pp._defaultOpacity),(0,Et.A)(Ku,this,t.boxes||null),(0,Et.A)(dp,this,t.methodOfCreation||""),(0,Et.A)(cp,this,t.text||""),this._isDraggable=!1,t.highlightId>-1?((0,Et.A)(sp,this,!0),(0,bt.A)(up,this,gp).call(this,t),(0,bt.A)(up,this,wp).call(this)):((0,Et.A)(Xu,this,t.anchorNode),(0,Et.A)(Yu,this,t.anchorOffset),(0,Et.A)($u,this,t.focusNode),(0,Et.A)(tp,this,t.focusOffset),(0,bt.A)(up,this,fp).call(this),(0,bt.A)(up,this,wp).call(this),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:(0,xt.A)(sp,this)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:(0,xt.A)(hp,this),methodOfCreation:(0,xt.A)(dp,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;Vr.initialize(t,e),pp._defaultColor||(pp._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case $t.HIGHLIGHT_DEFAULT_COLOR:pp._defaultColor=e;break;case $t.HIGHLIGHT_THICKNESS:pp._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return(0,xt.A)(ap,this)}updateParams(t,e){switch(t){case $t.HIGHLIGHT_COLOR:(0,bt.A)(up,this,Ap).call(this,e);break;case $t.HIGHLIGHT_THICKNESS:(0,bt.A)(up,this,mp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[$t.HIGHLIGHT_DEFAULT_COLOR,pp._defaultColor],[$t.HIGHLIGHT_THICKNESS,pp._defaultThickness]]}get propertiesToUpdate(){return[[$t.HIGHLIGHT_COLOR,this.color||pp._defaultColor],[$t.HIGHLIGHT_THICKNESS,(0,xt.A)(hp,this)||pp._defaultThickness],[$t.HIGHLIGHT_FREE,(0,xt.A)(sp,this)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&((0,Et.A)(Zu,this,new Bu({editor:this})),t.addColorPicker((0,xt.A)(Zu,this))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition((0,bt.A)(up,this,Ep).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,(0,bt.A)(up,this,Ep).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){(0,bt.A)(up,this,bp).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&((0,bt.A)(up,this,wp).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)(0,bt.A)(up,this,bp).call(this);else if(t){var i;(0,bt.A)(up,this,wp).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;(0,xt.A)(sp,this)?(t=(t-this.rotation+360)%360,i=yp.call(pp,(0,xt.A)(ip,this).box,t)):i=yp.call(pp,this,t),e.rotate((0,xt.A)(np,this),t),e.rotate((0,xt.A)(lp,this),t),e.updateBox((0,xt.A)(np,this),i),e.updateBox((0,xt.A)(lp,this),yp.call(pp,(0,xt.A)(Ju,this).box,t))}render(){if(this.div)return this.div;const t=super.render();(0,xt.A)(cp,this)&&(t.setAttribute("aria-label",(0,xt.A)(cp,this)),t.setAttribute("role","mark")),(0,xt.A)(sp,this)?t.classList.add("free"):this.div.addEventListener("keydown",(0,xt.A)(rp,this),{signal:this._uiManager._signal});const e=(0,Et.A)(ep,this,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=(0,xt.A)(Qu,this);const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),Fn(this,(0,xt.A)(ep,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass((0,xt.A)(lp,this),"hovered")}pointerleave(){this.parent.drawLayer.removeClass((0,xt.A)(lp,this),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:(0,bt.A)(up,this,xp).call(this,!0);break;case 1:case 3:(0,bt.A)(up,this,xp).call(this,!1)}}select(){var t,e;super.select(),(0,xt.A)(lp,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass((0,xt.A)(lp,this),"hovered"),null===(e=this.parent)||void 0===e||e.drawLayer.addClass((0,xt.A)(lp,this),"selected"))}unselect(){var t;super.unselect(),(0,xt.A)(lp,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass((0,xt.A)(lp,this),"selected"),(0,xt.A)(sp,this)||(0,bt.A)(up,this,xp).call(this,!1))}get _mustFixPosition(){return!(0,xt.A)(sp,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show((0,xt.A)(np,this),t),this.parent.drawLayer.show((0,xt.A)(lp,this),t))}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:l,height:c}=n.getBoundingClientRect(),h=e=>{(0,bt.A)(pp,this,Sp).call(this,t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},f=e=>{n.removeEventListener("pointermove",h),window.removeEventListener("blur",f),window.removeEventListener("pointerup",f),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",sn),(0,bt.A)(pp,this,Mp).call(this,t,e)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",sn,{signal:d}),n.addEventListener("pointermove",h,{signal:d}),this._freeHighlight=new du({x:s,y:r},[a,o,l,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(t,e,i){const n=super.deserialize(t,e,i),{rect:[s,r,a,o],color:l,quadPoints:c}=t;n.color=ni.makeHexColor(...l),(0,Et.A)(op,n,t.opacity);const[h,d]=n.pageDimensions;n.width=(a-s)/h,n.height=(o-r)/d;const u=(0,Et.A)(Ku,n,[]);for(let p=0;p<c.length;p+=8)u.push({x:(c[4]-a)/h,y:(o-(1-c[p+5]))/d,width:(c[p+2]-c[p])/h,height:(c[p+5]-c[p+1])/d});return(0,bt.A)(up,n,fp).call(n),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=Vr._colorManager.convert(this.color);return{annotationType:Jt.HIGHLIGHT,color:i,opacity:(0,xt.A)(op,this),thickness:(0,xt.A)(hp,this),quadPoints:(0,bt.A)(up,this,Cp).call(this),outlines:(0,bt.A)(up,this,kp).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:(0,bt.A)(up,this,Ep).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}function fp(){const t=new Hd((0,xt.A)(Ku,this),.001);(0,Et.A)(ip,this,t.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=(0,xt.A)(ip,this).box);const e=new Hd((0,xt.A)(Ku,this),.0025,.001,"ltr"===this._uiManager.direction);(0,Et.A)(Ju,this,e.getOutlines());const{lastPoint:i}=(0,xt.A)(Ju,this).box;(0,Et.A)(ap,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function gp(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;(0,Et.A)(ip,this,e);if((0,Et.A)(Ju,this,e.getNewOutline((0,xt.A)(hp,this)/2+1.5,.0025)),i>=0)(0,Et.A)(np,this,i),(0,Et.A)(Qu,this,n),this.parent.drawLayer.finalizeLine(i,e),(0,Et.A)(lp,this,this.parent.drawLayer.highlightOutline((0,xt.A)(Ju,this)));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine((0,xt.A)(np,this),e),this.parent.drawLayer.updateBox((0,xt.A)(np,this),yp.call(It,(0,xt.A)(ip,this).box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine((0,xt.A)(lp,this),(0,xt.A)(Ju,this)),this.parent.drawLayer.updateBox((0,xt.A)(lp,this),yp.call(It,(0,xt.A)(Ju,this).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}=(0,xt.A)(Ju,this).box;(0,Et.A)(ap,this,[(l[0]-s)/a,(l[1]-r)/o])}function Ap(t){const e=t=>{var e,i;this.color=t,null===(e=this.parent)||void 0===e||e.drawLayer.changeColor((0,xt.A)(np,this),t),null===(i=(0,xt.A)(Zu,this))||void 0===i||i.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:$t.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}function mp(t){const e=(0,xt.A)(hp,this),i=t=>{(0,Et.A)(hp,this,t),(0,bt.A)(up,this,vp).call(this,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function vp(t){if(!(0,xt.A)(sp,this))return;(0,bt.A)(up,this,gp).call(this,{highlightOutlines:(0,xt.A)(ip,this).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}function bp(){null!==(0,xt.A)(np,this)&&this.parent&&(this.parent.drawLayer.remove((0,xt.A)(np,this)),(0,Et.A)(np,this,null),this.parent.drawLayer.remove((0,xt.A)(lp,this)),(0,Et.A)(lp,this,null))}function wp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===(0,xt.A)(np,this)&&(({id:At(Et.A,[np,this])._,clipPathId:At(Et.A,[Qu,this])._}=t.drawLayer.highlight((0,xt.A)(ip,this),this.color,(0,xt.A)(op,this))),(0,Et.A)(lp,this,t.drawLayer.highlightOutline((0,xt.A)(Ju,this))),(0,xt.A)(ep,this)&&((0,xt.A)(ep,this).style.clipPath=(0,xt.A)(Qu,this)))}function yp(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}}function _p(t){It._keyboardManager.exec(this,t)}function xp(t){if(!(0,xt.A)(Xu,this))return;const e=window.getSelection();t?e.setPosition((0,xt.A)(Xu,this),(0,xt.A)(Yu,this)):e.setPosition((0,xt.A)($u,this),(0,xt.A)(tp,this))}function Ep(){return(0,xt.A)(sp,this)?this.rotation:0}function Cp(){if((0,xt.A)(sp,this))return null;const[t,e]=this.pageDimensions,i=(0,xt.A)(Ku,this),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,c=(1-a-l)*e;n[s]=n[s+4]=i,n[s+1]=n[s+3]=c,n[s+2]=n[s+6]=i+o*t,n[s+5]=n[s+7]=c+l*e,s+=8}return n}function kp(t){return(0,xt.A)(ip,this).serialize(t,(0,bt.A)(up,this,Ep).call(this))}function Sp(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function Mp(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=""}It=pp,(0,yt.A)(pp,"_defaultColor",null),(0,yt.A)(pp,"_defaultOpacity",1),(0,yt.A)(pp,"_defaultThickness",12),(0,yt.A)(pp,"_l10nPromise",void 0),(0,yt.A)(pp,"_type","highlight"),(0,yt.A)(pp,"_editorType",Jt.HIGHLIGHT),(0,yt.A)(pp,"_freeHighlightId",-1),(0,yt.A)(pp,"_freeHighlight",null),(0,yt.A)(pp,"_freeHighlightClipId","");var Lp=new WeakMap,Tp=new WeakMap,Rp=new WeakMap,Pp=new WeakMap,Fp=new WeakMap,Ip=new WeakMap,Dp=new WeakMap,Op=new WeakMap,Np=new WeakMap,Wp=new WeakMap,jp=new WeakMap,Bp=new WeakMap,Hp=new WeakMap,zp=new WeakMap,Up=new WeakMap,Vp=new WeakSet;class Gp extends Vr{constructor(t){super((0,gt.A)((0,gt.A)({},t),{},{name:"inkEditor"})),(0,vt.A)(this,Vp),(0,_t.A)(this,Lp,0),(0,_t.A)(this,Tp,0),(0,_t.A)(this,Rp,this.canvasPointermove.bind(this)),(0,_t.A)(this,Pp,this.canvasPointerleave.bind(this)),(0,_t.A)(this,Fp,this.canvasPointerup.bind(this)),(0,_t.A)(this,Ip,this.canvasPointerdown.bind(this)),(0,_t.A)(this,Dp,null),(0,_t.A)(this,Op,new Path2D),(0,_t.A)(this,Np,!1),(0,_t.A)(this,Wp,!1),(0,_t.A)(this,jp,!1),(0,_t.A)(this,Bp,null),(0,_t.A)(this,Hp,0),(0,_t.A)(this,zp,0),(0,_t.A)(this,Up,null),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){Vr.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case $t.INK_THICKNESS:Gp._defaultThickness=e;break;case $t.INK_COLOR:Gp._defaultColor=e;break;case $t.INK_OPACITY:Gp._defaultOpacity=e/100}}updateParams(t,e){switch(t){case $t.INK_THICKNESS:(0,bt.A)(Vp,this,qp).call(this,e);break;case $t.INK_COLOR:(0,bt.A)(Vp,this,Xp).call(this,e);break;case $t.INK_OPACITY:(0,bt.A)(Vp,this,Yp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[$t.INK_THICKNESS,Gp._defaultThickness],[$t.INK_COLOR,Gp._defaultColor||Vr._defaultLineColor],[$t.INK_OPACITY,Math.round(100*Gp._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[$t.INK_THICKNESS,this.thickness||Gp._defaultThickness],[$t.INK_COLOR,this.color||Gp._defaultColor||Vr._defaultLineColor],[$t.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:Gp._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||((0,bt.A)(Vp,this,of).call(this),(0,bt.A)(Vp,this,lf).call(this)),this.isAttachedToDOM||(this.parent.add(this),(0,bt.A)(Vp,this,cf).call(this)),(0,bt.A)(Vp,this,vf).call(this)))}remove(){var t;null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,(0,xt.A)(Dp,this)&&(clearTimeout((0,xt.A)(Dp,this)),(0,Et.A)(Dp,this,null)),null===(t=(0,xt.A)(Bp,this))||void 0===t||t.disconnect(),(0,Et.A)(Bp,this,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(){(0,xt.A)(Np,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",(0,xt.A)(Ip,this),{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",(0,xt.A)(Ip,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){(0,xt.A)(Np,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),(0,Et.A)(Np,this,!0),this.div.classList.add("disabled"),(0,bt.A)(Vp,this,vf).call(this,!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()&&!(0,xt.A)(Np,this)&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),(0,bt.A)(Vp,this,Zp).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),(0,bt.A)(Vp,this,Jp).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),(0,bt.A)(Vp,this,af).call(this,t)}canvasPointerleave(t){(0,bt.A)(Vp,this,af).call(this,t)}get isResizable(){return!this.isEmpty()&&(0,xt.A)(Np,this)}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]=(0,bt.A)(Vp,this,Kp).call(this);if(this.setAt(i,n,0,0),this.setDims(s,r),(0,bt.A)(Vp,this,of).call(this),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),(0,Et.A)(jp,this,!0),(0,bt.A)(Vp,this,cf).call(this),this.setDims(this.width*i,this.height*n),(0,bt.A)(Vp,this,rf).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return(0,bt.A)(Vp,this,lf).call(this),this.div}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if((0,xt.A)(Hp,this)===i&&(0,xt.A)(zp,this)===n)return;(0,Et.A)(Hp,this,i),(0,Et.A)(zp,this,n),this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s,this.height=e/r,this.fixAndSetPosition(),(0,xt.A)(Np,this)&&(0,bt.A)(Vp,this,hf).call(this,t,e),(0,bt.A)(Vp,this,cf).call(this),(0,bt.A)(Vp,this,rf).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,i){if(t instanceof Jh)return null;const n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=ni.makeHexColor(...t.color),n.opacity=t.opacity;const[s,r]=n.pageDimensions,a=n.width*s,o=n.height*r,l=n.parentScale,c=t.thickness/2;(0,Et.A)(Np,n,!0),(0,Et.A)(Hp,n,Math.round(a)),(0,Et.A)(zp,n,Math.round(o));const{paths:h,rect:d,rotation:u}=t;for(let{bezier:f}of h){f=ff.call(Gp,f,d,u);const t=[];n.paths.push(t);let e=l*(f[0]-c),i=l*(f[1]-c);for(let n=2,r=f.length;n<r;n+=6){const s=l*(f[n]-c),r=l*(f[n+1]-c),a=l*(f[n+2]-c),o=l*(f[n+3]-c),h=l*(f[n+4]-c),d=l*(f[n+5]-c);t.push([[e,i],[s,r],[a,o],[h,d]]),e=h,i=d}const s=(0,bt.A)(Gp,this,uf).call(this,t);n.bezierPath2D.push(s)}const p=(0,bt.A)(Vp,n,Af).call(n);return(0,Et.A)(Tp,n,Math.max(Vr.MIN_SIZE,p[2]-p[0])),(0,Et.A)(Lp,n,Math.max(Vr.MIN_SIZE,p[3]-p[1])),(0,bt.A)(Vp,n,hf).call(n,a,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=Vr._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Jt.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:(0,bt.A)(Vp,this,gf).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}function qp(t){const e=t=>{this.thickness=t,(0,bt.A)(Vp,this,vf).call(this)},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:$t.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function Xp(t){const e=t=>{this.color=t,(0,bt.A)(Vp,this,rf).call(this)},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:$t.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Yp(t){const e=t=>{this.opacity=t,(0,bt.A)(Vp,this,rf).call(this)};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:$t.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function Kp(){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]}}function Qp(){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="".concat(e).concat(function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i))}function Zp(t,e){const i=this._uiManager._signal;var n;(this.canvas.addEventListener("contextmenu",sn,{signal:i}),this.canvas.addEventListener("pointerleave",(0,xt.A)(Pp,this),{signal:i}),this.canvas.addEventListener("pointermove",(0,xt.A)(Rp,this),{signal:i}),this.canvas.addEventListener("pointerup",(0,xt.A)(Fp,this),{signal:i}),this.canvas.removeEventListener("pointerdown",(0,xt.A)(Ip,this)),this.isEditing=!0,(0,xt.A)(jp,this))||((0,Et.A)(jp,this,!0),(0,bt.A)(Vp,this,cf).call(this),this.thickness||(this.thickness=Dt._defaultThickness),this.color||(this.color=Dt._defaultColor||Vr._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=Dt._defaultOpacity));this.currentPath.push([t,e]),(0,Et.A)(Wp,this,!1),(0,bt.A)(Vp,this,Qp).call(this),(0,Et.A)(Up,this,()=>{(0,bt.A)(Vp,this,ef).call(this),(0,xt.A)(Up,this)&&window.requestAnimationFrame((0,xt.A)(Up,this))}),window.requestAnimationFrame((0,xt.A)(Up,this))}function Jp(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=(0,xt.A)(Op,this);if(s.push([t,e]),(0,Et.A)(Wp,this,!0),s.length<=2)return r.moveTo(...s[0]),void r.lineTo(t,e);3===s.length&&((0,Et.A)(Op,this,r=new Path2D),r.moveTo(...s[0])),(0,bt.A)(Vp,this,nf).call(this,r,...s.at(-3),...s.at(-2),t,e)}function $p(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);(0,xt.A)(Op,this).lineTo(...t)}function tf(t,e){let i;if((0,Et.A)(Up,this,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),(0,bt.A)(Vp,this,Jp).call(this,t,e),(0,bt.A)(Vp,this,$p).call(this),1!==this.currentPath.length)i=(0,bt.A)(Vp,this,sf).call(this);else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=(0,xt.A)(Op,this),s=this.currentPath;this.currentPath=[],(0,Et.A)(Op,this,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||((0,bt.A)(Vp,this,of).call(this),(0,bt.A)(Vp,this,lf).call(this)),(0,bt.A)(Vp,this,vf).call(this))},mustExec:!0})}function ef(){if(!(0,xt.A)(Wp,this))return;(0,Et.A)(Wp,this,!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((0,xt.A)(Op,this)),s.restore()}function nf(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,c=(n+r)/2,h=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,c+2*(n-c)/3,h+2*(s-h)/3,c,h)}function sf(){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],c=(r+o)/2,h=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[c+2*(r-c)/3,h+2*(a-h)/3];e.push([[n,s],d,u,[c,h]]),[n,s]=[c,h]}const[r,a]=t[i],[o,l]=t[i+1],c=[n+2*(r-n)/3,s+2*(a-s)/3],h=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],c,h,[o,l]]),e}function rf(){if(this.isEmpty())return void(0,bt.A)(Vp,this,df).call(this);(0,bt.A)(Vp,this,Qp).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),(0,bt.A)(Vp,this,df).call(this);for(const i of this.bezierPath2D)e.stroke(i)}function af(t){this.canvas.removeEventListener("pointerleave",(0,xt.A)(Pp,this)),this.canvas.removeEventListener("pointermove",(0,xt.A)(Rp,this)),this.canvas.removeEventListener("pointerup",(0,xt.A)(Fp,this)),this.canvas.addEventListener("pointerdown",(0,xt.A)(Ip,this),{signal:this._uiManager._signal}),(0,xt.A)(Dp,this)&&clearTimeout((0,xt.A)(Dp,this)),(0,Et.A)(Dp,this,setTimeout(()=>{(0,Et.A)(Dp,this,null),this.canvas.removeEventListener("contextmenu",sn)},10)),(0,bt.A)(Vp,this,tf).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function of(){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")}function lf(){(0,Et.A)(Bp,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),(0,xt.A)(Bp,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=(0,xt.A)(Bp,this))||void 0===t||t.disconnect(),(0,Et.A)(Bp,this,null)},{once:!0})}function cf(){if(!(0,xt.A)(jp,this))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),(0,bt.A)(Vp,this,df).call(this)}function hf(t,e){const i=(0,bt.A)(Vp,this,mf).call(this),n=(t-i)/(0,xt.A)(Tp,this),s=(e-i)/(0,xt.A)(Lp,this);this.scaleFactor=Math.min(n,s)}function df(){const t=(0,bt.A)(Vp,this,mf).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function uf(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}function pf(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}function ff(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}function gf(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,c,h,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,f=t*c[0]+a,g=t*c[1]+o,A=t*h[0]+a,m=t*h[1]+o,v=t*d[0]+a,b=t*d[1]+o;0===n&&(e.push(u,p),i.push(u,p)),e.push(f,g,A,m,v,b),i.push(f,g),n===s-1&&i.push(v,b)}s.push({bezier:pf.call(Dt,e,n,this.rotation),points:pf.call(Dt,i,n,this.rotation)})}return s}function Af(){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=ni.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]}function mf(){return(0,xt.A)(Np,this)?Math.ceil(this.thickness*this.parentScale):0}function vf(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!(0,xt.A)(Np,this))return void(0,bt.A)(Vp,this,rf).call(this);const e=(0,bt.A)(Vp,this,Af).call(this),i=(0,bt.A)(Vp,this,mf).call(this);(0,Et.A)(Tp,this,Math.max(Vr.MIN_SIZE,e[2]-e[0])),(0,Et.A)(Lp,this,Math.max(Vr.MIN_SIZE,e[3]-e[1]));const n=Math.ceil(i+(0,xt.A)(Tp,this)*this.scaleFactor),s=Math.ceil(i+(0,xt.A)(Lp,this)*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],(0,bt.A)(Vp,this,cf).call(this),(0,bt.A)(Vp,this,rf).call(this),(0,Et.A)(Hp,this,n),(0,Et.A)(zp,this,s),this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-c,l-this.translationY-c)}Dt=Gp,(0,yt.A)(Gp,"_defaultColor",null),(0,yt.A)(Gp,"_defaultOpacity",1),(0,yt.A)(Gp,"_defaultThickness",1),(0,yt.A)(Gp,"_type","ink"),(0,yt.A)(Gp,"_editorType",Jt.INK);var bf=new WeakMap,wf=new WeakMap,yf=new WeakMap,_f=new WeakMap,xf=new WeakMap,Ef=new WeakMap,Cf=new WeakMap,kf=new WeakMap,Sf=new WeakMap,Mf=new WeakMap,Lf=new WeakMap,Tf=new WeakSet;class Rf extends Vr{constructor(t){super((0,gt.A)((0,gt.A)({},t),{},{name:"stampEditor"})),(0,vt.A)(this,Tf),(0,_t.A)(this,bf,null),(0,_t.A)(this,wf,null),(0,_t.A)(this,yf,null),(0,_t.A)(this,_f,null),(0,_t.A)(this,xf,null),(0,_t.A)(this,Ef,""),(0,_t.A)(this,Cf,null),(0,_t.A)(this,kf,null),(0,_t.A)(this,Sf,null),(0,_t.A)(this,Mf,!1),(0,_t.A)(this,Lf,!1),(0,Et.A)(_f,this,t.bitmapUrl),(0,Et.A)(xf,this,t.bitmapFile)}static initialize(t,e){Vr.initialize(t,e)}static get supportedTypes(){return Ue(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>"image/".concat(t)))}static get supportedTypesStr(){return Ue(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(Jt.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;(0,xt.A)(wf,this)&&((0,Et.A)(bf,this,null),this._uiManager.imageManager.deleteId((0,xt.A)(wf,this)),null===(t=(0,xt.A)(Cf,this))||void 0===t||t.remove(),(0,Et.A)(Cf,this,null),null===(e=(0,xt.A)(kf,this))||void 0===e||e.disconnect(),(0,Et.A)(kf,this,null),(0,xt.A)(Sf,this)&&(clearTimeout((0,xt.A)(Sf,this)),(0,Et.A)(Sf,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&((0,xt.A)(wf,this)&&null===(0,xt.A)(Cf,this)&&(0,bt.A)(Tf,this,If).call(this),this.isAttachedToDOM||this.parent.add(this))):(0,xt.A)(wf,this)&&(0,bt.A)(Tf,this,If).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!((0,xt.A)(yf,this)||(0,xt.A)(bf,this)||(0,xt.A)(_f,this)||(0,xt.A)(xf,this)||(0,xt.A)(wf,this))}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(),(0,xt.A)(bf,this)?(0,bt.A)(Tf,this,Df).call(this):(0,bt.A)(Tf,this,If).call(this),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}getImageForAltText(){return(0,xt.A)(Cf,this)}static deserialize(t,e,i){if(t instanceof nd)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)?(0,Et.A)(wf,n,a):(0,Et.A)(_f,n,r),(0,Et.A)(Mf,n,o);const[c,h]=n.pageDimensions;return n.width=(s[2]-s[0])/c,n.height=(s[3]-s[1])/h,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:Jt.STAMP,bitmapId:(0,xt.A)(wf,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:(0,xt.A)(Mf,this),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=(0,bt.A)(Tf,this,jf).call(this,!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||(e.stamps=new Map);const r=(0,xt.A)(Mf,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has((0,xt.A)(wf,this))){if((0,xt.A)(Mf,this)){const t=e.stamps.get((0,xt.A)(wf,this));r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=(0,bt.A)(Tf,this,jf).call(this,!1))}}else e.stamps.set((0,xt.A)(wf,this),{area:r,serialized:i}),i.bitmap=(0,bt.A)(Tf,this,jf).call(this,!1);return i}}function Pf(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?((0,Et.A)(bf,this,t.bitmap),e||((0,Et.A)(wf,this,t.id),(0,Et.A)(Mf,this,t.isSvg)),t.file&&(0,Et.A)(Ef,this,t.file.name),(0,bt.A)(Tf,this,Df).call(this)):this.remove()}function Ff(){(0,Et.A)(yf,this,null),this._uiManager.enableWaiting(!1),(0,xt.A)(Cf,this)&&this.div.focus()}function If(){if((0,xt.A)(wf,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId((0,xt.A)(wf,this)).then(t=>(0,bt.A)(Tf,this,Pf).call(this,t,!0)).finally(()=>(0,bt.A)(Tf,this,Ff).call(this));if((0,xt.A)(_f,this)){const t=(0,xt.A)(_f,this);return(0,Et.A)(_f,this,null),this._uiManager.enableWaiting(!0),void(0,Et.A)(yf,this,this._uiManager.imageManager.getFromUrl(t).then(t=>(0,bt.A)(Tf,this,Pf).call(this,t)).finally(()=>(0,bt.A)(Tf,this,Ff).call(this)))}if((0,xt.A)(xf,this)){const t=(0,xt.A)(xf,this);return(0,Et.A)(xf,this,null),this._uiManager.enableWaiting(!0),void(0,Et.A)(yf,this,this._uiManager.imageManager.getFromFile(t).then(t=>(0,bt.A)(Tf,this,Pf).call(this,t)).finally(()=>(0,bt.A)(Tf,this,Ff).call(this)))}const t=document.createElement("input");t.type="file",t.accept=Ot.supportedTypesStr;const e=this._uiManager._signal;(0,Et.A)(yf,this,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]);(0,bt.A)(Tf,this,Pf).call(this,e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>(0,bt.A)(Tf,this,Ff).call(this))),t.click()}function Df(){const{div:t}=this;let{width:e,height:i}=(0,xt.A)(bf,this);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=(0,Et.A)(Cf,this,document.createElement("canvas"));t.append(l),t.hidden=!1,(0,bt.A)(Tf,this,Wf).call(this,e,i),(0,bt.A)(Tf,this,Bf).call(this),(0,xt.A)(Lf,this)||(this.parent.addUndoableEditor(this),(0,Et.A)(Lf,this,!0)),this._reportTelemetry({action:"inserted_image"}),(0,xt.A)(Ef,this)&&l.setAttribute("aria-label",(0,xt.A)(Ef,this))}function Of(t,e){var i;const[n,s]=this.parentDimensions;this.width=t/n,this.height=e/s,this.setDims(t,e),null!==(i=this._initialOptions)&&void 0!==i&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==(0,xt.A)(Sf,this)&&clearTimeout((0,xt.A)(Sf,this));(0,Et.A)(Sf,this,setTimeout(()=>{(0,Et.A)(Sf,this,null),(0,bt.A)(Tf,this,Wf).call(this,t,e)},200))}function Nf(t,e){const{width:i,height:n}=(0,xt.A)(bf,this);let s=i,r=n,a=(0,xt.A)(bf,this);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}function Wf(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=(0,xt.A)(Cf,this);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const n=(0,xt.A)(Mf,this)?(0,xt.A)(bf,this):(0,bt.A)(Tf,this,Nf).call(this,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=(null===t||void 0===t?void 0: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)}function jf(t){if(t){if((0,xt.A)(Mf,this)){const t=this._uiManager.imageManager.getSvgUrl((0,xt.A)(wf,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=(0,xt.A)(bf,this));return t.getContext("2d").drawImage((0,xt.A)(bf,this),0,0),t.toDataURL()}if((0,xt.A)(Mf,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*ki.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*ki.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage((0,xt.A)(bf,this),0,0,(0,xt.A)(bf,this).width,(0,xt.A)(bf,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone((0,xt.A)(bf,this))}function Bf(){this._uiManager._signal&&((0,Et.A)(kf,this,new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&(0,bt.A)(Tf,this,Of).call(this,e.width,e.height)})),(0,xt.A)(kf,this).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;null===(t=(0,xt.A)(kf,this))||void 0===t||t.disconnect(),(0,Et.A)(kf,this,null)},{once:!0}))}Ot=Rf,(0,yt.A)(Rf,"_type","stamp"),(0,yt.A)(Rf,"_editorType",Jt.STAMP);var Hf=new WeakMap,zf=new WeakMap,Uf=new WeakMap,Vf=new WeakMap,Gf=new WeakMap,qf=new WeakMap,Xf=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Qf=new WeakMap,Zf=new WeakMap,Jf=new WeakMap,$f=new WeakMap,tg=new WeakSet;class eg{constructor(t){let{uiManager:e,pageIndex:i,div:n,accessibilityManager:s,annotationLayer:r,drawLayer:a,textLayer:o,viewport:l,l10n:c}=t;(0,vt.A)(this,tg),(0,_t.A)(this,Hf,void 0),(0,_t.A)(this,zf,!1),(0,_t.A)(this,Uf,null),(0,_t.A)(this,Vf,null),(0,_t.A)(this,Gf,null),(0,_t.A)(this,qf,null),(0,_t.A)(this,Xf,null),(0,_t.A)(this,Yf,new Map),(0,_t.A)(this,Kf,!1),(0,_t.A)(this,Qf,!1),(0,_t.A)(this,Zf,!1),(0,_t.A)(this,Jf,null),(0,_t.A)(this,$f,void 0);const h=[...og._.values()];if(!eg._initialized){eg._initialized=!0;for(const t of h)t.initialize(c,e)}e.registerEditorTypes(h),(0,Et.A)($f,this,e),this.pageIndex=i,this.div=n,(0,Et.A)(Hf,this,s),(0,Et.A)(Uf,this,r),this.viewport=l,(0,Et.A)(Jf,this,o),this.drawLayer=a,(0,xt.A)($f,this).addLayer(this)}get isEmpty(){return 0===(0,xt.A)(Yf,this).size}get isInvisible(){return this.isEmpty&&(0,xt.A)($f,this).getMode()===Jt.NONE}updateToolbar(t){(0,xt.A)($f,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,xt.A)($f,this).getMode();switch((0,bt.A)(tg,this,ag).call(this),t){case Jt.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Jt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Jt.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 og._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=(0,xt.A)(Jf,this))||void 0===e?void 0:e.div)}addInkEditorIfNeeded(t){if((0,xt.A)($f,this).getMode()!==Jt.INK)return;if(!t)for(const e of(0,xt.A)(Yf,this).values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){(0,xt.A)($f,this).setEditingState(t)}addCommands(t){(0,xt.A)($f,this).addCommands(t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=(0,xt.A)(Uf,this))||void 0===t||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of(0,xt.A)(Yf,this).values())i.enableEditing(),i.show(!0),i.annotationElementId&&((0,xt.A)($f,this).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!(0,xt.A)(Uf,this))return;const e=(0,xt.A)(Uf,this).getEditableAnnotations();for(const i of e){if(i.hide(),(0,xt.A)($f,this).isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){(0,Et.A)(Zf,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const s of(0,xt.A)(Yf,this).values()){var i;s.disableEditing(),s.annotationElementId&&(null===s.serialize()?(e.set(s.annotationElementId,s),null===(i=this.getEditableAnnotation(s.annotationElementId))||void 0===i||i.show(),s.remove()):t.set(s.annotationElementId,s))}if((0,xt.A)(Uf,this)){const i=(0,xt.A)(Uf,this).getEditableAnnotations();for(const n of i){const{id:i}=n.data;if((0,xt.A)($f,this).isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&((0,xt.A)($f,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(n),s.show(!1)),n.show())}}(0,bt.A)(tg,this,ag).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const s of og._.values())n.remove("".concat(s._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),(0,Et.A)(Zf,this,!1)}getEditableAnnotation(t){var e;return(null===(e=(0,xt.A)(Uf,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){(0,xt.A)($f,this).getActive()!==t&&(0,xt.A)($f,this).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!==(t=(0,xt.A)(Jf,this))&&void 0!==t&&t.div&&!(0,xt.A)(qf,this)&&((0,Et.A)(qf,this,(0,bt.A)(tg,this,ig).bind(this)),(0,xt.A)(Jf,this).div.addEventListener("pointerdown",(0,xt.A)(qf,this),{signal:(0,xt.A)($f,this)._signal}),(0,xt.A)(Jf,this).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=(0,xt.A)(Jf,this))&&void 0!==t&&t.div&&(0,xt.A)(qf,this)&&((0,xt.A)(Jf,this).div.removeEventListener("pointerdown",(0,xt.A)(qf,this)),(0,Et.A)(qf,this,null),(0,xt.A)(Jf,this).div.classList.remove("highlighting"))}enableClick(){if((0,xt.A)(Gf,this))return;const t=(0,xt.A)($f,this)._signal;(0,Et.A)(Gf,this,this.pointerdown.bind(this)),(0,Et.A)(Vf,this,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",(0,xt.A)(Gf,this),{signal:t}),this.div.addEventListener("pointerup",(0,xt.A)(Vf,this),{signal:t})}disableClick(){(0,xt.A)(Gf,this)&&(this.div.removeEventListener("pointerdown",(0,xt.A)(Gf,this)),this.div.removeEventListener("pointerup",(0,xt.A)(Vf,this)),(0,Et.A)(Gf,this,null),(0,Et.A)(Vf,this,null))}attach(t){(0,xt.A)(Yf,this).set(t.id,t);const{annotationElementId:e}=t;e&&(0,xt.A)($f,this).isDeletedAnnotationElement(e)&&(0,xt.A)($f,this).removeDeletedAnnotationElement(t)}detach(t){var e;(0,xt.A)(Yf,this).delete(t.id),null===(e=(0,xt.A)(Hf,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!(0,xt.A)(Zf,this)&&t.annotationElementId&&(0,xt.A)($f,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),(0,xt.A)($f,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,(0,xt.A)(Qf,this)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&((0,xt.A)($f,this).addDeletedAnnotationElement(t.annotationElementId),Vr.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||e.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),(0,xt.A)($f,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),(0,xt.A)($f,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!(0,xt.A)(Xf,this)&&(t._focusEventsAllowed=!1,(0,Et.A)(Xf,this,setTimeout(()=>{(0,Et.A)(Xf,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:(0,xt.A)($f,this)._signal}),i.focus())},0))),t._structTreeParentId=null===(e=(0,xt.A)(Hf,this))||void 0===e?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(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(0,xt.A)($f,this).getId()}get _signal(){return(0,xt.A)($f,this)._signal}canCreateNewEmptyEditor(){var t;return null===(t=wt(tg,this,ng))||void 0===t?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){(0,xt.A)($f,this).updateToolbar(t),(0,xt.A)($f,this).updateMode(t);const{offsetX:i,offsetY:n}=(0,bt.A)(tg,this,rg).call(this),s=this.getNextId(),r=(0,bt.A)(tg,this,sg).call(this,(0,gt.A)({parent:this,id:s,x:i,y:n,uiManager:(0,xt.A)($f,this),isCentered:!0},e));r&&this.add(r)}deserialize(t){var e,i;return(null===(e=og._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,(0,xt.A)($f,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=(0,bt.A)(tg,this,sg).call(this,(0,gt.A)({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:(0,xt.A)($f,this),isCentered:e},i));return s&&this.add(s),s}addNewEditor(){this.createAndAddNewEditor((0,bt.A)(tg,this,rg).call(this),!0)}setSelected(t){(0,xt.A)($f,this).setSelected(t)}toggleSelected(t){(0,xt.A)($f,this).toggleSelected(t)}isSelected(t){return(0,xt.A)($f,this).isSelected(t)}unselect(t){(0,xt.A)($f,this).unselect(t)}pointerup(t){const{isMac:e}=ei.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&(0,xt.A)(Kf,this)&&((0,Et.A)(Kf,this,!1),(0,xt.A)(zf,this)?(0,xt.A)($f,this).getMode()!==Jt.STAMP?this.createAndAddNewEditor(t,!1):(0,xt.A)($f,this).unselectAll():(0,Et.A)(zf,this,!0))}pointerdown(t){if((0,xt.A)($f,this).getMode()===Jt.HIGHLIGHT&&this.enableTextSelection(),(0,xt.A)(Kf,this))return void(0,Et.A)(Kf,this,!1);const{isMac:e}=ei.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;(0,Et.A)(Kf,this,!0);const i=(0,xt.A)($f,this).getActive();(0,Et.A)(zf,this,!i||i.isEmpty())}findNewParent(t,e,i){const n=(0,xt.A)($f,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){var t;(null===(t=(0,xt.A)($f,this).getActive())||void 0===t?void 0:t.parent)===this&&((0,xt.A)($f,this).commitOrRemove(),(0,xt.A)($f,this).setActiveEditor(null)),(0,xt.A)(Xf,this)&&(clearTimeout((0,xt.A)(Xf,this)),(0,Et.A)(Xf,this,null));for(const i of(0,xt.A)(Yf,this).values()){var e;null===(e=(0,xt.A)(Hf,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,(0,xt.A)(Yf,this).clear(),(0,xt.A)($f,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,un(this.div,e);for(const i of(0,xt.A)($f,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;(0,xt.A)($f,this).commitOrRemove(),(0,bt.A)(tg,this,ag).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,un(this.div,{rotation:n}),i!==n)for(const s of(0,xt.A)(Yf,this).values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return(0,xt.A)($f,this).viewParameters.realScale}}function ig(t){if((0,xt.A)($f,this).unselectAll(),t.target===(0,xt.A)(Jf,this).div){const{isMac:e}=ei.platform;if(0!==t.button||t.ctrlKey&&e)return;(0,xt.A)($f,this).showAllEditors("highlight",!0,!0),(0,xt.A)(Jf,this).div.classList.add("free"),pp.startHighlighting(this,"ltr"===(0,xt.A)($f,this).direction,t),(0,xt.A)(Jf,this).div.addEventListener("pointerup",()=>{(0,xt.A)(Jf,this).div.classList.remove("free")},{once:!0,signal:(0,xt.A)($f,this)._signal}),t.preventDefault()}}function ng(t){return og._.get((0,xt.A)($f,t).getMode())}function sg(t){const e=wt(tg,this,ng);return e?new e.prototype.constructor(t):null}function rg(){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,c]=this.viewport.rotation%180===0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}function ag(){(0,Et.A)(Qf,this,!0);for(const t of(0,xt.A)(Yf,this).values())t.isEmpty()&&t.remove();(0,Et.A)(Qf,this,!1)}(0,yt.A)(eg,"_initialized",!1);var og={_:new Map([Sd,Gp,Rf,pp].map(t=>[t._editorType,t]))},lg=new WeakMap,cg=new WeakMap,hg=new WeakMap,dg=new WeakMap,ug=new WeakSet;class pg{constructor(t){let{pageIndex:e}=t;(0,vt.A)(this,ug),(0,_t.A)(this,lg,null),(0,_t.A)(this,cg,0),(0,_t.A)(this,hg,new Map),(0,_t.A)(this,dg,new Map),this.pageIndex=e}setParent(t){if((0,xt.A)(lg,this)){if((0,xt.A)(lg,this)!==t){if((0,xt.A)(hg,this).size>0)for(const e of(0,xt.A)(hg,this).values())e.remove(),t.append(e);(0,Et.A)(lg,this,t)}}else(0,Et.A)(lg,this,t)}static get _svgFactory(){return Ue(this,"_svgFactory",new Yi)}highlight(t,e,i){var n,s;let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=((0,Et.A)(cg,this,(n=(0,xt.A)(cg,this),s=n++,n)),s),o=(0,bt.A)(ug,this,gg).call(this,t.box);o.classList.add("highlight"),t.free&&o.classList.add("free");const l=pg._svgFactory.createElement("defs");o.append(l);const c=pg._svgFactory.createElement("path");l.append(c);const h="path_p".concat(this.pageIndex,"_").concat(a);c.setAttribute("id",h),c.setAttribute("d",t.toSVGPath()),r&&(0,xt.A)(dg,this).set(a,c);const d=(0,bt.A)(ug,this,Ag).call(this,l,h),u=pg._svgFactory.createElement("use");return o.append(u),o.setAttribute("fill",e),o.setAttribute("fill-opacity",i),u.setAttribute("href","#".concat(h)),(0,xt.A)(hg,this).set(a,o),{id:a,clipPathId:"url(#".concat(d,")")}}highlightOutline(t){var e,i;const n=((0,Et.A)(cg,this,(e=(0,xt.A)(cg,this),i=e++,e)),i),s=(0,bt.A)(ug,this,gg).call(this,t.box);s.classList.add("highlightOutline");const r=pg._svgFactory.createElement("defs");s.append(r);const a=pg._svgFactory.createElement("path");r.append(a);const o="path_p".concat(this.pageIndex,"_").concat(n);let l;if(a.setAttribute("id",o),a.setAttribute("d",t.toSVGPath()),a.setAttribute("vector-effect","non-scaling-stroke"),t.free){s.classList.add("free");const t=pg._svgFactory.createElement("mask");r.append(t),l="mask_p".concat(this.pageIndex,"_").concat(n),t.setAttribute("id",l),t.setAttribute("maskUnits","objectBoundingBox");const e=pg._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=pg._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(o)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const c=pg._svgFactory.createElement("use");s.append(c),c.setAttribute("href","#".concat(o)),l&&c.setAttribute("mask","url(#".concat(l,")"));const h=c.cloneNode();return s.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),(0,xt.A)(hg,this).set(n,s),n}finalizeLine(t,e){const i=(0,xt.A)(dg,this).get(t);(0,xt.A)(dg,this).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){(0,xt.A)(hg,this).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),(0,xt.A)(dg,this).delete(t)}updatePath(t,e){(0,xt.A)(dg,this).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){fg.call(pg,(0,xt.A)(hg,this).get(t),e)}show(t,e){(0,xt.A)(hg,this).get(t).classList.toggle("hidden",!e)}rotate(t,e){(0,xt.A)(hg,this).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){(0,xt.A)(hg,this).get(t).setAttribute("fill",e)}changeOpacity(t,e){(0,xt.A)(hg,this).get(t).setAttribute("fill-opacity",e)}addClass(t,e){(0,xt.A)(hg,this).get(t).classList.add(e)}removeClass(t,e){(0,xt.A)(hg,this).get(t).classList.remove(e)}remove(t){null!==(0,xt.A)(lg,this)&&((0,xt.A)(hg,this).get(t).remove(),(0,xt.A)(hg,this).delete(t))}destroy(){(0,Et.A)(lg,this,null);for(const t of(0,xt.A)(hg,this).values())t.remove();(0,xt.A)(hg,this).clear()}}function fg(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="".concat(100*i,"%"),r.left="".concat(100*e,"%"),r.width="".concat(100*n,"%"),r.height="".concat(100*s,"%")}function gg(t){const e=Nt._svgFactory.create(1,1,!0);return(0,xt.A)(lg,this).append(e),e.setAttribute("aria-hidden",!0),fg.call(Nt,e,t),e}function Ag(t,e){const i=Nt._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=Nt._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}Nt=pg;var mg=jt.AnnotationLayer,vg=jt.AnnotationMode,bg=jt.GlobalWorkerOptions,wg=jt.PDFDataRangeTransport,yg=jt.TextLayer,_g=jt.getDocument,xg=i(70579),Eg=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))},Cg=Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg(Eg([],["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 kg(t,e){var i={};return Cg.forEach(function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)}),i}function Sg(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}}}function Mg(t){var e,i,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(i=Mg(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}const Lg=function(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=Mg(t))&&(n&&(n+=" "),n+=e);return n};var Tg="Invariant failed";function Rg(t,e){if(!t)throw new Error(Tg)}var Pg=i(96440),Fg=Object.prototype.hasOwnProperty;function Ig(t,e,i){for(i of t.keys())if(Dg(i,e))return i}function Dg(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--&&Dg(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=Ig(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=Ig(e,s)))return!1;if(!Dg(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(Fg.call(t,i)&&++n&&!Fg.call(e,i))return!1;if(!(i in e)||!Dg(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}const Og=(0,s.createContext)(null);function Ng(t){let{children:e,type:i}=t;return(0,xg.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}class Wg{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 Rg(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(t){Rg(this.pdfViewer),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise(e=>{Rg(this.pdfDocument),Rg(t),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{Rg(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise(t=>{Rg(this.pdfDocument),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{Rg(!1,'"'.concat(e,'" is not a valid page reference.'))}):"number"===typeof e?t(e):Rg(!1,'"'.concat(e,'" is not a valid destination reference.'))}).then(e=>{const i=e+1;Rg(this.pdfViewer),Rg(i>=1&&i<=this.pagesCount,'"'.concat(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;Rg(this.pdfViewer),Rg(t>=1&&t<=this.pagesCount,'"'.concat(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 jg={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Bg="undefined"!==typeof window,Hg=Bg&&"file:"===window.location.protocol;function zg(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function Ug(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function Vg(t){Rg(Ug(t));const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function Gg(){return Bg&&window.devicePixelRatio||1}const qg="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function Xg(){Pg(!Hg,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(qg))}function Yg(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function Kg(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 Qg(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 Zg(){return(0,s.useReducer)(Qg,{value:void 0,error:void 0})}var Jg=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())})},$g=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:tA}=n,eA=(t,e)=>{switch(e){case jg.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case jg.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function iA(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const nA=(0,s.forwardRef)(function(t,e){var{children:i,className:n,error:r="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:l,inputRef:c,imageResourcesPath:h,loading:d="Loading PDF\u2026",noData:u="No PDF file specified.",onItemClick:p,onLoadError:f,onLoadProgress:g,onLoadSuccess:A,onPassword:m=eA,onSourceError:v,onSourceSuccess:b,options:w,renderMode:y,rotate:_}=t,x=$g(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[E,C]=Zg(),{value:k,error:S}=E,[M,L]=Zg(),{value:T,error:R}=M,P=(0,s.useRef)(new Wg),F=(0,s.useRef)([]),I=(0,s.useRef)(void 0),D=(0,s.useRef)(void 0);l&&l!==I.current&&iA(l)&&(Pg(!Dg(l,I.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.'),I.current=l),w&&w!==D.current&&(Pg(!Dg(w,D.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.'),D.current=w);const O=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(p)return void p({dest:e,pageIndex:n,pageNumber:i});const s=F.current[n];s?s.scrollIntoView():Pg(!1,"An internal link leading to page ".concat(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:P,pages:F,viewer:O}),[]),(0,s.useEffect)(function(){C({type:"RESET"})},[l,C]);const N=(0,s.useCallback)(()=>Jg(this,void 0,void 0,function*(){if(!l)return null;if("string"===typeof l){if(Ug(l)){return{data:Vg(l)}}return Xg(),{url:l}}if(l instanceof tA)return{range:l};if(l instanceof ArrayBuffer)return{data:l};if(Bg&&function(t){return Rg(Bg),t instanceof Blob}(l)){const t=yield function(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)})}(l);return{data:t}}if(Rg("object"===typeof l),Rg(iA(l)),"url"in l&&"string"===typeof l.url){if(Ug(l.url)){const{url:t}=l,e=$g(l,["url"]),i=Vg(t);return Object.assign({data:i},e)}Xg()}return l}),[l]);(0,s.useEffect)(()=>{const t=Sg(N());return t.promise.then(t=>{C({type:"RESOLVE",value:t})}).catch(t=>{C({type:"REJECT",error:t})}),()=>{Yg(t)}},[N,C]),(0,s.useEffect)(()=>{"undefined"!==typeof k&&(!1!==k?b&&b():S&&(Pg(!1,S.toString()),v&&v(S)))},[k]),(0,s.useEffect)(function(){L({type:"RESET"})},[L,k]),(0,s.useEffect)(function(){if(!k)return;const t=w?Object.assign(Object.assign({},k),w):k,e=_g(t);g&&(e.onProgress=g),m&&(e.onPassword=m);const i=e,n=i.promise.then(t=>{L({type:"RESOLVE",value:t})}).catch(t=>{i.destroyed||L({type:"REJECT",error:t})});return()=>{n.finally(()=>i.destroy())}},[w,L,k]),(0,s.useEffect)(()=>{"undefined"!==typeof T&&(!1!==T?T&&(A&&A(T),F.current=new Array(T.numPages),P.current.setDocument(T)):R&&(Pg(!1,R.toString()),f&&f(R)))},[T]),(0,s.useEffect)(function(){P.current.setViewer(O.current),P.current.setExternalLinkRel(a),P.current.setExternalLinkTarget(o)},[a,o]);const W=(0,s.useCallback)((t,e)=>{F.current[t]=e},[]),j=(0,s.useCallback)(t=>{delete F.current[t]},[]),B=(0,s.useMemo)(()=>({imageResourcesPath:h,linkService:P.current,onItemClick:p,pdf:T,registerPage:W,renderMode:y,rotate:_,unregisterPage:j}),[h,p,T,W,y,_,j]),H=(0,s.useMemo)(()=>kg(x,()=>T),[x,T]);return(0,xg.jsx)("div",Object.assign({className:Lg("react-pdf__Document",n),ref:c,style:{"--scale-factor":"1"}},H,{children:l?void 0===T||null===T?(0,xg.jsx)(Ng,{type:"loading",children:"function"===typeof d?d():d}):!1===T?(0,xg.jsx)(Ng,{type:"error",children:"function"===typeof r?r():r}):(0,xg.jsx)(Og.Provider,{value:B,children:i}):(0,xg.jsx)(Ng,{type:"no-data",children:"function"===typeof u?u():u})}))});function sA(){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)})}}const rA=(0,s.createContext)(null),aA={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},oA=/^H(\d+)$/;function lA(t){return"children"in t}function cA(t){return!!lA(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function hA(t){const e={};if(lA(t)){const{role:i}=t,n=i.match(oA);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in aA}(i)){const t=aA[i];t&&(e.role=t)}}return e}function dA(t){const e={};if(lA(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),cA(t)){const[i]=t.children;if(i){const t=dA(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function uA(t){return t?Object.assign(Object.assign({},hA(t)),dA(t)):null}function pA(t){let{className:e,node:i}=t;const n=(0,s.useMemo)(()=>uA(i),[i]),r=(0,s.useMemo)(()=>lA(i)?cA(i)?null:i.children.map((t,e)=>(0,xg.jsx)(pA,{node:t},e)):null,[i]);return(0,xg.jsx)("span",Object.assign({className:e},n,{children:r}))}function fA(){return(0,s.useContext)(rA)}function gA(){const t=fA();Rg(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,r]=Zg(),{value:a,error:o}=n,{customTextRenderer:l,page:c}=t;return(0,s.useEffect)(function(){r({type:"RESET"})},[r,c]),(0,s.useEffect)(function(){if(l)return;if(!c)return;const t=Sg(c.getStructTree()),e=t;return t.promise.then(t=>{r({type:"RESOLVE",value:t})}).catch(t=>{r({type:"REJECT",error:t})}),()=>Yg(e)},[l,c,r]),(0,s.useEffect)(()=>{void 0!==a&&(!1!==a?a&&i&&i(a):o&&(Pg(!1,o.toString()),e&&e(o)))},[a]),a?(0,xg.jsx)(pA,{className:"react-pdf__Page__structTree structTree",node:a}):null}const AA=vg;function mA(t){const e=fA();Rg(e);const i=Object.assign(Object.assign({},e),t),{_className:n,canvasBackground:r,devicePixelRatio:a=Gg(),onRenderError:o,onRenderSuccess:l,page:c,renderForms:h,renderTextLayer:d,rotate:u,scale:p}=i,{canvasRef:f}=t;Rg(c);const g=(0,s.useRef)(null);function A(t){(function(t){return"RenderingCancelledException"===t.name})(t)||(Pg(!1,t.toString()),o&&o(t))}const m=(0,s.useMemo)(()=>c.getViewport({scale:p*a,rotation:u}),[a,c,u,p]),v=(0,s.useMemo)(()=>c.getViewport({scale:p,rotation:u}),[c,u,p]);(0,s.useEffect)(function(){if(!c)return;c.cleanup();const{current:t}=g;if(!t)return;t.width=m.width,t.height=m.height,t.style.width="".concat(Math.floor(v.width),"px"),t.style.height="".concat(Math.floor(v.height),"px"),t.style.visibility="hidden";const e={annotationMode:h?AA.ENABLE_FORMS:AA.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:m};r&&(e.background=r);const i=c.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",c&&l&&l(Kg(c,p))}).catch(A),()=>Yg(n)},[r,c,h,m,v]);const b=(0,s.useCallback)(()=>{const{current:t}=g;t&&(t.width=0,t.height=0)},[]);return(0,s.useEffect)(()=>b,[b]),(0,xg.jsx)("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:sA(f,g),style:{display:"block",userSelect:"none"},children:d?(0,xg.jsx)(gA,{}):null})}function vA(){const t=fA();Rg(t);const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:r,onRenderTextLayerSuccess:a,page:o,pageIndex:l,pageNumber:c,rotate:h,scale:d}=t;Rg(o);const[u,p]=Zg(),{value:f,error:g}=u,A=(0,s.useRef)(null),m=(0,s.useRef)(void 0);Pg(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(){p({type:"RESET"})},[o,p]),(0,s.useEffect)(function(){if(!o)return;const t=Sg(o.getTextContent()),e=t;return t.promise.then(t=>{p({type:"RESOLVE",value:t})}).catch(t=>{p({type:"REJECT",error:t})}),()=>Yg(e)},[o,p]),(0,s.useEffect)(()=>{void 0!==f&&(!1!==f?f&&n&&n(f):g&&(Pg(!1,g.toString()),i&&i(g)))},[f]);const v=(0,s.useCallback)(()=>{a&&a()},[a]),b=(0,s.useCallback)(t=>{Pg(!1,t.toString()),r&&r(t)},[r]);const w=(0,s.useMemo)(()=>o.getViewport({scale:d,rotation:h}),[o,h,d]);return(0,s.useLayoutEffect)(function(){if(!o||!f)return;const{current:t}=A;if(!t)return;t.innerHTML="";const i=o.streamTextContent({includeMarkedContent:!0}),n=new yg({container:t,textContentSource:i,viewport:w}),s=n;return n.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),m.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;f.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:l,pageNumber:c,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1})}v()}).catch(b),()=>Yg(s)},[e,b,v,o,l,c,f,w]),(0,xg.jsx)("div",{className:Lg("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=m.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=m.current;t&&t.classList.add("active")},ref:A})}function bA(){return(0,s.useContext)(Og)}function wA(){const t=bA(),e=fA();Rg(e);const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:r,onGetAnnotationsError:a,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:l,onRenderAnnotationLayerSuccess:c,page:h,pdf:d,renderForms:u,rotate:p,scale:f=1}=i;Rg(d),Rg(h),Rg(r);const[g,A]=Zg(),{value:m,error:v}=g,b=(0,s.useRef)(null);Pg(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(){A({type:"RESET"})},[A,h]),(0,s.useEffect)(function(){if(!h)return;const t=Sg(h.getAnnotations()),e=t;return t.promise.then(t=>{A({type:"RESOLVE",value:t})}).catch(t=>{A({type:"REJECT",error:t})}),()=>{Yg(e)}},[A,h]),(0,s.useEffect)(()=>{void 0!==m&&(!1!==m?m&&o&&o(m):v&&(Pg(!1,v.toString()),a&&a(v)))},[m]);const w=(0,s.useMemo)(()=>h.getViewport({scale:f,rotation:p}),[h,p,f]);return(0,s.useEffect)(function(){if(!d||!h||!r||!m)return;const{current:t}=b;if(!t)return;const e=w.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:h,viewport:e},s={annotations:m,annotationStorage:d.annotationStorage,div:t,imageResourcesPath:n,linkService:r,page:h,renderForms:u,viewport:e};t.innerHTML="";try{new mg(i).render(s),c&&c()}catch(a){!function(t){Pg(!1,"".concat(t)),l&&l(t)}(a)}return()=>{}},[m,n,r,h,d,u,w]),(0,xg.jsx)("div",{className:Lg("react-pdf__Page__annotations","annotationLayer"),ref:b})}var yA=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 _A=1;function xA(t){const e=bA(),i=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackground:a,canvasRef:o,children:l,className:c,customRenderer:h,customTextRenderer:d,devicePixelRatio:u,error:p="Failed to load the page.",height:f,inputRef:g,loading:A="Loading page\u2026",noData:m="No page specified.",onGetAnnotationsError:v,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:y,onGetTextError:_,onGetTextSuccess:x,onLoadError:E,onLoadSuccess:C,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,pageIndex:P,pageNumber:F,pdf:I,registerPage:D,renderAnnotationLayer:O=!0,renderForms:N=!1,renderMode:W="canvas",renderTextLayer:j=!0,rotate:B,scale:H=_A,unregisterPage:z,width:U}=i,V=yA(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"]),[G,q]=Zg(),{value:X,error:Y}=G,K=(0,s.useRef)(null);Rg(I);const Q=zg(F)?F-1:null!==P&&void 0!==P?P:null,Z=null!==F&&void 0!==F?F:zg(P)?P+1:null,J=null!==B&&void 0!==B?B:X?X.rotate:null,$=(0,s.useMemo)(()=>{if(!X)return null;let t=1;const e=null!==H&&void 0!==H?H:_A;if(U||f){const e=X.getViewport({scale:1,rotation:J});U?t=U/e.width:f&&(t=f/e.height)}return e*t},[f,X,J,H,U]);(0,s.useEffect)(function(){return()=>{zg(Q)&&r&&z&&z(Q)}},[r,I,Q,z]),(0,s.useEffect)(function(){q({type:"RESET"})},[q,I,Q]),(0,s.useEffect)(function(){if(!I||!Z)return;const t=Sg(I.getPage(Z)),e=t;return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>Yg(e)},[q,I,Z]),(0,s.useEffect)(()=>{void 0!==X&&(!1!==X?function(){if(C){if(!X||!$)return;C(Kg(X,$))}if(r&&D){if(!zg(Q)||!K.current)return;D(Q,K.current)}}():Y&&(Pg(!1,Y.toString()),E&&E(Y)))},[X,$]);const tt=(0,s.useMemo)(()=>X&&zg(Q)&&Z&&zg(J)&&zg($)?{_className:n,canvasBackground:a,customTextRenderer:d,devicePixelRatio:u,onGetAnnotationsError:v,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:y,onGetTextError:_,onGetTextSuccess:x,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:S,onRenderError:M,onRenderSuccess:L,onRenderTextLayerError:T,onRenderTextLayerSuccess:R,page:X,pageIndex:Q,pageNumber:Z,renderForms:N,renderTextLayer:j,rotate:J,scale:$}:null,[n,a,d,u,v,b,w,y,_,x,k,S,M,L,T,R,X,Q,Z,N,j,J,$]),et=(0,s.useMemo)(()=>kg(V,()=>X?$?Kg(X,$):void 0:X),[V,X,$]),it="".concat(Q,"@").concat($,"/").concat(J);function nt(){switch(W){case"custom":return Rg(h),(0,xg.jsx)(h,{},"".concat(it,"_custom"));case"none":return null;default:return(0,xg.jsx)(mA,{canvasRef:o},"".concat(it,"_canvas"))}}return(0,xg.jsx)("div",Object.assign({className:Lg(n,c),"data-page-number":Z,ref:sA(g,K),style:{"--scale-factor":"".concat($),backgroundColor:a||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},et,{children:Z?null===I||void 0===X||null===X?(0,xg.jsx)(Ng,{type:"loading",children:"function"===typeof A?A():A}):!1===I||!1===X?(0,xg.jsx)(Ng,{type:"error",children:"function"===typeof p?p():p}):(0,xg.jsxs)(rA.Provider,{value:tt,children:[nt(),j?(0,xg.jsx)(vA,{},"".concat(it,"_text")):null,O?(0,xg.jsx)(wA,{},"".concat(it,"_annotations")):null,l]}):(0,xg.jsx)(Ng,{type:"no-data",children:"function"===typeof m?m():m})}))}var EA,CA=i(19155),kA=i(93141),SA=i(10986),MA=i.n(SA);const LA=["title","titleId"];function TA(){return TA=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},TA.apply(null,arguments)}function RA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,LA);return s.createElement("svg",TA({t:1731465967110,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1541,xmlnsXlink:"http://www.w3.org/1999/xlink",width:200,height:200,ref:e,"aria-labelledby":n},r),i?s.createElement("title",{id:n},i):null,EA||(EA=s.createElement("path",{d:"M112 166h-7q-21 3-35 18.5T56 222v562q3 20 18.5 34.5T112 833h388l56-167-119-179-103 123-72-71-5-5q-17-13-38-11.5T183 539l-71 71V222h259l18-56H112z m388 0l-18 56h407v379L654 327l-4-5q-18-16-41.5-14.5T570 328l-72 85 169 253-55 167h277l7-1q21-2 35-18t14-37V215q-3-21-18.5-35T889 166H500zM306 277q-34 0-58.5 24.5t-24.5 59q0 34.5 24.5 59T306 444q23 0 42.5-12t30.5-31l-45-68 14-44q-19-12-42-12z",fill:"#E0E0E0","p-id":1542})))}const PA=s.forwardRef(RA);i.p;var FA,IA;const DA=["title","titleId"];function OA(){return OA=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},OA.apply(null,arguments)}function NA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,DA);return s.createElement("svg",OA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u7f16\u7ec4 10"):i?s.createElement("title",{id:n},i):null,FA||(FA=s.createElement("defs",null,s.createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1"},s.createElement("stop",{stopColor:"#F5F5F5",offset:"0%"}),s.createElement("stop",{stopColor:"#E0E0E0",offset:"100%"})))),IA||(IA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807Icon",transform:"translate(-760.000000, -2364.000000)"},s.createElement("g",{id:"\\u7F16\\u7EC4-10",transform:"translate(760.000000, 2364.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u65E0\\u6027\\u522B",fill:"url(#linearGradient-1)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",x:0,y:0,width:56,height:56})),s.createElement("g",{id:"\\u5934\\u50CF_avatar-(1)\\u5907\\u4EFD",transform:"translate(8.000000, 12.000000)",fill:"#FFFFFF",fillRule:"nonzero"},s.createElement("path",{d:"M40,41.3851428 C40,40.9828571 40,35.6022857 39,33.792 C38.4,32.5851428 37.4,31.7805714 36.2,30.976 C34.8,30.1714285 33,29.3668572 30.8,28.9645714 C30.6,28.9645714 29.2,28.7634285 28,28.3611428 C26.6,27.9588571 26,27.7577143 25.8,27.5565714 L25.8,26.3497143 C26,23.7348571 27.4,22.3268572 28.6,21.12 C29,20.7177143 29.4,20.3154285 29.8,19.712 C31.2,17.7005714 31.4,15.6891429 31.4,15.2868571 C31.4,14.8845714 31.4,14.6834286 31.2,14.2811429 C31,13.8788572 30.8,13.4765714 30.6,13.2754286 C30.6,12.672 30.8,12.0685714 30.8,11.6662857 C30.8,10.6605715 31,9.05142856 30.6,7.44228572 C30.6,7.24114285 30.6,6.83885715 30.4,6.43657145 C30,5.22971431 29.6,4.22400004 28.8,3.4194286 C28.4,3.4194286 25.6,0.603428618 18,0 L15,0 C14.6,0 14.2,0 13.8,0.201142873 C12.4,0.603428571 12.2,1.60914289 12,2.01142859 L12,3.21828573 L11.8,3.4194286 C11.6,3.62057147 9.60000004,5.43085719 9.40000002,7.84457142 C9.20000001,9.45371426 9.20000001,11.8674285 9.40000002,13.6777143 C9.20000001,14.08 8.80000002,14.4822858 8.80000002,15.488 C8.80000002,15.8902857 9,17.9017143 10.4,19.712 C10.8,20.1142857 11,20.5165715 11.6,21.12 C12.8,22.528 14.2,23.936 14.4,26.3497143 L14.4,27.5565714 C14,27.7577143 13.4,28.16 12,28.5622857 C10.6,28.9645714 9.20000001,29.1657143 9,29.1657143 C7,29.568 5.19999998,30.1714285 3.80000001,30.976 C2.60000001,31.7805714 1.60000003,32.7862857 1,33.792 C0,35.6022857 0,40.9828571 0,41.3851428 L0,42.3908571 C0,43.1954286 0.800000015,44 1.8,44 L38.2,44 C39.2,44 40,43.1954286 40,42.1897143 L40,41.3851428 Z",id:"\\u8DEF\\u5F84"})))))))}const WA=s.forwardRef(NA);i.p;var jA;const BA=["title","titleId"];function HA(){return HA=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},HA.apply(null,arguments)}function zA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,BA);return s.createElement("svg",HA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u5973"):i?s.createElement("title",{id:n},i):null,jA||(jA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -230.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u5973",transform:"translate(792.000000, 230.000000)"},s.createElement("rect",{id:"Mask\\u5907\\u4EFD",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"\\u5973",transform:"translate(9.000000, 13.000000)",fillRule:"nonzero"},s.createElement("path",{d:"M19.1219936,0 C26.9032378,0 28.9014356,5.58612362 28.7427755,11.9244473 C28.5841154,18.262771 25.3419303,30.1526079 25.3419303,30.1526079 L19.1334908,30.1526079 L19.1219936,0 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"}),s.createElement("path",{d:"M18.5011497,0 C10.7291032,0 8.7217078,5.58612362 8.88726615,11.9244473 C9.05282451,18.262771 12.2881114,30.1526079 12.2881114,30.1526079 L18.4965509,30.1526079 L18.5011497,0 Z",id:"\\u8DEF\\u5F84",fill:"#420E04"}),s.createElement("path",{d:"M14.2564166,26.7815518 C11.9891865,29.1996673 7.8778199,30.5010196 3.9780001,31.1309294 C0.0781803048,31.7608392 0,35.9948487 0,37.2177506 L0,43 L18.5011497,43 L18.5011497,26.7815518 L14.2564166,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#EAE9E8"}),s.createElement("path",{d:"M18.5011497,21.5807577 L14.1736374,21.5807577 L14.1736374,27.196877 C14.1736374,28.0298347 15.5532906,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#EAC1A4"}),s.createElement("path",{d:"M18.5011497,3.92251556 C12.1202536,3.92251556 11.1751911,8.53723974 11.1751911,14.2502683 C11.1751911,20.0948165 16.693804,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("path",{d:"M11.0372258,13.419618 C10.5888385,11.7352436 9.97489279,11.7352436 9.71505809,12.1621056 C9.45522339,12.5889676 10.351998,14.2387315 10.3749922,15.6000751 C10.3979864,16.9614187 10.7980859,17.1552372 11.294761,16.663769 C11.7914362,16.1723009 11.0372258,13.419618 11.0372258,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"14.247219 27.1368856 11.4603194 28.8327967 15.6199739 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#F4F2F2",points:"14.247219 26.7815518 11.4603194 28.8327967 15.6199739 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M22.7642782,26.7815518 C25.0338077,29.1996673 29.1451744,30.5010196 33.0426947,31.1309294 C36.940215,31.7608392 37,35.9948487 37,37.2177506 L37,43 L18.5011497,43 L18.5011497,26.7815518 L22.7642782,26.7815518 Z",id:"\\u8DEF\\u5F84",fill:"#DDDCDB"}),s.createElement("path",{d:"M18.5011497,21.5807577 L22.8263626,21.5807577 L22.8263626,27.196877 C22.8263626,28.0298347 21.4467094,30.6740717 18.5011497,30.6740717 L18.5011497,21.5807577 Z",id:"\\u8DEF\\u5F84",fill:"#DDB597"}),s.createElement("path",{d:"M18.5011497,3.92251556 C24.8797464,3.92251556 25.8248089,8.53723974 25.8248089,14.2502683 C25.8248089,20.0948165 20.306196,24.5872505 18.5011497,24.5872505 L18.5011497,3.92251556 Z",id:"\\u8DEF\\u5F84",fill:"#EDC19C"}),s.createElement("path",{d:"M25.9673731,13.419618 C26.4272575,11.7352436 27.0320055,11.7352436 27.2918402,12.1621056 C27.5516748,12.5889676 26.6526008,14.2387315 26.6296066,15.6000751 C26.6066124,16.9614187 26.206513,17.1552372 25.7098378,16.663769 C25.2131626,16.1723009 25.967373,13.4196179 25.9673731,13.419618 Z",id:"\\u8DEF\\u5F84",fill:"#EBCFB7"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#DDDCDB",points:"22.752781 27.1368856 25.5396806 28.8327967 21.3800261 36.09868 18.5011497 30.6740717"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#EFEEED",points:"22.752781 26.7815518 25.5396806 28.8327967 21.3800261 35.7433462 18.5011497 30.6740717"}),s.createElement("path",{d:"M9.10801068,29.8549582 C7.43626653,30.4331409 5.71634854,30.860165 3.96880244,31.1309294 C0.0712820906,31.7608392 0,35.9948487 0,37.2177506 L0,43 L16.3373936,43 L9.10801068,29.848036 L9.10801068,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"9.10801068 29.8549582 7.32595862 30.4110324 7.10061524 34.8896222 10.4393761 36.7216678 10.4393761 42.9976927 16.3373936 42.9976927 9.10801068 29.8549582"}),s.createElement("path",{d:"M27.8942887,29.8549582 C29.5652485,30.433138 31.2844029,30.8601635 33.0311976,31.1309294 C36.940215,31.7608392 37,35.9902339 37,37.2177506 L37,43 L20.6741036,43 L27.9034864,29.848036 L27.8942887,29.8549582 Z",id:"\\u8DEF\\u5F84",fill:"#1D1D1D"}),s.createElement("polygon",{id:"\\u8DEF\\u5F84",fill:"#303030",points:"27.8942887 29.8549582 29.6763408 30.4110324 29.8993848 34.8896222 26.5629234 36.7216678 26.5629234 42.9976927 20.6626064 42.9976927"}),s.createElement("path",{d:"M10.8072836,5.07619661 C9.67366851,9.80398152 11.1062085,14.2871861 11.267168,14.7163554 C11.267168,14.7163554 12.1248524,14.8524898 13.3366478,12.6581885 C14.9140514,9.79936683 16.8041763,8.32265508 18.4459636,7.55661088 L18.4459636,0 C14.334597,0 11.6005842,1.79974245 10.8072836,5.07619661 Z",id:"\\u8DEF\\u5F84",fill:"#471207"}),s.createElement("path",{d:"M25.6224598,14.7140481 C25.7742216,14.2871861 27.2067616,9.80398157 26.0823442,5.07388927 C25.2936424,1.80204979 22.5573302,0 18.4459636,0 L18.4459636,7.55661088 C19.5462153,7.03397245 20.7468113,6.75837793 21.9640793,6.74903414 C24.4014667,8.41494958 25.6155615,11.7513952 25.6224598,14.7140481 Z",id:"\\u8DEF\\u5F84",fill:"#370B00"})))))))}const UA=s.forwardRef(zA);i.p;var VA;const GA=["title","titleId"];function qA(){return qA=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},qA.apply(null,arguments)}function XA(t,e){let{title:i,titleId:n}=t,r=function(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}(t,GA);return s.createElement("svg",qA({width:"56px",height:"56px",viewBox:"0 0 56 56",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:e,"aria-labelledby":n},r),void 0===i?s.createElement("title",{id:n},"\u5934\u50cf-\u7537"):i?s.createElement("title",{id:n},i):null,VA||(VA=s.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-792.000000, -166.000000)"},s.createElement("g",{id:"\\u5934\\u50CF-\\u7537",transform:"translate(792.000000, 166.000000)"},s.createElement("rect",{id:"Mask",fill:"#F1F1F1",x:0,y:0,width:56,height:56}),s.createElement("g",{id:"Group-46",transform:"translate(7.671233, 12.041096)"},s.createElement("path",{d:"M20.3287113,17.7016171 L14.8261307,17.7016171 L14.8261307,21.8854179 L14.8261307,24.6737429 C14.8261307,25.7091313 16.5713146,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-2",fill:"#DDB597"}),s.createElement("path",{d:"M18.1163052,33.9077874 C18.1163052,33.9077874 16.9107652,32.9969521 15.601989,31.3099039 C14.2932128,29.6230745 12.4333964,25.9116559 12.4333964,25.9116559 C11.796773,26.003812 11.1961258,26.0999083 10.6276562,26.2001637 L19.059062,43.7260274 L20.3287336,43.7260274 L20.3287336,29.2137349 L18.1163052,33.9077874 Z",id:"Fill-4",fill:"#EFEEED"}),s.createElement("path",{d:"M12.4334858,31.7147341 L8.64391162,30.0953254 L10.2679829,26.2654829 C4.85701892,27.2599373 2.57978853,28.6396525 1.7219446,30.5000682 C0.757736068,32.592078 0,43.7258961 0,43.7258961 L18.0757257,43.7258961 L10.3430638,38.5075824 L12.4334858,31.7147341 Z",id:"Fill-6",fill:"#1D1D1D"}),s.createElement("path",{d:"M20.3287113,17.7016171 L25.8312918,17.7016171 L25.8312918,21.8854179 L25.8312918,24.6737429 C25.8312918,25.7091313 24.0861079,28.9930418 20.3287113,28.9930418 L20.3287113,17.7016171 Z",id:"Fill-8",fill:"#D1AC93"}),s.createElement("path",{d:"M22.5412291,33.9077874 C22.5412291,33.9077874 23.7467691,32.9969521 25.0553218,31.3099039 C26.364098,29.6230745 28.2241379,25.9116559 28.2241379,25.9116559 C28.8607613,26.003812 29.4614085,26.0999083 30.0296546,26.2001637 L21.5984722,43.7260274 L20.3288006,43.7260274 L20.3288006,29.2137349 L22.5412291,33.9077874 Z",id:"Fill-10",fill:"#DDDCDB"}),s.createElement("path",{d:"M28.2240485,31.7147341 L32.0133992,30.0953254 L30.3895513,26.2654829 C35.8005153,27.2599373 38.0777457,28.6396525 38.9353662,30.5000682 C39.8997982,32.592078 40.6575342,43.7258961 40.6575342,43.7258961 L22.5815851,43.7258961 L30.314247,38.5075824 L28.2240485,31.7147341 Z",id:"Fill-12",fill:"#0F0F0F"}),s.createElement("path",{d:"M20.3287113,3.71115593 C14.1291744,3.71115593 13.2107742,8.10203448 13.2107742,13.5180132 C13.2107742,19.5112264 15.9664218,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-14",fill:"#EBCFB7"}),s.createElement("path",{d:"M20.3287113,3.71115593 C26.5282481,3.71115593 27.4466484,8.10203448 27.4466484,13.5180132 C27.4466484,19.5112264 24.6910007,23.3250894 20.3287113,23.3250894 L20.3287113,3.71115593 Z",id:"Fill-16",fill:"#EFC7A6"}),s.createElement("path",{d:"M13.0715617,12.7308772 C12.6353774,11.1337961 12.0383055,11.1337961 11.7858013,11.5387578 C11.5330737,11.9435005 12.4056656,13.5180351 12.4286815,14.8001217 C12.4516974,16.0824272 12.8398388,16.2752765 13.3231721,15.80771 C13.8062819,15.3399246 13.0715617,12.7308772 13.0715617,12.7308772",id:"Fill-18",fill:"#EBCFB7"}),s.createElement("path",{d:"M27.5859726,12.7308772 C28.0221568,11.1337961 28.6192287,11.1337961 28.8717329,11.5387578 C29.1242371,11.9435005 28.2516452,13.5180351 28.2288528,14.8001217 C28.2058369,16.0824272 27.817472,16.2752765 27.3343622,15.80771 C26.8510289,15.3399246 27.5859726,12.7308772 27.5859726,12.7308772",id:"Fill-20",fill:"#EBCFB7"}),s.createElement("path",{d:"M12.3795884,25.9199302 C11.7632994,26.0094596 11.1796348,26.1029291 10.6277008,26.2001199 C10.5054709,26.2217908 10.3870398,26.2436806 10.2679382,26.2655705 L8.64386693,30.0951941 L12.4334411,31.7148217 L10.3430191,38.50767 L18.075681,43.7259836 L19.0591067,43.7259836 L12.3795884,25.9199302 Z",id:"Fill-22",fill:"#3A3939"}),s.createElement("path",{d:"M32.0133992,30.0952379 L30.3895513,26.2656142 C30.2834102,26.2459134 30.1768221,26.2264315 30.0686699,26.2071684 L30.0686699,26.2069495 C30.0628601,26.205855 30.0566033,26.2051983 30.0510169,26.2041039 C30.0438664,26.2027905 29.1706041,26.0423381 28.2939899,25.9223819 L21.6763687,43.5636049 L21.6765921,43.5633861 L21.5986063,43.7260274 L22.5815851,43.7260274 L30.314247,38.5077137 L28.2240485,31.7146466 L32.0133992,30.0952379 Z",id:"Fill-24",fill:"#2D2D2D"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C16.3335585,0 13.6766779,1.70762469 12.9146962,4.81335203 C11.8139567,9.29901349 13.0521211,13.3967874 13.2000483,13.8032813 C13.8612518,13.932869 14.0167765,11.6642083 14.0167765,9.24144327 C14.0167765,3.89113401 16.7697427,6.64640537 20.3287113,6.64640537",id:"Fill-26",fill:"#370B00"}),s.createElement("path",{d:"M20.3287113,6.64640537 L20.3287113,0 C24.3238641,0 26.9807446,1.70762469 27.7427263,4.81335203 C28.8434659,9.29901349 27.605078,13.3967874 27.4573742,13.8032813 C26.7961707,13.932869 26.640646,11.6642083 26.640646,9.24144327 C26.640646,3.89113401 23.8876798,6.64640537 20.3287113,6.64640537",id:"Fill-28",fill:"#230600"}),s.createElement("polygon",{id:"Fill-30",fill:"#2A798C",points:"20.3287113 33.2162443 18.6501169 33.2162443 19.425506 43.7259836 20.3287113 43.7259836"}),s.createElement("polygon",{id:"Fill-32",fill:"#266C77",points:"21.23214 43.7259179 22.0073056 33.2161786 20.3287113 33.2161786 20.3287113 43.7259179"}),s.createElement("polygon",{id:"Fill-34",fill:"#3691AD",points:"18.2760532 31.4385503 19.1256293 33.2162224 20.3287113 33.2162224 20.3287113 28.9930199"}),s.createElement("polygon",{id:"Fill-36",fill:"#266C77",points:"22.3812799 31.4385503 20.3286219 28.9930199 20.3286219 33.2162224 21.5317039 33.2162224"}),s.createElement("path",{d:"M23.9005061,25.9844833 L25.8313812,24.1571213 C26.8119019,24.7194707 28.2241379,25.9115902 28.2241379,25.9115902 C28.2241379,25.9115902 26.4673343,29.8497873 25.1587815,31.6071019 C23.8497818,33.3639787 22.4846949,34.4026505 22.4846949,34.4026505 L20.3288006,29.2136692 L20.4320369,29.1004989 L23.9005061,25.9844833 Z",id:"Fill-38",fill:"#CCCCCC"}),s.createElement("path",{d:"M23.7972922,25.9115902 L25.8314035,24.1571213 C26.8119243,24.6969242 28.2241602,25.9115902 28.2241602,25.9115902 C28.2241602,25.9115902 26.3641204,29.6230088 25.0553442,31.3098382 C23.7465679,32.9968864 22.5412514,33.9077218 22.5412514,33.9077218 L20.328823,29.2136692 L20.328823,28.9034905 L23.7972922,25.9115902 Z",id:"Fill-40",fill:"#F4F2F2"}),s.createElement("path",{d:"M16.7568047,25.9844833 L14.826153,24.1571213 C13.8456323,24.7194707 12.4333964,25.9115902 12.4333964,25.9115902 C12.4333964,25.9115902 14.1899765,29.8497873 15.4987527,31.6071019 C16.807529,33.3639787 18.1726158,34.4026505 18.1726158,34.4026505 L20.3287336,29.2136692 L20.2252739,29.1004989 L16.7568047,25.9844833 Z",id:"Fill-42",fill:"#CCCCCC"}),s.createElement("path",{d:"M16.8601303,25.9115902 L14.826019,24.1571213 C13.8454982,24.6969242 12.4334858,25.9115902 12.4334858,25.9115902 C12.4334858,25.9115902 14.2933021,29.6230088 15.6020784,31.3098382 C16.9108546,32.9968864 18.1163946,33.9077218 18.1163946,33.9077218 L20.3285995,29.2136692 L20.3285995,28.9034905 L16.8601303,25.9115902 Z",id:"Fill-44",fill:"#FFFFFF"})))))))}const YA=s.forwardRef(XA);i.p;var KA=i(75087),QA=i.n(KA),ZA=i(38885),JA=(i(9056),i(74065)),$A=i.n(JA),tm=i(57469),em=i.n(tm),im=i(1582),nm=i.n(im),sm=i(80111),rm=i.n(sm);function am(){return am=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},am.apply(null,arguments)}function om(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const lm=["id","url","error","apis","loading","ttl","cacheName"],cm=["paramsType","paramsName"],hm=["data"],dm=t=>e=>{var i;const n=Object.assign({},{loading:null,ttl:6e6,cacheName:"file-cache"},e),{id:s,error:o,apis:c,loading:d,ttl:u,cacheName:p}=n,f=om(n,lm),{apis:g}=(0,a.usePreset)(),A=h()({},g,c);if(!s)return null;if(null==A||null==(i=A.file)||!i.getUrl)return console.warn("\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570"),null;const m=Object.assign({paramsType:"params",paramsName:"id"},A.file.getUrl),{paramsType:v,paramsName:b}=m,w=om(m,cm),y={},_=s.split("?")[0];return y[v]={[b]:_},r().createElement(l(),am({},Object.assign({},w,y),{updateType:"refresh",error:o,loading:d,cache:p,ttl:u,render:e=>{let{data:i}=e,n=om(e,hm);return r().createElement(t,am({},f,{id:_,data:i,fetchApi:n}))}}))},um=["data","children"],pm=dm(t=>{let{data:e,children:i}=t;return i(am({url:e},om(t,um)))}),fm=(t,e)=>{const i=document.createElement("a"),n=new MouseEvent("click");i.download=e,i.href=t,i.dispatchEvent(n)},gm=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",i=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error((null==i?void 0:i.notFoundFile)||"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f");if("string"===typeof t&&/blob:http(s)?:/.test(t))return void fm(t,e);if("[object Blob]"===Object.prototype.toString.call(t)){const i=new Blob([t],{type:t.type});return void fm(URL.createObjectURL(i),e)}const n=(0,o.getAjax)(),{data:s,headers:r}=await n({url:t,responseType:"blob"}),a=null==r?void 0:r["content-disposition"];if(a){const t=a.match(/filename\*?=(?:UTF-8'')?([^;]+)/i);if(t&&t[1])e=decodeURIComponent(t[1].replace(/['"]/g,""));else{const t=a.match(/filename="?([^"]+)"?/i);t&&(e=t[1])}}fm(URL.createObjectURL(new Blob([s],{type:null==s?void 0:s.type})),e)},Am=t=>{let{url:e,staticUrl:i}=t;return/^(blob:)?https?:\/\//.test(e)?e:i+e},mm=t=>{let{url:e,staticUrl:i}=t;var n;const{apis:s}=(0,a.usePreset)(),r=i||(null==(n=s.file)?void 0:n.staticUrl)||"";return Am({staticUrl:r,url:e})},vm=["paramsType","paramsName"],bm=["isLoading","data","error","refresh"],wm=t=>{let{id:e,src:i,filename:n,staticUrl:r,apis:l,onError:c,onSuccess:h}=t;var u,p;const{message:f}=d.App.useApp(),{apis:g}=(0,a.usePreset)(),A=Object.assign({},g,l),m=r||(null==(u=A.file)?void 0:u.staticUrl)||"",[v,b]=(0,s.useState)(!1),w=Object.assign({paramsType:"params",paramsName:"id"},null==(p=A.file)?void 0:p.getUrl),{paramsType:y,paramsName:_}=w,x=om(w,vm),E={};E[y]={[_]:e};const C=(0,o.useFetch)(Object.assign({},x,E,{auto:!1})),{isLoading:S,data:M,error:L,refresh:T}=C,R=om(C,bm),P=k()(c||f.error),F=k()(h),I=k()(t=>gm(Am({staticUrl:m,url:t}),n).then(F).catch(t=>{P(t.message)}));return(0,s.useEffect)(()=>{S||(L?P(L):M&&(b(!0),I(M).then(()=>{b(!1)})))},[S,L,M,P]),am({},R,{isLoading:S||v,download:()=>i?I(i):T(e?E:{})})},ym={unnamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",fileUpload:"\u4e0a\u4f20\u6587\u4ef6",uploadTips:"\u652f\u6301\u6269\u5c55\u540d{accept}\uff0c\u5355\u4e2a\u6587\u4ef6\u5927\u5c0f\u4e0d\u8d85\u8fc7{fileSize}M\uff0c\u6700\u591a\u4e0a\u4f20{maxLength}\u4e2a\u9644\u4ef6",maxLengthError:"\u4e0a\u4f20\u6587\u4ef6\u4e0d\u80fd\u8d85\u8fc7\u6700\u5927\u5141\u8bb8\u6570\u91cf{maxLength}",fileSizeError:"\u6587\u4ef6{filename}\u4e0d\u80fd\u8d85\u8fc7{fileSize}MB!",uploadError:"\u6587\u4ef6{filename}\u4e0a\u4f20\u9519\u8bef{error}",uploadAnomaly:"\u6587\u4ef6{filename}\u4e0a\u4f20\u5f02\u5e38{error}",fileLoadedError:"\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25",fileNotFoundError:"\u672a\u6307\u5b9a\u6587\u4ef6",pageNotFoundError:"\u672a\u6307\u5b9a\u9875\u9762",unSupportFileType:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b",unSupportFileTypeDescription:"\u7cfb\u7edf\u4e0d\u652f\u6301\u8be5\u6587\u4ef6\u7c7b\u578b\u9884\u89c8\uff0c\u8bf7\u4e0b\u8f7d\u5230\u672c\u5730\u540e\u8fdb\u884c\u9884\u89c8",uploading:"\u6b63\u5728\u4e0a\u4f20",unNamedDownloadFile:"\u672a\u547d\u540d\u4e0b\u8f7d\u6587\u4ef6",notFoundFile:"\u672a\u83b7\u53d6\u5230\u4e0b\u8f7d\u7684\u6587\u4ef6\u4fe1\u606f",downloadSuccess:"\u4e0b\u8f7d\u6210\u529f",pleaseSetApi:"\u8bf7\u5728Global\u7ec4\u4ef6\u8bbe\u7f6epreset.apis.file.getUrl\u53c2\u6570",filePreview:"\u6587\u4ef6\u9884\u89c8"},_m=["id","src","filename","api","onSuccess","onError","onClick"],xm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=Object.assign({},{filename:e({id:"unnamedDownloadFile"})},t),{id:n,src:s,filename:a,api:o,onSuccess:l,onError:c,onClick:h}=i,p=om(i,_m),{isLoading:f,download:g}=wm({id:n,src:s,filename:a,api:o,onError:c,onSuccess:l});return r().createElement(d.Button,am({icon:r().createElement(u.A,null)},M()(p,["locale"]),{loading:f,onClick:function(){h&&h(...arguments),g()}}))});xm.useDownload=wm,xm.download=fm,xm.downloadBlobFile=gm;var Em="_Cmp6z",Cm="_lmC4r",km="_-jyU7",Sm="_lN9hC",Mm="_yaqrz",Lm="_SXsiw",Tm="_15U-a",Rm="_tpRpL";const Pm=["className","url","maxWidth","ignoreContent"],Fm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{data:e,apis:i,contentWindowUrl:n}=t;var o;const l=(0,s.useRef)(null),{apis:c}=(0,a.usePreset)(),{formatMessage:h}=(0,L.useIntl)(),d=Object.assign({},c,i),u=n||(null==(o=d.file)?void 0:o.contentWindowUrl)||"https://cdn.jsdelivr.net/npm/@kne/iframe-resizer@0.1.3/dist/contentWindow.js";return(0,s.useEffect)(()=>{const t=(new DOMParser).parseFromString(e,"text/html");t.querySelectorAll("script").forEach(t=>{t.parentElement.removeChild(t)});const i=document.createElement("script");i.src=u,t.head.appendChild(i);const n=document.createElement("style");n.innerText="html,body{height:auto!important;}body{pointer-events: none;background: #FFFFFF;}",t.head.appendChild(n),l.current.srcdoc=t.documentElement.outerHTML},[e]),(0,s.useEffect)(()=>{ut({checkOrigin:!1},l.current)},[]),r().createElement("iframe",{title:h({id:"filePreview"}),frameBorder:"0",width:"100%",ref:l})}),Im=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=Object.assign({},t),{className:n,url:s,maxWidth:a,ignoreContent:o}=i,c=om(i,Pm),h=r().createElement("iframe",{title:e({id:"filePreview"}),src:s,width:"100%",className:Rm});return r().createElement("div",{className:ft()(n,Em),style:{maxWidth:a}},o?h:r().createElement(l(),{url:s,transformResponse:t=>{let{data:e}=t;return{data:{code:200,results:e}}},showError:!1,error:h,render:t=>{let{data:e}=t;return r().createElement(Fm,am({},c,{url:s,data:e}))}}))}),Dm=["url","filename","type"],Om=t=>{var e;let{url:i,filename:n,type:s}=t,o=om(t,Dm);const{apis:l}=(0,a.usePreset)(),c=Object.assign({},l,o.apis),h=mm({staticUrl:o.staticUrl||(null==(e=c.file)?void 0:e.staticUrl),url:i}),d=s&&Km[s]||Qm(n||h);return r().createElement(d,am({},o,{url:h}))},Nm=["url","apis","className"],Wm=t=>{var e;let{url:i,apis:n,className:s}=t,o=om(t,Nm);const{apis:c}=(0,a.usePreset)(),h=Object.assign({},c,n);return r().createElement(l(),am({},(null==(e=h.file)?void 0:e.previewOffice)||{loader:async()=>({data:[{url:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(encodeURIComponent(i)),type:"html"}]})},{render:t=>{let{data:e}=t;const{data:i}=e;return i.map(t=>{let{url:e,type:i}=t;return r().createElement(Om,am({},o,{type:i,ignoreContent:!0,url:e,className:s,key:e}))})}}))},jm=(0,s.memo)((0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{var e;const{formatMessage:i}=(0,L.useIntl)(),{url:n,apis:o,maxWidth:l,scale:c,rotate:h,className:u,pdfjsUrl:p}=Object.assign({},{autoSize:!0,renderTextLayer:!1,scale:100,rotate:0,maxWidth:1200},t),[f,g]=(0,s.useState)(0),{apis:A}=(0,a.usePreset)(),m=Object.assign({},A,o),v=p||(null==(e=m.file)?void 0:e.pdfjsUrl)||"https://cdn.jsdelivr.net/npm/pdfjs-dist@4.4.168";bg.workerSrc=v+"/build/pdf.worker.min.mjs";const b=(0,s.useMemo)(()=>({file:n,options:{standardFontDataUrl:v+"/standard_fonts/",cMapUrl:v+"/cmaps/",cMapPacked:!0}}),[v,n]),[w,y]=(0,s.useState)(l),_=(0,CA.A)(()=>{_.current&&_.current.clientWidth&&y(Math.min(_.current.clientWidth,l))});return r().createElement("div",{ref:_,className:ft()(u,Em),style:{maxWidth:l}},r().createElement(nA,am({},b,{error:i({id:"fileLoadedError"}),loading:r().createElement("div",{className:Cm},r().createElement(d.Spin,null)),noData:i({id:"fileNotFoundError"}),onLoadSuccess:t=>{let{numPages:e}=t;g(e)}}),r().createElement(d.Flex,{vertical:!0,gap:8},f>=1&&Array.from(new Array(f),(t,e)=>r().createElement(xA,{key:"page_".concat(e),className:"preview-item",scale:c/100,rotate:h,pageNumber:e+1,width:w,loading:null,renderAnnotationLayer:!1,renderTextLayer:!0,noData:i({id:"pageNotFoundError"})})))))})),Bm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{url:e,className:i,maxWidth:n}=t;const{formatMessage:a}=(0,L.useIntl)(),[l,c]=(0,s.useState)(""),[h,u]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(0,o.getAjax)()({url:e,method:"GET"}).then(t=>{let{data:e}=t;c(e),u(!1)},()=>{u(!1),f(!0)})},[e]),r().createElement("div",{className:ft()(i,Em),style:{maxWidth:n}},h?r().createElement("div",{className:Cm},r().createElement(d.Spin,null)):null,r().createElement("div",{className:km},p?r().createElement("div",{className:Sm},a({id:"fileLoadedError"})):r().createElement("div",{className:Mm},l)))}),Hm=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{maxWidth:e}=t;const{formatMessage:i}=(0,L.useIntl)();return r().createElement("div",{className:Em,style:{maxWidth:e}},r().createElement("div",{className:km},r().createElement(d.Result,{status:"500",title:i({id:"unSupportFileType"}),subTitle:i({id:"unSupportFileTypeDescription"})})))}),zm=["url","scale","rotate","className","maxWidth","origin"],Um=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{let{url:e,scale:i,rotate:n,className:a,maxWidth:o,origin:l}=t,c=om(t,zm);const[h,u]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!1),{formatMessage:g}=(0,L.useIntl)();return(0,s.useEffect)(()=>{const t=new Image;t.src=e;const i=()=>{u(!1)},n=()=>{u(!1),f(!0)};return t.addEventListener("load",i),t.addEventListener("error",n),()=>{t.removeEventListener("load",i),t.removeEventListener("error",n)}},[e,i,n]),l?r().createElement("img",am({alt:g({id:"filePreview"})},c,{className:a,src:e})):r().createElement("div",{className:ft()(a,Em),style:{maxWidth:o}},h?r().createElement("div",{className:Cm},r().createElement(d.Spin,null)):null,p?r().createElement("div",{className:Sm},g({id:"fileLoadedError"})):r().createElement("img",am({alt:g({id:"filePreview"})},c,{src:e})))}),Vm=["url","maxWidth"],Gm=t=>{let{url:e,maxWidth:i}=t,n=om(t,Vm);return r().createElement("div",{className:Em,style:{maxWidth:i}},r().createElement("div",{className:Lm},r().createElement("audio",am({},n,{src:e,controls:!0}))))},qm=["url","maxWidth","origin","controls","getElement"],Xm=t=>{let{url:e,maxWidth:i,origin:n,controls:a=!0,getElement:o}=t,l=om(t,qm);const c=(0,s.useRef)(null),h=k()(o);return(0,s.useEffect)(()=>{h(c.current)},[h]),n?r().createElement("video",am({controls:a},l,{src:e,ref:c})):r().createElement("div",{className:Em,style:{maxWidth:i}},r().createElement("div",{className:Tm},r().createElement("video",am({controls:a},l,{src:e,ref:c}))))},Ym=t=>{const e=(t||"").split("?")[0].toLowerCase();return/.txt$/.test(e)?"txt":/.pdf$/.test(e)?"pdf":/.(png|jpg|jpeg)$/.test(e)?"image":/.(html|htm)$/.test(e)?"html":/.(doc|docx|xls|xlsx|ppt|pptx|csv)$/.test(e)?"office":/.(mp3|wav|ogg|aac)$/.test(e)?"audio":/.(mp4|avi|mov|mkv|flv)$/.test(e)?"video":"unknown"},Km={txt:Bm,pdf:jm,image:Um,html:Im,office:Wm,audio:Gm,video:Xm,unknown:Hm},Qm=t=>Km[Ym(t)],Zm=["data","id","staticUrl","className","fetchApi","filename","render"],Jm=dm(t=>{let{data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,render:l}=t,c=om(t,Zm);const h=mm({staticUrl:n,url:e}),d=e&&Qm(e)||o&&Qm(o);return"function"===typeof l?l({data:e,id:i,staticUrl:n,className:s,fetchApi:a,filename:o,url:h,component:d}):r().createElement(d,am({},c,{className:s,url:h}))}),$m=["id","src","originName","filename"],tv=t=>{let{id:e,src:i,originName:n,filename:s}=t,a=om(t,$m);return i?r().createElement(Om,am({},a,{url:i,filename:s||n})):r().createElement(Jm,am({},a,{id:e,filename:s||n}))},ev=["content","onSuccess","onError","onBeforePrint","printProps","contentRef"],iv=t=>{let{onSuccess:e,onError:i,onBeforePrint:n,printProps:a,contentRef:o}=t,l=om(t,ev);const[c,h]=(0,s.useState)(!1),u=(0,kA.useReactToPrint)(am({contentRef:o,bodyClass:document.body.getAttribute("class"),onBeforePrint:async function(){h(!0),n&&await n(...arguments)},onPrintError:function(){h(!1),i&&i(...arguments)},onAfterPrint:function(){h(!1),e&&e(...arguments)}},a));return r().createElement(d.Button,am({},l,{onClick:()=>{h(!0),u()},loading:c}))};var nv=".file-modal-outer {\n min-height: 100px;\n}\n\n.file-title {\n margin-right: 30px;\n}\n\n.ellipse {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n word-break: break-all;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLm1vZHVsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLGdCQUFnQjtFQUNoQix1QkFBdUI7RUFDdkIsb0JBQW9CO0VBQ3BCLHFCQUFxQjtFQUNyQiw0QkFBNEI7RUFDNUIscUJBQXFCO0FBQ3ZCIiwiZmlsZSI6InN0eWxlLm1vZHVsZXMuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5maWxlLW1vZGFsLW91dGVyIHtcbiAgbWluLWhlaWdodDogMTAwcHg7XG59XG5cbi5maWxlLXRpdGxlIHtcbiAgbWFyZ2luLXJpZ2h0OiAzMHB4O1xufVxuXG4uZWxsaXBzZSB7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgLXdlYmtpdC1saW5lLWNsYW1wOiAxO1xuICAtd2Via2l0LWJveC1vcmllbnQ6IHZlcnRpY2FsO1xuICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XG59Il19 */";const sv=["title","filename","originName","openDownload","openPrint","id","src","apis"],rv=["renderModal"],av=(0,L.createIntlProvider)("zh-CN",ym,"react-file"),ov=t=>{const e=Object.assign({},{footer:null,openDownload:!1,openPrint:!1},t),{title:i,filename:n,originName:a,openDownload:o,openPrint:l,id:c,src:h,apis:u}=e,p=om(e,sv),[f,g]=MA()(p,{value:"open",default:"defaultOpen",onChange:"onOpenChange"}),{message:m}=d.App.useApp(),v=(0,s.useRef)();return am({},p,{open:f,onOpenChange:g,onCancel:()=>{g(!1)},title:r().createElement(d.Space,{size:10,className:nv["file-title"]},r().createElement("span",{className:nv.ellipse},i||n||a),r().createElement("span",null,o&&r().createElement(av,null,t=>{let{formatMessage:e}=t;return r().createElement(xm,{className:"btn-no-padding",type:"link",id:c,src:h,apis:u,filename:n||a,onSuccess:()=>{m.success(e({id:"downloadSuccess"}))}})}),l&&["txt","pdf","image","html"].indexOf(Ym(n||a))>-1&&r().createElement(iv,{contentRef:v,type:"link",icon:r().createElement(A,null)}))),children:r().createElement("div",{ref:v,className:nv["file-modal-outer"]},r().createElement(tv,{id:c,src:h,filename:n||a,apis:u}))})},lv=t=>{const e=Object.assign({},{renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{renderModal:i}=e,n=om(e,rv),s=ov(n);return Object.assign({},s,{renderModal:t=>i(Object.assign({},s,t))})},cv=t=>{const{renderModal:e}=lv(t);return e()},hv=["filename","originName","id","src","title","modalProps","openDownload","openPrint","children"],dv=t=>{const[e,i]=(0,s.useState)(!1),n=Object.assign({},{icon:r().createElement(v,null)},t),{filename:a,originName:o,id:l,src:c,title:h,modalProps:u,openDownload:p,openPrint:f,children:g}=n,A=om(n,hv),m=Object.assign({},u,{filename:a||o,id:l,src:c,title:h,open:e,openPrint:f,openDownload:p,onCancel:()=>{i(!1)}});return r().createElement(r().Fragment,null,r().createElement(d.Button,am({},A,{onClick:()=>{i(!0)}}),"function"===typeof g?g(a||o):g||a||o),r().createElement(cv,am({},m,{open:e,onOpenChange:i})))},uv=t=>{let{params:e}=t;const{data:i}=e;return new Promise((t,e)=>{const n=new window.Image;n.src=i,n.addEventListener("load",()=>{t(i)}),n.addEventListener("error",t=>{e(t)})})};var pv="_H1zfc",fv="_BAe2W",gv="_9kK1I",Av="_Wwi2N";const mv=["id","src","alt","onClick","loading","error","className","apis","staticUrl"],vv=["id","src","alt","gender","loading","error","className","gap","icon","children","shape","size","width","height","defaultAvatar","apis","staticUrl"],bv=r().createElement(d.Skeleton.Avatar,{shape:"square",active:!0}),wv=r().createElement(PA,null),yv=r().createElement(WA,null),_v=r().createElement(UA,null),xv=r().createElement(YA,null),Ev=t=>{let{data:e,className:i,alt:n,innerLoading:s,loading:o,error:c,innerError:h,children:d,onClick:u,staticUrl:p}=t;var f;const{apis:g}=(0,a.usePreset)(),A=Object.assign({},g),m=mm({staticUrl:p||(null==(f=A.file)?void 0:f.staticUrl),url:e});return r().createElement(l(),{loader:uv,params:{data:m},error:h||c,loading:s||o,render:t=>{let{data:e}=t;return"function"===typeof d?d({alt:n,className:ft()(i,fv),src:e}):r().createElement("img",{alt:n,className:ft()(i,fv),src:e,onClick:u})}})},Cv=dm(Ev),kv=t=>{let{loading:e,error:i,src:n,id:s,alt:a,className:o,children:l,apis:c,onClick:h,staticUrl:d}=t;const u=(t,e)=>{const i=t.type;return!i&&t.render?t.render(Object.assign({},t.props,e)):r().createElement(i,Object.assign({},t.props,e))},p=e&&u(e,{className:gv}),f=i&&u(i,{className:Av});return n?r().createElement(Ev,{alt:a,className:o,staticUrl:d,data:n,loading:p,error:f,onClick:h},l):s?r().createElement(Cv,{alt:a,className:o,id:s,loading:p,innerLoading:p,error:f,innerError:f,apis:c,onClick:h},l):f},Sv=t=>{const e=Object.assign({},{loading:bv,error:wv},t),{id:i,src:n,alt:s,onClick:a,loading:o,error:l,className:c,apis:h,staticUrl:d}=e,u=om(e,mv);return r().createElement("div",am({},u,{className:ft()(c,pv)}),kv({loading:o,error:l,src:n,id:i,alt:s,className:c,apis:h,onClick:a,staticUrl:d}))};Sv.Avatar=t=>{const e=Object.assign({},{size:100,defaultAvatar:yv,error:wv,shape:"circle"},t),{id:i,src:n,alt:s,gender:a,loading:o,error:l,className:c,gap:h,icon:u,children:p,shape:f,size:g,width:A,height:m,defaultAvatar:v,apis:b,staticUrl:w}=e,y=om(e,vv),_=(()=>{const t=A&&m?{style:{width:A,height:m}}:{size:g};let e=f;if(A&&A!==m&&(e="square"),i||n)return kv({loading:o||r().createElement(d.Skeleton.Avatar,{shape:e,active:!0}),staticUrl:w,error:l,src:n,defaultAvatar:v,id:i,alt:s,className:c,apis:b,children:i=>r().createElement(d.Avatar,am({},i,{gap:h,shape:e},t))});if(a){const i=["F","female","f"].indexOf(a)>-1?_v:["M","male","m"].indexOf(a)>-1?xv:yv;return r().createElement(d.Avatar,am({},y,{src:i,gap:h,shape:e},t))}return r().createElement(d.Avatar,am({},y,{gap:h,icon:u,shape:e,size:g,src:v},t),p)})();return r().createElement("div",am({},y,{className:ft()(c,pv),style:{width:A&&m?A:g,height:A&&m?m:g}}),_)};const Mv=t=>{const{item:e,hasPreview:i,getPermission:n,apis:s,onEdit:a,onDelete:o,onPreview:l,renderModal:c}=Object.assign({},{hasPreview:!0,apis:{},getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{filename:h,id:u,src:p}=e,{onOpenChange:f,renderModal:g}=lv({apis:s,id:u,src:p,filename:h,renderModal:c});return r().createElement(d.Flex,{justify:"end"},i&&n("preview",e)&&r().createElement(r().Fragment,null,r().createElement(d.Button,{type:"text",icon:r().createElement(b.A,null),onClick:()=>{l?l(e):f(!0)}}),g()),n("edit",e)&&r().createElement(ZA.LoadingButton,{type:"text",icon:r().createElement(w.A,null),onClick:()=>a&&a(e)}),n("download",e)&&r().createElement(xm,{type:"text",id:u,src:p,filename:h}),n("delete",e)&&r().createElement(ZA.ConfirmButton,{type:"text",icon:r().createElement(y.A,null),onClick:()=>o&&o(e)}))};var Lv="_yRMtw",Tv="_OivOI",Rv="_doPR9",Pv="_bLeUP",Fv="_mZdoa";const Iv=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),{className:i,dataSource:n,getPermission:s,infoItemRenders:a,onDelete:o,onEdit:l,apis:c,renderModal:h}=Object.assign({},{infoItemRenders:[t=>t.userName?r().createElement(d.Typography.Text,null,t.userName):null,t=>t.date?r().createElement(d.Typography.Text,null,em()(t.date).format("YYYY-MM-DD HH:mm:ss")):null],getPermission:()=>!0,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t);return r().createElement(d.List,{className:i,dataSource:n.map((t,e)=>(t.index=e,t)),rowKey:t=>"item_".concat(t.uuid&&"uuid_".concat(t.uuid)||t.id&&"id_".concat(t.id)||t.src&&"src_".concat(t.src)),renderItem:t=>{const{type:i,filename:n}=t;return r().createElement(d.List.Item,{className:Lv},r().createElement(d.Row,{justify:"space-between",wrap:!1,className:Tv},r().createElement(d.Col,{flex:1},r().createElement("div",{className:Rv}),r().createElement(d.Space,{className:"is-block",align:"start",size:4},r().createElement(QA(),{type:$A()(null==n?void 0:n.split(".")),size:14}),n||"")),a&&a.map((e,n)=>r().createElement(d.Col,{span:e.span||4,key:n},"uploading"!==i&&("function"===typeof e?e:e.render)(t),r().createElement("div",{className:Rv}))),r().createElement(d.Col,{className:Fv},"uploading"!==i?r().createElement(Mv,{getPermission:s,item:t,apis:c,onDelete:o,renderModal:h,onEdit:l}):r().createElement(d.Space,{className:Pv},r().createElement(d.Spin,{size:"small"}),r().createElement(d.Typography.Link,null,e({id:"uploading"}))))))},bordered:!0})}),Dv=t=>{const{locale:e}=(0,a.useContext)(),{formatMessage:i}=(0,L.createIntl)({locale:e,namespace:"react-file"}),{multiple:n,fileSize:r,maxLength:o,value:l,concurrentCount:c,onAdd:h,onError:u,onSave:p,onChange:f,onUpload:g}=Object.assign({},{concurrentCount:1,value:[]},t),{apis:A}=(0,a.usePreset)(),{message:m}=d.App.useApp(),[v,b]=(0,s.useState)([]),w=(0,s.useRef)(c),y=(0,s.useMemo)(()=>nm()(w.current),[]),_=k()(async t=>{const e=o-l.length;1!==o&&!0===n&&t.length>e?m.error(i({id:"maxLengthError"},{maxLength:o})):await Promise.allSettled(t.map(async t=>{if(t.size>1024*r*1024)return void m.error(i({id:"fileSizeError"},{filename:t.name,fileSize:r}));const e=rm()(),s=n=>{const s=n.message||i({id:"uploadError"},{filename:t.name,error:n.message?":"+n.message:""});m.error(s),u&&u({file:t,error:n,errMsg:s}),b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i})};try{var a;b(1===o||!0!==n?[{uuid:e,type:"uploading",filename:t.name}]:i=>{const n=i.slice(0);return n.unshift({uuid:e,type:"uploading",filename:t.name}),n}),h&&await Promise.resolve(h(t));const r=g||(null==(a=A.file)?void 0:a.upload),{data:l}=await y(()=>r({file:t}));if(0!==l.code)return void s(new Error(i({id:"uploadError"},{filename:t.name,error:l.msg?":"+l.msg:""})));const c=p?await Promise.resolve(p(l,t,e)):Object.assign({},l.data,{filename:l.data.filename||l.data.originName||t.name,id:l.data.id,uuid:e});b(t=>{const i=t.slice(0),n=i.findIndex(t=>t.uuid===e);return n>-1&&i.splice(n,1),i}),f(1===o||!0!==n?[c]:t=>{const e=(t||[]).slice(0);return e.push(c),e})}catch(l){s(l)}}))});return{fileList:v,onFileSelected:_}};var Ov="_-hhpT",Nv="_FyygJ",Wv="_hBEXs",jv="_BMSEY";const Bv=[".pdf",".jpg",".png",".jpeg",".doc",".docx",".xls",".xlsx",".html",".msg",".eml",".zip"],Hv=["children","className","buttonText","accept","multiple","onChange"],zv=["children"],Uv=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=(0,s.useRef)(null),n=Object.assign({},{accept:Bv,buttonText:e({id:"fileUpload"}),children:t=>{let{children:e}=t,i=om(t,zv);return r().createElement(d.Button,am({icon:r().createElement(x,null)},i),l,e)}},t),{children:a,className:o,buttonText:l,accept:c,multiple:h,onChange:u}=n,p=om(n,Hv);return a(am({},p,{className:ft()(o,Ov),children:!p.disabled&&r().createElement("input",{ref:i,type:"file",accept:c,multiple:h,className:Nv,onChange:t=>{const e=[].slice.call(t.target.files,0);0!==e.length&&(i.current.setAttribute("type","text"),i.current.setAttribute("type","file"),u(e))}})}))}),Vv=["className","fileSize","maxLength","multiple","size","accept","children","renderTips","showUploadList","onSave","ossUpload","getPermission","concurrentCount","apis","renderModal"],Gv=(0,L.createWithIntlProvider)("zh-CN",ym,"react-file")(t=>{const{formatMessage:e}=(0,L.useIntl)(),i=Object.assign({},{defaultValue:[],accept:Bv,renderTips:t=>t,children:e({id:"fileUpload"}),multiple:!0,showUploadList:!0,maxLength:10,fileSize:30,concurrentCount:10,renderModal:t=>r().createElement(d.Modal,Object.assign({},t))},t),{className:n,fileSize:s,maxLength:a,multiple:o,size:l,accept:c,children:h,renderTips:u,showUploadList:p,onSave:f,ossUpload:g,getPermission:A,concurrentCount:m,apis:v,renderModal:b}=i,w=om(i,Vv),[y,_]=MA()(w),x=y||[],{fileList:E,onFileSelected:C}=Dv({multiple:o,onSave:f,ossUpload:g,fileSize:s,maxLength:a,value:x,onChange:_,concurrentCount:m});c.map(t=>t.replace(/^\./,"")).join("\u3001");const k=[...x,...E],S=u(e({id:"uploadTips"},{fileSize:s,maxLength:a,accept:c.map(t=>t.replace(/^\./,"")).join(",")}),{fileSize:s,maxLength:a,accept:c});return r().createElement(d.Flex,{vertical:!0,gap:8},r().createElement(d.Flex,{gap:8},r().createElement(Uv,am({},M()(w,["value","onChange"]),{size:l,multiple:o,accept:c,className:n,buttonText:h,onChange:C})),S&&r().createElement("div",{className:jv},S)),p&&k.length>0&&r().createElement(Iv,{className:Wv,dataSource:k,infoItemRenders:[],getPermission:A||(t=>["delete","preview"].indexOf(t)>-1),onDelete:t=>{const e=x.slice(0),i=e.indexOf(t);i>-1&&e.splice(i,1),_(e)},apis:v,renderModal:b}))}),qv=(t,e)=>{if(t&&e){const i=Array.isArray(e)?e:e.split(","),n=t.name||"",s=(t.type||"").toLowerCase(),r=s.replace(/\/.*$/,"");return i.some(t=>{const e=t.trim().toLowerCase();return"."===e.charAt(0)?n.toLowerCase().endsWith(e):e.endsWith("/*")?r===e.replace(/\/.*$/,""):s===e})}return!0}},33279:t=>{t.exports=function(t){return t}},34552:(t,e,i)=>{var n=i(9812),s=Object.prototype,r=s.hasOwnProperty,a=s.toString,o=n?n.toStringTag:void 0;t.exports=function(t){var e=r.call(t,o),i=t[o];try{t[o]=void 0;var n=!0}catch(l){}var s=a.call(t);return n&&(e?t[o]=i:delete t[o]),s}},34677:(t,e,i)=>{var n=i(23253),s=i(84570)(function(t,e,i){n(t,e,i)});t.exports=s},35324:(t,e,i)=>{var n=i(54052),s=i(62597),r=i(14079),a=i(41069);t.exports=function(t,e){return n(t)?t:s(t,e)?[t]:r(a(t))}},35428:(t,e,i)=>{var n=i(16913),s=i(56173),r=i(22761),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return r(t)&&s(t.length)&&!!a[n(t)]}},36140:t=>{var e=Object.prototype;t.exports=function(t){var i=t&&t.constructor;return t===("function"==typeof i&&i.prototype||e)}},36954:(t,e,i)=>{var n=i(11629),s=i(37857),r=i(46686),a=i(96996),o=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,h=l.toString,d=c.hasOwnProperty,u=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!r(t)||s(t))&&(n(t)?u:o).test(a(t))}},37105:(t,e,i)=>{var n="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;t.exports=n},37159:(t,e,i)=>{var n=i(12622);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},37857:(t,e,i)=>{var n=i(13440),s=function(){var t=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!s&&s in t}},38268:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t){var i=t.length,n=new t.constructor(i);return i&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}},38458:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(26562);function s(t,e){return t.get((0,n.A)(t,e))}},38541:(t,e,i)=>{var n=i(9812),s=i(50149),r=i(54052),a=i(19841),o=n?n.prototype:void 0,l=o?o.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(r(e))return s(e,t)+"";if(a(e))return l?l.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}},38710:(t,e,i)=>{var n=i(61516);t.exports=function(t,e){var i=e?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}},39790:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(8195);function s(t,e){(0,n.A)(t,e),e.add(t)}},40801:(t,e,i)=>{var n=i(61141),s=i(46686),r=i(19841),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=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)?c(t.slice(2),i?2:8):a.test(t)?NaN:+t}},41069:(t,e,i)=>{var n=i(38541);t.exports=function(t){return null==t?"":n(t)}},43516:t=>{t.exports=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}},44353:(t,e,i)=>{t=i.nmd(t);var n=i(56552),s=e&&!e.nodeType&&e,r=s&&t&&!t.nodeType&&t,a=r&&r.exports===s?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var i=t.length,n=o?o(i):new t.constructor(i);return t.copy(n),n}},44543:(t,e,i)=>{t=i.nmd(t);var n=i(56552),s=i(60014),r=e&&!e.nodeType&&e,a=r&&t&&!t.nodeType&&t,o=a&&a.exports===r?n.Buffer:void 0,l=(o?o.isBuffer:void 0)||s;t.exports=l},45921:(t,e,i)=>{var n=i(20449),s=i(47574),r=i(56832),a=r&&r.isSet,o=a?s(a):n;t.exports=o},46350:(t,e,i)=>{var n=i(28325),s=i(86578)(n);t.exports=s},46686:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},47251:(t,e,i)=>{var n=i(98724),s=i(97160),r=i(85204);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(r||s),string:new n}}},47574:t=>{t.exports=function(t){return function(e){return t(e)}}},48734:(t,e,i)=>{var n=i(95575),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:s.call(e,t)}},48895:t=>{t.exports=function(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t}},49134:(t,e,i)=>{"use strict";function n(t){var e;return null===t||void 0===t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}function s(t){return function(t){return n(t)instanceof ShadowRoot}(t)?n(t):null}i.d(e,{j:()=>s})},50149:t=>{t.exports=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}},51104:(t,e,i)=>{var n=i(96614),s=i(28673);t.exports=function(t,e){return t&&n(e,s(e),t)}},51153:(t,e,i)=>{"use strict";var n=i(73884),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 c(t,e,i){var n,r={},c=null,h=null;for(n in void 0!==i&&(c=""+i),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(h=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:c,ref:h,props:r,_owner:o.current}}e.Fragment=r,e.jsx=c,e.jsxs=c},51268:(t,e,i)=>{var n=i(35428),s=i(47574),r=i(56832),a=r&&r.isTypedArray,o=a?s(a):n;t.exports=o},51946:(t,e,i)=>{var n=i(61340);t.exports=function(t){return n(this.__data__,t)>-1}},52969:(t,e,i)=>{var n=i(35324),s=i(70914);t.exports=function(t,e){for(var i=0,r=(e=n(e,t)).length;null!=t&&i<r;)t=t[s(e[i++])];return i&&i==r?t:void 0}},53737:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}},53871:t=>{t.exports=function(t,e,i){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(s);++n<s;)r[n]=t[n+e];return r}},53986:(t,e,i)=>{"use strict";function n(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(-1!==e.indexOf(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],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}i.d(e,{A:()=>n})},54052:t=>{var e=Array.isArray;t.exports=e},55119:(t,e,i)=>{var n=i(96614),s=i(30474);t.exports=function(t,e){return t&&n(e,s(e),t)}},55149:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(8195);function s(t,e,i){(0,n.A)(t,e),e.set(t,i)}},55636:(t,e,i)=>{var n=i(31170),s=Math.max;t.exports=function(t,e,i){return e=s(void 0===e?t.length-1:e,0),function(){for(var r=arguments,a=-1,o=s(r.length-e,0),l=Array(o);++a<o;)l[a]=r[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=r[a];return c[e]=i(l),n(t,this,c)}}},55647:(t,e,i)=>{var n=i(33279),s=i(55636),r=i(46350);t.exports=function(t,e){return r(s(t,e,n),t+"")}},55906:t=>{t.exports=function(t){return function(e,i,n){for(var s=-1,r=Object(e),a=n(e),o=a.length;o--;){var l=a[t?o:++s];if(!1===i(r[l],l,r))break}return e}}},56173:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},56326:(t,e,i)=>{var n=i(48895),s=i(85990),r=i(69621),a=i(57828),o=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,r(t)),t=s(t);return e}:a;t.exports=o},56552:(t,e,i)=>{var n=i(37105),s="object"==typeof self&&self&&self.Object===Object&&self,r=n||s||Function("return this")();t.exports=r},56832:(t,e,i)=>{t=i.nmd(t);var n=i(37105),s=e&&!e.nodeType&&e,r=s&&t&&!t.nodeType&&t,a=r&&r.exports===s&&n.process,o=function(){try{var t=r&&r.require&&r.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=o},56874:(t,e,i)=>{var n=i(12622);t.exports=function(t,e){var i=n(this,t),s=i.size;return i.set(t,e),this.size+=i.size==s?0:1,this}},57828:t=>{t.exports=function(){return[]}},57887:(t,e,i)=>{var n=i(5791),s=i(47574),r=i(56832),a=r&&r.isMap,o=a?s(a):n;t.exports=o},58122:(t,e,i)=>{var n=i(46686),s=i(36140),r=i(43516),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return r(t);var e=s(t),i=[];for(var o in t)("constructor"!=o||!e&&a.call(t,o))&&i.push(o);return i}},59395:(t,e,i)=>{var n=i(4262),s=i(69621),r=i(28673);t.exports=function(t){return n(t,r,s)}},60014:t=>{t.exports=function(){return!1}},60929:(t,e,i)=>{var n=i(93211),s=i(6571),r=i(69194),a=i(46686);t.exports=function(t,e,i){if(!a(i))return!1;var o=typeof e;return!!("number"==o?s(i)&&r(e,i.length):"string"==o&&e in i)&&n(i[e],t)}},61141:(t,e,i)=>{var n=i(10143),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},61143:(t,e,i)=>{var n=i(13028)(Object.keys,Object);t.exports=n},61340:(t,e,i)=>{var n=i(93211);t.exports=function(t,e){for(var i=t.length;i--;)if(n(t[i][0],e))return i;return-1}},61516:(t,e,i)=>{var n=i(22929);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},61714:(t,e,i)=>{var n=i(61340);t.exports=function(t,e){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,e])):i[s][1]=e,this}},61966:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},62597:(t,e,i)=>{var n=i(54052),s=i(19841),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!s(t))||(a.test(t)||!r.test(t)||null!=e&&t in Object(e))}},63868:(t,e,i)=>{var n=i(71775),s=i(93211);t.exports=function(t,e,i){(void 0!==i&&!s(t[e],i)||void 0===i&&!(e in t))&&n(t,e,i)}},64467:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(20816);function s(t,e,i){return(e=(0,n.A)(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},64816:(t,e,i)=>{var n=i(47251),s=i(37159),r=i(80438),a=i(69394),o=i(56874);function l(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])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l},65387:(t,e,i)=>{var n=i(87937)(i(56552),"Promise");t.exports=n},67407:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},68592:(t,e,i)=>{var n=i(4262),s=i(56326),r=i(30474);t.exports=function(t){return n(t,r,s)}},69194:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,i){var n=typeof t;return!!(i=null==i?9007199254740991:i)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<i}},69394:(t,e,i)=>{var n=i(12622);t.exports=function(t){return n(this,t).has(t)}},69621:(t,e,i)=>{var n=i(17529),s=i(57828),r=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(t){return null==t?[]:(t=Object(t),n(a(t),function(e){return r.call(t,e)}))}:s;t.exports=o},70579:(t,e,i)=>{"use strict";t.exports=i(51153)},70705:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},70914:(t,e,i)=>{var n=i(19841);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},71775:(t,e,i)=>{var n=i(5654);t.exports=function(t,e,i){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}},72070:(t,e,i)=>{var n=i(87937)(i(56552),"Set");t.exports=n},72154:(t,e,i)=>{var n=i(95575),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return s.call(e,t)?e[t]:void 0}},73204:(t,e,i)=>{var n=i(3343),s=i(22777),r=i(54052),a=i(44543),o=i(69194),l=i(51268),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var i=r(t),h=!i&&s(t),d=!i&&!h&&a(t),u=!i&&!h&&!d&&l(t),p=i||h||d||u,f=p?n(t.length,String):[],g=f.length;for(var A in t)!e&&!c.call(t,A)||p&&("length"==A||d&&("offset"==A||"parent"==A)||u&&("buffer"==A||"byteLength"==A||"byteOffset"==A)||o(A,g))||f.push(A);return f}},74065:t=>{t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},76191:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},76272:(t,e,i)=>{var n=i(6571),s=i(22761);t.exports=function(t){return s(t)&&n(t)}},76788:(t,e,i)=>{var n=i(97160),s=i(85204),r=i(64816);t.exports=function(t,e){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!s||a.length<199)return a.push([t,e]),this.size=++i.size,this;i=this.__data__=new r(a)}return i.set(t,e),this.size=i.size,this}},77116:(t,e,i)=>{var n=i(9812),s=i(22777),r=i(54052),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return r(t)||s(t)||!!(a&&t&&t[a])}},78420:(t,e,i)=>{var n=i(71775),s=i(93211),r=Object.prototype.hasOwnProperty;t.exports=function(t,e,i){var a=t[e];r.call(t,e)&&s(a,i)&&(void 0!==i||e in t)||n(t,e,i)}},79889:(t,e,i)=>{var n=i(93950),s=i(46686);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})}},80111:(t,e,i)=>{var n=i(41069),s=0;t.exports=function(t){var e=++s;return n(t)+e}},80438:(t,e,i)=>{var n=i(12622);t.exports=function(t){return n(this,t).get(t)}},80726:t=>{t.exports=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}},80755:(t,e,i)=>{var n=i(48895),s=i(77116);t.exports=function t(e,i,r,a,o){var l=-1,c=e.length;for(r||(r=s),o||(o=[]);++l<c;){var h=e[l];i>0&&r(h)?i>1?t(h,i-1,r,a,o):n(o,h):a||(o[o.length]=h)}return o}},82284:(t,e,i)=>{"use strict";function n(t){return n="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},n(t)}i.d(e,{A:()=>n})},83223:(t,e,i)=>{var n=i(63868),s=i(44353),r=i(38710),a=i(91980),o=i(20310),l=i(22777),c=i(54052),h=i(76272),d=i(44543),u=i(11629),p=i(46686),f=i(12322),g=i(51268),A=i(53737),m=i(91609);t.exports=function(t,e,i,v,b,w,y){var _=A(t,i),x=A(e,i),E=y.get(x);if(E)n(t,i,E);else{var C=w?w(_,x,i+"",t,e,y):void 0,k=void 0===C;if(k){var S=c(x),M=!S&&d(x),L=!S&&!M&&g(x);C=x,S||M||L?c(_)?C=_:h(_)?C=a(_):M?(k=!1,C=s(x,!0)):L?(k=!1,C=r(x,!0)):C=[]:f(x)||l(x)?(C=_,l(_)?C=m(_):p(_)&&!u(_)||(C=o(x))):k=!1}k&&(y.set(x,C),b(C,x,v,w,y),y.delete(x)),n(t,i,C)}}},83713:(t,e,i)=>{var n=i(36140),s=i(61143),r=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return s(t);var e=[];for(var i in Object(t))r.call(t,i)&&"constructor"!=i&&e.push(i);return e}},84545:(t,e,i)=>{var n=i(97160);t.exports=function(){this.__data__=new n,this.size=0}},84570:(t,e,i)=>{var n=i(55647),s=i(60929);t.exports=function(t){return n(function(e,i){var n=-1,r=i.length,a=r>1?i[r-1]:void 0,o=r>2?i[2]:void 0;for(a=t.length>3&&"function"==typeof a?(r--,a):void 0,o&&s(i[0],i[1],o)&&(a=r<3?void 0:a,r=1),e=Object(e);++n<r;){var l=i[n];l&&t(e,l,n,a)}return e})}},85204:(t,e,i)=>{var n=i(87937)(i(56552),"Map");t.exports=n},85990:(t,e,i)=>{var n=i(13028)(Object.getPrototypeOf,Object);t.exports=n},86578:t=>{var e=Date.now;t.exports=function(t){var i=0,n=0;return function(){var s=e(),r=16-(s-n);if(n=s,r>0){if(++i>=800)return arguments[0]}else i=0;return t.apply(void 0,arguments)}}},87563:t=>{t.exports=function(){this.__data__=[],this.size=0}},87937:(t,e,i)=>{var n=i(36954),s=i(14657);t.exports=function(t,e){var i=s(t,e);return n(i)?i:void 0}},88140:(t,e,i)=>{var n=i(35324),s=i(74065),r=i(21676),a=i(70914);t.exports=function(t,e){return e=n(e,t),null==(t=r(t,e))||delete t[a(s(e))]}},88259:(t,e,i)=>{var n=i(15797);t.exports=function(t){var e=n(t,function(t){return 500===i.size&&i.clear(),t}),i=e.cache;return e}},89330:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(58168),s=i(73884);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(22172);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},89379:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(64467);function s(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 r(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach(function(e){(0,n.A)(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}},91609:(t,e,i)=>{var n=i(96614),s=i(30474);t.exports=function(t){return n(t,s(t))}},91980:t=>{t.exports=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}},93141:function(t,e,i){var n;"undefined"!=typeof self&&self,t.exports=(n=i(73884),function(){"use strict";var t={155:function(t){t.exports=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{useReactToPrint:function(){return g}});var r=i(155);const a="printWindow";function o(t){let{level:e="error",messages:i,suppressErrors:n=!1}=t;n||("error"===e?console.error(i):"warning"===e?console.warn(i):console.debug(i))}function l(t,e){if(e||!t){const t=document.getElementById(a);t&&document.body.removeChild(t)}}function c(t){return t instanceof Error?t:new Error("Unknown Error")}function h(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:r,print:a,suppressErrors:h}=e;setTimeout(()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),l(r)}if(t.contentWindow.focus(),a)a(t).then(u).catch(t=>{s?s("print",c(t)):o({messages:["An error was thrown by the specified `print` function"],suppressErrors:h})});else{if(t.contentWindow.print){const p=null!==(d=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==d?d:"",f=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=f,t.contentDocument&&(t.contentDocument.title=p))}else o({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:h});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(t=>{var e,i;return(null!==(i=null!==(e=navigator.userAgent)&&void 0!==e?e:navigator.vendor)&&void 0!==i?i:"opera"in window&&window.opera).match(t)})?setTimeout(u,500):u()}}else o({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:h})},500)}function d(t){const e=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let n=i.nextNode();for(;n;)e.push(n),n=i.nextNode();return e}function u(t,e,i){const n=d(t),s=d(e);if(n.length===s.length)for(let r=0;r<n.length;r++){const t=n[r],e=s[r],a=t.shadowRoot;if(null!==a){const t=e.attachShadow({mode:a.mode});t.innerHTML=a.innerHTML,u(a,t,i)}}else o({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const p='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function f(t,e,i,n){var s,r,a,l,d;const{contentNode:f,clonedContentNode:g,clonedImgNodes:A,clonedVideoNodes:m,numResourcesToLoad:v,originalCanvasNodes:b}=i,{bodyClass:w,fonts:y,ignoreGlobalStyles:_,pageStyle:x,nonce:E,suppressErrors:C,copyShadowRoots:k}=n;t.onload=null;const S=null!==(s=t.contentDocument)&&void 0!==s?s:null===(r=t.contentWindow)||void 0===r?void 0:r.document;if(S){const i=S.body.appendChild(g);k&&u(f,i,!!C),y&&((null===(a=t.contentDocument)||void 0===a?void 0:a.fonts)&&(null===(l=t.contentWindow)||void 0===l?void 0:l.FontFace)?y.forEach(i=>{const n=new FontFace(i.family,i.source,{weight:i.weight,style:i.style});t.contentDocument.fonts.add(n),n.loaded.then(()=>{e(n)}).catch(t=>{e(n,["Failed loading the font:",n,"Load error:",c(t)])})}):(y.forEach(t=>{e(t)}),o({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:C})));const n=null!=x?x:p,s=S.createElement("style");E&&(s.setAttribute("nonce",E),S.head.setAttribute("nonce",E)),s.appendChild(S.createTextNode(n)),S.head.appendChild(s),w&&S.body.classList.add(...w.split(" "));const r=S.querySelectorAll("canvas");for(let t=0;t<b.length;++t){const e=b[t],i=r[t];if(void 0===i){o({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:C});continue}const n=i.getContext("2d");n&&n.drawImage(e,0,0)}for(let t=0;t<A.length;t++){const i=A[t],n=i.getAttribute("src");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,n,s,r,a)=>{e(i,["Error loading <img>",i,"Error",a])},t.src=n}else e(i,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',i])}for(let t=0;t<m.length;t++){const i=m[t];i.preload="auto";const n=i.getAttribute("poster");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,s,r,a,o)=>{e(i,["Error loading video poster",n,"for video",i,"Error:",o])},t.src=n}else i.readyState>=2?e(i):i.src?(i.onloadeddata=()=>{e(i)},i.onerror=(t,n,s,r,a)=>{e(i,["Error loading video",i,"Error",a])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const h="select",v=f.querySelectorAll(h),M=S.querySelectorAll(h);for(let t=0;t<v.length;t++)M[t].value=v[t].value;if(!_){const i=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let n=0,s=i.length;n<s;++n){const s=i[n];if("style"===s.tagName.toLowerCase()){const e=S.createElement(s.tagName),i=s.sheet;if(i){let r="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(r+="".concat(i.cssRules[e].cssText,"\r\n"))}catch(t){o({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",s,"Original error: ".concat(c(t).message)],level:"warning"})}e.setAttribute("id","react-to-print-".concat(n)),E&&e.setAttribute("nonce",E),e.appendChild(S.createTextNode(r)),S.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))o({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",s],level:"warning"}),e(s);else{const t=S.createElement(s.tagName);for(let e=0,i=s.attributes.length;e<i;++e){const i=s.attributes[e];i&&t.setAttribute(i.nodeName,null!==(d=i.nodeValue)&&void 0!==d?d:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,r,a)=>{e(t,["Failed to load",t,"Error:",a])},E&&t.setAttribute("nonce",E),S.head.appendChild(t)}else o({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",s],level:"warning"}),e(s)}}}0===v&&h(t,n)}function g(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:A,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,printIframeProps:y,suppressErrors:_}=t;const x=(0,r.useCallback)(t=>{function r(){const r={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:g,onBeforePrint:A,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,printIframeProps:y,suppressErrors:_},l=function(t){const e=document.createElement("iframe");return e.width="".concat(document.documentElement.clientWidth,"px"),e.height="".concat(document.documentElement.clientHeight,"px"),e.style.position="absolute",e.style.top="-".concat(document.documentElement.clientHeight+100,"px"),e.style.left="-".concat(document.documentElement.clientWidth+100,"px"),e.id=a,e.srcdoc="<!DOCTYPE html>",t&&(t.allow&&(e.allow=t.allow),void 0!==t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),void 0!==t.sandbox&&(e.sandbox=t.sandbox)),e}(y),c=function(t,e){const{contentRef:i,fonts:n,ignoreGlobalStyles:s,suppressErrors:r}=e,a=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return i&&"function"==typeof i?(e&&o({level:"warning",messages:['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']}),i()):e?e.current:void o({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n})}({contentRef:i,optionalContent:t,suppressErrors:r});if(!a)return;const l=a.cloneNode(!0),c=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),h=l.querySelectorAll("img"),d=l.querySelectorAll("video"),u=n?n.length:0;return{contentNode:a,clonedContentNode:l,clonedImgNodes:h,clonedVideoNodes:d,numResourcesToLoad:(s?0:c.length)+h.length+d.length+u,originalCanvasNodes:a.querySelectorAll("canvas")}}(t,r);if(!c)return void o({messages:["There is nothing to print"],suppressErrors:_});const x=function(t,e,i){const{suppressErrors:n}=t,s=[],r=[];return function(a,l){s.includes(a)?o({level:"debug",messages:["Tried to mark a resource that has already been handled",a],suppressErrors:n}):(l?(o({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...l],suppressErrors:n}),r.push(a)):s.push(a),s.length+r.length===e&&h(i,t))}}(r,c.numResourcesToLoad,l);!function(t,e,i,n){t.onload=()=>{f(t,e,i,n)},document.body.appendChild(t)}(l,x,c,r)}l(b,!0),A?A().then(()=>{r()}).catch(t=>{null==m||m("onBeforePrint",c(t))}):r()},[e,i,n,s,d,u,p,g,A,m,v,b,w,_]);return x}return s}())},93211:t=>{t.exports=function(t,e){return t===e||t!==t&&e!==e}},93950:(t,e,i)=>{var n=i(46686),s=i(4757),r=i(40801),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,c,h,d,u,p,f=0,g=!1,A=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var i=l,n=c;return l=c=void 0,f=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||A&&t-f>=h}function w(){var t=s();if(b(t))return y(t);u=setTimeout(w,function(t){var i=e-(t-p);return A?o(i,h-(t-f)):i}(t))}function y(t){return u=void 0,m&&l?v(t):(l=c=void 0,d)}function _(){var t=s(),i=b(t);if(l=arguments,c=this,p=t,i){if(void 0===u)return function(t){return f=t,u=setTimeout(w,e),g?v(t):d}(p);if(A)return clearTimeout(u),u=setTimeout(w,e),v(p)}return void 0===u&&(u=setTimeout(w,e)),d}return e=r(e)||0,n(i)&&(g=!!i.leading,h=(A="maxWait"in i)?a(r(i.maxWait)||0,e):h,m="trailing"in i?!!i.trailing:m),_.cancel=function(){void 0!==u&&clearTimeout(u),f=0,l=p=c=u=void 0},_.flush=function(){return void 0===u?d:y(s())},_}},94258:(t,e,i)=>{var n=i(55906)();t.exports=n},95575:(t,e,i)=>{var n=i(87937)(Object,"create");t.exports=n},96440:t=>{"use strict";var e=function(){};t.exports=e},96614:(t,e,i)=>{var n=i(78420),s=i(71775);t.exports=function(t,e,i,r){var a=!i;i||(i={});for(var o=-1,l=e.length;++o<l;){var c=e[o],h=r?r(i[c],t[c],c,i,t):void 0;void 0===h&&(h=t[c]),a?s(i,c,h):n(i,c,h)}return i}},96761:(t,e,i)=>{var n=i(12322);t.exports=function(t){return n(t)?void 0:t}},96996:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(i){}try{return t+""}catch(i){}}return""}},97132:(t,e,i)=>{var n=i(5538),s=i(80726),r=i(78420),a=i(51104),o=i(55119),l=i(44353),c=i(91980),h=i(98124),d=i(29075),u=i(59395),p=i(68592),f=i(26924),g=i(38268),A=i(18630),m=i(20310),v=i(54052),b=i(44543),w=i(57887),y=i(46686),_=i(45921),x=i(28673),E=i(30474),C="[object Arguments]",k="[object Function]",S="[object Object]",M={};M[C]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[S]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[k]=M["[object WeakMap]"]=!1,t.exports=function t(e,i,L,T,R,P){var F,I=1&i,D=2&i,O=4&i;if(L&&(F=R?L(e,T,R,P):L(e)),void 0!==F)return F;if(!y(e))return e;var N=v(e);if(N){if(F=g(e),!I)return c(e,F)}else{var W=f(e),j=W==k||"[object GeneratorFunction]"==W;if(b(e))return l(e,I);if(W==S||W==C||j&&!R){if(F=D||j?{}:m(e),!I)return D?d(e,o(F,e)):h(e,a(F,e))}else{if(!M[W])return R?e:{};F=A(e,W,I)}}P||(P=new n);var B=P.get(e);if(B)return B;P.set(e,F),_(e)?e.forEach(function(n){F.add(t(n,i,L,n,e,P))}):w(e)&&e.forEach(function(n,s){F.set(s,t(n,i,L,s,e,P))});var H=N?void 0:(O?D?p:u:D?E:x)(e);return s(H||e,function(n,s){H&&(n=e[s=n]),r(F,s,t(n,i,L,s,e,P))}),F}},97160:(t,e,i)=>{var n=i(87563),s=i(29935),r=i(24190),a=i(51946),o=i(61714);function l(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])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l},97685:(t,e,i)=>{var n=i(87937)(i(56552),"DataView");t.exports=n},98124:(t,e,i)=>{var n=i(96614),s=i(69621);t.exports=function(t,e){return n(t,s(t),e)}},98724:(t,e,i)=>{var n=i(27615),s=i(25051),r=i(72154),a=i(48734),o=i(22662);function l(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])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,t.exports=l}}]);
3
+ //# sourceMappingURL=1353.7388baf9.chunk.js.map