@modul/mbui 1.6.2-beta-dev-e5553a74 → 1.6.2-beta-dev-5a123420

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.
@@ -588,7 +588,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
588
588
  border
589
589
  border-input
590
590
  rounded-md
591
- `,c=function(t){var r=t.label;return o.default.createElement("span",{className:"text-light truncate grow"},r)},d=function(t){var r,n=t.selected,i=t.placeholder,a=t.multiple,d=t.isClearable,f=t.onClear,m=t.disabled,h=n.length;return o.default.createElement("span",{className:(0,u.cn)(l,m&&"text-light bg-light")},0===h&&o.default.createElement(c,{label:i}),a&&h>0&&o.default.createElement("span",{className:"grow"},"Выбрано ",h),!a&&h>0&&o.default.createElement("span",{className:"truncate grow"},null==(r=n[0])?void 0:r.label),d&&h>0&&o.default.createElement("button",{onClick:f,className:"ml-2 pointer shrink-0","aria-label":"Очистить поле"},o.default.createElement(s.Cancel,{className:"text-light"})),o.default.createElement(s.DropSmall,{className:"text-light shrink-0"}))};r.ValueWrapper=function(t){var r=t.valueProps,n=t.valueComponent;return o.default.createElement(null!=n?n:d,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach(function(r){var a,o,s;a=t,o=r,s=n[r],(o=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!=i(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(o))in a?Object.defineProperty(a,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[o]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}({},r))}},87936:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(d,{useLayoutEffect:()=>m}),t.exports=c(a({},"__esModule",{value:!0}),d);var f=((t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)))(n(54953)),m=globalThis?.document?f.useLayoutEffect:()=>{}},88047:(t,r)=>{"use strict";r.addLeadingZeros=function(t,r){let n=Math.abs(t).toString().padStart(r,"0");return(t<0?"-":"")+n}},88165:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(d,{usePrevious:()=>m}),t.exports=c(a({},"__esModule",{value:!0}),d);var f=((t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)))(n(54953));function m(t){let r=f.useRef({value:t,previous:t});return f.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}},88251:(t,r,n)=>{"use strict";r.getYear=function(t,r){return(0,i.toDate)(t,r?.in).getFullYear()};var i=n(36339)},88380:function(t,r,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.Week=function(t){let{week:r,...n}=t;return a.default.createElement("tr",{...n})};let a=i(n(54953))},88410:(t,r,n)=>{"use strict";function i(t){return(i="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})(t)}function a(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function o(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach(function(r){var a,o,s;a=t,o=r,s=n[r],(o=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!=i(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(o))in a?Object.defineProperty(a,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[o]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}Object.defineProperty(r,"__esModule",{value:!0}),r.toast=r.Toaster=void 0;var s=(0,n(31635).__importDefault)(n(54953)),u=n(17131),l=n(41469),c=function(t){var r=Object.assign({},(function(t){if(null==t)throw TypeError("Cannot destructure "+t)}(t),t));return s.default.createElement(l.Toaster,o({visibleToasts:1,toastOptions:{unstyled:!0,classNames:{icon:"shrink-0 size-[24px]",toast:"p-3 text-white border-none rounded-md flex w-full shadow-md",description:"text-[14px] leading-[1.125] my-1",content:"grow",actionButton:"shrink-0 py-3 px-6 font-medium",cancelButton:"shrink-0 py-3 px-6 font-medium"}},expand:!0,offset:{top:"calc(var(--safe-area-inset-top, 0) + 8px)",left:8,right:8,bottom:"calc(var(--safe-area-inset-bottom, 10px) + 8px)"},mobileOffset:{top:"calc(var(--safe-area-inset-top, 0) + 8px)",left:8,right:8,bottom:"calc(var(--safe-area-inset-bottom, 0) + 16px)"}},r))};r.Toaster=c,c.displayName="Toaster",r.toast={success:function(t,r){return(0,l.toast)(t,o({position:"top-center",icon:s.default.createElement(u.CheckCircleSolid,null),classNames:{content:"w-[calc(100%-28px)]"},className:"bg-success"},r))},critical:function(t,r){return(0,l.toast)(t,o({position:"top-center",icon:s.default.createElement(u.InfoSolid,null),duration:1/0,classNames:{content:"w-[calc(100%-28px)]"},className:"bg-critical"},r))},snackbar:function(t,r){return(0,l.toast)(t,o({position:"bottom-center",classNames:{toast:"items-center",content:"mt-0"},className:"bg-[--base]"},r))}}},88421:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getInitialMonth=function(t,r){let{month:n,defaultMonth:i,today:a=r.today(),numberOfMonths:o=1,endMonth:s,startMonth:u}=t,l=n||i||a,{differenceInCalendarMonths:c,addMonths:d,startOfMonth:f}=r;return s&&0>c(s,l)&&(l=d(s,-1*(o-1))),u&&0>c(l,u)&&(l=u),f(l)}},88500:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI4IiBmaWxsPSIjZmZmIiByeD0iNCIvPjxtYXNrIGlkPSJhIiB3aWR0aD0iNDAiIGhlaWdodD0iMjgiIHg9IjAiIHk9IjAiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiPjxyZWN0IHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0iI0M0QzRDNCIgcng9IjQiLz48L21hc2s+PGcgbWFzaz0idXJsKCNhKSI+PHBhdGggZmlsbD0iI0ZBMzg0MyIgZD0iTTAgMGg0MHYyOEgweiIvPjxnIGZpbHRlcj0idXJsKCNiKSI+PGVsbGlwc2UgY3g9IjQwLjUzIiBjeT0iNy4xOCIgZmlsbD0iIzAyNThGRiIgcng9IjEzLjU4IiByeT0iMTAuNyIgdHJhbnNmb3JtPSJyb3RhdGUoMTMuMDEgNDAuNTMgNy4xOCkiLz48L2c+PGcgZmlsdGVyPSJ1cmwoI2MpIj48ZWxsaXBzZSBjeD0iMzMuMjQiIGN5PSIyMi41MyIgZmlsbD0idXJsKCNkKSIgcng9IjE2LjI5IiByeT0iMTMuMDciIHRyYW5zZm9ybT0icm90YXRlKC0xMy4zMiAzMy4yNCAyMi41MykiLz48L2c+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik04IDExdjYuOTdoMi4yM3YtMy43M2guMjRsMS4yNCAzLjczaDFsMS4yMy0zLjczaC4yNXYzLjczaDIuMjJWMTFIMTQuMnMtLjY1IDAtMSAxYy0uNzkgMi4zMy0uOTggMi45OC0uOTggMi45OHMtLjEtLjM1LTEtMi45OGMtLjM0LTEtLjk4LTEtLjk4LTF6bTkuNCAwdjYuOTdoMS45OHMuNSAwIC43NC0uNWwxLjc0LTMuNDhoLjI0djMuOThoMi4yM1YxMWgtMS45OHMtLjUuMDUtLjc0LjVsLTEuNzMgMy40OGgtLjI1VjExem03LjUyIDBoNC42YzEuNCAwIDIuNDggMS4xIDIuNDggMi40OSAwIC4xNSAwIC4zNS0uMDUuNWgtMy42NmMtMS42MyAwLTMuMTItMS40NS0zLjM3LTIuOTltLjQgNi45N3YtMy43NGg2LjUzYy0uMyAxLTEuMjQgMS43NS0yLjMyIDEuNzVoLTEuOTh2MS45OXoiLz48ZGVmcz48ZmlsdGVyIGlkPSJiIiB3aWR0aD0iNDcuMjIiIGhlaWdodD0iNDIuMDUiIHg9IjE2LjkyIiB5PSItMTMuODUiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDMiIHN0ZERldmlhdGlvbj0iNS4wOCIvPjwvZmlsdGVyPjxmaWx0ZXIgaWQ9ImMiIHdpZHRoPSI1Ny4xMyIgaGVpZ2h0PSI1MS4zNyIgeD0iNC42OCIgeT0iLTMuMTYiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDMiIHN0ZERldmlhdGlvbj0iNi4yMSIvPjwvZmlsdGVyPjxsaW5lYXJHcmFkaWVudCBpZD0iZCIgeDE9IjI1Ljc5IiB4Mj0iMzkuODEiIHkxPSI4LjciIHkyPSIyMi4yMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIG9mZnNldD0iLjY4IiBzdG9wLWNvbG9yPSIjOTU0MkZGIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDA1N0ZGIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+"},88551:(t,r,n)=>{"use strict";r.differenceInMinutes=function(t,r,n){let s=(0,o.differenceInMilliseconds)(t,r)/a.millisecondsInMinute;return(0,i.getRoundingMethod)(n?.roundingMethod)(s)};var i=n(16318),a=n(11179),o=n(7894)},88825:(t,r,n)=>{"use strict";r.lightFormat=function(t,r){let n=(0,o.toDate)(t);if(!(0,a.isValid)(n))throw RangeError("Invalid time value");let d=r.match(s);return d?d.map(t=>{if("''"===t)return"'";let r=t[0];if("'"===r){var a=t;let r=a.match(u);return r?r[1].replace(l,"'"):a}let o=i.lightFormatters[r];if(o)return o(n,t);if(r.match(c))throw RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return t}).join(""):""},Object.defineProperty(r,"lightFormatters",{enumerable:!0,get:function(){return i.lightFormatters}});var i=n(78146),a=n(33266),o=n(36339);let s=/(\w)\1*|''|'(''|[^'])+('|$)|./g,u=/^'([^]*?)'?$/,l=/''/g,c=/[a-zA-Z]/},88912:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Textarea=void 0;var i=n(15772);Object.defineProperty(r,"Textarea",{enumerable:!0,get:function(){return i.Textarea}})},88924:(t,r,n)=>{"use strict";r.isThisSecond=function(t){return(0,a.isSameSecond)(t,(0,i.constructNow)(t))};var i=n(25017),a=n(14954)},89189:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(d,{FocusScope:()=>M,Root:()=>P}),t.exports=c(a({},"__esModule",{value:!0}),d);var f=((t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)))(n(54953)),m=n(91355),h=n(62053),p=n(37119),g=n(74848),b="focusScope.autoFocusOnMount",y="focusScope.autoFocusOnUnmount",v={bubbles:!1,cancelable:!0},M=f.forwardRef((t,r)=>{let{loop:n=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=t,[u,l]=f.useState(null),c=(0,p.useCallbackRef)(a),d=(0,p.useCallbackRef)(o),M=f.useRef(null),S=(0,m.useComposedRefs)(r,t=>l(t)),P=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(i){let t=function(t){if(P.paused||!u)return;let r=t.target;u.contains(r)?M.current=r:w(M.current,{select:!0})},r=function(t){if(P.paused||!u)return;let r=t.relatedTarget;null!==r&&(u.contains(r)||w(M.current,{select:!0}))};document.addEventListener("focusin",t),document.addEventListener("focusout",r);let n=new MutationObserver(function(t){if(document.activeElement===document.body)for(let r of t)r.removedNodes.length>0&&w(u)});return u&&n.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",t),document.removeEventListener("focusout",r),n.disconnect()}}},[i,u,P.paused]),f.useEffect(()=>{if(u){I.add(P);let t=document.activeElement;if(!u.contains(t)){let r=new CustomEvent(b,v);u.addEventListener(b,c),u.dispatchEvent(r),r.defaultPrevented||(function(t,{select:r=!1}={}){let n=document.activeElement;for(let i of t)if(w(i,{select:r}),document.activeElement!==n)return}(j(u).filter(t=>"A"!==t.tagName),{select:!0}),document.activeElement===t&&w(u))}return()=>{u.removeEventListener(b,c),setTimeout(()=>{let r=new CustomEvent(y,v);u.addEventListener(y,d),u.dispatchEvent(r),r.defaultPrevented||w(t??document.body,{select:!0}),u.removeEventListener(y,d),I.remove(P)},0)}}},[u,c,d,P]);let N=f.useCallback(t=>{if(!n&&!i||P.paused)return;let r="Tab"===t.key&&!t.altKey&&!t.ctrlKey&&!t.metaKey,a=document.activeElement;if(r&&a){let r=t.currentTarget,[i,o]=function(t){let r=j(t);return[A(r,t),A(r.reverse(),t)]}(r);i&&o?t.shiftKey||a!==o?t.shiftKey&&a===i&&(t.preventDefault(),n&&w(o,{select:!0})):(t.preventDefault(),n&&w(i,{select:!0})):a===r&&t.preventDefault()}},[n,i,P.paused]);return(0,g.jsx)(h.Primitive.div,{tabIndex:-1,...s,ref:S,onKeyDown:N})});function j(t){let r=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>{let r="INPUT"===t.tagName&&"hidden"===t.type;return t.disabled||t.hidden||r?NodeFilter.FILTER_SKIP:t.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)r.push(n.currentNode);return r}function A(t,r){for(let n of t)if(!function(t,{upTo:r}){if("hidden"===getComputedStyle(t).visibility)return!0;for(;t&&(void 0===r||t!==r);){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}(n,{upTo:r}))return n}function w(t,{select:r=!1}={}){if(t&&t.focus){var n;let i=document.activeElement;t.focus({preventScroll:!0}),t!==i&&(n=t)instanceof HTMLInputElement&&"select"in n&&r&&t.select()}}M.displayName="FocusScope";var I=function(){let t=[];return{add(r){let n=t[0];r!==n&&n?.pause(),(t=S(t,r)).unshift(r)},remove(r){t=S(t,r),t[0]?.resume()}}}();function S(t,r){let n=[...t],i=n.indexOf(r);return -1!==i&&n.splice(i,1),n}var P=M},89286:(t,r,n)=>{"use strict";r.YearParser=void 0;var i=n(9262),a=n(34850);class o extends i.Parser{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,r,n){let i=t=>({year:t,isTwoDigitYear:"yy"===r});switch(r){case"y":return(0,a.mapValue)((0,a.parseNDigits)(4,t),i);case"yo":return(0,a.mapValue)(n.ordinalNumber(t,{unit:"year"}),i);default:return(0,a.mapValue)((0,a.parseNDigits)(r.length,t),i)}}validate(t,r){return r.isTwoDigitYear||r.year>0}set(t,r,n){let i=t.getFullYear();if(n.isTwoDigitYear){let r=(0,a.normalizeTwoDigitYear)(n.year,i);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}let o="era"in r&&1!==r.era?1-n.year:n.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}r.YearParser=o},89379:(t,r,n)=>{"use strict";n.d(r,{A:()=>o});var i=n(64467);function a(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function o(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach(function(r){(0,i.A)(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}},89418:(t,r,n)=>{"use strict";var i=n(27560);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===i[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return i[t]}}))});var a=n(67139);Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===a[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return a[t]}}))});var o=n(51700);Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===o[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return o[t]}}))});var s=n(26921);Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===s[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return s[t]}}))});var u=n(40848);Object.keys(u).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===u[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return u[t]}}))});var l=n(73458);Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===l[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return l[t]}}))})},89455:function(t,r,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.PreviousMonthButton=function(t){let{components:r}=(0,o.useDayPicker)();return a.default.createElement(r.Button,{...t})};let a=i(n(54953)),o=n(94832)},89596:(t,r,n)=>{"use strict";r.endOfDecade=function(t,r){let n=(0,i.toDate)(t,r?.in),a=9+10*Math.floor(n.getFullYear()/10);return n.setFullYear(a,11,31),n.setHours(23,59,59,999),n};var i=n(36339)},89602:(t,r,n)=>{"use strict";r.secondsToMilliseconds=function(t){return t*i.millisecondsInSecond};var i=n(11179)},89654:(t,r,n)=>{"use strict";function i(t){return(i="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})(t)}var a=["className","children"];function o(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function s(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?o(Object(n),!0).forEach(function(r){var a,o,s;a=t,o=r,s=n[r],(o=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!=i(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(o))in a?Object.defineProperty(a,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[o]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}Object.defineProperty(r,"__esModule",{value:!0}),r.Skeleton=void 0;var u=(0,n(31635).__importDefault)(n(54953)),l=n(18559),c=function(t){var r=t.className,n=t.children,i=function(t,r){if(null==t)return{};var n,i,a=function(t,r){if(null==t)return{};var n={};for(var i in t)if(({}).hasOwnProperty.call(t,i)){if(-1!==r.indexOf(i))continue;n[i]=t[i]}return n}(t,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],-1===r.indexOf(n)&&({}).propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(t,a);return u.default.createElement("div",s(s({className:r},i),{},{role:"status"}),n)};r.Skeleton=c,c.displayName="Skeleton",c.Item=function(t){var r=t.className;return u.default.createElement("div",{className:(0,l.cn)("animate-pulse bg-[--skeleton-bg] rounded-sm",r)})},c.Item.displayName="Skeleton.Item"},89656:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d=(t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)),f={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(f,{createCollection:()=>y,unstable_createCollection:()=>O}),t.exports=c(a({},"__esModule",{value:!0}),f);var m=d(n(54953)),h=n(95791),p=n(1969),g=n(56490),b=n(74848);function y(t){let r=t+"CollectionProvider",[n,i]=(0,h.createContextScope)(r),[a,o]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=t=>{let{scope:r,children:n}=t,i=m.default.useRef(null),o=m.default.useRef(new Map).current;return(0,b.jsx)(a,{scope:r,itemMap:o,collectionRef:i,children:n})};s.displayName=r;let u=t+"CollectionSlot",l=(0,g.createSlot)(u),c=m.default.forwardRef((t,r)=>{let{scope:n,children:i}=t,a=o(u,n),s=(0,p.useComposedRefs)(r,a.collectionRef);return(0,b.jsx)(l,{ref:s,children:i})});c.displayName=u;let d=t+"CollectionItemSlot",f="data-radix-collection-item",y=(0,g.createSlot)(d),v=m.default.forwardRef((t,r)=>{let{scope:n,children:i,...a}=t,s=m.default.useRef(null),u=(0,p.useComposedRefs)(r,s),l=o(d,n);return m.default.useEffect(()=>(l.itemMap.set(s,{ref:s,...a}),()=>void l.itemMap.delete(s))),(0,b.jsx)(y,{...{[f]:""},ref:u,children:i})});return v.displayName=d,[{Provider:s,Slot:c,ItemSlot:v},function(r){let n=o(t+"CollectionConsumer",r);return m.default.useCallback(()=>{let t=n.collectionRef.current;if(!t)return[];let r=Array.from(t.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((t,n)=>r.indexOf(t.ref.current)-r.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},i]}var v=d(n(54953)),M=n(95791),j=n(1969),A=n(56490),w=new WeakMap,I=class t extends Map{#e;constructor(t){super(t),this.#e=[...super.keys()],w.set(this,!0)}set(t,r){return w.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,r),this}insert(t,r,n){let i,a=this.has(r),o=this.#e.length,s=P(t),u=s>=0?s:o+s,l=u<0||u>=o?-1:u;if(l===this.size||a&&l===this.size-1||-1===l)return this.set(r,n),this;let c=this.size+ +!a;s<0&&u++;let d=[...this.#e],f=!1;for(let t=u;t<c;t++)if(u===t){let o=d[t];d[t]===r&&(o=d[t+1]),a&&this.delete(r),i=this.get(o),this.set(r,n)}else{f||d[t-1]!==r||(f=!0);let n=d[f?t:t-1],a=i;i=this.get(n),this.delete(n),this.set(n,a)}return this}with(r,n,i){let a=new t(this);return a.insert(r,n,i),a}before(t){let r=this.#e.indexOf(t)-1;if(!(r<0))return this.entryAt(r)}setBefore(t,r,n){let i=this.#e.indexOf(t);return -1===i?this:this.insert(i,r,n)}after(t){let r=this.#e.indexOf(t);if(-1!==(r=-1===r||r===this.size-1?-1:r+1))return this.entryAt(r)}setAfter(t,r,n){let i=this.#e.indexOf(t);return -1===i?this:this.insert(i+1,r,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let r=super.delete(t);return r&&this.#e.splice(this.#e.indexOf(t),1),r}deleteAt(t){let r=this.keyAt(t);return void 0!==r&&this.delete(r)}at(t){let r=S(this.#e,t);if(void 0!==r)return this.get(r)}entryAt(t){let r=S(this.#e,t);if(void 0!==r)return[r,this.get(r)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return S(this.#e,t)}from(t,r){let n=this.indexOf(t);if(-1===n)return;let i=n+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(t,r){let n=this.indexOf(t);if(-1===n)return;let i=n+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(t,r){let n=0;for(let i of this){if(Reflect.apply(t,r,[i,n,this]))return i;n++}}findIndex(t,r){let n=0;for(let i of this){if(Reflect.apply(t,r,[i,n,this]))return n;n++}return -1}filter(r,n){let i=[],a=0;for(let t of this)Reflect.apply(r,n,[t,a,this])&&i.push(t),a++;return new t(i)}map(r,n){let i=[],a=0;for(let t of this)i.push([t[0],Reflect.apply(r,n,[t,a,this])]),a++;return new t(i)}reduce(...t){let[r,n]=t,i=0,a=n??this.at(0);for(let n of this)a=0===i&&1===t.length?n:Reflect.apply(r,this,[a,n,i,this]),i++;return a}reduceRight(...t){let[r,n]=t,i=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let a=this.at(n);i=n===this.size-1&&1===t.length?a:Reflect.apply(r,this,[i,a,n,this])}return i}toSorted(r){return new t([...this.entries()].sort(r))}toReversed(){let r=new t;for(let t=this.size-1;t>=0;t--){let n=this.keyAt(t),i=this.get(n);r.set(n,i)}return r}toSpliced(...r){let n=[...this.entries()];return n.splice(...r),new t(n)}slice(r,n){let i=new t,a=this.size-1;if(void 0===r)return i;r<0&&(r+=this.size),void 0!==n&&n>0&&(a=n-1);for(let t=r;t<=a;t++){let r=this.keyAt(t),n=this.get(r);i.set(r,n)}return i}every(t,r){let n=0;for(let i of this){if(!Reflect.apply(t,r,[i,n,this]))return!1;n++}return!0}some(t,r){let n=0;for(let i of this){if(Reflect.apply(t,r,[i,n,this]))return!0;n++}return!1}};function S(t,r){if("at"in Array.prototype)return Array.prototype.at.call(t,r);let n=function(t,r){let n=t.length,i=P(r),a=i>=0?i:n+i;return a<0||a>=n?-1:a}(t,r);return -1===n?void 0:t[n]}function P(t){return t!=t||0===t?0:Math.trunc(t)}var N=n(74848);function O(t){let r=t+"CollectionProvider",[n,i]=(0,M.createContextScope)(r),[a,o]=n(r,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new I,setItemMap:()=>void 0}),s=({state:t,...r})=>t?(0,N.jsx)(l,{...r,state:t}):(0,N.jsx)(u,{...r});s.displayName=r;let u=t=>{let r=g();return(0,N.jsx)(l,{...t,state:r})};u.displayName=r+"Init";let l=t=>{let{scope:r,children:n,state:i}=t,o=v.default.useRef(null),[s,u]=v.default.useState(null),l=(0,j.useComposedRefs)(o,u),[c,d]=i;return v.default.useEffect(()=>{var t;if(!s)return;let r=(t=()=>{},new MutationObserver(r=>{for(let n of r)if("childList"===n.type)return void t()}));return r.observe(s,{childList:!0,subtree:!0}),()=>{r.disconnect()}},[s]),(0,N.jsx)(a,{scope:r,itemMap:c,setItemMap:d,collectionRef:l,collectionRefObject:o,collectionElement:s,children:n})};l.displayName=r+"Impl";let c=t+"CollectionSlot",d=(0,A.createSlot)(c),f=v.default.forwardRef((t,r)=>{let{scope:n,children:i}=t,a=o(c,n),s=(0,j.useComposedRefs)(r,a.collectionRef);return(0,N.jsx)(d,{ref:s,children:i})});f.displayName=c;let m=t+"CollectionItemSlot",h=(0,A.createSlot)(m),p=v.default.forwardRef((t,r)=>{let{scope:n,children:i,...a}=t,s=v.default.useRef(null),[u,l]=v.default.useState(null),c=(0,j.useComposedRefs)(r,s,l),{setItemMap:d}=o(m,n),f=v.default.useRef(a);!function(t,r){if(t===r)return!0;if("object"!=typeof t||"object"!=typeof r||null==t||null==r)return!1;let n=Object.keys(t),i=Object.keys(r);if(n.length!==i.length)return!1;for(let i of n)if(!Object.prototype.hasOwnProperty.call(r,i)||t[i]!==r[i])return!1;return!0}(f.current,a)&&(f.current=a);let p=f.current;return v.default.useEffect(()=>(d(t=>u?t.has(u)?t.set(u,{...p,element:u}).toSorted(x):(t.set(u,{...p,element:u}),t.toSorted(x)):t),()=>{d(t=>u&&t.has(u)?(t.delete(u),new I(t)):t)}),[u,p,d]),(0,N.jsx)(h,{"data-radix-collection-item":"",ref:c,children:i})});function g(){return v.default.useState(new I)}return p.displayName=m,[{Provider:s,Slot:f,ItemSlot:p},{createCollectionScope:i,useCollection:function(r){let{itemMap:n}=o(t+"CollectionConsumer",r);return n},useInitCollection:g}]}function x(t,r){var n;return t[1].element&&r[1].element?(n=t[1].element,r[1].element.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)?-1:1:0}},89742:(t,r,n)=>{"use strict";n.d(r,{A:()=>u});var i=n(10123),a=n(70551),o=n(94188),s=n(71858);function u(t,r){(0,a.A)(1,arguments);var n,u,l,c,d,f,m,h,p=(0,s.q)(),g=(0,o.A)(null!=(n=null!=(u=null!=(l=null!=(c=null==r?void 0:r.weekStartsOn)?c:null==r||null==(d=r.locale)||null==(f=d.options)?void 0:f.weekStartsOn)?l:p.weekStartsOn)?u:null==(m=p.locale)||null==(h=m.options)?void 0:h.weekStartsOn)?n:0);if(!(g>=0&&g<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var b=(0,i.A)(t),y=b.getUTCDay();return b.setUTCDate(b.getUTCDate()-(7*(y<g)+y-g)),b.setUTCHours(0,0,0,0),b}},89875:(t,r,n)=>{"use strict";r.addMilliseconds=function(t,r,n){return(0,i.constructFrom)(n?.in||t,+(0,a.toDate)(t)+r)};var i=n(3539),a=n(36339)},89980:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isPdfRole=a,r.isStructTreeNode=o,r.isStructTreeNodeWithOnlyContentChild=s,r.getRoleAttributes=u,r.getBaseAttributes=l,r.getAttributes=function(t){return t?Object.assign(Object.assign({},u(t)),l(t)):null};let i=n(45831);function a(t){return t in i.PDF_ROLE_TO_HTML_ROLE}function o(t){return"children"in t}function s(t){return!!o(t)&&1===t.children.length&&0 in t.children&&"id"in t.children[0]}function u(t){let r={};if(o(t)){let{role:n}=t,o=n.match(i.HEADING_PATTERN);if(o)r.role="heading",r["aria-level"]=Number(o[1]);else if(a(n)){let t=i.PDF_ROLE_TO_HTML_ROLE[n];t&&(r.role=t)}}return r}function l(t){let r={};if(o(t)){if(void 0!==t.alt&&(r["aria-label"]=t.alt),void 0!==t.lang&&(r.lang=t.lang),s(t)){let[n]=t.children;if(n){let t=l(n);return Object.assign(Object.assign({},r),t)}}}else"id"in t&&(r["aria-owns"]=t.id);return r}},90047:(t,r,n)=>{"use strict";r.eachMinuteOfInterval=function(t,r){let{start:n,end:s}=(0,i.normalizeInterval)(r?.in,t);n.setSeconds(0,0);let u=+n>+s,l=u?+n:+s,c=u?s:n,d=r?.step??1;if(!d)return[];d<0&&(d=-d,u=!u);let f=[];for(;+c<=l;)f.push((0,o.constructFrom)(n,c)),c=(0,a.addMinutes)(c,d);return u?f.reverse():f};var i=n(22111),a=n(75756),o=n(3539)},90151:(t,r,n)=>{"use strict";r.isWeekend=function(t,r){let n=(0,i.toDate)(t,r?.in).getDay();return 0===n||6===n};var i=n(36339)},90181:(t,r,n)=>{var i={"./empty-bg.svg":62874,"./empty.svg":71230,"./mabl5-bg.svg":12772,"./mabl5.svg":77636,"./mamo2-bg.svg":64663,"./mamo2.svg":54353,"./maod2-bg.svg":29562,"./maod2.svg":56766,"./mask.svg":60671,"./mb06-bg.svg":40608,"./mb06.svg":94152,"./mir1-bg.svg":68330,"./mir1.svg":9614,"./mir1d-bg.svg":13658,"./mir1d.svg":77310,"./mirmd-bg.svg":22494,"./mirmd.svg":95802,"./mirn-bg.svg":57823,"./mirn.svg":48153,"./mirp-bg.svg":78089,"./mirp.svg":51327,"./mirs-bg.svg":39948,"./mirs.svg":72300,"./mirsd-bg.svg":92720,"./mirsd.svg":63512,"./mirst-bg.svg":85568,"./mirst.svg":15656,"./mirst2.svg":11914,"./mirt-bg.svg":98165,"./mirt.svg":94867,"./mov02-bg.svg":75067,"./mov02.svg":1549,"./pvd01-bg.svg":70462,"./pvd01.svg":57114,"./vabmo-bg.svg":31590,"./vabmo.svg":43266,"./vb01-bg.svg":21258,"./vb01.svg":93966,"./vb02-bg.svg":90907,"./vb02.svg":4685,"./vb03-bg.svg":5932,"./vb03.svg":69228,"./vb05-bg.svg":49958,"./vb05.svg":95394,"./vb07-bg.svg":87672,"./vb07.svg":18880};function a(t){return n(o(t))}function o(t){if(!n.o(i,t)){var r=Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}return i[t]}a.keys=function(){return Object.keys(i)},a.resolve=o,t.exports=a,a.id=90181},90330:(t,r,n)=>{"use strict";var i=n(54953),a=t=>"checkbox"===t.type,o=t=>t instanceof Date,s=t=>null==t;let u=t=>"object"==typeof t;var l=t=>!s(t)&&!Array.isArray(t)&&u(t)&&!o(t),c=t=>l(t)&&t.target?a(t.target)?t.target.checked:t.target.value:t,d=(t,r)=>t.has((t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t)(r)),f=t=>{let r=t.constructor&&t.constructor.prototype;return l(r)&&r.hasOwnProperty("isPrototypeOf")},m="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function h(t){let r,n=Array.isArray(t);if(t instanceof Date)r=new Date(t);else if(t instanceof Set)r=new Set(t);else{if(m&&(t instanceof Blob||t instanceof FileList)||!n&&!l(t))return t;if(r=n?[]:{},n||f(t))for(let n in t)t.hasOwnProperty(n)&&(r[n]=h(t[n]));else r=t}return r}var p=t=>Array.isArray(t)?t.filter(Boolean):[],g=t=>void 0===t,b=(t,r,n)=>{if(!r||!l(t))return n;let i=p(r.split(/[,[\].]+?/)).reduce((t,r)=>s(t)?t:t[r],t);return g(i)||i===t?g(t[r])?n:t[r]:i},y=t=>"boolean"==typeof t,v=t=>/^\w*$/.test(t),M=t=>p(t.replace(/["|']|\]/g,"").split(/\.|\[/)),j=(t,r,n)=>{let i=-1,a=v(r)?[r]:M(r),o=a.length,s=o-1;for(;++i<o;){let r=a[i],o=n;if(i!==s){let n=t[r];o=l(n)||Array.isArray(n)?n:isNaN(+a[i+1])?{}:[]}if("__proto__"===r)return;t[r]=o,t=t[r]}return t};let A={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},w={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},I="maxLength",S="minLength",P="pattern",N="required",O=i.createContext(null),x=()=>i.useContext(O);var D=(t,r,n,i=!0)=>{let a={defaultValues:r._defaultValues};for(let o in t)Object.defineProperty(a,o,{get:()=>(r._proxyFormState[o]!==w.all&&(r._proxyFormState[o]=!i||w.all),n&&(n[o]=!0),t[o])});return a},L=t=>l(t)&&!Object.keys(t).length,C=(t,r,n,i)=>{n(t);let{name:a,...o}=t;return L(o)||Object.keys(o).length>=Object.keys(r).length||Object.keys(o).find(t=>r[t]===(!i||w.all))},k=t=>Array.isArray(t)?t:[t],E=(t,r,n)=>!t||!r||t===r||k(t).some(t=>t&&(n?t===r:t.startsWith(r)||r.startsWith(t)));function T(t){let r=i.useRef(t);r.current=t,i.useEffect(()=>{let n=!t.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function z(t){let r=x(),{control:n=r.control,disabled:a,name:o,exact:s}=t||{},[u,l]=i.useState(n._formState),c=i.useRef(!0),d=i.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=i.useRef(o);return f.current=o,T({disabled:a,next:t=>c.current&&E(f.current,t.name,s)&&C(t,d.current,n._updateFormState)&&l({...n._formState,...t}),subject:n._subjects.state}),i.useEffect(()=>(c.current=!0,d.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),D(u,n,d.current,!1)}var W=t=>"string"==typeof t,Z=(t,r,n,i,a)=>W(t)?(i&&r.watch.add(t),b(n,t,a)):Array.isArray(t)?t.map(t=>(i&&r.watch.add(t),b(n,t))):(i&&(r.watchAll=!0),n);function R(t){let r=x(),{control:n=r.control,name:a,defaultValue:o,disabled:s,exact:u}=t||{},l=i.useRef(a);l.current=a,T({disabled:s,subject:n._subjects.values,next:t=>{E(l.current,t.name,u)&&d(h(Z(l.current,n._names,t.values||n._formValues,!1,o)))}});let[c,d]=i.useState(n._getWatch(a,o));return i.useEffect(()=>n._removeUnmounted()),c}function Y(t){let r=x(),{name:n,disabled:a,control:o=r.control,shouldUnregister:s}=t,u=d(o._names.array,n),l=R({control:o,name:n,defaultValue:b(o._formValues,n,b(o._defaultValues,n,t.defaultValue)),exact:!0}),f=z({control:o,name:n,exact:!0}),m=i.useRef(o.register(n,{...t.rules,value:l,...y(t.disabled)?{disabled:t.disabled}:{}}));return i.useEffect(()=>{let t=o._options.shouldUnregister||s,r=(t,r)=>{let n=b(o._fields,t);n&&n._f&&(n._f.mount=r)};if(r(n,!0),t){let t=h(b(o._options.defaultValues,n));j(o._defaultValues,n,t),g(b(o._formValues,n))&&j(o._formValues,n,t)}return()=>{(u?t&&!o._state.action:t)?o.unregister(n):r(n,!1)}},[n,o,u,s]),i.useEffect(()=>{b(o._fields,n)&&o._updateDisabledField({disabled:a,fields:o._fields,name:n,value:b(o._fields,n)._f.value})},[a,n,o]),{field:{name:n,value:l,...y(a)||f.disabled?{disabled:f.disabled||a}:{},onChange:i.useCallback(t=>m.current.onChange({target:{value:c(t),name:n},type:A.CHANGE}),[n]),onBlur:i.useCallback(()=>m.current.onBlur({target:{value:b(o._formValues,n),name:n},type:A.BLUR}),[n,o]),ref:i.useCallback(t=>{let r=b(o._fields,n);r&&t&&(r._f.ref={focus:()=>t.focus(),select:()=>t.select(),setCustomValidity:r=>t.setCustomValidity(r),reportValidity:()=>t.reportValidity()})},[o._fields,n])},formState:f,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!b(f.errors,n)},isDirty:{enumerable:!0,get:()=>!!b(f.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!b(f.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!b(f.validatingFields,n)},error:{enumerable:!0,get:()=>b(f.errors,n)}})}}var _=(t,r,n,i,a)=>r?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[i]:a||!0}}:{},G=()=>{let t="undefined"==typeof performance?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let n=(16*Math.random()+t)%16|0;return("x"==r?n:3&n|8).toString(16)})},H=(t,r,n={})=>n.shouldFocus||g(n.shouldFocus)?n.focusName||`${t}.${g(n.focusIndex)?r:n.focusIndex}.`:"",F=t=>({isOnSubmit:!t||t===w.onSubmit,isOnBlur:t===w.onBlur,isOnChange:t===w.onChange,isOnAll:t===w.all,isOnTouch:t===w.onTouched}),V=(t,r,n)=>!n&&(r.watchAll||r.watch.has(t)||[...r.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));let B=(t,r,n,i)=>{for(let a of n||Object.keys(t)){let n=b(t,a);if(n){let{_f:t,...o}=n;if(t){if(t.refs&&t.refs[0]&&r(t.refs[0],a)&&!i||t.ref&&r(t.ref,t.name)&&!i)return!0;if(B(o,r))break}else if(l(o)&&B(o,r))break}}};var U=(t,r,n)=>{let i=k(b(t,n));return j(i,"root",r[n]),j(t,n,i),t},X=t=>"file"===t.type,Q=t=>"function"==typeof t,J=t=>{if(!m)return!1;let r=t?t.ownerDocument:0;return t instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},K=t=>W(t),q=t=>"radio"===t.type,$=t=>t instanceof RegExp;let ee={value:!1,isValid:!1},et={value:!0,isValid:!0};var er=t=>{if(Array.isArray(t)){if(t.length>1){let r=t.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!g(t[0].attributes.value)?g(t[0].value)||""===t[0].value?et:{value:t[0].value,isValid:!0}:et:ee}return ee};let en={isValid:!1,value:null};var ei=t=>Array.isArray(t)?t.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,en):en;function ea(t,r,n="validate"){if(K(t)||Array.isArray(t)&&t.every(K)||y(t)&&!t)return{type:n,message:K(t)?t:"",ref:r}}var eo=t=>l(t)&&!$(t)?t:{value:t,message:""},es=async(t,r,n,i,o)=>{let{ref:u,refs:c,required:d,maxLength:f,minLength:m,min:h,max:p,pattern:v,validate:M,name:j,valueAsNumber:A,mount:w,disabled:O}=t._f,x=b(r,j);if(!w||O)return{};let D=c?c[0]:u,C=t=>{i&&D.reportValidity&&(D.setCustomValidity(y(t)?"":t||""),D.reportValidity())},k={},E=q(u),T=a(u),z=(A||X(u))&&g(u.value)&&g(x)||J(u)&&""===u.value||""===x||Array.isArray(x)&&!x.length,Z=_.bind(null,j,n,k),R=(t,r,n,i=I,a=S)=>{let o=t?r:n;k[j]={type:t?i:a,message:o,ref:u,...Z(t?i:a,o)}};if(o?!Array.isArray(x)||!x.length:d&&(!(E||T)&&(z||s(x))||y(x)&&!x||T&&!er(c).isValid||E&&!ei(c).isValid)){let{value:t,message:r}=K(d)?{value:!!d,message:d}:eo(d);if(t&&(k[j]={type:N,message:r,ref:D,...Z(N,r)},!n))return C(r),k}if(!(z||s(h)&&s(p))){let t,r,i=eo(p),a=eo(h);if(s(x)||isNaN(x)){let n=u.valueAsDate||new Date(x),o=t=>new Date((new Date).toDateString()+" "+t),s="time"==u.type,l="week"==u.type;W(i.value)&&x&&(t=s?o(x)>o(i.value):l?x>i.value:n>new Date(i.value)),W(a.value)&&x&&(r=s?o(x)<o(a.value):l?x<a.value:n<new Date(a.value))}else{let n=u.valueAsNumber||(x?+x:x);s(i.value)||(t=n>i.value),s(a.value)||(r=n<a.value)}if((t||r)&&(R(!!t,i.message,a.message,"max","min"),!n))return C(k[j].message),k}if((f||m)&&!z&&(W(x)||o&&Array.isArray(x))){let t=eo(f),r=eo(m),i=!s(t.value)&&x.length>+t.value,a=!s(r.value)&&x.length<+r.value;if((i||a)&&(R(i,t.message,r.message),!n))return C(k[j].message),k}if(v&&!z&&W(x)){let{value:t,message:r}=eo(v);if($(t)&&!x.match(t)&&(k[j]={type:P,message:r,ref:u,...Z(P,r)},!n))return C(r),k}if(M){if(Q(M)){let t=ea(await M(x,r),D);if(t&&(k[j]={...t,...Z("validate",t.message)},!n))return C(t.message),k}else if(l(M)){let t={};for(let i in M){if(!L(t)&&!n)break;let a=ea(await M[i](x,r),D,i);a&&(t={...a,...Z(i,a.message)},C(a.message),n&&(k[j]=t))}if(!L(t)&&(k[j]={ref:D,...t},!n))return k}}return C(!0),k},eu=(t,r)=>[...t,...k(r)],el=t=>Array.isArray(t)?t.map(()=>{}):void 0;function ec(t,r,n){return[...t.slice(0,r),...k(n),...t.slice(r)]}var ed=(t,r,n)=>Array.isArray(t)?(g(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(r,1)[0]),t):[],ef=(t,r)=>[...k(r),...k(t)],em=(t,r)=>g(r)?[]:function(t,r){let n=0,i=[...t];for(let t of r)i.splice(t-n,1),n++;return p(i).length?i:[]}(t,k(r).sort((t,r)=>t-r)),eh=(t,r,n)=>{[t[r],t[n]]=[t[n],t[r]]};function ep(t,r){let n=Array.isArray(r)?r:v(r)?[r]:M(r),i=1===n.length?t:function(t,r){let n=r.slice(0,-1).length,i=0;for(;i<n;)t=g(t)?i++:t[r[i++]];return t}(t,n),a=n.length-1,o=n[a];return i&&delete i[o],0!==a&&(l(i)&&L(i)||Array.isArray(i)&&function(t){for(let r in t)if(t.hasOwnProperty(r)&&!g(t[r]))return!1;return!0}(i))&&ep(t,n.slice(0,-1)),t}var eg=(t,r,n)=>(t[r]=n,t),eb=()=>{let t=[];return{get observers(){return t},next:r=>{for(let n of t)n.next&&n.next(r)},subscribe:r=>(t.push(r),{unsubscribe:()=>{t=t.filter(t=>t!==r)}}),unsubscribe:()=>{t=[]}}},ey=t=>s(t)||!u(t);function ev(t,r){if(ey(t)||ey(r))return t===r;if(o(t)&&o(r))return t.getTime()===r.getTime();let n=Object.keys(t),i=Object.keys(r);if(n.length!==i.length)return!1;for(let a of n){let n=t[a];if(!i.includes(a))return!1;if("ref"!==a){let t=r[a];if(o(n)&&o(t)||l(n)&&l(t)||Array.isArray(n)&&Array.isArray(t)?!ev(n,t):n!==t)return!1}}return!0}var eM=t=>"select-multiple"===t.type,ej=t=>q(t)||a(t),eA=t=>J(t)&&t.isConnected,ew=t=>{for(let r in t)if(Q(t[r]))return!0;return!1};function eI(t,r={}){let n=Array.isArray(t);if(l(t)||n)for(let n in t)Array.isArray(t[n])||l(t[n])&&!ew(t[n])?(r[n]=Array.isArray(t[n])?[]:{},eI(t[n],r[n])):s(t[n])||(r[n]=!0);return r}var eS=(t,r)=>(function t(r,n,i){let a=Array.isArray(r);if(l(r)||a)for(let a in r)Array.isArray(r[a])||l(r[a])&&!ew(r[a])?g(n)||ey(i[a])?i[a]=Array.isArray(r[a])?eI(r[a],[]):{...eI(r[a])}:t(r[a],s(n)?{}:n[a],i[a]):i[a]=!ev(r[a],n[a]);return i})(t,r,eI(r)),eP=(t,{valueAsNumber:r,valueAsDate:n,setValueAs:i})=>g(t)?t:r?""===t?NaN:t?+t:t:n&&W(t)?new Date(t):i?i(t):t;function eN(t){let r=t.ref;if(!(t.refs?t.refs.every(t=>t.disabled):r.disabled))return X(r)?r.files:q(r)?ei(t.refs).value:eM(r)?[...r.selectedOptions].map(({value:t})=>t):a(r)?er(t.refs).value:eP(g(r.value)?t.ref.value:r.value,t)}var eO=(t,r,n,i)=>{let a={};for(let n of t){let t=b(r,n);t&&j(a,n,t._f)}return{criteriaMode:n,names:[...t],fields:a,shouldUseNativeValidation:i}},ex=t=>g(t)?t:$(t)?t.source:l(t)?$(t.value)?t.value.source:t.value:t;let eD="AsyncFunction";var eL=t=>!(t&&t.validate||!(Q(t.validate)&&t.validate.constructor.name===eD||l(t.validate)&&Object.values(t.validate).find(t=>t.constructor.name===eD))),eC=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function ek(t,r,n){let i=b(t,n);if(i||v(n))return{error:i,name:n};let a=n.split(".");for(;a.length;){let i=a.join("."),o=b(r,i),s=b(t,i);if(o&&!Array.isArray(o)&&n!==i)break;if(s&&s.type)return{name:i,error:s};a.pop()}return{name:n}}var eE=(t,r,n,i,a)=>!a.isOnAll&&(!n&&a.isOnTouch?!(r||t):(n?i.isOnBlur:a.isOnBlur)?!t:!(n?i.isOnChange:a.isOnChange)||t),eT=(t,r)=>!p(b(t,r)).length&&ep(t,r);let ez={mode:w.onSubmit,reValidateMode:w.onChange,shouldFocusError:!0};r.Controller=t=>t.render(Y(t)),r.Form=function(t){let r=x(),[n,a]=i.useState(!1),{control:o=r.control,onSubmit:s,children:u,action:l,method:c="post",headers:d,encType:f,onError:m,render:h,onSuccess:p,validateStatus:g,...y}=t,v=async r=>{let n=!1,i="";await o.handleSubmit(async t=>{let a=new FormData,u="";try{u=JSON.stringify(t)}catch(t){}for(let r of o._names.mount)a.append(r,b(t,r));if(s&&await s({data:t,event:r,method:c,formData:a,formDataJson:u}),l)try{let t=[d&&d["Content-Type"],f].some(t=>t&&t.includes("json")),r=await fetch(l,{method:c,headers:{...d,...f?{"Content-Type":f}:{}},body:t?u:a});r&&(g?!g(r.status):r.status<200||r.status>=300)?(n=!0,m&&m({response:r}),i=String(r.status)):p&&p({response:r})}catch(t){n=!0,m&&m({error:t})}})(r),n&&t.control&&(t.control._subjects.state.next({isSubmitSuccessful:!1}),t.control.setError("root.server",{type:i}))};return i.useEffect(()=>{a(!0)},[]),h?i.createElement(i.Fragment,null,h({submit:v})):i.createElement("form",{noValidate:n,action:l,method:c,encType:f,onSubmit:v,...y},u)},r.FormProvider=t=>{let{children:r,...n}=t;return i.createElement(O.Provider,{value:n},r)},r.appendErrors=_,r.get=b,r.set=j,r.useController=Y,r.useFieldArray=function(t){let r=x(),{control:n=r.control,name:a,keyName:o="id",shouldUnregister:s}=t,[u,l]=i.useState(n._getFieldArray(a)),c=i.useRef(n._getFieldArray(a).map(G)),d=i.useRef(u),f=i.useRef(a),m=i.useRef(!1);f.current=a,d.current=u,n._names.array.add(a),t.rules&&n.register(a,t.rules),T({next:({values:t,name:r})=>{if(r===f.current||!r){let r=b(t,f.current);Array.isArray(r)&&(l(r),c.current=r.map(G))}},subject:n._subjects.array});let p=i.useCallback(t=>{m.current=!0,n._updateFieldArray(a,t)},[n,a]);return i.useEffect(()=>{if(n._state.action=!1,V(a,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!F(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([a]).then(t=>{let r=b(t.errors,a),i=b(n._formState.errors,a);(i?!r&&i.type||r&&(i.type!==r.type||i.message!==r.message):r&&r.type)&&(r?j(n._formState.errors,a,r):ep(n._formState.errors,a),n._subjects.state.next({errors:n._formState.errors}))});else{let t=b(n._fields,a);!t||!t._f||F(n._options.reValidateMode).isOnSubmit&&F(n._options.mode).isOnSubmit||es(t,n._formValues,n._options.criteriaMode===w.all,n._options.shouldUseNativeValidation,!0).then(t=>!L(t)&&n._subjects.state.next({errors:U(n._formState.errors,t,a)}))}n._subjects.values.next({name:a,values:{...n._formValues}}),n._names.focus&&B(n._fields,(t,r)=>{if(n._names.focus&&r.startsWith(n._names.focus)&&t.focus)return t.focus(),1}),n._names.focus="",n._updateValid(),m.current=!1},[u,a,n]),i.useEffect(()=>(b(n._formValues,a)||n._updateFieldArray(a),()=>{(n._options.shouldUnregister||s)&&n.unregister(a)}),[a,n,o,s]),{swap:i.useCallback((t,r)=>{let i=n._getFieldArray(a);eh(i,t,r),eh(c.current,t,r),p(i),l(i),n._updateFieldArray(a,i,eh,{argA:t,argB:r},!1)},[p,a,n]),move:i.useCallback((t,r)=>{let i=n._getFieldArray(a);ed(i,t,r),ed(c.current,t,r),p(i),l(i),n._updateFieldArray(a,i,ed,{argA:t,argB:r},!1)},[p,a,n]),prepend:i.useCallback((t,r)=>{let i=k(h(t)),o=ef(n._getFieldArray(a),i);n._names.focus=H(a,0,r),c.current=ef(c.current,i.map(G)),p(o),l(o),n._updateFieldArray(a,o,ef,{argA:el(t)})},[p,a,n]),append:i.useCallback((t,r)=>{let i=k(h(t)),o=eu(n._getFieldArray(a),i);n._names.focus=H(a,o.length-1,r),c.current=eu(c.current,i.map(G)),p(o),l(o),n._updateFieldArray(a,o,eu,{argA:el(t)})},[p,a,n]),remove:i.useCallback(t=>{let r=em(n._getFieldArray(a),t);c.current=em(c.current,t),p(r),l(r),n._updateFieldArray(a,r,em,{argA:t})},[p,a,n]),insert:i.useCallback((t,r,i)=>{let o=k(h(r)),s=ec(n._getFieldArray(a),t,o);n._names.focus=H(a,t,i),c.current=ec(c.current,t,o.map(G)),p(s),l(s),n._updateFieldArray(a,s,ec,{argA:t,argB:el(r)})},[p,a,n]),update:i.useCallback((t,r)=>{let i=h(r),o=eg(n._getFieldArray(a),t,i);c.current=[...o].map((r,n)=>r&&n!==t?c.current[n]:G()),p(o),l([...o]),n._updateFieldArray(a,o,eg,{argA:t,argB:i},!0,!1)},[p,a,n]),replace:i.useCallback(t=>{let r=k(h(t));c.current=r.map(G),p([...r]),l([...r]),n._updateFieldArray(a,[...r],t=>t,{},!0,!1)},[p,a,n]),fields:i.useMemo(()=>u.map((t,r)=>({...t,[o]:c.current[r]||G()})),[u,o])}},r.useForm=function(t={}){let r=i.useRef(),n=i.useRef(),[u,f]=i.useState({isDirty:!1,isValidating:!1,isLoading:Q(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Q(t.defaultValues)?void 0:t.defaultValues});r.current||(r.current={...function(t={}){let r,n={...ez,...t},i={submitCount:0,isDirty:!1,isLoading:Q(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},u={},f=(l(n.defaultValues)||l(n.values))&&h(n.defaultValues||n.values)||{},v=n.shouldUnregister?{}:h(f),M={action:!1,mount:!1,watch:!1},I={mount:new Set,unMount:new Set,array:new Set,watch:new Set},S=0,P={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},N={values:eb(),array:eb(),state:eb()},O=F(n.mode),x=F(n.reValidateMode),D=n.criteriaMode===w.all,C=async t=>{if(P.isValid||t){let t=n.resolver?L((await Y()).errors):await _(u,!0);t!==i.isValid&&N.state.next({isValid:t})}},E=(t,r)=>{(P.isValidating||P.validatingFields)&&((t||Array.from(I.mount)).forEach(t=>{t&&(r?j(i.validatingFields,t,r):ep(i.validatingFields,t))}),N.state.next({validatingFields:i.validatingFields,isValidating:!L(i.validatingFields)}))},T=(t,r,n,i)=>{let a=b(u,t);if(a){let o=b(v,t,g(n)?b(f,t):n);g(o)||i&&i.defaultChecked||r?j(v,t,r?o:eN(a._f)):K(t,o),M.mount&&C()}},z=(t,r,n,a,o)=>{let s=!1,l=!1,c={name:t},d=!!(b(u,t)&&b(u,t)._f&&b(u,t)._f.disabled);if(!n||a){P.isDirty&&(l=i.isDirty,i.isDirty=c.isDirty=G(),s=l!==c.isDirty);let n=d||ev(b(f,t),r);l=!(d||!b(i.dirtyFields,t)),n||d?ep(i.dirtyFields,t):j(i.dirtyFields,t,!0),c.dirtyFields=i.dirtyFields,s=s||P.dirtyFields&&!n!==l}if(n){let r=b(i.touchedFields,t);r||(j(i.touchedFields,t,n),c.touchedFields=i.touchedFields,s=s||P.touchedFields&&r!==n)}return s&&o&&N.state.next(c),s?c:{}},R=(n,a,o,s)=>{var u;let l=b(i.errors,n),c=P.isValid&&y(a)&&i.isValid!==a;if(t.delayError&&o?(u=()=>{j(i.errors,n,o),N.state.next({errors:i.errors})},(r=t=>{clearTimeout(S),S=setTimeout(u,t)})(t.delayError)):(clearTimeout(S),r=null,o?j(i.errors,n,o):ep(i.errors,n)),(o?!ev(l,o):l)||!L(s)||c){let t={...s,...c&&y(a)?{isValid:a}:{},errors:i.errors,name:n};i={...i,...t},N.state.next(t)}},Y=async t=>{E(t,!0);let r=await n.resolver(v,n.context,eO(t||I.mount,u,n.criteriaMode,n.shouldUseNativeValidation));return E(t),r},_=async(t,r,a={valid:!0})=>{for(let o in t){let s=t[o];if(s){let{_f:t,...u}=s;if(t){let u=I.array.has(t.name),l=s._f&&eL(s._f);l&&P.validatingFields&&E([o],!0);let c=await es(s,v,D,n.shouldUseNativeValidation&&!r,u);if(l&&P.validatingFields&&E([o]),c[t.name]&&(a.valid=!1,r))break;r||(b(c,t.name)?u?U(i.errors,c,t.name):j(i.errors,t.name,c[t.name]):ep(i.errors,t.name))}L(u)||await _(u,r,a)}}return a.valid},G=(t,r)=>(t&&r&&j(v,t,r),!ev(en(),f)),H=(t,r,n)=>Z(t,I,{...M.mount?v:g(r)?f:W(t)?{[t]:r}:r},n,r),K=(t,r,n={})=>{let i=b(u,t),o=r;if(i){let n=i._f;n&&(n.disabled||j(v,t,eP(r,n)),o=J(n.ref)&&s(r)?"":r,eM(n.ref)?[...n.ref.options].forEach(t=>t.selected=o.includes(t.value)):n.refs?a(n.ref)?n.refs.length>1?n.refs.forEach(t=>(!t.defaultChecked||!t.disabled)&&(t.checked=Array.isArray(o)?!!o.find(r=>r===t.value):o===t.value)):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach(t=>t.checked=t.value===o):X(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||N.values.next({name:t,values:{...v}})))}(n.shouldDirty||n.shouldTouch)&&z(t,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&er(t)},q=(t,r,n)=>{for(let i in r){let a=r[i],s=`${t}.${i}`,l=b(u,s);!I.array.has(t)&&ey(a)&&(!l||l._f)||o(a)?K(s,a,n):q(s,a,n)}},$=(t,r,n={})=>{let a=b(u,t),o=I.array.has(t),l=h(r);j(v,t,l),o?(N.array.next({name:t,values:{...v}}),(P.isDirty||P.dirtyFields)&&n.shouldDirty&&N.state.next({name:t,dirtyFields:eS(f,v),isDirty:G(t,l)})):!a||a._f||s(l)?K(t,l,n):q(t,l,n),V(t,I)&&N.state.next({...i}),N.values.next({name:M.mount?t:void 0,values:{...v}})},ee=async a=>{M.mount=!0;let o=a.target,s=o.name,l=!0,d=b(u,s),f=t=>{l=Number.isNaN(t)||ev(t,b(v,s,t))};if(d){let m,h,p=o.type?eN(d._f):c(a),g=a.type===A.BLUR||a.type===A.FOCUS_OUT,y=!eC(d._f)&&!n.resolver&&!b(i.errors,s)&&!d._f.deps||eE(g,b(i.touchedFields,s),i.isSubmitted,x,O),M=V(s,I,g);j(v,s,p),g?(d._f.onBlur&&d._f.onBlur(a),r&&r(0)):d._f.onChange&&d._f.onChange(a);let w=z(s,p,g,!1),S=!L(w)||M;if(g||N.values.next({name:s,type:a.type,values:{...v}}),y)return P.isValid&&("onBlur"===t.mode?g&&C():C()),S&&N.state.next({name:s,...M?{}:w});if(!g&&M&&N.state.next({...i}),n.resolver){let{errors:t}=await Y([s]);if(f(p),l){let r=ek(i.errors,u,s),n=ek(t,u,r.name||s);m=n.error,s=n.name,h=L(t)}}else E([s],!0),m=(await es(d,v,D,n.shouldUseNativeValidation))[s],E([s]),f(p),l&&(m?h=!1:P.isValid&&(h=await _(u,!0)));l&&(d._f.deps&&er(d._f.deps),R(s,h,m,w))}},et=(t,r)=>{if(b(i.errors,r)&&t.focus)return t.focus(),1},er=async(t,r={})=>{let a,o,s=k(t);if(n.resolver){let r=await (async t=>{let{errors:r}=await Y(t);if(t)for(let n of t){let t=b(r,n);t?j(i.errors,n,t):ep(i.errors,n)}else i.errors=r;return r})(g(t)?t:s);a=L(r),o=t?!s.some(t=>b(r,t)):a}else t?((o=(await Promise.all(s.map(async t=>{let r=b(u,t);return await _(r&&r._f?{[t]:r}:r)}))).every(Boolean))||i.isValid)&&C():o=a=await _(u);return N.state.next({...!W(t)||P.isValid&&a!==i.isValid?{}:{name:t},...n.resolver||!t?{isValid:a}:{},errors:i.errors}),r.shouldFocus&&!o&&B(u,et,t?s:I.mount),o},en=t=>{let r={...M.mount?v:f};return g(t)?r:W(t)?b(r,t):t.map(t=>b(r,t))},ei=(t,r)=>({invalid:!!b((r||i).errors,t),isDirty:!!b((r||i).dirtyFields,t),error:b((r||i).errors,t),isValidating:!!b(i.validatingFields,t),isTouched:!!b((r||i).touchedFields,t)}),ea=(t,r,n)=>{let a=(b(u,t,{_f:{}})._f||{}).ref,{ref:o,message:s,type:l,...c}=b(i.errors,t)||{};j(i.errors,t,{...c,...r,ref:a}),N.state.next({name:t,errors:i.errors,isValid:!1}),n&&n.shouldFocus&&a&&a.focus&&a.focus()},eo=(t,r={})=>{for(let a of t?k(t):I.mount)I.mount.delete(a),I.array.delete(a),r.keepValue||(ep(u,a),ep(v,a)),r.keepError||ep(i.errors,a),r.keepDirty||ep(i.dirtyFields,a),r.keepTouched||ep(i.touchedFields,a),r.keepIsValidating||ep(i.validatingFields,a),n.shouldUnregister||r.keepDefaultValue||ep(f,a);N.values.next({values:{...v}}),N.state.next({...i,...r.keepDirty?{isDirty:G()}:{}}),r.keepIsValid||C()},eu=({disabled:t,name:r,field:n,fields:i,value:a})=>{if(y(t)&&M.mount||t){let o=t?void 0:g(a)?eN(n?n._f:b(i,r)._f):a;j(v,r,o),z(r,o,!1,!1,!0)}},el=(r,i={})=>{let a=b(u,r),o=y(i.disabled)||y(t.disabled);return j(u,r,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:r}},name:r,mount:!0,...i}}),I.mount.add(r),a?eu({field:a,disabled:y(i.disabled)?i.disabled:t.disabled,name:r,value:i.value}):T(r,!0,i.value),{...o?{disabled:i.disabled||t.disabled}:{},...n.progressive?{required:!!i.required,min:ex(i.min),max:ex(i.max),minLength:ex(i.minLength),maxLength:ex(i.maxLength),pattern:ex(i.pattern)}:{},name:r,onChange:ee,onBlur:ee,ref:t=>{if(t){el(r,i),a=b(u,r);let n=g(t.value)&&t.querySelectorAll&&t.querySelectorAll("input,select,textarea")[0]||t,o=ej(n),s=a._f.refs||[];(o?s.find(t=>t===n):n===a._f.ref)||(j(u,r,{_f:{...a._f,...o?{refs:[...s.filter(eA),n,...Array.isArray(b(f,r))?[{}]:[]],ref:{type:n.type,name:r}}:{ref:n}}}),T(r,!1,void 0,n))}else(a=b(u,r,{}))._f&&(a._f.mount=!1),(n.shouldUnregister||i.shouldUnregister)&&(!d(I.array,r)||!M.action)&&I.unMount.add(r)}}},ec=()=>n.shouldFocusError&&B(u,et,I.mount),ed=(t,r)=>async a=>{let o;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let s=h(v);if(N.state.next({isSubmitting:!0}),n.resolver){let{errors:t,values:r}=await Y();i.errors=t,s=r}else await _(u);if(ep(i.errors,"root"),L(i.errors)){N.state.next({errors:{}});try{await t(s,a)}catch(t){o=t}}else r&&await r({...i.errors},a),ec(),setTimeout(ec);if(N.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:L(i.errors)&&!o,submitCount:i.submitCount+1,errors:i.errors}),o)throw o},ef=(r,n={})=>{let a=r?h(r):f,o=h(a),s=L(r),l=s?f:o;if(n.keepDefaultValues||(f=a),!n.keepValues){if(n.keepDirtyValues)for(let t of I.mount)b(i.dirtyFields,t)?j(l,t,b(v,t)):$(t,b(l,t));else{if(m&&g(r))for(let t of I.mount){let r=b(u,t);if(r&&r._f){let t=Array.isArray(r._f.refs)?r._f.refs[0]:r._f.ref;if(J(t)){let r=t.closest("form");if(r){r.reset();break}}}}u={}}v=t.shouldUnregister?n.keepDefaultValues?h(f):{}:h(l),N.array.next({values:{...l}}),N.values.next({values:{...l}})}I={mount:n.keepDirtyValues?I.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},M.mount=!P.isValid||!!n.keepIsValid||!!n.keepDirtyValues,M.watch=!!t.shouldUnregister,N.state.next({submitCount:n.keepSubmitCount?i.submitCount:0,isDirty:!s&&(n.keepDirty?i.isDirty:!(!n.keepDefaultValues||ev(r,f))),isSubmitted:!!n.keepIsSubmitted&&i.isSubmitted,dirtyFields:s?{}:n.keepDirtyValues?n.keepDefaultValues&&v?eS(f,v):i.dirtyFields:n.keepDefaultValues&&r?eS(f,r):n.keepDirty?i.dirtyFields:{},touchedFields:n.keepTouched?i.touchedFields:{},errors:n.keepErrors?i.errors:{},isSubmitSuccessful:!!n.keepIsSubmitSuccessful&&i.isSubmitSuccessful,isSubmitting:!1})},em=(t,r)=>ef(Q(t)?t(v):t,r);return{control:{register:el,unregister:eo,getFieldState:ei,handleSubmit:ed,setError:ea,_executeSchema:Y,_getWatch:H,_getDirty:G,_updateValid:C,_removeUnmounted:()=>{for(let t of I.unMount){let r=b(u,t);r&&(r._f.refs?r._f.refs.every(t=>!eA(t)):!eA(r._f.ref))&&eo(t)}I.unMount=new Set},_updateFieldArray:(t,r=[],n,a,o=!0,s=!0)=>{if(a&&n){if(M.action=!0,s&&Array.isArray(b(u,t))){let r=n(b(u,t),a.argA,a.argB);o&&j(u,t,r)}if(s&&Array.isArray(b(i.errors,t))){let r=n(b(i.errors,t),a.argA,a.argB);o&&j(i.errors,t,r),eT(i.errors,t)}if(P.touchedFields&&s&&Array.isArray(b(i.touchedFields,t))){let r=n(b(i.touchedFields,t),a.argA,a.argB);o&&j(i.touchedFields,t,r)}P.dirtyFields&&(i.dirtyFields=eS(f,v)),N.state.next({name:t,isDirty:G(t,r),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else j(v,t,r)},_updateDisabledField:eu,_getFieldArray:r=>p(b(M.mount?v:f,r,t.shouldUnregister?b(f,r,[]):[])),_reset:ef,_resetDefaultValues:()=>Q(n.defaultValues)&&n.defaultValues().then(t=>{em(t,n.resetOptions),N.state.next({isLoading:!1})}),_updateFormState:t=>{i={...i,...t}},_disableForm:t=>{y(t)&&(N.state.next({disabled:t}),B(u,(r,n)=>{let i=b(u,n);i&&(r.disabled=i._f.disabled||t,Array.isArray(i._f.refs)&&i._f.refs.forEach(r=>{r.disabled=i._f.disabled||t}))},0,!1))},_subjects:N,_proxyFormState:P,_setErrors:t=>{i.errors=t,N.state.next({errors:i.errors,isValid:!1})},get _fields(){return u},get _formValues(){return v},get _state(){return M},set _state(e){M=e},get _defaultValues(){return f},get _names(){return I},set _names(e){I=e},get _formState(){return i},set _formState(e){i=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:er,register:el,handleSubmit:ed,watch:(t,r)=>Q(t)?N.values.subscribe({next:n=>t(H(void 0,r),n)}):H(t,r,!0),setValue:$,getValues:en,reset:em,resetField:(t,r={})=>{b(u,t)&&(g(r.defaultValue)?$(t,h(b(f,t))):($(t,r.defaultValue),j(f,t,h(r.defaultValue))),r.keepTouched||ep(i.touchedFields,t),r.keepDirty||(ep(i.dirtyFields,t),i.isDirty=r.defaultValue?G(t,h(b(f,t))):G()),r.keepError||(ep(i.errors,t),P.isValid&&C()),N.state.next({...i}))},clearErrors:t=>{t&&k(t).forEach(t=>ep(i.errors,t)),N.state.next({errors:t?i.errors:{}})},unregister:eo,setError:ea,setFocus:(t,r={})=>{let n=b(u,t),i=n&&n._f;if(i){let t=i.refs?i.refs[0]:i.ref;t.focus&&(t.focus(),r.shouldSelect&&t.select())}},getFieldState:ei}}(t),formState:u});let v=r.current.control;return v._options=t,T({subject:v._subjects.state,next:t=>{C(t,v._proxyFormState,v._updateFormState,!0)&&f({...v._formState})}}),i.useEffect(()=>v._disableForm(t.disabled),[v,t.disabled]),i.useEffect(()=>{if(v._proxyFormState.isDirty){let t=v._getDirty();t!==u.isDirty&&v._subjects.state.next({isDirty:t})}},[v,u.isDirty]),i.useEffect(()=>{t.values&&!ev(t.values,n.current)?(v._reset(t.values,v._options.resetOptions),n.current=t.values,f(t=>({...t}))):v._resetDefaultValues()},[t.values,v]),i.useEffect(()=>{t.errors&&v._setErrors(t.errors)},[t.errors,v]),i.useEffect(()=>{v._state.mount||(v._updateValid(),v._state.mount=!0),v._state.watch&&(v._state.watch=!1,v._subjects.state.next({...v._formState})),v._removeUnmounted()}),i.useEffect(()=>{t.shouldUnregister&&v._subjects.values.next({values:v._getWatch()})},[t.shouldUnregister,v]),r.current.formState=D(u,v),r.current},r.useFormContext=x,r.useFormState=z,r.useWatch=R},90373:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=n(31635);(0,i.__exportStar)(n(98854),r),(0,i.__exportStar)(n(54898),r),(0,i.__exportStar)(n(11839),r)},90433:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=(0,n(54953).createContext)(null)},90825:(t,r,n)=>{"use strict";r.subWeeks=function(t,r,n){return(0,i.addWeeks)(t,-r,n)};var i=n(97460)},90846:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI4IiBmaWxsPSIjZmZmIiByeD0iNCIvPjxtYXNrIGlkPSJhIiB3aWR0aD0iNDAiIGhlaWdodD0iMjgiIHg9IjAiIHk9IjAiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiPjxyZWN0IHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0iI0M0QzRDNCIgcng9IjQiLz48L21hc2s+PGcgbWFzaz0idXJsKCNhKSI+PHBhdGggZmlsbD0iIzA3MkRBMCIgZD0iTTAgMGg0MHYyOEgweiIvPjxnIGZpbHRlcj0idXJsKCNiKSI+PGVsbGlwc2UgY3g9IjguMTIiIGN5PSIyOC41OCIgZmlsbD0iIzA2RiIgcng9IjI0LjczIiByeT0iMTUuNjYiIHRyYW5zZm9ybT0icm90YXRlKDEzLjAxIDguMTIgMjguNTgpIi8+PC9nPjxnIGZpbHRlcj0idXJsKCNjKSI+PGVsbGlwc2UgY3g9IjM0LjI2IiBjeT0iMjQuMDQiIGZpbGw9InVybCgjZCkiIHJ4PSIyNS44MSIgcnk9IjE2LjU1IiB0cmFuc2Zvcm09InJvdGF0ZSgtMTMuMzIgMzQuMjYgMjQuMDQpIi8+PC9nPjwvZz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOCAxMXY2Ljk3aDIuMjN2LTMuNzNoLjI0bDEuMjQgMy43M2gxbDEuMjMtMy43M2guMjV2My43M2gyLjIyVjExSDE0LjJzLS42NSAwLTEgMWMtLjc5IDIuMzMtLjk4IDIuOTgtLjk4IDIuOThzLS4xLS4zNS0xLTIuOThjLS4zNC0xLS45OC0xLS45OC0xem05LjQgMHY2Ljk3aDEuOThzLjUgMCAuNzQtLjVsMS43NC0zLjQ4aC4yNHYzLjk4aDIuMjNWMTFoLTEuOThzLS41LjA1LS43NC41bC0xLjczIDMuNDhoLS4yNVYxMXptNy41MiAwaDQuNmMxLjQgMCAyLjQ4IDEuMSAyLjQ4IDIuNDkgMCAuMTUgMCAuMzUtLjA1LjVoLTMuNjZjLTEuNjMgMC0zLjEyLTEuNDUtMy4zNy0yLjk5bS40IDYuOTd2LTMuNzRoNi41M2MtLjMgMS0xLjI0IDEuNzUtMi4zMiAxLjc1aC0xLjk4djEuOTl6Ii8+PGRlZnM+PGZpbHRlciBpZD0iYiIgd2lkdGg9IjY1LjUzIiBoZWlnaHQ9IjQ5LjMyIiB4PSItMjQuNjUiIHk9IjMuOTIiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDIiIHN0ZERldmlhdGlvbj0iNC4yMSIvPjwvZmlsdGVyPjxmaWx0ZXIgaWQ9ImMiIHdpZHRoPSI3MS40IiBoZWlnaHQ9IjU0Ljk0IiB4PSItMS40NCIgeT0iLTMuNDMiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDIiIHN0ZERldmlhdGlvbj0iNS4xNSIvPjwvZmlsdGVyPjxsaW5lYXJHcmFkaWVudCBpZD0iZCIgeDE9IjMzLjE2IiB4Mj0iMzMuOTYiIHkxPSIzLjI2IiB5Mj0iMjAuMDUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjMDBBM0ZGIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODcwN0I0Ii8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+"},90907:(t,r,n)=>{"use strict";t.exports=n.p+"assets/images/bankcards/vb02-bg.svg"},91100:(t,r,n)=>{"use strict";n.r(r),n.d(r,{AbortException:()=>rG,AnnotationEditorLayer:()=>rH,AnnotationEditorParamsType:()=>rF,AnnotationEditorType:()=>rV,AnnotationEditorUIManager:()=>rB,AnnotationLayer:()=>rU,AnnotationMode:()=>rX,ColorPicker:()=>rQ,DOMSVGFactory:()=>rJ,DrawLayer:()=>rK,FeatureTest:()=>rq,GlobalWorkerOptions:()=>r$,ImageKind:()=>r0,InvalidPDFException:()=>r1,MissingPDFException:()=>r4,OPS:()=>r2,OutputScale:()=>r3,PDFDataRangeTransport:()=>r5,PDFDateString:()=>r9,PDFWorker:()=>r6,PasswordResponses:()=>r8,PermissionFlag:()=>r7,PixelsPerInch:()=>ne,RenderingCancelledException:()=>nt,TextLayer:()=>nr,UnexpectedResponseException:()=>nn,Util:()=>ni,VerbosityLevel:()=>na,XfaLayer:()=>no,build:()=>ns,createValidAbsoluteUrl:()=>nu,fetchData:()=>nl,getDocument:()=>nc,getFilenameFromUrl:()=>nd,getPdfFilenameFromUrl:()=>nf,getXfaPageViewport:()=>nm,isDataScheme:()=>nh,isPdfFile:()=>np,noContextMenu:()=>ng,normalizeUnicode:()=>nb,setLayerDimensions:()=>ny,shadow:()=>nv,version:()=>nM});var i={};i.d=(t,r)=>{for(var n in r)i.o(r,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},i.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);var a=globalThis.pdfjsLib={};i.d(a,{AbortException:()=>T,AnnotationEditorLayer:()=>rY,AnnotationEditorParamsType:()=>f,AnnotationEditorType:()=>d,AnnotationEditorUIManager:()=>ej,AnnotationLayer:()=>rP,AnnotationMode:()=>c,ColorPicker:()=>rz,DOMSVGFactory:()=>t5,DrawLayer:()=>r_,FeatureTest:()=>R,GlobalWorkerOptions:()=>e7,ImageKind:()=>p,InvalidPDFException:()=>L,MissingPDFException:()=>C,OPS:()=>v,OutputScale:()=>ef,PDFDataRangeTransport:()=>tH,PDFDateString:()=>eo,PDFWorker:()=>tU,PasswordResponses:()=>M,PermissionFlag:()=>m,PixelsPerInch:()=>X,RenderingCancelledException:()=>K,TextLayer:()=>tE,UnexpectedResponseException:()=>k,Util:()=>_,VerbosityLevel:()=>y,XfaLayer:()=>t9,build:()=>t0,createValidAbsoluteUrl:()=>P,fetchData:()=>Q,getDocument:()=>tY,getFilenameFromUrl:()=>ee,getPdfFilenameFromUrl:()=>et,getXfaPageViewport:()=>es,isDataScheme:()=>q,isPdfFile:()=>$,noContextMenu:()=>ei,normalizeUnicode:()=>F,setLayerDimensions:()=>ed,shadow:()=>N,version:()=>t$});let o="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),s=[1,0,0,1,0,0],u=[.001,0,0,.001,0,0],l={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},c={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},d={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},f={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},m={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},h={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},p={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},g={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},b={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},y={ERRORS:0,WARNINGS:1,INFOS:5},v={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,setStrokeTransparent:92,setFillTransparent:93},M={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},j=y.WARNINGS;function A(t){j>=y.INFOS&&console.log(`Info: ${t}`)}function w(t){j>=y.WARNINGS&&console.log(`Warning: ${t}`)}function I(t){throw Error(t)}function S(t,r){t||I(r)}function P(t,r=null,n=null){if(!t)return null;try{if(n&&"string"==typeof t){if(n.addDefaultProtocol&&t.startsWith("www.")){let r=t.match(/\./g);r?.length>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{var i;i=t,t=decodeURIComponent(escape(i))}catch{}}let a=r?new URL(t,r):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(a))return a}catch{}return null}function N(t,r,n,i=!1){return Object.defineProperty(t,r,{value:n,enumerable:!i,configurable:!0,writable:!1}),n}let O=function(){function t(t,r){this.message=t,this.name=r}return t.prototype=Error(),t.constructor=t,t}();class x extends O{constructor(t,r){super(t,"PasswordException"),this.code=r}}class D extends O{constructor(t,r){super(t,"UnknownErrorException"),this.details=r}}class L extends O{constructor(t){super(t,"InvalidPDFException")}}class C extends O{constructor(t){super(t,"MissingPDFException")}}class k extends O{constructor(t,r){super(t,"UnexpectedResponseException"),this.status=r}}class E extends O{constructor(t){super(t,"FormatError")}}class T extends O{constructor(t){super(t,"AbortException")}}function z(t){("object"!=typeof t||t?.length===void 0)&&I("Invalid argument for bytesToString");let r=t.length;if(r<8192)return String.fromCharCode.apply(null,t);let n=[];for(let i=0;i<r;i+=8192){let a=Math.min(i+8192,r),o=t.subarray(i,a);n.push(String.fromCharCode.apply(null,o))}return n.join("")}function W(t){"string"!=typeof t&&I("Invalid argument for stringToBytes");let r=t.length,n=new Uint8Array(r);for(let i=0;i<r;++i)n[i]=255&t.charCodeAt(i);return n}function Z(t){let r=Object.create(null);for(let[n,i]of t)r[n]=i;return r}class R{static get isLittleEndian(){return N(this,"isLittleEndian",function(){let t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return N(this,"isEvalSupported",function(){try{return Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return N(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"!=typeof navigator&&"string"==typeof navigator?.platform?N(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:"string"==typeof navigator?.userAgent&&navigator.userAgent.includes("Firefox")}):N(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return N(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}let Y=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class _{static makeHexColor(t,r,n){return`#${Y[t]}${Y[r]}${Y[n]}`}static scaleMinMax(t,r){let n;t[0]?(t[0]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[0],r[2]*=t[0],t[3]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[3],r[3]*=t[3]):(n=r[0],r[0]=r[1],r[1]=n,n=r[2],r[2]=r[3],r[3]=n,t[1]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[1],r[3]*=t[1],t[2]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[2],r[2]*=t[2]),r[0]+=t[4],r[1]+=t[5],r[2]+=t[4],r[3]+=t[5]}static transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}static applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}static applyInverseTransform(t,r){let n=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/n,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/n]}static getAxialAlignedBoundingBox(t,r){let n=this.applyTransform(t,r),i=this.applyTransform(t.slice(2,4),r),a=this.applyTransform([t[0],t[3]],r),o=this.applyTransform([t[2],t[1]],r);return[Math.min(n[0],i[0],a[0],o[0]),Math.min(n[1],i[1],a[1],o[1]),Math.max(n[0],i[0],a[0],o[0]),Math.max(n[1],i[1],a[1],o[1])]}static inverseTransform(t){let r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}static singularValueDecompose2dScale(t){let r=[t[0],t[2],t[1],t[3]],n=t[0]*r[0]+t[1]*r[2],i=t[0]*r[1]+t[1]*r[3],a=t[2]*r[0]+t[3]*r[2],o=t[2]*r[1]+t[3]*r[3],s=(n+o)/2,u=Math.sqrt((n+o)**2-4*(n*o-a*i))/2;return[Math.sqrt(s+u||1),Math.sqrt(s-u||1)]}static normalizeRect(t){let r=t.slice(0);return t[0]>t[2]&&(r[0]=t[2],r[2]=t[0]),t[1]>t[3]&&(r[1]=t[3],r[3]=t[1]),r}static intersect(t,r){let n=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(n>i)return null;let a=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),o=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return a>o?null:[n,a,i,o]}static #t(t,r,n,i,a,o,s,u,l,c){if(l<=0||l>=1)return;let d=1-l,f=l*l,m=f*l,h=d*(d*(d*t+3*l*r)+3*f*n)+m*i,p=d*(d*(d*a+3*l*o)+3*f*s)+m*u;c[0]=Math.min(c[0],h),c[1]=Math.min(c[1],p),c[2]=Math.max(c[2],h),c[3]=Math.max(c[3],p)}static #r(t,r,n,i,a,o,s,u,l,c,d,f){if(1e-12>Math.abs(l)){Math.abs(c)>=1e-12&&this.#t(t,r,n,i,a,o,s,u,-d/c,f);return}let m=c**2-4*d*l;if(m<0)return;let h=Math.sqrt(m),p=2*l;this.#t(t,r,n,i,a,o,s,u,(-c+h)/p,f),this.#t(t,r,n,i,a,o,s,u,(-c-h)/p,f)}static bezierBoundingBox(t,r,n,i,a,o,s,u,l){return l?(l[0]=Math.min(l[0],t,s),l[1]=Math.min(l[1],r,u),l[2]=Math.max(l[2],t,s),l[3]=Math.max(l[3],r,u)):l=[Math.min(t,s),Math.min(r,u),Math.max(t,s),Math.max(r,u)],this.#r(t,n,a,s,r,i,o,u,3*(-t+3*(n-a)+s),6*(t-2*n+a),3*(n-t),l),this.#r(t,n,a,s,r,i,o,u,3*(-r+3*(i-o)+u),6*(r-2*i+o),3*(i-r),l),l}}let G=null,H=null;function F(t){return G||(G=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,H=new Map([["ſt","ſt"]])),t.replaceAll(G,(t,r,n)=>r?r.normalize("NFKC"):H.get(n))}let V="pdfjs_internal_id_",B={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8},U="http://www.w3.org/2000/svg";class X{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Q(t,r="text"){if(en(t,document.baseURI)){let n=await fetch(t);if(!n.ok)throw Error(n.statusText);switch(r){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,i)=>{let a=new XMLHttpRequest;a.open("GET",t,!0),a.responseType=r,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){switch(r){case"arraybuffer":case"blob":case"json":n(a.response);return}n(a.responseText);return}i(Error(a.statusText))}},a.send(null)})}class J{constructor({viewBox:t,scale:r,rotation:n,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){let s,u,l,c,d,f,m,h;this.viewBox=t,this.scale=r,this.rotation=n,this.offsetX=i,this.offsetY=a;let p=(t[2]+t[0])/2,g=(t[3]+t[1])/2;switch((n%=360)<0&&(n+=360),n){case 180:s=-1,u=0,l=0,c=1;break;case 90:s=0,u=1,l=1,c=0;break;case 270:s=0,u=-1,l=-1,c=0;break;case 0:s=1,u=0,l=0,c=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(l=-l,c=-c),0===s?(d=Math.abs(g-t[1])*r+i,f=Math.abs(p-t[0])*r+a,m=(t[3]-t[1])*r,h=(t[2]-t[0])*r):(d=Math.abs(p-t[0])*r+i,f=Math.abs(g-t[1])*r+a,m=(t[2]-t[0])*r,h=(t[3]-t[1])*r),this.transform=[s*r,u*r,l*r,c*r,d-s*r*p-l*r*g,f-u*r*p-c*r*g],this.width=m,this.height=h}get rawDims(){let{viewBox:t}=this;return N(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:r=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new J({viewBox:this.viewBox.slice(),scale:t,rotation:r,offsetX:n,offsetY:i,dontFlip:a})}convertToViewportPoint(t,r){return _.applyTransform([t,r],this.transform)}convertToViewportRectangle(t){let r=_.applyTransform([t[0],t[1]],this.transform),n=_.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],n[0],n[1]]}convertToPdfPoint(t,r){return _.applyInverseTransform([t,r],this.transform)}}class K extends O{constructor(t,r=0){super(t,"RenderingCancelledException"),this.extraDelay=r}}function q(t){let r=t.length,n=0;for(;n<r&&""===t[n].trim();)n++;return"data:"===t.substring(n,n+5).toLowerCase()}function $(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function ee(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function et(t,r="document.pdf"){if("string"!=typeof t)return r;if(q(t))return w('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),r;let n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t),a=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(a&&(a=a[0]).includes("%"))try{a=n.exec(decodeURIComponent(a))[0]}catch{}return a||r}class er{started=Object.create(null);times=[];time(t){t in this.started&&w(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||w(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){let t=[],r=0;for(let{name:t}of this.times)r=Math.max(t.length,r);for(let{name:n,start:i,end:a}of this.times)t.push(`${n.padEnd(r)} ${a-i}ms
591
+ `,c=function(t){var r=t.label;return o.default.createElement("span",{className:"text-light truncate grow"},r)},d=function(t){var r,n=t.selected,i=t.placeholder,a=t.multiple,d=t.isClearable,f=t.onClear,m=t.disabled,h=n.length;return o.default.createElement("span",{className:(0,u.cn)(l,m&&"text-light bg-light")},0===h&&o.default.createElement(c,{label:i}),a&&h>0&&o.default.createElement("span",{className:"grow"},"Выбрано ",h),!a&&h>0&&o.default.createElement("span",{className:"truncate grow"},null==(r=n[0])?void 0:r.label),d&&h>0&&o.default.createElement("button",{onClick:f,className:"ml-2 pointer shrink-0","aria-label":"Очистить поле"},o.default.createElement(s.Cancel,{className:"text-light"})),o.default.createElement(s.DropSmall,{className:"text-light shrink-0"}))};r.ValueWrapper=function(t){var r=t.valueProps,n=t.valueComponent;return o.default.createElement(null!=n?n:d,function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach(function(r){var a,o,s;a=t,o=r,s=n[r],(o=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!=i(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(o))in a?Object.defineProperty(a,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[o]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}({},r))}},87936:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(d,{useLayoutEffect:()=>m}),t.exports=c(a({},"__esModule",{value:!0}),d);var f=((t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)))(n(54953)),m=globalThis?.document?f.useLayoutEffect:()=>{}},88047:(t,r)=>{"use strict";r.addLeadingZeros=function(t,r){let n=Math.abs(t).toString().padStart(r,"0");return(t<0?"-":"")+n}},88165:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(d,{usePrevious:()=>m}),t.exports=c(a({},"__esModule",{value:!0}),d);var f=((t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)))(n(54953));function m(t){let r=f.useRef({value:t,previous:t});return f.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}},88251:(t,r,n)=>{"use strict";r.getYear=function(t,r){return(0,i.toDate)(t,r?.in).getFullYear()};var i=n(36339)},88380:function(t,r,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.Week=function(t){let{week:r,...n}=t;return a.default.createElement("tr",{...n})};let a=i(n(54953))},88410:(t,r,n)=>{"use strict";function i(t){return(i="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})(t)}function a(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function o(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach(function(r){var a,o,s;a=t,o=r,s=n[r],(o=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!=i(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(o))in a?Object.defineProperty(a,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[o]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}Object.defineProperty(r,"__esModule",{value:!0}),r.toast=r.Toaster=void 0;var s=(0,n(31635).__importDefault)(n(54953)),u=n(17131),l=n(41469),c=function(t){var r=Object.assign({},(function(t){if(null==t)throw TypeError("Cannot destructure "+t)}(t),t));return s.default.createElement(l.Toaster,o({visibleToasts:1,toastOptions:{unstyled:!0,classNames:{icon:"shrink-0 size-[24px]",toast:"p-3 text-white border-none rounded-md flex w-full shadow-md",description:"text-[14px] leading-[1.125] my-1",content:"grow",actionButton:"shrink-0 py-3 px-6 font-medium",cancelButton:"shrink-0 py-3 px-6 font-medium"}},expand:!0,offset:{left:8,right:8},mobileOffset:{left:8,right:8}},r))};r.Toaster=c,c.displayName="Toaster",r.toast={success:function(t,r){return(0,l.toast)(t,o({position:"top-center",icon:s.default.createElement(u.CheckCircleSolid,null),classNames:{content:"w-[calc(100%-28px)]"},className:"bg-success"},r))},critical:function(t,r){return(0,l.toast)(t,o({position:"top-center",icon:s.default.createElement(u.InfoSolid,null),duration:1/0,classNames:{content:"w-[calc(100%-28px)]"},className:"bg-critical"},r))},snackbar:function(t,r){return(0,l.toast)(t,o({position:"bottom-center",classNames:{toast:"items-center",content:"mt-0"},className:"bg-[--base]"},r))}}},88421:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getInitialMonth=function(t,r){let{month:n,defaultMonth:i,today:a=r.today(),numberOfMonths:o=1,endMonth:s,startMonth:u}=t,l=n||i||a,{differenceInCalendarMonths:c,addMonths:d,startOfMonth:f}=r;return s&&0>c(s,l)&&(l=d(s,-1*(o-1))),u&&0>c(l,u)&&(l=u),f(l)}},88500:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI4IiBmaWxsPSIjZmZmIiByeD0iNCIvPjxtYXNrIGlkPSJhIiB3aWR0aD0iNDAiIGhlaWdodD0iMjgiIHg9IjAiIHk9IjAiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiPjxyZWN0IHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0iI0M0QzRDNCIgcng9IjQiLz48L21hc2s+PGcgbWFzaz0idXJsKCNhKSI+PHBhdGggZmlsbD0iI0ZBMzg0MyIgZD0iTTAgMGg0MHYyOEgweiIvPjxnIGZpbHRlcj0idXJsKCNiKSI+PGVsbGlwc2UgY3g9IjQwLjUzIiBjeT0iNy4xOCIgZmlsbD0iIzAyNThGRiIgcng9IjEzLjU4IiByeT0iMTAuNyIgdHJhbnNmb3JtPSJyb3RhdGUoMTMuMDEgNDAuNTMgNy4xOCkiLz48L2c+PGcgZmlsdGVyPSJ1cmwoI2MpIj48ZWxsaXBzZSBjeD0iMzMuMjQiIGN5PSIyMi41MyIgZmlsbD0idXJsKCNkKSIgcng9IjE2LjI5IiByeT0iMTMuMDciIHRyYW5zZm9ybT0icm90YXRlKC0xMy4zMiAzMy4yNCAyMi41MykiLz48L2c+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik04IDExdjYuOTdoMi4yM3YtMy43M2guMjRsMS4yNCAzLjczaDFsMS4yMy0zLjczaC4yNXYzLjczaDIuMjJWMTFIMTQuMnMtLjY1IDAtMSAxYy0uNzkgMi4zMy0uOTggMi45OC0uOTggMi45OHMtLjEtLjM1LTEtMi45OGMtLjM0LTEtLjk4LTEtLjk4LTF6bTkuNCAwdjYuOTdoMS45OHMuNSAwIC43NC0uNWwxLjc0LTMuNDhoLjI0djMuOThoMi4yM1YxMWgtMS45OHMtLjUuMDUtLjc0LjVsLTEuNzMgMy40OGgtLjI1VjExem03LjUyIDBoNC42YzEuNCAwIDIuNDggMS4xIDIuNDggMi40OSAwIC4xNSAwIC4zNS0uMDUuNWgtMy42NmMtMS42MyAwLTMuMTItMS40NS0zLjM3LTIuOTltLjQgNi45N3YtMy43NGg2LjUzYy0uMyAxLTEuMjQgMS43NS0yLjMyIDEuNzVoLTEuOTh2MS45OXoiLz48ZGVmcz48ZmlsdGVyIGlkPSJiIiB3aWR0aD0iNDcuMjIiIGhlaWdodD0iNDIuMDUiIHg9IjE2LjkyIiB5PSItMTMuODUiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDMiIHN0ZERldmlhdGlvbj0iNS4wOCIvPjwvZmlsdGVyPjxmaWx0ZXIgaWQ9ImMiIHdpZHRoPSI1Ny4xMyIgaGVpZ2h0PSI1MS4zNyIgeD0iNC42OCIgeT0iLTMuMTYiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDMiIHN0ZERldmlhdGlvbj0iNi4yMSIvPjwvZmlsdGVyPjxsaW5lYXJHcmFkaWVudCBpZD0iZCIgeDE9IjI1Ljc5IiB4Mj0iMzkuODEiIHkxPSI4LjciIHkyPSIyMi4yMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIG9mZnNldD0iLjY4IiBzdG9wLWNvbG9yPSIjOTU0MkZGIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDA1N0ZGIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+"},88551:(t,r,n)=>{"use strict";r.differenceInMinutes=function(t,r,n){let s=(0,o.differenceInMilliseconds)(t,r)/a.millisecondsInMinute;return(0,i.getRoundingMethod)(n?.roundingMethod)(s)};var i=n(16318),a=n(11179),o=n(7894)},88825:(t,r,n)=>{"use strict";r.lightFormat=function(t,r){let n=(0,o.toDate)(t);if(!(0,a.isValid)(n))throw RangeError("Invalid time value");let d=r.match(s);return d?d.map(t=>{if("''"===t)return"'";let r=t[0];if("'"===r){var a=t;let r=a.match(u);return r?r[1].replace(l,"'"):a}let o=i.lightFormatters[r];if(o)return o(n,t);if(r.match(c))throw RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return t}).join(""):""},Object.defineProperty(r,"lightFormatters",{enumerable:!0,get:function(){return i.lightFormatters}});var i=n(78146),a=n(33266),o=n(36339);let s=/(\w)\1*|''|'(''|[^'])+('|$)|./g,u=/^'([^]*?)'?$/,l=/''/g,c=/[a-zA-Z]/},88912:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Textarea=void 0;var i=n(15772);Object.defineProperty(r,"Textarea",{enumerable:!0,get:function(){return i.Textarea}})},88924:(t,r,n)=>{"use strict";r.isThisSecond=function(t){return(0,a.isSameSecond)(t,(0,i.constructNow)(t))};var i=n(25017),a=n(14954)},89189:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(d,{FocusScope:()=>M,Root:()=>P}),t.exports=c(a({},"__esModule",{value:!0}),d);var f=((t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)))(n(54953)),m=n(91355),h=n(62053),p=n(37119),g=n(74848),b="focusScope.autoFocusOnMount",y="focusScope.autoFocusOnUnmount",v={bubbles:!1,cancelable:!0},M=f.forwardRef((t,r)=>{let{loop:n=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=t,[u,l]=f.useState(null),c=(0,p.useCallbackRef)(a),d=(0,p.useCallbackRef)(o),M=f.useRef(null),S=(0,m.useComposedRefs)(r,t=>l(t)),P=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(i){let t=function(t){if(P.paused||!u)return;let r=t.target;u.contains(r)?M.current=r:w(M.current,{select:!0})},r=function(t){if(P.paused||!u)return;let r=t.relatedTarget;null!==r&&(u.contains(r)||w(M.current,{select:!0}))};document.addEventListener("focusin",t),document.addEventListener("focusout",r);let n=new MutationObserver(function(t){if(document.activeElement===document.body)for(let r of t)r.removedNodes.length>0&&w(u)});return u&&n.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",t),document.removeEventListener("focusout",r),n.disconnect()}}},[i,u,P.paused]),f.useEffect(()=>{if(u){I.add(P);let t=document.activeElement;if(!u.contains(t)){let r=new CustomEvent(b,v);u.addEventListener(b,c),u.dispatchEvent(r),r.defaultPrevented||(function(t,{select:r=!1}={}){let n=document.activeElement;for(let i of t)if(w(i,{select:r}),document.activeElement!==n)return}(j(u).filter(t=>"A"!==t.tagName),{select:!0}),document.activeElement===t&&w(u))}return()=>{u.removeEventListener(b,c),setTimeout(()=>{let r=new CustomEvent(y,v);u.addEventListener(y,d),u.dispatchEvent(r),r.defaultPrevented||w(t??document.body,{select:!0}),u.removeEventListener(y,d),I.remove(P)},0)}}},[u,c,d,P]);let N=f.useCallback(t=>{if(!n&&!i||P.paused)return;let r="Tab"===t.key&&!t.altKey&&!t.ctrlKey&&!t.metaKey,a=document.activeElement;if(r&&a){let r=t.currentTarget,[i,o]=function(t){let r=j(t);return[A(r,t),A(r.reverse(),t)]}(r);i&&o?t.shiftKey||a!==o?t.shiftKey&&a===i&&(t.preventDefault(),n&&w(o,{select:!0})):(t.preventDefault(),n&&w(i,{select:!0})):a===r&&t.preventDefault()}},[n,i,P.paused]);return(0,g.jsx)(h.Primitive.div,{tabIndex:-1,...s,ref:S,onKeyDown:N})});function j(t){let r=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>{let r="INPUT"===t.tagName&&"hidden"===t.type;return t.disabled||t.hidden||r?NodeFilter.FILTER_SKIP:t.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)r.push(n.currentNode);return r}function A(t,r){for(let n of t)if(!function(t,{upTo:r}){if("hidden"===getComputedStyle(t).visibility)return!0;for(;t&&(void 0===r||t!==r);){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}(n,{upTo:r}))return n}function w(t,{select:r=!1}={}){if(t&&t.focus){var n;let i=document.activeElement;t.focus({preventScroll:!0}),t!==i&&(n=t)instanceof HTMLInputElement&&"select"in n&&r&&t.select()}}M.displayName="FocusScope";var I=function(){let t=[];return{add(r){let n=t[0];r!==n&&n?.pause(),(t=S(t,r)).unshift(r)},remove(r){t=S(t,r),t[0]?.resume()}}}();function S(t,r){let n=[...t],i=n.indexOf(r);return -1!==i&&n.splice(i,1),n}var P=M},89286:(t,r,n)=>{"use strict";r.YearParser=void 0;var i=n(9262),a=n(34850);class o extends i.Parser{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,r,n){let i=t=>({year:t,isTwoDigitYear:"yy"===r});switch(r){case"y":return(0,a.mapValue)((0,a.parseNDigits)(4,t),i);case"yo":return(0,a.mapValue)(n.ordinalNumber(t,{unit:"year"}),i);default:return(0,a.mapValue)((0,a.parseNDigits)(r.length,t),i)}}validate(t,r){return r.isTwoDigitYear||r.year>0}set(t,r,n){let i=t.getFullYear();if(n.isTwoDigitYear){let r=(0,a.normalizeTwoDigitYear)(n.year,i);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}let o="era"in r&&1!==r.era?1-n.year:n.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}r.YearParser=o},89379:(t,r,n)=>{"use strict";n.d(r,{A:()=>o});var i=n(64467);function a(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function o(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach(function(r){(0,i.A)(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}},89418:(t,r,n)=>{"use strict";var i=n(27560);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===i[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return i[t]}}))});var a=n(67139);Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===a[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return a[t]}}))});var o=n(51700);Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===o[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return o[t]}}))});var s=n(26921);Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===s[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return s[t]}}))});var u=n(40848);Object.keys(u).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===u[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return u[t]}}))});var l=n(73458);Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in r&&r[t]===l[t]||Object.defineProperty(r,t,{enumerable:!0,get:function(){return l[t]}}))})},89455:function(t,r,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.PreviousMonthButton=function(t){let{components:r}=(0,o.useDayPicker)();return a.default.createElement(r.Button,{...t})};let a=i(n(54953)),o=n(94832)},89596:(t,r,n)=>{"use strict";r.endOfDecade=function(t,r){let n=(0,i.toDate)(t,r?.in),a=9+10*Math.floor(n.getFullYear()/10);return n.setFullYear(a,11,31),n.setHours(23,59,59,999),n};var i=n(36339)},89602:(t,r,n)=>{"use strict";r.secondsToMilliseconds=function(t){return t*i.millisecondsInSecond};var i=n(11179)},89654:(t,r,n)=>{"use strict";function i(t){return(i="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})(t)}var a=["className","children"];function o(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function s(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?o(Object(n),!0).forEach(function(r){var a,o,s;a=t,o=r,s=n[r],(o=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!=i(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(o))in a?Object.defineProperty(a,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[o]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}Object.defineProperty(r,"__esModule",{value:!0}),r.Skeleton=void 0;var u=(0,n(31635).__importDefault)(n(54953)),l=n(18559),c=function(t){var r=t.className,n=t.children,i=function(t,r){if(null==t)return{};var n,i,a=function(t,r){if(null==t)return{};var n={};for(var i in t)if(({}).hasOwnProperty.call(t,i)){if(-1!==r.indexOf(i))continue;n[i]=t[i]}return n}(t,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],-1===r.indexOf(n)&&({}).propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(t,a);return u.default.createElement("div",s(s({className:r},i),{},{role:"status"}),n)};r.Skeleton=c,c.displayName="Skeleton",c.Item=function(t){var r=t.className;return u.default.createElement("div",{className:(0,l.cn)("animate-pulse bg-[--skeleton-bg] rounded-sm",r)})},c.Item.displayName="Skeleton.Item"},89656:(t,r,n)=>{"use strict";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(t,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let u of s(r))l.call(t,u)||u===n||a(t,u,{get:()=>r[u],enumerable:!(i=o(r,u))||i.enumerable});return t},d=(t,r,n)=>(n=null!=t?i(u(t)):{},c(!r&&t&&t.__esModule?n:a(n,"default",{value:t,enumerable:!0}),t)),f={};((t,r)=>{for(var n in r)a(t,n,{get:r[n],enumerable:!0})})(f,{createCollection:()=>y,unstable_createCollection:()=>O}),t.exports=c(a({},"__esModule",{value:!0}),f);var m=d(n(54953)),h=n(95791),p=n(1969),g=n(56490),b=n(74848);function y(t){let r=t+"CollectionProvider",[n,i]=(0,h.createContextScope)(r),[a,o]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=t=>{let{scope:r,children:n}=t,i=m.default.useRef(null),o=m.default.useRef(new Map).current;return(0,b.jsx)(a,{scope:r,itemMap:o,collectionRef:i,children:n})};s.displayName=r;let u=t+"CollectionSlot",l=(0,g.createSlot)(u),c=m.default.forwardRef((t,r)=>{let{scope:n,children:i}=t,a=o(u,n),s=(0,p.useComposedRefs)(r,a.collectionRef);return(0,b.jsx)(l,{ref:s,children:i})});c.displayName=u;let d=t+"CollectionItemSlot",f="data-radix-collection-item",y=(0,g.createSlot)(d),v=m.default.forwardRef((t,r)=>{let{scope:n,children:i,...a}=t,s=m.default.useRef(null),u=(0,p.useComposedRefs)(r,s),l=o(d,n);return m.default.useEffect(()=>(l.itemMap.set(s,{ref:s,...a}),()=>void l.itemMap.delete(s))),(0,b.jsx)(y,{...{[f]:""},ref:u,children:i})});return v.displayName=d,[{Provider:s,Slot:c,ItemSlot:v},function(r){let n=o(t+"CollectionConsumer",r);return m.default.useCallback(()=>{let t=n.collectionRef.current;if(!t)return[];let r=Array.from(t.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((t,n)=>r.indexOf(t.ref.current)-r.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},i]}var v=d(n(54953)),M=n(95791),j=n(1969),A=n(56490),w=new WeakMap,I=class t extends Map{#e;constructor(t){super(t),this.#e=[...super.keys()],w.set(this,!0)}set(t,r){return w.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,r),this}insert(t,r,n){let i,a=this.has(r),o=this.#e.length,s=P(t),u=s>=0?s:o+s,l=u<0||u>=o?-1:u;if(l===this.size||a&&l===this.size-1||-1===l)return this.set(r,n),this;let c=this.size+ +!a;s<0&&u++;let d=[...this.#e],f=!1;for(let t=u;t<c;t++)if(u===t){let o=d[t];d[t]===r&&(o=d[t+1]),a&&this.delete(r),i=this.get(o),this.set(r,n)}else{f||d[t-1]!==r||(f=!0);let n=d[f?t:t-1],a=i;i=this.get(n),this.delete(n),this.set(n,a)}return this}with(r,n,i){let a=new t(this);return a.insert(r,n,i),a}before(t){let r=this.#e.indexOf(t)-1;if(!(r<0))return this.entryAt(r)}setBefore(t,r,n){let i=this.#e.indexOf(t);return -1===i?this:this.insert(i,r,n)}after(t){let r=this.#e.indexOf(t);if(-1!==(r=-1===r||r===this.size-1?-1:r+1))return this.entryAt(r)}setAfter(t,r,n){let i=this.#e.indexOf(t);return -1===i?this:this.insert(i+1,r,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let r=super.delete(t);return r&&this.#e.splice(this.#e.indexOf(t),1),r}deleteAt(t){let r=this.keyAt(t);return void 0!==r&&this.delete(r)}at(t){let r=S(this.#e,t);if(void 0!==r)return this.get(r)}entryAt(t){let r=S(this.#e,t);if(void 0!==r)return[r,this.get(r)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return S(this.#e,t)}from(t,r){let n=this.indexOf(t);if(-1===n)return;let i=n+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(t,r){let n=this.indexOf(t);if(-1===n)return;let i=n+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(t,r){let n=0;for(let i of this){if(Reflect.apply(t,r,[i,n,this]))return i;n++}}findIndex(t,r){let n=0;for(let i of this){if(Reflect.apply(t,r,[i,n,this]))return n;n++}return -1}filter(r,n){let i=[],a=0;for(let t of this)Reflect.apply(r,n,[t,a,this])&&i.push(t),a++;return new t(i)}map(r,n){let i=[],a=0;for(let t of this)i.push([t[0],Reflect.apply(r,n,[t,a,this])]),a++;return new t(i)}reduce(...t){let[r,n]=t,i=0,a=n??this.at(0);for(let n of this)a=0===i&&1===t.length?n:Reflect.apply(r,this,[a,n,i,this]),i++;return a}reduceRight(...t){let[r,n]=t,i=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let a=this.at(n);i=n===this.size-1&&1===t.length?a:Reflect.apply(r,this,[i,a,n,this])}return i}toSorted(r){return new t([...this.entries()].sort(r))}toReversed(){let r=new t;for(let t=this.size-1;t>=0;t--){let n=this.keyAt(t),i=this.get(n);r.set(n,i)}return r}toSpliced(...r){let n=[...this.entries()];return n.splice(...r),new t(n)}slice(r,n){let i=new t,a=this.size-1;if(void 0===r)return i;r<0&&(r+=this.size),void 0!==n&&n>0&&(a=n-1);for(let t=r;t<=a;t++){let r=this.keyAt(t),n=this.get(r);i.set(r,n)}return i}every(t,r){let n=0;for(let i of this){if(!Reflect.apply(t,r,[i,n,this]))return!1;n++}return!0}some(t,r){let n=0;for(let i of this){if(Reflect.apply(t,r,[i,n,this]))return!0;n++}return!1}};function S(t,r){if("at"in Array.prototype)return Array.prototype.at.call(t,r);let n=function(t,r){let n=t.length,i=P(r),a=i>=0?i:n+i;return a<0||a>=n?-1:a}(t,r);return -1===n?void 0:t[n]}function P(t){return t!=t||0===t?0:Math.trunc(t)}var N=n(74848);function O(t){let r=t+"CollectionProvider",[n,i]=(0,M.createContextScope)(r),[a,o]=n(r,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new I,setItemMap:()=>void 0}),s=({state:t,...r})=>t?(0,N.jsx)(l,{...r,state:t}):(0,N.jsx)(u,{...r});s.displayName=r;let u=t=>{let r=g();return(0,N.jsx)(l,{...t,state:r})};u.displayName=r+"Init";let l=t=>{let{scope:r,children:n,state:i}=t,o=v.default.useRef(null),[s,u]=v.default.useState(null),l=(0,j.useComposedRefs)(o,u),[c,d]=i;return v.default.useEffect(()=>{var t;if(!s)return;let r=(t=()=>{},new MutationObserver(r=>{for(let n of r)if("childList"===n.type)return void t()}));return r.observe(s,{childList:!0,subtree:!0}),()=>{r.disconnect()}},[s]),(0,N.jsx)(a,{scope:r,itemMap:c,setItemMap:d,collectionRef:l,collectionRefObject:o,collectionElement:s,children:n})};l.displayName=r+"Impl";let c=t+"CollectionSlot",d=(0,A.createSlot)(c),f=v.default.forwardRef((t,r)=>{let{scope:n,children:i}=t,a=o(c,n),s=(0,j.useComposedRefs)(r,a.collectionRef);return(0,N.jsx)(d,{ref:s,children:i})});f.displayName=c;let m=t+"CollectionItemSlot",h=(0,A.createSlot)(m),p=v.default.forwardRef((t,r)=>{let{scope:n,children:i,...a}=t,s=v.default.useRef(null),[u,l]=v.default.useState(null),c=(0,j.useComposedRefs)(r,s,l),{setItemMap:d}=o(m,n),f=v.default.useRef(a);!function(t,r){if(t===r)return!0;if("object"!=typeof t||"object"!=typeof r||null==t||null==r)return!1;let n=Object.keys(t),i=Object.keys(r);if(n.length!==i.length)return!1;for(let i of n)if(!Object.prototype.hasOwnProperty.call(r,i)||t[i]!==r[i])return!1;return!0}(f.current,a)&&(f.current=a);let p=f.current;return v.default.useEffect(()=>(d(t=>u?t.has(u)?t.set(u,{...p,element:u}).toSorted(x):(t.set(u,{...p,element:u}),t.toSorted(x)):t),()=>{d(t=>u&&t.has(u)?(t.delete(u),new I(t)):t)}),[u,p,d]),(0,N.jsx)(h,{"data-radix-collection-item":"",ref:c,children:i})});function g(){return v.default.useState(new I)}return p.displayName=m,[{Provider:s,Slot:f,ItemSlot:p},{createCollectionScope:i,useCollection:function(r){let{itemMap:n}=o(t+"CollectionConsumer",r);return n},useInitCollection:g}]}function x(t,r){var n;return t[1].element&&r[1].element?(n=t[1].element,r[1].element.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)?-1:1:0}},89742:(t,r,n)=>{"use strict";n.d(r,{A:()=>u});var i=n(10123),a=n(70551),o=n(94188),s=n(71858);function u(t,r){(0,a.A)(1,arguments);var n,u,l,c,d,f,m,h,p=(0,s.q)(),g=(0,o.A)(null!=(n=null!=(u=null!=(l=null!=(c=null==r?void 0:r.weekStartsOn)?c:null==r||null==(d=r.locale)||null==(f=d.options)?void 0:f.weekStartsOn)?l:p.weekStartsOn)?u:null==(m=p.locale)||null==(h=m.options)?void 0:h.weekStartsOn)?n:0);if(!(g>=0&&g<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var b=(0,i.A)(t),y=b.getUTCDay();return b.setUTCDate(b.getUTCDate()-(7*(y<g)+y-g)),b.setUTCHours(0,0,0,0),b}},89875:(t,r,n)=>{"use strict";r.addMilliseconds=function(t,r,n){return(0,i.constructFrom)(n?.in||t,+(0,a.toDate)(t)+r)};var i=n(3539),a=n(36339)},89980:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isPdfRole=a,r.isStructTreeNode=o,r.isStructTreeNodeWithOnlyContentChild=s,r.getRoleAttributes=u,r.getBaseAttributes=l,r.getAttributes=function(t){return t?Object.assign(Object.assign({},u(t)),l(t)):null};let i=n(45831);function a(t){return t in i.PDF_ROLE_TO_HTML_ROLE}function o(t){return"children"in t}function s(t){return!!o(t)&&1===t.children.length&&0 in t.children&&"id"in t.children[0]}function u(t){let r={};if(o(t)){let{role:n}=t,o=n.match(i.HEADING_PATTERN);if(o)r.role="heading",r["aria-level"]=Number(o[1]);else if(a(n)){let t=i.PDF_ROLE_TO_HTML_ROLE[n];t&&(r.role=t)}}return r}function l(t){let r={};if(o(t)){if(void 0!==t.alt&&(r["aria-label"]=t.alt),void 0!==t.lang&&(r.lang=t.lang),s(t)){let[n]=t.children;if(n){let t=l(n);return Object.assign(Object.assign({},r),t)}}}else"id"in t&&(r["aria-owns"]=t.id);return r}},90047:(t,r,n)=>{"use strict";r.eachMinuteOfInterval=function(t,r){let{start:n,end:s}=(0,i.normalizeInterval)(r?.in,t);n.setSeconds(0,0);let u=+n>+s,l=u?+n:+s,c=u?s:n,d=r?.step??1;if(!d)return[];d<0&&(d=-d,u=!u);let f=[];for(;+c<=l;)f.push((0,o.constructFrom)(n,c)),c=(0,a.addMinutes)(c,d);return u?f.reverse():f};var i=n(22111),a=n(75756),o=n(3539)},90151:(t,r,n)=>{"use strict";r.isWeekend=function(t,r){let n=(0,i.toDate)(t,r?.in).getDay();return 0===n||6===n};var i=n(36339)},90181:(t,r,n)=>{var i={"./empty-bg.svg":62874,"./empty.svg":71230,"./mabl5-bg.svg":12772,"./mabl5.svg":77636,"./mamo2-bg.svg":64663,"./mamo2.svg":54353,"./maod2-bg.svg":29562,"./maod2.svg":56766,"./mask.svg":60671,"./mb06-bg.svg":40608,"./mb06.svg":94152,"./mir1-bg.svg":68330,"./mir1.svg":9614,"./mir1d-bg.svg":13658,"./mir1d.svg":77310,"./mirmd-bg.svg":22494,"./mirmd.svg":95802,"./mirn-bg.svg":57823,"./mirn.svg":48153,"./mirp-bg.svg":78089,"./mirp.svg":51327,"./mirs-bg.svg":39948,"./mirs.svg":72300,"./mirsd-bg.svg":92720,"./mirsd.svg":63512,"./mirst-bg.svg":85568,"./mirst.svg":15656,"./mirst2.svg":11914,"./mirt-bg.svg":98165,"./mirt.svg":94867,"./mov02-bg.svg":75067,"./mov02.svg":1549,"./pvd01-bg.svg":70462,"./pvd01.svg":57114,"./vabmo-bg.svg":31590,"./vabmo.svg":43266,"./vb01-bg.svg":21258,"./vb01.svg":93966,"./vb02-bg.svg":90907,"./vb02.svg":4685,"./vb03-bg.svg":5932,"./vb03.svg":69228,"./vb05-bg.svg":49958,"./vb05.svg":95394,"./vb07-bg.svg":87672,"./vb07.svg":18880};function a(t){return n(o(t))}function o(t){if(!n.o(i,t)){var r=Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}return i[t]}a.keys=function(){return Object.keys(i)},a.resolve=o,t.exports=a,a.id=90181},90330:(t,r,n)=>{"use strict";var i=n(54953),a=t=>"checkbox"===t.type,o=t=>t instanceof Date,s=t=>null==t;let u=t=>"object"==typeof t;var l=t=>!s(t)&&!Array.isArray(t)&&u(t)&&!o(t),c=t=>l(t)&&t.target?a(t.target)?t.target.checked:t.target.value:t,d=(t,r)=>t.has((t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t)(r)),f=t=>{let r=t.constructor&&t.constructor.prototype;return l(r)&&r.hasOwnProperty("isPrototypeOf")},m="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function h(t){let r,n=Array.isArray(t);if(t instanceof Date)r=new Date(t);else if(t instanceof Set)r=new Set(t);else{if(m&&(t instanceof Blob||t instanceof FileList)||!n&&!l(t))return t;if(r=n?[]:{},n||f(t))for(let n in t)t.hasOwnProperty(n)&&(r[n]=h(t[n]));else r=t}return r}var p=t=>Array.isArray(t)?t.filter(Boolean):[],g=t=>void 0===t,b=(t,r,n)=>{if(!r||!l(t))return n;let i=p(r.split(/[,[\].]+?/)).reduce((t,r)=>s(t)?t:t[r],t);return g(i)||i===t?g(t[r])?n:t[r]:i},y=t=>"boolean"==typeof t,v=t=>/^\w*$/.test(t),M=t=>p(t.replace(/["|']|\]/g,"").split(/\.|\[/)),j=(t,r,n)=>{let i=-1,a=v(r)?[r]:M(r),o=a.length,s=o-1;for(;++i<o;){let r=a[i],o=n;if(i!==s){let n=t[r];o=l(n)||Array.isArray(n)?n:isNaN(+a[i+1])?{}:[]}if("__proto__"===r)return;t[r]=o,t=t[r]}return t};let A={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},w={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},I="maxLength",S="minLength",P="pattern",N="required",O=i.createContext(null),x=()=>i.useContext(O);var D=(t,r,n,i=!0)=>{let a={defaultValues:r._defaultValues};for(let o in t)Object.defineProperty(a,o,{get:()=>(r._proxyFormState[o]!==w.all&&(r._proxyFormState[o]=!i||w.all),n&&(n[o]=!0),t[o])});return a},L=t=>l(t)&&!Object.keys(t).length,C=(t,r,n,i)=>{n(t);let{name:a,...o}=t;return L(o)||Object.keys(o).length>=Object.keys(r).length||Object.keys(o).find(t=>r[t]===(!i||w.all))},k=t=>Array.isArray(t)?t:[t],E=(t,r,n)=>!t||!r||t===r||k(t).some(t=>t&&(n?t===r:t.startsWith(r)||r.startsWith(t)));function T(t){let r=i.useRef(t);r.current=t,i.useEffect(()=>{let n=!t.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function z(t){let r=x(),{control:n=r.control,disabled:a,name:o,exact:s}=t||{},[u,l]=i.useState(n._formState),c=i.useRef(!0),d=i.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=i.useRef(o);return f.current=o,T({disabled:a,next:t=>c.current&&E(f.current,t.name,s)&&C(t,d.current,n._updateFormState)&&l({...n._formState,...t}),subject:n._subjects.state}),i.useEffect(()=>(c.current=!0,d.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),D(u,n,d.current,!1)}var W=t=>"string"==typeof t,Z=(t,r,n,i,a)=>W(t)?(i&&r.watch.add(t),b(n,t,a)):Array.isArray(t)?t.map(t=>(i&&r.watch.add(t),b(n,t))):(i&&(r.watchAll=!0),n);function R(t){let r=x(),{control:n=r.control,name:a,defaultValue:o,disabled:s,exact:u}=t||{},l=i.useRef(a);l.current=a,T({disabled:s,subject:n._subjects.values,next:t=>{E(l.current,t.name,u)&&d(h(Z(l.current,n._names,t.values||n._formValues,!1,o)))}});let[c,d]=i.useState(n._getWatch(a,o));return i.useEffect(()=>n._removeUnmounted()),c}function Y(t){let r=x(),{name:n,disabled:a,control:o=r.control,shouldUnregister:s}=t,u=d(o._names.array,n),l=R({control:o,name:n,defaultValue:b(o._formValues,n,b(o._defaultValues,n,t.defaultValue)),exact:!0}),f=z({control:o,name:n,exact:!0}),m=i.useRef(o.register(n,{...t.rules,value:l,...y(t.disabled)?{disabled:t.disabled}:{}}));return i.useEffect(()=>{let t=o._options.shouldUnregister||s,r=(t,r)=>{let n=b(o._fields,t);n&&n._f&&(n._f.mount=r)};if(r(n,!0),t){let t=h(b(o._options.defaultValues,n));j(o._defaultValues,n,t),g(b(o._formValues,n))&&j(o._formValues,n,t)}return()=>{(u?t&&!o._state.action:t)?o.unregister(n):r(n,!1)}},[n,o,u,s]),i.useEffect(()=>{b(o._fields,n)&&o._updateDisabledField({disabled:a,fields:o._fields,name:n,value:b(o._fields,n)._f.value})},[a,n,o]),{field:{name:n,value:l,...y(a)||f.disabled?{disabled:f.disabled||a}:{},onChange:i.useCallback(t=>m.current.onChange({target:{value:c(t),name:n},type:A.CHANGE}),[n]),onBlur:i.useCallback(()=>m.current.onBlur({target:{value:b(o._formValues,n),name:n},type:A.BLUR}),[n,o]),ref:i.useCallback(t=>{let r=b(o._fields,n);r&&t&&(r._f.ref={focus:()=>t.focus(),select:()=>t.select(),setCustomValidity:r=>t.setCustomValidity(r),reportValidity:()=>t.reportValidity()})},[o._fields,n])},formState:f,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!b(f.errors,n)},isDirty:{enumerable:!0,get:()=>!!b(f.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!b(f.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!b(f.validatingFields,n)},error:{enumerable:!0,get:()=>b(f.errors,n)}})}}var _=(t,r,n,i,a)=>r?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[i]:a||!0}}:{},G=()=>{let t="undefined"==typeof performance?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let n=(16*Math.random()+t)%16|0;return("x"==r?n:3&n|8).toString(16)})},H=(t,r,n={})=>n.shouldFocus||g(n.shouldFocus)?n.focusName||`${t}.${g(n.focusIndex)?r:n.focusIndex}.`:"",F=t=>({isOnSubmit:!t||t===w.onSubmit,isOnBlur:t===w.onBlur,isOnChange:t===w.onChange,isOnAll:t===w.all,isOnTouch:t===w.onTouched}),V=(t,r,n)=>!n&&(r.watchAll||r.watch.has(t)||[...r.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));let B=(t,r,n,i)=>{for(let a of n||Object.keys(t)){let n=b(t,a);if(n){let{_f:t,...o}=n;if(t){if(t.refs&&t.refs[0]&&r(t.refs[0],a)&&!i||t.ref&&r(t.ref,t.name)&&!i)return!0;if(B(o,r))break}else if(l(o)&&B(o,r))break}}};var U=(t,r,n)=>{let i=k(b(t,n));return j(i,"root",r[n]),j(t,n,i),t},X=t=>"file"===t.type,Q=t=>"function"==typeof t,J=t=>{if(!m)return!1;let r=t?t.ownerDocument:0;return t instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},K=t=>W(t),q=t=>"radio"===t.type,$=t=>t instanceof RegExp;let ee={value:!1,isValid:!1},et={value:!0,isValid:!0};var er=t=>{if(Array.isArray(t)){if(t.length>1){let r=t.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!g(t[0].attributes.value)?g(t[0].value)||""===t[0].value?et:{value:t[0].value,isValid:!0}:et:ee}return ee};let en={isValid:!1,value:null};var ei=t=>Array.isArray(t)?t.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,en):en;function ea(t,r,n="validate"){if(K(t)||Array.isArray(t)&&t.every(K)||y(t)&&!t)return{type:n,message:K(t)?t:"",ref:r}}var eo=t=>l(t)&&!$(t)?t:{value:t,message:""},es=async(t,r,n,i,o)=>{let{ref:u,refs:c,required:d,maxLength:f,minLength:m,min:h,max:p,pattern:v,validate:M,name:j,valueAsNumber:A,mount:w,disabled:O}=t._f,x=b(r,j);if(!w||O)return{};let D=c?c[0]:u,C=t=>{i&&D.reportValidity&&(D.setCustomValidity(y(t)?"":t||""),D.reportValidity())},k={},E=q(u),T=a(u),z=(A||X(u))&&g(u.value)&&g(x)||J(u)&&""===u.value||""===x||Array.isArray(x)&&!x.length,Z=_.bind(null,j,n,k),R=(t,r,n,i=I,a=S)=>{let o=t?r:n;k[j]={type:t?i:a,message:o,ref:u,...Z(t?i:a,o)}};if(o?!Array.isArray(x)||!x.length:d&&(!(E||T)&&(z||s(x))||y(x)&&!x||T&&!er(c).isValid||E&&!ei(c).isValid)){let{value:t,message:r}=K(d)?{value:!!d,message:d}:eo(d);if(t&&(k[j]={type:N,message:r,ref:D,...Z(N,r)},!n))return C(r),k}if(!(z||s(h)&&s(p))){let t,r,i=eo(p),a=eo(h);if(s(x)||isNaN(x)){let n=u.valueAsDate||new Date(x),o=t=>new Date((new Date).toDateString()+" "+t),s="time"==u.type,l="week"==u.type;W(i.value)&&x&&(t=s?o(x)>o(i.value):l?x>i.value:n>new Date(i.value)),W(a.value)&&x&&(r=s?o(x)<o(a.value):l?x<a.value:n<new Date(a.value))}else{let n=u.valueAsNumber||(x?+x:x);s(i.value)||(t=n>i.value),s(a.value)||(r=n<a.value)}if((t||r)&&(R(!!t,i.message,a.message,"max","min"),!n))return C(k[j].message),k}if((f||m)&&!z&&(W(x)||o&&Array.isArray(x))){let t=eo(f),r=eo(m),i=!s(t.value)&&x.length>+t.value,a=!s(r.value)&&x.length<+r.value;if((i||a)&&(R(i,t.message,r.message),!n))return C(k[j].message),k}if(v&&!z&&W(x)){let{value:t,message:r}=eo(v);if($(t)&&!x.match(t)&&(k[j]={type:P,message:r,ref:u,...Z(P,r)},!n))return C(r),k}if(M){if(Q(M)){let t=ea(await M(x,r),D);if(t&&(k[j]={...t,...Z("validate",t.message)},!n))return C(t.message),k}else if(l(M)){let t={};for(let i in M){if(!L(t)&&!n)break;let a=ea(await M[i](x,r),D,i);a&&(t={...a,...Z(i,a.message)},C(a.message),n&&(k[j]=t))}if(!L(t)&&(k[j]={ref:D,...t},!n))return k}}return C(!0),k},eu=(t,r)=>[...t,...k(r)],el=t=>Array.isArray(t)?t.map(()=>{}):void 0;function ec(t,r,n){return[...t.slice(0,r),...k(n),...t.slice(r)]}var ed=(t,r,n)=>Array.isArray(t)?(g(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(r,1)[0]),t):[],ef=(t,r)=>[...k(r),...k(t)],em=(t,r)=>g(r)?[]:function(t,r){let n=0,i=[...t];for(let t of r)i.splice(t-n,1),n++;return p(i).length?i:[]}(t,k(r).sort((t,r)=>t-r)),eh=(t,r,n)=>{[t[r],t[n]]=[t[n],t[r]]};function ep(t,r){let n=Array.isArray(r)?r:v(r)?[r]:M(r),i=1===n.length?t:function(t,r){let n=r.slice(0,-1).length,i=0;for(;i<n;)t=g(t)?i++:t[r[i++]];return t}(t,n),a=n.length-1,o=n[a];return i&&delete i[o],0!==a&&(l(i)&&L(i)||Array.isArray(i)&&function(t){for(let r in t)if(t.hasOwnProperty(r)&&!g(t[r]))return!1;return!0}(i))&&ep(t,n.slice(0,-1)),t}var eg=(t,r,n)=>(t[r]=n,t),eb=()=>{let t=[];return{get observers(){return t},next:r=>{for(let n of t)n.next&&n.next(r)},subscribe:r=>(t.push(r),{unsubscribe:()=>{t=t.filter(t=>t!==r)}}),unsubscribe:()=>{t=[]}}},ey=t=>s(t)||!u(t);function ev(t,r){if(ey(t)||ey(r))return t===r;if(o(t)&&o(r))return t.getTime()===r.getTime();let n=Object.keys(t),i=Object.keys(r);if(n.length!==i.length)return!1;for(let a of n){let n=t[a];if(!i.includes(a))return!1;if("ref"!==a){let t=r[a];if(o(n)&&o(t)||l(n)&&l(t)||Array.isArray(n)&&Array.isArray(t)?!ev(n,t):n!==t)return!1}}return!0}var eM=t=>"select-multiple"===t.type,ej=t=>q(t)||a(t),eA=t=>J(t)&&t.isConnected,ew=t=>{for(let r in t)if(Q(t[r]))return!0;return!1};function eI(t,r={}){let n=Array.isArray(t);if(l(t)||n)for(let n in t)Array.isArray(t[n])||l(t[n])&&!ew(t[n])?(r[n]=Array.isArray(t[n])?[]:{},eI(t[n],r[n])):s(t[n])||(r[n]=!0);return r}var eS=(t,r)=>(function t(r,n,i){let a=Array.isArray(r);if(l(r)||a)for(let a in r)Array.isArray(r[a])||l(r[a])&&!ew(r[a])?g(n)||ey(i[a])?i[a]=Array.isArray(r[a])?eI(r[a],[]):{...eI(r[a])}:t(r[a],s(n)?{}:n[a],i[a]):i[a]=!ev(r[a],n[a]);return i})(t,r,eI(r)),eP=(t,{valueAsNumber:r,valueAsDate:n,setValueAs:i})=>g(t)?t:r?""===t?NaN:t?+t:t:n&&W(t)?new Date(t):i?i(t):t;function eN(t){let r=t.ref;if(!(t.refs?t.refs.every(t=>t.disabled):r.disabled))return X(r)?r.files:q(r)?ei(t.refs).value:eM(r)?[...r.selectedOptions].map(({value:t})=>t):a(r)?er(t.refs).value:eP(g(r.value)?t.ref.value:r.value,t)}var eO=(t,r,n,i)=>{let a={};for(let n of t){let t=b(r,n);t&&j(a,n,t._f)}return{criteriaMode:n,names:[...t],fields:a,shouldUseNativeValidation:i}},ex=t=>g(t)?t:$(t)?t.source:l(t)?$(t.value)?t.value.source:t.value:t;let eD="AsyncFunction";var eL=t=>!(t&&t.validate||!(Q(t.validate)&&t.validate.constructor.name===eD||l(t.validate)&&Object.values(t.validate).find(t=>t.constructor.name===eD))),eC=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function ek(t,r,n){let i=b(t,n);if(i||v(n))return{error:i,name:n};let a=n.split(".");for(;a.length;){let i=a.join("."),o=b(r,i),s=b(t,i);if(o&&!Array.isArray(o)&&n!==i)break;if(s&&s.type)return{name:i,error:s};a.pop()}return{name:n}}var eE=(t,r,n,i,a)=>!a.isOnAll&&(!n&&a.isOnTouch?!(r||t):(n?i.isOnBlur:a.isOnBlur)?!t:!(n?i.isOnChange:a.isOnChange)||t),eT=(t,r)=>!p(b(t,r)).length&&ep(t,r);let ez={mode:w.onSubmit,reValidateMode:w.onChange,shouldFocusError:!0};r.Controller=t=>t.render(Y(t)),r.Form=function(t){let r=x(),[n,a]=i.useState(!1),{control:o=r.control,onSubmit:s,children:u,action:l,method:c="post",headers:d,encType:f,onError:m,render:h,onSuccess:p,validateStatus:g,...y}=t,v=async r=>{let n=!1,i="";await o.handleSubmit(async t=>{let a=new FormData,u="";try{u=JSON.stringify(t)}catch(t){}for(let r of o._names.mount)a.append(r,b(t,r));if(s&&await s({data:t,event:r,method:c,formData:a,formDataJson:u}),l)try{let t=[d&&d["Content-Type"],f].some(t=>t&&t.includes("json")),r=await fetch(l,{method:c,headers:{...d,...f?{"Content-Type":f}:{}},body:t?u:a});r&&(g?!g(r.status):r.status<200||r.status>=300)?(n=!0,m&&m({response:r}),i=String(r.status)):p&&p({response:r})}catch(t){n=!0,m&&m({error:t})}})(r),n&&t.control&&(t.control._subjects.state.next({isSubmitSuccessful:!1}),t.control.setError("root.server",{type:i}))};return i.useEffect(()=>{a(!0)},[]),h?i.createElement(i.Fragment,null,h({submit:v})):i.createElement("form",{noValidate:n,action:l,method:c,encType:f,onSubmit:v,...y},u)},r.FormProvider=t=>{let{children:r,...n}=t;return i.createElement(O.Provider,{value:n},r)},r.appendErrors=_,r.get=b,r.set=j,r.useController=Y,r.useFieldArray=function(t){let r=x(),{control:n=r.control,name:a,keyName:o="id",shouldUnregister:s}=t,[u,l]=i.useState(n._getFieldArray(a)),c=i.useRef(n._getFieldArray(a).map(G)),d=i.useRef(u),f=i.useRef(a),m=i.useRef(!1);f.current=a,d.current=u,n._names.array.add(a),t.rules&&n.register(a,t.rules),T({next:({values:t,name:r})=>{if(r===f.current||!r){let r=b(t,f.current);Array.isArray(r)&&(l(r),c.current=r.map(G))}},subject:n._subjects.array});let p=i.useCallback(t=>{m.current=!0,n._updateFieldArray(a,t)},[n,a]);return i.useEffect(()=>{if(n._state.action=!1,V(a,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!F(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([a]).then(t=>{let r=b(t.errors,a),i=b(n._formState.errors,a);(i?!r&&i.type||r&&(i.type!==r.type||i.message!==r.message):r&&r.type)&&(r?j(n._formState.errors,a,r):ep(n._formState.errors,a),n._subjects.state.next({errors:n._formState.errors}))});else{let t=b(n._fields,a);!t||!t._f||F(n._options.reValidateMode).isOnSubmit&&F(n._options.mode).isOnSubmit||es(t,n._formValues,n._options.criteriaMode===w.all,n._options.shouldUseNativeValidation,!0).then(t=>!L(t)&&n._subjects.state.next({errors:U(n._formState.errors,t,a)}))}n._subjects.values.next({name:a,values:{...n._formValues}}),n._names.focus&&B(n._fields,(t,r)=>{if(n._names.focus&&r.startsWith(n._names.focus)&&t.focus)return t.focus(),1}),n._names.focus="",n._updateValid(),m.current=!1},[u,a,n]),i.useEffect(()=>(b(n._formValues,a)||n._updateFieldArray(a),()=>{(n._options.shouldUnregister||s)&&n.unregister(a)}),[a,n,o,s]),{swap:i.useCallback((t,r)=>{let i=n._getFieldArray(a);eh(i,t,r),eh(c.current,t,r),p(i),l(i),n._updateFieldArray(a,i,eh,{argA:t,argB:r},!1)},[p,a,n]),move:i.useCallback((t,r)=>{let i=n._getFieldArray(a);ed(i,t,r),ed(c.current,t,r),p(i),l(i),n._updateFieldArray(a,i,ed,{argA:t,argB:r},!1)},[p,a,n]),prepend:i.useCallback((t,r)=>{let i=k(h(t)),o=ef(n._getFieldArray(a),i);n._names.focus=H(a,0,r),c.current=ef(c.current,i.map(G)),p(o),l(o),n._updateFieldArray(a,o,ef,{argA:el(t)})},[p,a,n]),append:i.useCallback((t,r)=>{let i=k(h(t)),o=eu(n._getFieldArray(a),i);n._names.focus=H(a,o.length-1,r),c.current=eu(c.current,i.map(G)),p(o),l(o),n._updateFieldArray(a,o,eu,{argA:el(t)})},[p,a,n]),remove:i.useCallback(t=>{let r=em(n._getFieldArray(a),t);c.current=em(c.current,t),p(r),l(r),n._updateFieldArray(a,r,em,{argA:t})},[p,a,n]),insert:i.useCallback((t,r,i)=>{let o=k(h(r)),s=ec(n._getFieldArray(a),t,o);n._names.focus=H(a,t,i),c.current=ec(c.current,t,o.map(G)),p(s),l(s),n._updateFieldArray(a,s,ec,{argA:t,argB:el(r)})},[p,a,n]),update:i.useCallback((t,r)=>{let i=h(r),o=eg(n._getFieldArray(a),t,i);c.current=[...o].map((r,n)=>r&&n!==t?c.current[n]:G()),p(o),l([...o]),n._updateFieldArray(a,o,eg,{argA:t,argB:i},!0,!1)},[p,a,n]),replace:i.useCallback(t=>{let r=k(h(t));c.current=r.map(G),p([...r]),l([...r]),n._updateFieldArray(a,[...r],t=>t,{},!0,!1)},[p,a,n]),fields:i.useMemo(()=>u.map((t,r)=>({...t,[o]:c.current[r]||G()})),[u,o])}},r.useForm=function(t={}){let r=i.useRef(),n=i.useRef(),[u,f]=i.useState({isDirty:!1,isValidating:!1,isLoading:Q(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Q(t.defaultValues)?void 0:t.defaultValues});r.current||(r.current={...function(t={}){let r,n={...ez,...t},i={submitCount:0,isDirty:!1,isLoading:Q(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},u={},f=(l(n.defaultValues)||l(n.values))&&h(n.defaultValues||n.values)||{},v=n.shouldUnregister?{}:h(f),M={action:!1,mount:!1,watch:!1},I={mount:new Set,unMount:new Set,array:new Set,watch:new Set},S=0,P={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},N={values:eb(),array:eb(),state:eb()},O=F(n.mode),x=F(n.reValidateMode),D=n.criteriaMode===w.all,C=async t=>{if(P.isValid||t){let t=n.resolver?L((await Y()).errors):await _(u,!0);t!==i.isValid&&N.state.next({isValid:t})}},E=(t,r)=>{(P.isValidating||P.validatingFields)&&((t||Array.from(I.mount)).forEach(t=>{t&&(r?j(i.validatingFields,t,r):ep(i.validatingFields,t))}),N.state.next({validatingFields:i.validatingFields,isValidating:!L(i.validatingFields)}))},T=(t,r,n,i)=>{let a=b(u,t);if(a){let o=b(v,t,g(n)?b(f,t):n);g(o)||i&&i.defaultChecked||r?j(v,t,r?o:eN(a._f)):K(t,o),M.mount&&C()}},z=(t,r,n,a,o)=>{let s=!1,l=!1,c={name:t},d=!!(b(u,t)&&b(u,t)._f&&b(u,t)._f.disabled);if(!n||a){P.isDirty&&(l=i.isDirty,i.isDirty=c.isDirty=G(),s=l!==c.isDirty);let n=d||ev(b(f,t),r);l=!(d||!b(i.dirtyFields,t)),n||d?ep(i.dirtyFields,t):j(i.dirtyFields,t,!0),c.dirtyFields=i.dirtyFields,s=s||P.dirtyFields&&!n!==l}if(n){let r=b(i.touchedFields,t);r||(j(i.touchedFields,t,n),c.touchedFields=i.touchedFields,s=s||P.touchedFields&&r!==n)}return s&&o&&N.state.next(c),s?c:{}},R=(n,a,o,s)=>{var u;let l=b(i.errors,n),c=P.isValid&&y(a)&&i.isValid!==a;if(t.delayError&&o?(u=()=>{j(i.errors,n,o),N.state.next({errors:i.errors})},(r=t=>{clearTimeout(S),S=setTimeout(u,t)})(t.delayError)):(clearTimeout(S),r=null,o?j(i.errors,n,o):ep(i.errors,n)),(o?!ev(l,o):l)||!L(s)||c){let t={...s,...c&&y(a)?{isValid:a}:{},errors:i.errors,name:n};i={...i,...t},N.state.next(t)}},Y=async t=>{E(t,!0);let r=await n.resolver(v,n.context,eO(t||I.mount,u,n.criteriaMode,n.shouldUseNativeValidation));return E(t),r},_=async(t,r,a={valid:!0})=>{for(let o in t){let s=t[o];if(s){let{_f:t,...u}=s;if(t){let u=I.array.has(t.name),l=s._f&&eL(s._f);l&&P.validatingFields&&E([o],!0);let c=await es(s,v,D,n.shouldUseNativeValidation&&!r,u);if(l&&P.validatingFields&&E([o]),c[t.name]&&(a.valid=!1,r))break;r||(b(c,t.name)?u?U(i.errors,c,t.name):j(i.errors,t.name,c[t.name]):ep(i.errors,t.name))}L(u)||await _(u,r,a)}}return a.valid},G=(t,r)=>(t&&r&&j(v,t,r),!ev(en(),f)),H=(t,r,n)=>Z(t,I,{...M.mount?v:g(r)?f:W(t)?{[t]:r}:r},n,r),K=(t,r,n={})=>{let i=b(u,t),o=r;if(i){let n=i._f;n&&(n.disabled||j(v,t,eP(r,n)),o=J(n.ref)&&s(r)?"":r,eM(n.ref)?[...n.ref.options].forEach(t=>t.selected=o.includes(t.value)):n.refs?a(n.ref)?n.refs.length>1?n.refs.forEach(t=>(!t.defaultChecked||!t.disabled)&&(t.checked=Array.isArray(o)?!!o.find(r=>r===t.value):o===t.value)):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach(t=>t.checked=t.value===o):X(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||N.values.next({name:t,values:{...v}})))}(n.shouldDirty||n.shouldTouch)&&z(t,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&er(t)},q=(t,r,n)=>{for(let i in r){let a=r[i],s=`${t}.${i}`,l=b(u,s);!I.array.has(t)&&ey(a)&&(!l||l._f)||o(a)?K(s,a,n):q(s,a,n)}},$=(t,r,n={})=>{let a=b(u,t),o=I.array.has(t),l=h(r);j(v,t,l),o?(N.array.next({name:t,values:{...v}}),(P.isDirty||P.dirtyFields)&&n.shouldDirty&&N.state.next({name:t,dirtyFields:eS(f,v),isDirty:G(t,l)})):!a||a._f||s(l)?K(t,l,n):q(t,l,n),V(t,I)&&N.state.next({...i}),N.values.next({name:M.mount?t:void 0,values:{...v}})},ee=async a=>{M.mount=!0;let o=a.target,s=o.name,l=!0,d=b(u,s),f=t=>{l=Number.isNaN(t)||ev(t,b(v,s,t))};if(d){let m,h,p=o.type?eN(d._f):c(a),g=a.type===A.BLUR||a.type===A.FOCUS_OUT,y=!eC(d._f)&&!n.resolver&&!b(i.errors,s)&&!d._f.deps||eE(g,b(i.touchedFields,s),i.isSubmitted,x,O),M=V(s,I,g);j(v,s,p),g?(d._f.onBlur&&d._f.onBlur(a),r&&r(0)):d._f.onChange&&d._f.onChange(a);let w=z(s,p,g,!1),S=!L(w)||M;if(g||N.values.next({name:s,type:a.type,values:{...v}}),y)return P.isValid&&("onBlur"===t.mode?g&&C():C()),S&&N.state.next({name:s,...M?{}:w});if(!g&&M&&N.state.next({...i}),n.resolver){let{errors:t}=await Y([s]);if(f(p),l){let r=ek(i.errors,u,s),n=ek(t,u,r.name||s);m=n.error,s=n.name,h=L(t)}}else E([s],!0),m=(await es(d,v,D,n.shouldUseNativeValidation))[s],E([s]),f(p),l&&(m?h=!1:P.isValid&&(h=await _(u,!0)));l&&(d._f.deps&&er(d._f.deps),R(s,h,m,w))}},et=(t,r)=>{if(b(i.errors,r)&&t.focus)return t.focus(),1},er=async(t,r={})=>{let a,o,s=k(t);if(n.resolver){let r=await (async t=>{let{errors:r}=await Y(t);if(t)for(let n of t){let t=b(r,n);t?j(i.errors,n,t):ep(i.errors,n)}else i.errors=r;return r})(g(t)?t:s);a=L(r),o=t?!s.some(t=>b(r,t)):a}else t?((o=(await Promise.all(s.map(async t=>{let r=b(u,t);return await _(r&&r._f?{[t]:r}:r)}))).every(Boolean))||i.isValid)&&C():o=a=await _(u);return N.state.next({...!W(t)||P.isValid&&a!==i.isValid?{}:{name:t},...n.resolver||!t?{isValid:a}:{},errors:i.errors}),r.shouldFocus&&!o&&B(u,et,t?s:I.mount),o},en=t=>{let r={...M.mount?v:f};return g(t)?r:W(t)?b(r,t):t.map(t=>b(r,t))},ei=(t,r)=>({invalid:!!b((r||i).errors,t),isDirty:!!b((r||i).dirtyFields,t),error:b((r||i).errors,t),isValidating:!!b(i.validatingFields,t),isTouched:!!b((r||i).touchedFields,t)}),ea=(t,r,n)=>{let a=(b(u,t,{_f:{}})._f||{}).ref,{ref:o,message:s,type:l,...c}=b(i.errors,t)||{};j(i.errors,t,{...c,...r,ref:a}),N.state.next({name:t,errors:i.errors,isValid:!1}),n&&n.shouldFocus&&a&&a.focus&&a.focus()},eo=(t,r={})=>{for(let a of t?k(t):I.mount)I.mount.delete(a),I.array.delete(a),r.keepValue||(ep(u,a),ep(v,a)),r.keepError||ep(i.errors,a),r.keepDirty||ep(i.dirtyFields,a),r.keepTouched||ep(i.touchedFields,a),r.keepIsValidating||ep(i.validatingFields,a),n.shouldUnregister||r.keepDefaultValue||ep(f,a);N.values.next({values:{...v}}),N.state.next({...i,...r.keepDirty?{isDirty:G()}:{}}),r.keepIsValid||C()},eu=({disabled:t,name:r,field:n,fields:i,value:a})=>{if(y(t)&&M.mount||t){let o=t?void 0:g(a)?eN(n?n._f:b(i,r)._f):a;j(v,r,o),z(r,o,!1,!1,!0)}},el=(r,i={})=>{let a=b(u,r),o=y(i.disabled)||y(t.disabled);return j(u,r,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:r}},name:r,mount:!0,...i}}),I.mount.add(r),a?eu({field:a,disabled:y(i.disabled)?i.disabled:t.disabled,name:r,value:i.value}):T(r,!0,i.value),{...o?{disabled:i.disabled||t.disabled}:{},...n.progressive?{required:!!i.required,min:ex(i.min),max:ex(i.max),minLength:ex(i.minLength),maxLength:ex(i.maxLength),pattern:ex(i.pattern)}:{},name:r,onChange:ee,onBlur:ee,ref:t=>{if(t){el(r,i),a=b(u,r);let n=g(t.value)&&t.querySelectorAll&&t.querySelectorAll("input,select,textarea")[0]||t,o=ej(n),s=a._f.refs||[];(o?s.find(t=>t===n):n===a._f.ref)||(j(u,r,{_f:{...a._f,...o?{refs:[...s.filter(eA),n,...Array.isArray(b(f,r))?[{}]:[]],ref:{type:n.type,name:r}}:{ref:n}}}),T(r,!1,void 0,n))}else(a=b(u,r,{}))._f&&(a._f.mount=!1),(n.shouldUnregister||i.shouldUnregister)&&(!d(I.array,r)||!M.action)&&I.unMount.add(r)}}},ec=()=>n.shouldFocusError&&B(u,et,I.mount),ed=(t,r)=>async a=>{let o;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let s=h(v);if(N.state.next({isSubmitting:!0}),n.resolver){let{errors:t,values:r}=await Y();i.errors=t,s=r}else await _(u);if(ep(i.errors,"root"),L(i.errors)){N.state.next({errors:{}});try{await t(s,a)}catch(t){o=t}}else r&&await r({...i.errors},a),ec(),setTimeout(ec);if(N.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:L(i.errors)&&!o,submitCount:i.submitCount+1,errors:i.errors}),o)throw o},ef=(r,n={})=>{let a=r?h(r):f,o=h(a),s=L(r),l=s?f:o;if(n.keepDefaultValues||(f=a),!n.keepValues){if(n.keepDirtyValues)for(let t of I.mount)b(i.dirtyFields,t)?j(l,t,b(v,t)):$(t,b(l,t));else{if(m&&g(r))for(let t of I.mount){let r=b(u,t);if(r&&r._f){let t=Array.isArray(r._f.refs)?r._f.refs[0]:r._f.ref;if(J(t)){let r=t.closest("form");if(r){r.reset();break}}}}u={}}v=t.shouldUnregister?n.keepDefaultValues?h(f):{}:h(l),N.array.next({values:{...l}}),N.values.next({values:{...l}})}I={mount:n.keepDirtyValues?I.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},M.mount=!P.isValid||!!n.keepIsValid||!!n.keepDirtyValues,M.watch=!!t.shouldUnregister,N.state.next({submitCount:n.keepSubmitCount?i.submitCount:0,isDirty:!s&&(n.keepDirty?i.isDirty:!(!n.keepDefaultValues||ev(r,f))),isSubmitted:!!n.keepIsSubmitted&&i.isSubmitted,dirtyFields:s?{}:n.keepDirtyValues?n.keepDefaultValues&&v?eS(f,v):i.dirtyFields:n.keepDefaultValues&&r?eS(f,r):n.keepDirty?i.dirtyFields:{},touchedFields:n.keepTouched?i.touchedFields:{},errors:n.keepErrors?i.errors:{},isSubmitSuccessful:!!n.keepIsSubmitSuccessful&&i.isSubmitSuccessful,isSubmitting:!1})},em=(t,r)=>ef(Q(t)?t(v):t,r);return{control:{register:el,unregister:eo,getFieldState:ei,handleSubmit:ed,setError:ea,_executeSchema:Y,_getWatch:H,_getDirty:G,_updateValid:C,_removeUnmounted:()=>{for(let t of I.unMount){let r=b(u,t);r&&(r._f.refs?r._f.refs.every(t=>!eA(t)):!eA(r._f.ref))&&eo(t)}I.unMount=new Set},_updateFieldArray:(t,r=[],n,a,o=!0,s=!0)=>{if(a&&n){if(M.action=!0,s&&Array.isArray(b(u,t))){let r=n(b(u,t),a.argA,a.argB);o&&j(u,t,r)}if(s&&Array.isArray(b(i.errors,t))){let r=n(b(i.errors,t),a.argA,a.argB);o&&j(i.errors,t,r),eT(i.errors,t)}if(P.touchedFields&&s&&Array.isArray(b(i.touchedFields,t))){let r=n(b(i.touchedFields,t),a.argA,a.argB);o&&j(i.touchedFields,t,r)}P.dirtyFields&&(i.dirtyFields=eS(f,v)),N.state.next({name:t,isDirty:G(t,r),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else j(v,t,r)},_updateDisabledField:eu,_getFieldArray:r=>p(b(M.mount?v:f,r,t.shouldUnregister?b(f,r,[]):[])),_reset:ef,_resetDefaultValues:()=>Q(n.defaultValues)&&n.defaultValues().then(t=>{em(t,n.resetOptions),N.state.next({isLoading:!1})}),_updateFormState:t=>{i={...i,...t}},_disableForm:t=>{y(t)&&(N.state.next({disabled:t}),B(u,(r,n)=>{let i=b(u,n);i&&(r.disabled=i._f.disabled||t,Array.isArray(i._f.refs)&&i._f.refs.forEach(r=>{r.disabled=i._f.disabled||t}))},0,!1))},_subjects:N,_proxyFormState:P,_setErrors:t=>{i.errors=t,N.state.next({errors:i.errors,isValid:!1})},get _fields(){return u},get _formValues(){return v},get _state(){return M},set _state(e){M=e},get _defaultValues(){return f},get _names(){return I},set _names(e){I=e},get _formState(){return i},set _formState(e){i=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:er,register:el,handleSubmit:ed,watch:(t,r)=>Q(t)?N.values.subscribe({next:n=>t(H(void 0,r),n)}):H(t,r,!0),setValue:$,getValues:en,reset:em,resetField:(t,r={})=>{b(u,t)&&(g(r.defaultValue)?$(t,h(b(f,t))):($(t,r.defaultValue),j(f,t,h(r.defaultValue))),r.keepTouched||ep(i.touchedFields,t),r.keepDirty||(ep(i.dirtyFields,t),i.isDirty=r.defaultValue?G(t,h(b(f,t))):G()),r.keepError||(ep(i.errors,t),P.isValid&&C()),N.state.next({...i}))},clearErrors:t=>{t&&k(t).forEach(t=>ep(i.errors,t)),N.state.next({errors:t?i.errors:{}})},unregister:eo,setError:ea,setFocus:(t,r={})=>{let n=b(u,t),i=n&&n._f;if(i){let t=i.refs?i.refs[0]:i.ref;t.focus&&(t.focus(),r.shouldSelect&&t.select())}},getFieldState:ei}}(t),formState:u});let v=r.current.control;return v._options=t,T({subject:v._subjects.state,next:t=>{C(t,v._proxyFormState,v._updateFormState,!0)&&f({...v._formState})}}),i.useEffect(()=>v._disableForm(t.disabled),[v,t.disabled]),i.useEffect(()=>{if(v._proxyFormState.isDirty){let t=v._getDirty();t!==u.isDirty&&v._subjects.state.next({isDirty:t})}},[v,u.isDirty]),i.useEffect(()=>{t.values&&!ev(t.values,n.current)?(v._reset(t.values,v._options.resetOptions),n.current=t.values,f(t=>({...t}))):v._resetDefaultValues()},[t.values,v]),i.useEffect(()=>{t.errors&&v._setErrors(t.errors)},[t.errors,v]),i.useEffect(()=>{v._state.mount||(v._updateValid(),v._state.mount=!0),v._state.watch&&(v._state.watch=!1,v._subjects.state.next({...v._formState})),v._removeUnmounted()}),i.useEffect(()=>{t.shouldUnregister&&v._subjects.values.next({values:v._getWatch()})},[t.shouldUnregister,v]),r.current.formState=D(u,v),r.current},r.useFormContext=x,r.useFormState=z,r.useWatch=R},90373:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=n(31635);(0,i.__exportStar)(n(98854),r),(0,i.__exportStar)(n(54898),r),(0,i.__exportStar)(n(11839),r)},90433:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=(0,n(54953).createContext)(null)},90825:(t,r,n)=>{"use strict";r.subWeeks=function(t,r,n){return(0,i.addWeeks)(t,-r,n)};var i=n(97460)},90846:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI4IiBmaWxsPSIjZmZmIiByeD0iNCIvPjxtYXNrIGlkPSJhIiB3aWR0aD0iNDAiIGhlaWdodD0iMjgiIHg9IjAiIHk9IjAiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiPjxyZWN0IHdpZHRoPSI0MCIgaGVpZ2h0PSIyOCIgZmlsbD0iI0M0QzRDNCIgcng9IjQiLz48L21hc2s+PGcgbWFzaz0idXJsKCNhKSI+PHBhdGggZmlsbD0iIzA3MkRBMCIgZD0iTTAgMGg0MHYyOEgweiIvPjxnIGZpbHRlcj0idXJsKCNiKSI+PGVsbGlwc2UgY3g9IjguMTIiIGN5PSIyOC41OCIgZmlsbD0iIzA2RiIgcng9IjI0LjczIiByeT0iMTUuNjYiIHRyYW5zZm9ybT0icm90YXRlKDEzLjAxIDguMTIgMjguNTgpIi8+PC9nPjxnIGZpbHRlcj0idXJsKCNjKSI+PGVsbGlwc2UgY3g9IjM0LjI2IiBjeT0iMjQuMDQiIGZpbGw9InVybCgjZCkiIHJ4PSIyNS44MSIgcnk9IjE2LjU1IiB0cmFuc2Zvcm09InJvdGF0ZSgtMTMuMzIgMzQuMjYgMjQuMDQpIi8+PC9nPjwvZz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNOCAxMXY2Ljk3aDIuMjN2LTMuNzNoLjI0bDEuMjQgMy43M2gxbDEuMjMtMy43M2guMjV2My43M2gyLjIyVjExSDE0LjJzLS42NSAwLTEgMWMtLjc5IDIuMzMtLjk4IDIuOTgtLjk4IDIuOThzLS4xLS4zNS0xLTIuOThjLS4zNC0xLS45OC0xLS45OC0xem05LjQgMHY2Ljk3aDEuOThzLjUgMCAuNzQtLjVsMS43NC0zLjQ4aC4yNHYzLjk4aDIuMjNWMTFoLTEuOThzLS41LjA1LS43NC41bC0xLjczIDMuNDhoLS4yNVYxMXptNy41MiAwaDQuNmMxLjQgMCAyLjQ4IDEuMSAyLjQ4IDIuNDkgMCAuMTUgMCAuMzUtLjA1LjVoLTMuNjZjLTEuNjMgMC0zLjEyLTEuNDUtMy4zNy0yLjk5bS40IDYuOTd2LTMuNzRoNi41M2MtLjMgMS0xLjI0IDEuNzUtMi4zMiAxLjc1aC0xLjk4djEuOTl6Ii8+PGRlZnM+PGZpbHRlciBpZD0iYiIgd2lkdGg9IjY1LjUzIiBoZWlnaHQ9IjQ5LjMyIiB4PSItMjQuNjUiIHk9IjMuOTIiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDIiIHN0ZERldmlhdGlvbj0iNC4yMSIvPjwvZmlsdGVyPjxmaWx0ZXIgaWQ9ImMiIHdpZHRoPSI3MS40IiBoZWlnaHQ9IjU0Ljk0IiB4PSItMS40NCIgeT0iLTMuNDMiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJzaGFwZSIvPjxmZUdhdXNzaWFuQmx1ciByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMzQ1XzIwMDIiIHN0ZERldmlhdGlvbj0iNS4xNSIvPjwvZmlsdGVyPjxsaW5lYXJHcmFkaWVudCBpZD0iZCIgeDE9IjMzLjE2IiB4Mj0iMzMuOTYiIHkxPSIzLjI2IiB5Mj0iMjAuMDUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjMDBBM0ZGIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODcwN0I0Ii8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+"},90907:(t,r,n)=>{"use strict";t.exports=n.p+"assets/images/bankcards/vb02-bg.svg"},91100:(t,r,n)=>{"use strict";n.r(r),n.d(r,{AbortException:()=>rG,AnnotationEditorLayer:()=>rH,AnnotationEditorParamsType:()=>rF,AnnotationEditorType:()=>rV,AnnotationEditorUIManager:()=>rB,AnnotationLayer:()=>rU,AnnotationMode:()=>rX,ColorPicker:()=>rQ,DOMSVGFactory:()=>rJ,DrawLayer:()=>rK,FeatureTest:()=>rq,GlobalWorkerOptions:()=>r$,ImageKind:()=>r0,InvalidPDFException:()=>r1,MissingPDFException:()=>r4,OPS:()=>r2,OutputScale:()=>r3,PDFDataRangeTransport:()=>r5,PDFDateString:()=>r9,PDFWorker:()=>r6,PasswordResponses:()=>r8,PermissionFlag:()=>r7,PixelsPerInch:()=>ne,RenderingCancelledException:()=>nt,TextLayer:()=>nr,UnexpectedResponseException:()=>nn,Util:()=>ni,VerbosityLevel:()=>na,XfaLayer:()=>no,build:()=>ns,createValidAbsoluteUrl:()=>nu,fetchData:()=>nl,getDocument:()=>nc,getFilenameFromUrl:()=>nd,getPdfFilenameFromUrl:()=>nf,getXfaPageViewport:()=>nm,isDataScheme:()=>nh,isPdfFile:()=>np,noContextMenu:()=>ng,normalizeUnicode:()=>nb,setLayerDimensions:()=>ny,shadow:()=>nv,version:()=>nM});var i={};i.d=(t,r)=>{for(var n in r)i.o(r,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},i.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);var a=globalThis.pdfjsLib={};i.d(a,{AbortException:()=>T,AnnotationEditorLayer:()=>rY,AnnotationEditorParamsType:()=>f,AnnotationEditorType:()=>d,AnnotationEditorUIManager:()=>ej,AnnotationLayer:()=>rP,AnnotationMode:()=>c,ColorPicker:()=>rz,DOMSVGFactory:()=>t5,DrawLayer:()=>r_,FeatureTest:()=>R,GlobalWorkerOptions:()=>e7,ImageKind:()=>p,InvalidPDFException:()=>L,MissingPDFException:()=>C,OPS:()=>v,OutputScale:()=>ef,PDFDataRangeTransport:()=>tH,PDFDateString:()=>eo,PDFWorker:()=>tU,PasswordResponses:()=>M,PermissionFlag:()=>m,PixelsPerInch:()=>X,RenderingCancelledException:()=>K,TextLayer:()=>tE,UnexpectedResponseException:()=>k,Util:()=>_,VerbosityLevel:()=>y,XfaLayer:()=>t9,build:()=>t0,createValidAbsoluteUrl:()=>P,fetchData:()=>Q,getDocument:()=>tY,getFilenameFromUrl:()=>ee,getPdfFilenameFromUrl:()=>et,getXfaPageViewport:()=>es,isDataScheme:()=>q,isPdfFile:()=>$,noContextMenu:()=>ei,normalizeUnicode:()=>F,setLayerDimensions:()=>ed,shadow:()=>N,version:()=>t$});let o="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),s=[1,0,0,1,0,0],u=[.001,0,0,.001,0,0],l={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},c={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},d={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},f={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},m={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},h={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},p={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},g={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},b={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},y={ERRORS:0,WARNINGS:1,INFOS:5},v={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,setStrokeTransparent:92,setFillTransparent:93},M={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},j=y.WARNINGS;function A(t){j>=y.INFOS&&console.log(`Info: ${t}`)}function w(t){j>=y.WARNINGS&&console.log(`Warning: ${t}`)}function I(t){throw Error(t)}function S(t,r){t||I(r)}function P(t,r=null,n=null){if(!t)return null;try{if(n&&"string"==typeof t){if(n.addDefaultProtocol&&t.startsWith("www.")){let r=t.match(/\./g);r?.length>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{var i;i=t,t=decodeURIComponent(escape(i))}catch{}}let a=r?new URL(t,r):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(a))return a}catch{}return null}function N(t,r,n,i=!1){return Object.defineProperty(t,r,{value:n,enumerable:!i,configurable:!0,writable:!1}),n}let O=function(){function t(t,r){this.message=t,this.name=r}return t.prototype=Error(),t.constructor=t,t}();class x extends O{constructor(t,r){super(t,"PasswordException"),this.code=r}}class D extends O{constructor(t,r){super(t,"UnknownErrorException"),this.details=r}}class L extends O{constructor(t){super(t,"InvalidPDFException")}}class C extends O{constructor(t){super(t,"MissingPDFException")}}class k extends O{constructor(t,r){super(t,"UnexpectedResponseException"),this.status=r}}class E extends O{constructor(t){super(t,"FormatError")}}class T extends O{constructor(t){super(t,"AbortException")}}function z(t){("object"!=typeof t||t?.length===void 0)&&I("Invalid argument for bytesToString");let r=t.length;if(r<8192)return String.fromCharCode.apply(null,t);let n=[];for(let i=0;i<r;i+=8192){let a=Math.min(i+8192,r),o=t.subarray(i,a);n.push(String.fromCharCode.apply(null,o))}return n.join("")}function W(t){"string"!=typeof t&&I("Invalid argument for stringToBytes");let r=t.length,n=new Uint8Array(r);for(let i=0;i<r;++i)n[i]=255&t.charCodeAt(i);return n}function Z(t){let r=Object.create(null);for(let[n,i]of t)r[n]=i;return r}class R{static get isLittleEndian(){return N(this,"isLittleEndian",function(){let t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return N(this,"isEvalSupported",function(){try{return Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return N(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"!=typeof navigator&&"string"==typeof navigator?.platform?N(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:"string"==typeof navigator?.userAgent&&navigator.userAgent.includes("Firefox")}):N(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return N(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}let Y=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class _{static makeHexColor(t,r,n){return`#${Y[t]}${Y[r]}${Y[n]}`}static scaleMinMax(t,r){let n;t[0]?(t[0]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[0],r[2]*=t[0],t[3]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[3],r[3]*=t[3]):(n=r[0],r[0]=r[1],r[1]=n,n=r[2],r[2]=r[3],r[3]=n,t[1]<0&&(n=r[1],r[1]=r[3],r[3]=n),r[1]*=t[1],r[3]*=t[1],t[2]<0&&(n=r[0],r[0]=r[2],r[2]=n),r[0]*=t[2],r[2]*=t[2]),r[0]+=t[4],r[1]+=t[5],r[2]+=t[4],r[3]+=t[5]}static transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}static applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}static applyInverseTransform(t,r){let n=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/n,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/n]}static getAxialAlignedBoundingBox(t,r){let n=this.applyTransform(t,r),i=this.applyTransform(t.slice(2,4),r),a=this.applyTransform([t[0],t[3]],r),o=this.applyTransform([t[2],t[1]],r);return[Math.min(n[0],i[0],a[0],o[0]),Math.min(n[1],i[1],a[1],o[1]),Math.max(n[0],i[0],a[0],o[0]),Math.max(n[1],i[1],a[1],o[1])]}static inverseTransform(t){let r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}static singularValueDecompose2dScale(t){let r=[t[0],t[2],t[1],t[3]],n=t[0]*r[0]+t[1]*r[2],i=t[0]*r[1]+t[1]*r[3],a=t[2]*r[0]+t[3]*r[2],o=t[2]*r[1]+t[3]*r[3],s=(n+o)/2,u=Math.sqrt((n+o)**2-4*(n*o-a*i))/2;return[Math.sqrt(s+u||1),Math.sqrt(s-u||1)]}static normalizeRect(t){let r=t.slice(0);return t[0]>t[2]&&(r[0]=t[2],r[2]=t[0]),t[1]>t[3]&&(r[1]=t[3],r[3]=t[1]),r}static intersect(t,r){let n=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(n>i)return null;let a=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),o=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return a>o?null:[n,a,i,o]}static #t(t,r,n,i,a,o,s,u,l,c){if(l<=0||l>=1)return;let d=1-l,f=l*l,m=f*l,h=d*(d*(d*t+3*l*r)+3*f*n)+m*i,p=d*(d*(d*a+3*l*o)+3*f*s)+m*u;c[0]=Math.min(c[0],h),c[1]=Math.min(c[1],p),c[2]=Math.max(c[2],h),c[3]=Math.max(c[3],p)}static #r(t,r,n,i,a,o,s,u,l,c,d,f){if(1e-12>Math.abs(l)){Math.abs(c)>=1e-12&&this.#t(t,r,n,i,a,o,s,u,-d/c,f);return}let m=c**2-4*d*l;if(m<0)return;let h=Math.sqrt(m),p=2*l;this.#t(t,r,n,i,a,o,s,u,(-c+h)/p,f),this.#t(t,r,n,i,a,o,s,u,(-c-h)/p,f)}static bezierBoundingBox(t,r,n,i,a,o,s,u,l){return l?(l[0]=Math.min(l[0],t,s),l[1]=Math.min(l[1],r,u),l[2]=Math.max(l[2],t,s),l[3]=Math.max(l[3],r,u)):l=[Math.min(t,s),Math.min(r,u),Math.max(t,s),Math.max(r,u)],this.#r(t,n,a,s,r,i,o,u,3*(-t+3*(n-a)+s),6*(t-2*n+a),3*(n-t),l),this.#r(t,n,a,s,r,i,o,u,3*(-r+3*(i-o)+u),6*(r-2*i+o),3*(i-r),l),l}}let G=null,H=null;function F(t){return G||(G=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,H=new Map([["ſt","ſt"]])),t.replaceAll(G,(t,r,n)=>r?r.normalize("NFKC"):H.get(n))}let V="pdfjs_internal_id_",B={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8},U="http://www.w3.org/2000/svg";class X{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Q(t,r="text"){if(en(t,document.baseURI)){let n=await fetch(t);if(!n.ok)throw Error(n.statusText);switch(r){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,i)=>{let a=new XMLHttpRequest;a.open("GET",t,!0),a.responseType=r,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){switch(r){case"arraybuffer":case"blob":case"json":n(a.response);return}n(a.responseText);return}i(Error(a.statusText))}},a.send(null)})}class J{constructor({viewBox:t,scale:r,rotation:n,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){let s,u,l,c,d,f,m,h;this.viewBox=t,this.scale=r,this.rotation=n,this.offsetX=i,this.offsetY=a;let p=(t[2]+t[0])/2,g=(t[3]+t[1])/2;switch((n%=360)<0&&(n+=360),n){case 180:s=-1,u=0,l=0,c=1;break;case 90:s=0,u=1,l=1,c=0;break;case 270:s=0,u=-1,l=-1,c=0;break;case 0:s=1,u=0,l=0,c=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(l=-l,c=-c),0===s?(d=Math.abs(g-t[1])*r+i,f=Math.abs(p-t[0])*r+a,m=(t[3]-t[1])*r,h=(t[2]-t[0])*r):(d=Math.abs(p-t[0])*r+i,f=Math.abs(g-t[1])*r+a,m=(t[2]-t[0])*r,h=(t[3]-t[1])*r),this.transform=[s*r,u*r,l*r,c*r,d-s*r*p-l*r*g,f-u*r*p-c*r*g],this.width=m,this.height=h}get rawDims(){let{viewBox:t}=this;return N(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:r=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new J({viewBox:this.viewBox.slice(),scale:t,rotation:r,offsetX:n,offsetY:i,dontFlip:a})}convertToViewportPoint(t,r){return _.applyTransform([t,r],this.transform)}convertToViewportRectangle(t){let r=_.applyTransform([t[0],t[1]],this.transform),n=_.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],n[0],n[1]]}convertToPdfPoint(t,r){return _.applyInverseTransform([t,r],this.transform)}}class K extends O{constructor(t,r=0){super(t,"RenderingCancelledException"),this.extraDelay=r}}function q(t){let r=t.length,n=0;for(;n<r&&""===t[n].trim();)n++;return"data:"===t.substring(n,n+5).toLowerCase()}function $(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function ee(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function et(t,r="document.pdf"){if("string"!=typeof t)return r;if(q(t))return w('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),r;let n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t),a=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(a&&(a=a[0]).includes("%"))try{a=n.exec(decodeURIComponent(a))[0]}catch{}return a||r}class er{started=Object.create(null);times=[];time(t){t in this.started&&w(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||w(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){let t=[],r=0;for(let{name:t}of this.times)r=Math.max(t.length,r);for(let{name:n,start:i,end:a}of this.times)t.push(`${n.padEnd(r)} ${a-i}ms
592
592
  `);return t.join("")}}function en(t,r){try{let{protocol:n}=r?new URL(t,r):new URL(t);return"http:"===n||"https:"===n}catch{return!1}}function ei(t){t.preventDefault()}function ea(t){console.log("Deprecated API usage: "+t)}class eo{static #n;static toDateObject(t){if(!t||"string"!=typeof t)return null;this.#n||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");let r=this.#n.exec(t);if(!r)return null;let n=parseInt(r[1],10),i=parseInt(r[2],10);i=i>=1&&i<=12?i-1:0;let a=parseInt(r[3],10);a=a>=1&&a<=31?a:1;let o=parseInt(r[4],10);o=o>=0&&o<=23?o:0;let s=parseInt(r[5],10);s=s>=0&&s<=59?s:0;let u=parseInt(r[6],10);u=u>=0&&u<=59?u:0;let l=r[7]||"Z",c=parseInt(r[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(r[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(o+=c,s+=d):"+"===l&&(o-=c,s-=d),new Date(Date.UTC(n,i,a,o,s,u))}}function es(t,{scale:r=1,rotation:n=0}){let{width:i,height:a}=t.attributes.style;return new J({viewBox:[0,0,parseInt(i),parseInt(a)],scale:r,rotation:n})}function eu(t){if(t.startsWith("#")){let r=parseInt(t.slice(1),16);return[(0xff0000&r)>>16,(65280&r)>>8,255&r]}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):(w(`Not a valid color format: "${t}"`),[0,0,0])}function el(t){let{a:r,b:n,c:i,d:a,e:o,f:s}=t.getTransform();return[r,n,i,a,o,s]}function ec(t){let{a:r,b:n,c:i,d:a,e:o,f:s}=t.getTransform().invertSelf();return[r,n,i,a,o,s]}function ed(t,r,n=!1,i=!0){if(r instanceof J){let{pageWidth:i,pageHeight:a}=r.rawDims,{style:o}=t,s=R.isCSSRoundSupported,u=`var(--scale-factor) * ${i}px`,l=`var(--scale-factor) * ${a}px`,c=s?`round(down, ${u}, var(--scale-round-x, 1px))`:`calc(${u})`,d=s?`round(down, ${l}, var(--scale-round-y, 1px))`:`calc(${l})`;n&&r.rotation%180!=0?(o.width=d,o.height=c):(o.width=c,o.height=d)}i&&t.setAttribute("data-main-rotation",r.rotation)}class ef{constructor(){let t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}}class em{#i=null;#a=null;#o;#s=null;#u=null;static #l=null;constructor(t){this.#o=t,em.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){let t=this.#i=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");let r=this.#o._uiManager._signal;t.addEventListener("contextmenu",ei,{signal:r}),t.addEventListener("pointerdown",em.#c,{signal:r});let n=this.#s=document.createElement("div");n.className="buttons",t.append(n);let i=this.#o.toolbarPosition;if(i){let{style:r}=t,n="ltr"===this.#o._uiManager.direction?1-i[0]:i[0];r.insetInlineEnd=`${100*n}%`,r.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),t}get div(){return this.#i}static #c(t){t.stopPropagation()}#f(t){this.#o._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#m(t){this.#o._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#h(t){let r=this.#o._uiManager._signal;t.addEventListener("focusin",this.#f.bind(this),{capture:!0,signal:r}),t.addEventListener("focusout",this.#m.bind(this),{capture:!0,signal:r}),t.addEventListener("contextmenu",ei,{signal:r})}hide(){this.#i.classList.add("hidden"),this.#a?.hideDropdown()}show(){this.#i.classList.remove("hidden"),this.#u?.shown()}#d(){let{editorType:t,_uiManager:r}=this.#o,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",em.#l[t]),this.#h(n),n.addEventListener("click",t=>{r.delete()},{signal:r._signal}),this.#s.append(n)}get #p(){let t=document.createElement("div");return t.className="divider",t}async addAltText(t){let r=await t.render();this.#h(r),this.#s.prepend(r,this.#p),this.#u=t}addColorPicker(t){this.#a=t;let r=t.renderButton();this.#h(r),this.#s.prepend(r,this.#p)}remove(){this.#i.remove(),this.#a?.destroy(),this.#a=null}}class eh{#s=null;#i=null;#g;constructor(t){this.#g=t}#b(){let t=this.#i=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ei,{signal:this.#g._signal});let r=this.#s=document.createElement("div");return r.className="buttons",t.append(r),this.#y(),t}#v(t,r){let n=0,i=0;for(let a of t){let t=a.y+a.height;if(t<n)continue;let o=a.x+(r?a.width:0);if(t>n){i=o,n=t;continue}r?o>i&&(i=o):o<i&&(i=o)}return[r?1-i:i,n]}show(t,r,n){let[i,a]=this.#v(r,n),{style:o}=this.#i||=this.#b();t.append(this.#i),o.insetInlineEnd=`${100*i}%`,o.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){this.#i.remove()}#y(){let t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");let r=document.createElement("span");t.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");let n=this.#g._signal;t.addEventListener("contextmenu",ei,{signal:n}),t.addEventListener("click",()=>{this.#g.highlightSelection("floating_button")},{signal:n}),this.#s.append(t)}}function ep(t,r,n){for(let i of n)r.addEventListener(i,t[i].bind(t))}class eg{#M=0;get id(){return`pdfjs_internal_editor_${this.#M++}`}}class eb{#j=(function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();let t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let r=0;r<32;r++)t[r]=Math.floor(255*Math.random());return z(t)})();#M=0;#A=null;static get _isSVGFittingCanvas(){let t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;return r.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>',N(this,"_isSVGFittingCanvas",r.decode().then(()=>(t.drawImage(r,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0])))}async #w(t,r){this.#A||=new Map;let n=this.#A.get(t);if(null===n)return null;if(n?.bitmap)return n.refCounter+=1,n;try{let t;if(n||={bitmap:null,id:`image_${this.#j}_${this.#M++}`,refCounter:0,isSvg:!1},"string"==typeof r?(n.url=r,t=await Q(r,"blob")):r instanceof File?t=n.file=r:r instanceof Blob&&(t=r),"image/svg+xml"===t.type){let r=eb._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((t,o)=>{a.onload=()=>{n.bitmap=a,n.isSvg=!0,t()},i.onload=async()=>{let t=n.svgUrl=i.result;a.src=await r?`${t}#svgView(preserveAspectRatio(none))`:t},a.onerror=i.onerror=o});i.readAsDataURL(t),await o}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(t){console.error(t),n=null}return this.#A.set(t,n),n&&this.#A.set(n.id,n),n}async getFromFile(t){let{lastModified:r,name:n,size:i,type:a}=t;return this.#w(`${r}_${n}_${i}_${a}`,t)}async getFromUrl(t){return this.#w(t,t)}async getFromBlob(t,r){let n=await r;return this.#w(t,n)}async getFromId(t){this.#A||=new Map;let r=this.#A.get(t);if(!r)return null;if(r.bitmap)return r.refCounter+=1,r;if(r.file)return this.getFromFile(r.file);if(r.blobPromise){let{blobPromise:t}=r;return delete r.blobPromise,this.getFromBlob(r.id,t)}return this.getFromUrl(r.url)}getFromCanvas(t,r){this.#A||=new Map;let n=this.#A.get(t);if(n?.bitmap)return n.refCounter+=1,n;let i=new OffscreenCanvas(r.width,r.height);return i.getContext("2d").drawImage(r,0,0),n={bitmap:i.transferToImageBitmap(),id:`image_${this.#j}_${this.#M++}`,refCounter:1,isSvg:!1},this.#A.set(t,n),this.#A.set(n.id,n),n}getSvgUrl(t){let r=this.#A.get(t);return r?.isSvg?r.svgUrl:null}deleteId(t){this.#A||=new Map;let r=this.#A.get(t);if(!r||(r.refCounter-=1,0!==r.refCounter))return;let{bitmap:n}=r;if(!r.url&&!r.file){let t=new OffscreenCanvas(n.width,n.height);t.getContext("bitmaprenderer").transferFromImageBitmap(n),r.blobPromise=t.convertToBlob()}n.close?.(),r.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#j}_`)}}class ey{#I=[];#S=!1;#P;#N=-1;constructor(t=128){this.#P=t}add({cmd:t,undo:r,post:n,mustExec:i,type:a=NaN,overwriteIfSameType:o=!1,keepUndo:s=!1}){if(i&&t(),this.#S)return;let u={cmd:t,undo:r,post:n,type:a};if(-1===this.#N){this.#I.length>0&&(this.#I.length=0),this.#N=0,this.#I.push(u);return}if(o&&this.#I[this.#N].type===a){s&&(u.undo=this.#I[this.#N].undo),this.#I[this.#N]=u;return}let l=this.#N+1;l===this.#P?this.#I.splice(0,1):(this.#N=l,l<this.#I.length&&this.#I.splice(l)),this.#I.push(u)}undo(){if(-1===this.#N)return;this.#S=!0;let{undo:t,post:r}=this.#I[this.#N];t(),r?.(),this.#S=!1,this.#N-=1}redo(){if(this.#N<this.#I.length-1){this.#N+=1,this.#S=!0;let{cmd:t,post:r}=this.#I[this.#N];t(),r?.(),this.#S=!1}}hasSomethingToUndo(){return -1!==this.#N}hasSomethingToRedo(){return this.#N<this.#I.length-1}destroy(){this.#I=null}}class ev{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:r}=R.platform;for(let[n,i,a={}]of t)for(let t of n){let n=t.startsWith("mac+");r&&n?(this.callbacks.set(t.slice(4),{callback:i,options:a}),this.allKeys.add(t.split("+").at(-1))):r||n||(this.callbacks.set(t,{callback:i,options:a}),this.allKeys.add(t.split("+").at(-1)))}}#O(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);let r=this.buffer.join("+");return this.buffer.length=0,r}exec(t,r){if(!this.allKeys.has(r.key))return;let n=this.callbacks.get(this.#O(r));if(!n)return;let{callback:i,options:{bubbles:a=!1,args:o=[],checker:s=null}}=n;(!s||s(t,r))&&(i.bind(t,...o,r)(),a||(r.stopPropagation(),r.preventDefault()))}}class eM{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]),r=document.createElement("span");for(let n of(r.style.visibility="hidden",document.body.append(r),t.keys())){r.style.color=n;let i=window.getComputedStyle(r).color;t.set(n,eu(i))}return r.remove(),N(this,"_colors",t)}convert(t){let r=eu(t);if(!window.matchMedia("(forced-colors: active)").matches)return r;for(let[t,n]of this._colors)if(n.every((t,n)=>t===r[n]))return eM._colorsMapping.get(t);return r}getHexCode(t){let r=this._colors.get(t);return r?_.makeHexColor(...r):t}}class ej{#x=new AbortController;#D=null;#L=new Map;#C=new Map;#k=null;#E=null;#T=null;#z=new ey;#W=null;#Z=0;#R=new Set;#Y=null;#_=null;#G=new Set;#H=!1;#F=!1;#V=!1;#B=null;#U=null;#X=null;#Q=null;#J=!1;#K=null;#q=new eg;#$=!1;#ee=!1;#et=null;#er=null;#en=null;#ei=null;#ea=d.NONE;#eo=new Set;#es=null;#eu=null;#el=null;#ec={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#ed=[0,0];#ef=null;#em=null;#eh=null;#ep=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=ej.prototype,r=t=>t.#em.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),n=(t,{target:r})=>{if(r instanceof HTMLInputElement){let{type:t}=r;return"text"!==t&&"number"!==t}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return N(this,"_keyboardManager",new ev([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],t.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:n}],[["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:n}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:r})=>!(r instanceof HTMLButtonElement)&&t.#em.contains(r)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:r})=>!(r instanceof HTMLButtonElement)&&t.#em.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:r}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:r}]]))}constructor(t,r,n,i,a,o,s,u,l,c,d){let f=this._signal=this.#x.signal;this.#em=t,this.#eh=r,this.#k=n,this._eventBus=i,i._on("editingaction",this.onEditingAction.bind(this),{signal:f}),i._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),i._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),i._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),i._on("setpreference",this.onSetPreference.bind(this),{signal:f}),i._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:f}),this.#eg(),this.#eb(),this.#ey(),this.#E=a.annotationStorage,this.#B=a.filterFactory,this.#eu=o,this.#Q=s||null,this.#H=u,this.#F=l,this.#V=c,this.#ei=d||null,this.viewParameters={realScale:X.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){for(let t of(this.#ep?.resolve(),this.#ep=null,this.#x?.abort(),this.#x=null,this._signal=null,this.#C.values()))t.destroy();this.#C.clear(),this.#L.clear(),this.#G.clear(),this.#D=null,this.#eo.clear(),this.#z.destroy(),this.#k?.destroy(),this.#K?.hide(),this.#K=null,this.#U&&(clearTimeout(this.#U),this.#U=null),this.#ef&&(clearTimeout(this.#ef),this.#ef=null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#ei}get useNewAltTextFlow(){return this.#F}get useNewAltTextWhenAddingImage(){return this.#V}get hcmFilter(){return N(this,"hcmFilter",this.#eu?this.#B.addHCMFilter(this.#eu.foreground,this.#eu.background):"none")}get direction(){return N(this,"direction",getComputedStyle(this.#em).direction)}get highlightColors(){return N(this,"highlightColors",this.#Q?new Map(this.#Q.split(",").map(t=>t.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return N(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#en=t}editAltText(t,r=!1){this.#k?.editAltText(this,t,r)}switchToMode(t,r){this._eventBus.on("annotationeditormodechanged",r,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,r){this._eventBus.dispatch("setpreference",{source:this,name:t,value:r})}onSetPreference({name:t,value:r}){"enableNewAltTextWhenAddingImage"===t&&(this.#V=r)}onPageChanging({pageNumber:t}){this.#Z=t-1}focusMainContainer(){this.#em.focus()}findParent(t,r){for(let n of this.#C.values()){let{x:i,y:a,width:o,height:s}=n.div.getBoundingClientRect();if(t>=i&&t<=i+o&&r>=a&&r<=a+s)return n}return null}disableUserSelect(t=!1){this.#eh.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#G.add(t)}removeShouldRescale(t){this.#G.delete(t)}onScaleChanging({scale:t}){for(let r of(this.commitOrRemove(),this.viewParameters.realScale=t*X.PDF_TO_CSS_UNITS,this.#G))r.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#ev({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#eM(t){let{currentLayer:r}=this;if(r.hasTextLayer(t))return r;for(let r of this.#C.values())if(r.hasTextLayer(t))return r;return null}highlightSelection(t=""){let r=document.getSelection();if(!r||r.isCollapsed)return;let{anchorNode:n,anchorOffset:i,focusNode:a,focusOffset:o}=r,s=r.toString(),u=this.#ev(r).closest(".textLayer"),l=this.getSelectionBoxes(u);if(!l)return;r.empty();let c=this.#eM(u),f=this.#ea===d.NONE,m=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:n,anchorOffset:i,focusNode:a,focusOffset:o,text:s}),f&&this.showAllEditors("highlight",!0,!0)};if(f)return void this.switchToMode(d.HIGHLIGHT,m);m()}#ej(){let t=document.getSelection();if(!t||t.isCollapsed)return;let r=this.#ev(t).closest(".textLayer"),n=this.getSelectionBoxes(r);n&&(this.#K||=new eh(this),this.#K.show(r,n,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#E||this.#E.has(t.id)||this.#E.setValue(t.id,t)}#eA(){let t=document.getSelection();if(!t||t.isCollapsed){this.#es&&(this.#K?.hide(),this.#es=null,this.#ew({hasSelectedText:!1}));return}let{anchorNode:r}=t;if(r===this.#es)return;let n=this.#ev(t).closest(".textLayer");if(!n){this.#es&&(this.#K?.hide(),this.#es=null,this.#ew({hasSelectedText:!1}));return}if(this.#K?.hide(),this.#es=r,this.#ew({hasSelectedText:!0}),(this.#ea===d.HIGHLIGHT||this.#ea===d.NONE)&&(this.#ea===d.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#J=this.isShiftKeyDown,!this.isShiftKeyDown)){let t=this.#ea===d.HIGHLIGHT?this.#eM(n):null;t?.toggleDrawing();let r=new AbortController,i=this.combinedSignal(r),a=n=>{("pointerup"!==n.type||0===n.button)&&(r.abort(),t?.toggleDrawing(!0),"pointerup"===n.type&&this.#eI("main_toolbar"))};window.addEventListener("pointerup",a,{signal:i}),window.addEventListener("blur",a,{signal:i})}}#eI(t=""){this.#ea===d.HIGHLIGHT?this.highlightSelection(t):this.#H&&this.#ej()}#eg(){document.addEventListener("selectionchange",this.#eA.bind(this),{signal:this._signal})}#eS(){if(this.#X)return;this.#X=new AbortController;let t=this.combinedSignal(this.#X);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#eP(){this.#X?.abort(),this.#X=null}blur(){if(this.isShiftKeyDown=!1,this.#J&&(this.#J=!1,this.#eI("main_toolbar")),!this.hasSelection)return;let{activeElement:t}=document;for(let r of this.#eo)if(r.div.contains(t)){this.#er=[r,t],r._focusEventsAllowed=!1;break}}focus(){if(!this.#er)return;let[t,r]=this.#er;this.#er=null,r.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),r.focus()}#ey(){if(this.#et)return;this.#et=new AbortController;let t=this.combinedSignal(this.#et);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#eN(){this.#et?.abort(),this.#et=null}#eO(){if(this.#W)return;this.#W=new AbortController;let t=this.combinedSignal(this.#W);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#ex(){this.#W?.abort(),this.#W=null}#eb(){let t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#ey(),this.#eO()}removeEditListeners(){this.#eN(),this.#ex()}dragOver(t){for(let{type:r}of t.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(r)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(let r of t.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(r.type)){n.paste(r,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#D?.commitOrRemove(),!this.hasSelection)return;let r=[];for(let t of this.#eo){let n=t.serialize(!0);n&&r.push(n)}0!==r.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();let{clipboardData:r}=t;for(let t of r.items)for(let r of this.#_)if(r.isHandlingMimeForPasting(t.type))return void r.paste(t,this.currentLayer);let n=r.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(t){w(`paste: "${t.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let i=this.currentLayer;try{let t=[];for(let r of n){let n=await i.deserialize(r);if(!n)return;t.push(n)}this.addCommands({cmd:()=>{for(let r of t)this.#eD(r);this.#eL(t)},undo:()=>{for(let r of t)r.remove()},mustExec:!0})}catch(t){w(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#ea===d.NONE||this.isEditorHandlingKeyboard||ej._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#J&&(this.#J=!1,this.#eI("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#ew(t){Object.entries(t).some(([t,r])=>this.#ec[t]!==r)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ec,t)}),this.#ea===d.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#eC([[f.HIGHLIGHT_FREE,!0]]))}#eC(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#eS(),this.#eO(),this.#ew({isEditing:this.#ea!==d.NONE,isEmpty:this.#ek(),hasSomethingToUndo:this.#z.hasSomethingToUndo(),hasSomethingToRedo:this.#z.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#eP(),this.#ex(),this.#ew({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#_)for(let r of(this.#_=t,this.#_))this.#eC(r.defaultPropertiesToUpdate)}getId(){return this.#q.id}get currentLayer(){return this.#C.get(this.#Z)}getLayer(t){return this.#C.get(t)}get currentPageIndex(){return this.#Z}addLayer(t){this.#C.set(t.pageIndex,t),this.#$?t.enable():t.disable()}removeLayer(t){this.#C.delete(t.pageIndex)}async updateMode(t,r=null,n=!1){if(this.#ea!==t&&(!this.#ep||(await this.#ep.promise,this.#ep))){if(this.#ep=Promise.withResolvers(),this.#ea=t,t===d.NONE){this.setEditingState(!1),this.#eE(),this.#ep.resolve();return}for(let r of(this.setEditingState(!0),await this.#eT(),this.unselectAll(),this.#C.values()))r.updateMode(t);if(!r){n&&this.addNewEditorFromKeyboard(),this.#ep.resolve();return}for(let t of this.#L.values())t.annotationElementId===r?(this.setSelected(t),t.enterInEditMode()):t.unselect();this.#ep.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#ea&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,r){if(this.#_){switch(t){case f.CREATE:this.currentLayer.addNewEditor();return;case f.HIGHLIGHT_DEFAULT_COLOR:this.#en?.updateColor(r);break;case f.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#el||=new Map).set(t,r),this.showAllEditors("highlight",r)}for(let n of this.#eo)n.updateParams(t,r);for(let n of this.#_)n.updateDefaultParams(t,r)}}showAllEditors(t,r,n=!1){for(let n of this.#L.values())n.editorType===t&&n.show(r);(this.#el?.get(f.HIGHLIGHT_SHOW_ALL)??!0)!==r&&this.#eC([[f.HIGHLIGHT_SHOW_ALL,r]])}enableWaiting(t=!1){if(this.#ee!==t)for(let r of(this.#ee=t,this.#C.values()))t?r.disableClick():r.enableClick(),r.div.classList.toggle("waiting",t)}async #eT(){if(!this.#$){this.#$=!0;let t=[];for(let r of this.#C.values())t.push(r.enable());for(let r of(await Promise.all(t),this.#L.values()))r.enable()}}#eE(){if(this.unselectAll(),this.#$){for(let t of(this.#$=!1,this.#C.values()))t.disable();for(let t of this.#L.values())t.disable()}}getEditors(t){let r=[];for(let n of this.#L.values())n.pageIndex===t&&r.push(n);return r}getEditor(t){return this.#L.get(t)}addEditor(t){this.#L.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#U&&clearTimeout(this.#U),this.#U=setTimeout(()=>{this.focusMainContainer(),this.#U=null},0)),this.#L.delete(t.id),this.unselect(t),t.annotationElementId&&this.#R.has(t.annotationElementId)||this.#E?.remove(t.id)}addDeletedAnnotationElement(t){this.#R.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#R.has(t)}removeDeletedAnnotationElement(t){this.#R.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#eD(t){let r=this.#C.get(t.pageIndex);r?r.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#D!==t&&(this.#D=t,t&&this.#eC(t.propertiesToUpdate))}get #ez(){let t=null;for(t of this.#eo);return t}updateUI(t){this.#ez===t&&this.#eC(t.propertiesToUpdate)}toggleSelected(t){if(this.#eo.has(t)){this.#eo.delete(t),t.unselect(),this.#ew({hasSelectedEditor:this.hasSelection});return}this.#eo.add(t),t.select(),this.#eC(t.propertiesToUpdate),this.#ew({hasSelectedEditor:!0})}setSelected(t){for(let r of this.#eo)r!==t&&r.unselect();this.#eo.clear(),this.#eo.add(t),t.select(),this.#eC(t.propertiesToUpdate),this.#ew({hasSelectedEditor:!0})}isSelected(t){return this.#eo.has(t)}get firstSelectedEditor(){return this.#eo.values().next().value}unselect(t){t.unselect(),this.#eo.delete(t),this.#ew({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#eo.size}get isEnterHandled(){return 1===this.#eo.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#z.undo(),this.#ew({hasSomethingToUndo:this.#z.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#ek()})}redo(){this.#z.redo(),this.#ew({hasSomethingToUndo:!0,hasSomethingToRedo:this.#z.hasSomethingToRedo(),isEmpty:this.#ek()})}addCommands(t){this.#z.add(t),this.#ew({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#ek()})}#ek(){if(0===this.#L.size)return!0;if(1===this.#L.size)for(let t of this.#L.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let t=[...this.#eo];this.addCommands({cmd:()=>{for(let r of t)r.remove()},undo:()=>{for(let r of t)this.#eD(r)},mustExec:!0})}commitOrRemove(){this.#D?.commitOrRemove()}hasSomethingToControl(){return this.#D||this.hasSelection}#eL(t){for(let t of this.#eo)t.unselect();for(let r of(this.#eo.clear(),t))r.isEmpty()||(this.#eo.add(r),r.select());this.#ew({hasSelectedEditor:this.hasSelection})}selectAll(){for(let t of this.#eo)t.commit();this.#eL(this.#L.values())}unselectAll(){if((!this.#D||(this.#D.commitOrRemove(),this.#ea===d.NONE))&&this.hasSelection){for(let t of this.#eo)t.unselect();this.#eo.clear(),this.#ew({hasSelectedEditor:!1})}}translateSelectedEditors(t,r,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#ed[0]+=t,this.#ed[1]+=r;let[i,a]=this.#ed,o=[...this.#eo];for(let n of(this.#ef&&clearTimeout(this.#ef),this.#ef=setTimeout(()=>{this.#ef=null,this.#ed[0]=this.#ed[1]=0,this.addCommands({cmd:()=>{for(let t of o)this.#L.has(t.id)&&t.translateInPage(i,a)},undo:()=>{for(let t of o)this.#L.has(t.id)&&t.translateInPage(-i,-a)},mustExec:!1})},1e3),o))n.translateInPage(t,r)}setUpDragSession(){if(this.hasSelection)for(let t of(this.disableUserSelect(!0),this.#Y=new Map,this.#eo))this.#Y.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!this.#Y)return!1;this.disableUserSelect(!1);let t=this.#Y;this.#Y=null;let r=!1;for(let[{x:n,y:i,pageIndex:a},o]of t)o.newX=n,o.newY=i,o.newPageIndex=a,r||=n!==o.savedX||i!==o.savedY||a!==o.savedPageIndex;if(!r)return!1;let n=(t,r,n,i)=>{if(this.#L.has(t.id)){let a=this.#C.get(i);a?t._setParentAndPosition(a,r,n):(t.pageIndex=i,t.x=r,t.y=n)}};return this.addCommands({cmd:()=>{for(let[r,{newX:i,newY:a,newPageIndex:o}]of t)n(r,i,a,o)},undo:()=>{for(let[r,{savedX:i,savedY:a,savedPageIndex:o}]of t)n(r,i,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,r){if(this.#Y)for(let n of this.#Y.keys())n.drag(t,r)}rebuild(t){if(null===t.parent){let r=this.getLayer(t.pageIndex);r?(r.changeParent(t),r.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#eo.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#D===t}getActive(){return this.#D}getMode(){return this.#ea}get imageManager(){return N(this,"imageManager",new eb)}getSelectionBoxes(t){let r;if(!t)return null;let n=document.getSelection();for(let r=0,i=n.rangeCount;r<i;r++)if(!t.contains(n.getRangeAt(r).commonAncestorContainer))return null;let{x:i,y:a,width:o,height:s}=t.getBoundingClientRect();switch(t.getAttribute("data-main-rotation")){case"90":r=(t,r,n,u)=>({x:(r-a)/s,y:1-(t+n-i)/o,width:u/s,height:n/o});break;case"180":r=(t,r,n,u)=>({x:1-(t+n-i)/o,y:1-(r+u-a)/s,width:n/o,height:u/s});break;case"270":r=(t,r,n,u)=>({x:1-(r+u-a)/s,y:(t-i)/o,width:u/s,height:n/o});break;default:r=(t,r,n,u)=>({x:(t-i)/o,y:(r-a)/s,width:n/o,height:u/s})}let u=[];for(let t=0,i=n.rangeCount;t<i;t++){let i=n.getRangeAt(t);if(!i.collapsed)for(let{x:t,y:n,width:a,height:o}of i.getClientRects())0!==a&&0!==o&&u.push(r(t,n,a,o))}return 0===u.length?null:u}addChangedExistingAnnotation({annotationElementId:t,id:r}){(this.#T||=new Map).set(t,r)}removeChangedExistingAnnotation({annotationElementId:t}){this.#T?.delete(t)}renderAnnotationElement(t){let r=this.#T?.get(t.data.id);if(!r)return;let n=this.#E.getRawValue(r);n&&(this.#ea!==d.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}}class eA{#u=null;#eW=!1;#eZ=null;#eR=null;#eY=null;#e_=null;#eG=!1;#eH=null;#o=null;#eF=null;#eV=null;#eB=!1;static #eU=null;static _l10n=null;constructor(t){this.#o=t,this.#eB=t._uiManager.useNewAltTextFlow,eA.#eU||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){eA._l10n??=t}async render(){let t=this.#eZ=document.createElement("button");t.className="altText",t.tabIndex="0";let r=this.#eR=document.createElement("span");t.append(r),this.#eB?(t.classList.add("new"),t.setAttribute("data-l10n-id",eA.#eU.missing),r.setAttribute("data-l10n-id",eA.#eU["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let n=this.#o._uiManager._signal;t.addEventListener("contextmenu",ei,{signal:n}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:n});let i=t=>{t.preventDefault(),this.#o._uiManager.editAltText(this.#o),this.#eB&&this.#o._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#eX}})};return t.addEventListener("click",i,{capture:!0,signal:n}),t.addEventListener("keydown",r=>{r.target===t&&"Enter"===r.key&&(this.#eG=!0,i(r))},{signal:n}),await this.#eQ(),t}get #eX(){return this.#u&&"added"||null===this.#u&&this.guessedText&&"review"||"missing"}finish(){this.#eZ&&(this.#eZ.focus({focusVisible:this.#eG}),this.#eG=!1)}isEmpty(){return this.#eB?null===this.#u:!this.#u&&!this.#eW}hasData(){return this.#eB?null!==this.#u||!!this.#eF:this.isEmpty()}get guessedText(){return this.#eF}async setGuessedText(t){null===this.#u&&(this.#eF=t,this.#eV=await eA._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#eQ())}toggleAltTextBadge(t=!1){if(!this.#eB||this.#u){this.#eH?.remove(),this.#eH=null;return}if(!this.#eH){let t=this.#eH=document.createElement("div");t.className="noAltTextBadge",this.#o.div.append(t)}this.#eH.classList.toggle("hidden",!t)}serialize(t){let r=this.#u;return t||this.#eF!==r||(r=this.#eV),{altText:r,decorative:this.#eW,guessedText:this.#eF,textWithDisclaimer:this.#eV}}get data(){return{altText:this.#u,decorative:this.#eW}}set data({altText:t,decorative:r,guessedText:n,textWithDisclaimer:i,cancel:a=!1}){n&&(this.#eF=n,this.#eV=i),(this.#u!==t||this.#eW!==r)&&(a||(this.#u=t,this.#eW=r),this.#eQ())}toggle(t=!1){this.#eZ&&(!t&&this.#e_&&(clearTimeout(this.#e_),this.#e_=null),this.#eZ.disabled=!t)}shown(){this.#o._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#eX}})}destroy(){this.#eZ?.remove(),this.#eZ=null,this.#eR=null,this.#eY=null,this.#eH?.remove(),this.#eH=null}async #eQ(){let t=this.#eZ;if(!t)return;if(this.#eB){if(t.classList.toggle("done",!!this.#u),t.setAttribute("data-l10n-id",eA.#eU[this.#eX]),this.#eR?.setAttribute("data-l10n-id",eA.#eU[`${this.#eX}-label`]),!this.#u)return void this.#eY?.remove()}else{if(!this.#u&&!this.#eW){t.classList.remove("done"),this.#eY?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let r=this.#eY;if(!r){this.#eY=r=document.createElement("span"),r.className="tooltip",r.setAttribute("role","tooltip"),r.id=`alt-text-tooltip-${this.#o.id}`;let n=this.#o._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#e_),this.#e_=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#e_=setTimeout(()=>{this.#e_=null,this.#eY.classList.add("show"),this.#o._reportTelemetry({action:"alt_text_tooltip"})},100)},{signal:n}),t.addEventListener("mouseleave",()=>{this.#e_&&(clearTimeout(this.#e_),this.#e_=null),this.#eY?.classList.remove("show")},{signal:n})}this.#eW?r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(r.removeAttribute("data-l10n-id"),r.textContent=this.#u),r.parentNode||t.append(r);let n=this.#o.getImageForAltText();n?.setAttribute("aria-describedby",r.id)}}class ew{#eJ=null;#eK=null;#u=null;#eq=!1;#e$=!1;#e0=null;#e1=null;#e4=null;#e2="";#e3=!1;#e5=null;#e9=!1;#e6=!1;#e8=!1;#e7=null;#te=0;#tt=0;#tr=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#tn=!1;#ti=ew._zIndex++;static _borderLineWidth=-1;static _colorManager=new eM;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=ew.prototype._resizeWithKeyboard,r=ej.TRANSLATE_SMALL,n=ej.TRANSLATE_BIG;return N(this,"_resizerKeyboardManager",new ev([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-r,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[r,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-r]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,r]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,n]}],[["Escape","mac+Escape"],ew.prototype._stopResizingWithKeyboard]]))}constructor(t){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;let{rotation:r,rawDims:{pageWidth:n,pageHeight:i,pageX:a,pageY:o}}=this.parent.viewport;this.rotation=r,this.pageRotation=(360+r-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[a,o];let[s,u]=this.parentDimensions;this.x=t.x/s,this.y=t.y/u,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return N(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){let r=new eI({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});r.annotationElementId=t.annotationElementId,r.deleted=!0,r._uiManager.addToAnnotationStorage(r)}static initialize(t,r){if(ew._l10n??=t,ew._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==ew._borderLineWidth)return;let n=getComputedStyle(document.documentElement);ew._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,r){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,r){I("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#tn}set _isDraggable(t){this.#tn=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){let[t,r]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*r/(2*t),this.y+=this.width*t/(2*r);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*r/(2*t),this.y-=this.width*t/(2*r);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#ti}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#ta(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#e3?this.#e3=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;let r=t.relatedTarget;!r?.closest(`#${this.id}`)&&(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,r,n,i){let[a,o]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(t+n)/a,this.y=(r+i)/o,this.fixAndSetPosition()}#to([t,r],n,i){[n,i]=this.screenToPageTranslation(n,i),this.x+=n/t,this.y+=i/r,this.fixAndSetPosition()}translate(t,r){this.#to(this.parentDimensions,t,r)}translateInPage(t,r){this.#e5||=[this.x,this.y],this.#to(this.pageDimensions,t,r),this.div.scrollIntoView({block:"nearest"})}drag(t,r){this.#e5||=[this.x,this.y];let[n,i]=this.parentDimensions;if(this.x+=t/n,this.y+=r/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:t,y:r}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,r)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,u]=this.getBaseTranslation();a+=s,o+=u,this.div.style.left=`${(100*a).toFixed(2)}%`,this.div.style.top=`${(100*o).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#e5&&(this.#e5[0]!==this.x||this.#e5[1]!==this.y)}getBaseTranslation(){let[t,r]=this.parentDimensions,{_borderLineWidth:n}=ew,i=n/t,a=n/r;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){let[r,n]=this.pageDimensions,{x:i,y:a,width:o,height:s}=this;if(o*=r,s*=n,i*=r,a*=n,this._mustFixPosition)switch(t){case 0:i=Math.max(0,Math.min(r-o,i)),a=Math.max(0,Math.min(n-s,a));break;case 90:i=Math.max(0,Math.min(r-s,i)),a=Math.min(n,Math.max(o,a));break;case 180:i=Math.min(r,Math.max(o,i)),a=Math.min(n,Math.max(s,a));break;case 270:i=Math.min(r,Math.max(s,i)),a=Math.max(0,Math.min(n-o,a))}this.x=i/=r,this.y=a/=n;let[u,l]=this.getBaseTranslation();i+=u,a+=l;let{style:c}=this.div;c.left=`${(100*i).toFixed(2)}%`,c.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static #ts(t,r,n){switch(n){case 90:return[r,-t];case 180:return[-t,-r];case 270:return[-r,t];default:return[t,r]}}screenToPageTranslation(t,r){return ew.#ts(t,r,this.parentRotation)}pageTranslationToScreen(t,r){return ew.#ts(t,r,360-this.parentRotation)}#tu(t){switch(t){case 90:{let[t,r]=this.pageDimensions;return[0,-t/r,r/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,r]=this.pageDimensions;return[0,t/r,-r/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:t,pageDimensions:[r,n]}=this;return[r*t,n*t]}setDims(t,r){let[n,i]=this.parentDimensions;this.div.style.width=`${(100*t/n).toFixed(2)}%`,this.#e$||(this.div.style.height=`${(100*r/i).toFixed(2)}%`)}fixDims(){let{style:t}=this.div,{height:r,width:n}=t,i=n.endsWith("%"),a=!this.#e$&&r.endsWith("%");if(i&&a)return;let[o,s]=this.parentDimensions;i||(t.width=`${(100*parseFloat(n)/o).toFixed(2)}%`),this.#e$||a||(t.height=`${(100*parseFloat(r)/s).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#tl(){if(this.#e0)return;this.#e0=document.createElement("div"),this.#e0.classList.add("resizers");let t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],r=this._uiManager._signal;for(let n of t){let t=document.createElement("div");this.#e0.append(t),t.classList.add("resizer",n),t.setAttribute("data-resizer-name",n),t.addEventListener("pointerdown",this.#tc.bind(this,n),{signal:r}),t.addEventListener("contextmenu",ei,{signal:r}),t.tabIndex=-1}this.div.prepend(this.#e0)}#tc(t,r){r.preventDefault();let{isMac:n}=R.platform;if(0!==r.button||r.ctrlKey&&n)return;this.#u?.toggle(!1);let i=this._isDraggable;this._isDraggable=!1;let a=new AbortController,o=this._uiManager.combinedSignal(a);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#td.bind(this,t),{passive:!0,capture:!0,signal:o}),window.addEventListener("contextmenu",ei,{signal:o});let s=this.x,u=this.y,l=this.width,c=this.height,d=this.parent.div.style.cursor,f=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(r.target).cursor;let m=()=>{a.abort(),this.parent.togglePointerEvents(!0),this.#u?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=d,this.div.style.cursor=f,this.#tf(s,u,l,c)};window.addEventListener("pointerup",m,{signal:o}),window.addEventListener("blur",m,{signal:o})}#tf(t,r,n,i){let a=this.x,o=this.y,s=this.width,u=this.height;(a!==t||o!==r||s!==n||u!==i)&&this.addCommands({cmd:()=>{this.width=s,this.height=u,this.x=a,this.y=o;let[t,r]=this.parentDimensions;this.setDims(t*s,r*u),this.fixAndSetPosition()},undo:()=>{this.width=n,this.height=i,this.x=t,this.y=r;let[a,o]=this.parentDimensions;this.setDims(a*n,o*i),this.fixAndSetPosition()},mustExec:!0})}#td(t,r){let n,i,a,o,[s,u]=this.parentDimensions,l=this.x,c=this.y,d=this.width,f=this.height,m=ew.MIN_SIZE/s,h=ew.MIN_SIZE/u,p=t=>Math.round(1e4*t)/1e4,g=this.#tu(this.rotation),b=(t,r)=>[g[0]*t+g[2]*r,g[1]*t+g[3]*r],y=this.#tu(360-this.rotation),v=!1,M=!1;switch(t){case"topLeft":v=!0,n=(t,r)=>[0,0],i=(t,r)=>[t,r];break;case"topMiddle":n=(t,r)=>[t/2,0],i=(t,r)=>[t/2,r];break;case"topRight":v=!0,n=(t,r)=>[t,0],i=(t,r)=>[0,r];break;case"middleRight":M=!0,n=(t,r)=>[t,r/2],i=(t,r)=>[0,r/2];break;case"bottomRight":v=!0,n=(t,r)=>[t,r],i=(t,r)=>[0,0];break;case"bottomMiddle":n=(t,r)=>[t/2,r],i=(t,r)=>[t/2,0];break;case"bottomLeft":v=!0,n=(t,r)=>[0,r],i=(t,r)=>[t,0];break;case"middleLeft":M=!0,n=(t,r)=>[0,r/2],i=(t,r)=>[t,r/2]}let j=n(d,f),A=i(d,f),w=b(...A),I=p(l+w[0]),S=p(c+w[1]),P=1,N=1,[O,x]=this.screenToPageTranslation(r.movementX,r.movementY);if([O,x]=(a=O/s,o=x/u,[y[0]*a+y[2]*o,y[1]*a+y[3]*o]),v){let t=Math.hypot(d,f);P=N=Math.max(Math.min(Math.hypot(A[0]-j[0]-O,A[1]-j[1]-x)/t,1/d,1/f),m/d,h/f)}else M?P=Math.max(m,Math.min(1,Math.abs(A[0]-j[0]-O)))/d:N=Math.max(h,Math.min(1,Math.abs(A[1]-j[1]-x)))/f;let D=p(d*P),L=p(f*N),C=I-(w=b(...i(D,L)))[0],k=S-w[1];this.width=D,this.height=L,this.x=C,this.y=k,this.setDims(s*D,u*L),this.fixAndSetPosition()}altTextFinish(){this.#u?.finish()}async addEditToolbar(){return this._editToolbar||this.#e6||(this._editToolbar=new em(this),this.div.append(this._editToolbar.render()),this.#u&&await this._editToolbar.addAltText(this.#u)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#u?.destroy())}addContainer(t){let r=this._editToolbar?.div;r?r.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#u||(eA.initialize(ew._l10n),this.#u=new eA(this),this.#eJ&&(this.#u.data=this.#eJ,this.#eJ=null),await this.addEditToolbar())}get altTextData(){return this.#u?.data}set altTextData(t){this.#u&&(this.#u.data=t)}get guessedAltText(){return this.#u?.guessedText}async setGuessedAltText(t){await this.#u?.setGuessedText(t)}serializeAltText(t){return this.#u?.serialize(t)}hasAltText(){return!!this.#u&&!this.#u.isEmpty()}hasAltTextData(){return this.#u?.hasData()??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#eq?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#tm();let[t,r]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*r/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/r).toFixed(2)}%`);let[n,i]=this.getInitialTranslation();return this.translate(n,i),ep(this,this.div,["pointerdown"]),this.div}pointerdown(t){let{isMac:r}=R.platform;return 0!==t.button||t.ctrlKey&&r?void t.preventDefault():(this.#e3=!0,this._isDraggable)?void this.#th(t):void this.#tp(t)}get isSelected(){return this._uiManager.isSelected(this)}#tp(t){let{isMac:r}=R.platform;t.ctrlKey&&!r||t.shiftKey||t.metaKey&&r?this.parent.toggleSelected(this):this.parent.setSelected(this)}#th(t){let{isSelected:r}=this;this._uiManager.setUpDragSession();let n=new AbortController,i=this._uiManager.combinedSignal(n);r&&(this.div.classList.add("moving"),this.#te=t.clientX,this.#tt=t.clientY,window.addEventListener("pointermove",t=>{let{clientX:r,clientY:n}=t,[i,a]=this.screenToPageTranslation(r-this.#te,n-this.#tt);this.#te=r,this.#tt=n,this._uiManager.dragSelectedEditors(i,a)},{passive:!0,capture:!0,signal:i}));let a=()=>{n.abort(),r&&this.div.classList.remove("moving"),this.#e3=!1,this._uiManager.endDragSession()||this.#tp(t)};window.addEventListener("pointerup",a,{signal:i}),window.addEventListener("blur",a,{signal:i})}moveInDOM(){this.#e7&&clearTimeout(this.#e7),this.#e7=setTimeout(()=>{this.#e7=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,r,n){t.changeParent(this),this.x=r,this.y=n,this.fixAndSetPosition()}getRect(t,r,n=this.rotation){let i=this.parentScale,[a,o]=this.pageDimensions,[s,u]=this.pageTranslation,l=t/i,c=r/i,d=this.x*a,f=this.y*o,m=this.width*a,h=this.height*o;switch(n){case 0:return[d+l+s,o-f-c-h+u,d+l+m+s,o-f-c+u];case 90:return[d+c+s,o-f+l+u,d+c+h+s,o-f+l+m+u];case 180:return[d-l-m+s,o-f+c+u,d-l+s,o-f+c+h+u];case 270:return[d-c-h+s,o-f-l-m+u,d-c+s,o-f-l+u];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(t,r){let[n,i,a,o]=t,s=a-n,u=o-i;switch(this.rotation){case 0:return[n,r-o,s,u];case 90:return[n,r-i,u,s];case 180:return[a,r-i,s,u];case 270:return[a,r-o,u,s];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#e6=!0}disableEditMode(){this.#e6=!1}isInEditMode(){return this.#e6}shouldGetKeyboardEvents(){return this.#e8}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#tm(){if(this.#e4||!this.div)return;this.#e4=new AbortController;let t=this._uiManager.combinedSignal(this.#e4);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#tm()}rotate(t){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,r=null){I("An editor must be serializable")}static async deserialize(t,r,n){let i=new this.prototype.constructor({parent:r,id:r.getNextId(),uiManager:n});i.rotation=t.rotation,i.#eJ=t.accessibilityData;let[a,o]=i.pageDimensions,[s,u,l,c]=i.getRectInCurrentCoords(t.rect,o);return i.x=s/a,i.y=u/o,i.width=l/a,i.height=c/o,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#e4?.abort(),this.#e4=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#e7&&(clearTimeout(this.#e7),this.#e7=null),this.#ta(),this.removeEditToolbar(),this.#tr){for(let t of this.#tr.values())clearTimeout(t);this.#tr=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#tl(),this.#e0.classList.remove("hidden"),ep(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#e1={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let r=this.#e0.children;if(!this.#eK){this.#eK=Array.from(r);let t=this.#tg.bind(this),n=this.#tb.bind(this),i=this._uiManager._signal;for(let r of this.#eK){let a=r.getAttribute("data-resizer-name");r.setAttribute("role","spinbutton"),r.addEventListener("keydown",t,{signal:i}),r.addEventListener("blur",n,{signal:i}),r.addEventListener("focus",this.#ty.bind(this,a),{signal:i}),r.setAttribute("data-l10n-id",ew._l10nResizer[a])}}let n=this.#eK[0],i=0;for(let t of r){if(t===n)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#eK.length/4);if(a!==i){if(a<i)for(let t=0;t<i-a;t++)this.#e0.append(this.#e0.firstChild);else if(a>i)for(let t=0;t<a-i;t++)this.#e0.firstChild.before(this.#e0.lastChild);let t=0;for(let n of r){let r=this.#eK[t++].getAttribute("data-resizer-name");n.setAttribute("data-l10n-id",ew._l10nResizer[r])}}this.#tv(0),this.#e8=!0,this.#e0.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#tg(t){ew._resizerKeyboardManager.exec(this,t)}#tb(t){this.#e8&&t.relatedTarget?.parentNode!==this.#e0&&this.#ta()}#ty(t){this.#e2=this.#e8?t:""}#tv(t){if(this.#eK)for(let r of this.#eK)r.tabIndex=t}_resizeWithKeyboard(t,r){this.#e8&&this.#td(this.#e2,{movementX:t,movementY:r})}#ta(){if(this.#e8=!1,this.#tv(-1),this.#e1){let{savedX:t,savedY:r,savedWidth:n,savedHeight:i}=this.#e1;this.#tf(t,r,n,i),this.#e1=null}}_stopResizingWithKeyboard(){this.#ta(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar)return void this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});this._editToolbar?.show(),this.#u?.toggleAltTextBadge(!1)}unselect(){this.#e0?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#u?.toggleAltTextBadge(!0)}updateParams(t,r){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#e9}set isEditing(t){this.#e9=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,r){this.#e$=!0;let{style:n}=this.div;n.aspectRatio=t/r,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,r=!1){if(r){this.#tr||=new Map;let{action:r}=t,n=this.#tr.get(r);n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(t),this.#tr.delete(r),0===this.#tr.size&&(this.#tr=null)},ew._telemetryTimeout),this.#tr.set(r,n);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#eq=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#eq=!0}renderAnnotationElement(t){let r=t.container.querySelector(".annotationContent");if(r){if("CANVAS"===r.nodeName){let t=r;(r=document.createElement("div")).classList.add("annotationContent",this.editorType),t.before(r)}}else(r=document.createElement("div")).classList.add("annotationContent",this.editorType),t.container.prepend(r);return r}resetAnnotationElement(t){let{firstChild:r}=t.container;r?.nodeName==="DIV"&&r.classList.contains("annotationContent")&&r.remove()}}class eI extends ew{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}class eS{constructor(t){this.h1=t?0|t:0xc3d2e1f0,this.h2=t?0|t:0xc3d2e1f0}update(t){let r,n;if("string"==typeof t){r=new Uint8Array(2*t.length),n=0;for(let i=0,a=t.length;i<a;i++){let a=t.charCodeAt(i);a<=255?r[n++]=a:(r[n++]=a>>>8,r[n++]=255&a)}}else if(ArrayBuffer.isView(t))n=(r=t.slice()).byteLength;else throw Error("Invalid data format, must be a string or TypedArray.");let i=n>>2,a=n-4*i,o=new Uint32Array(r.buffer,0,i),s=0,u=0,l=this.h1,c=this.h2;for(let t=0;t<i;t++)1&t?(l^=s=0x1b873593*(s=(s=0xcc9e2d51*(s=o[t])&0xffff0000|11601*s&65535)<<15|s>>>17)&0xffff0000|13715*s&65535,l=5*(l=l<<13|l>>>19)+0xe6546b64):(c^=u=0x1b873593*(u=(u=0xcc9e2d51*(u=o[t])&0xffff0000|11601*u&65535)<<15|u>>>17)&0xffff0000|13715*u&65535,c=5*(c=c<<13|c>>>19)+0xe6546b64);switch(s=0,a){case 3:s^=r[4*i+2]<<16;case 2:s^=r[4*i+1]<<8;case 1:s^=r[4*i],s=0x1b873593*(s=(s=0xcc9e2d51*s&0xffff0000|11601*s&65535)<<15|s>>>17)&0xffff0000|13715*s&65535,1&i?l^=s:c^=s}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,r=this.h2;return t^=r>>>1,r=0xff51afd7*r&0xffff0000|((r<<16|(t=0xed558ccd*t&0xffff0000|36045*t&65535)>>>16)*0xafd7ed55&0xffff0000)>>>16,t^=r>>>1,r=0xc4ceb9fe*r&0xffff0000|((r<<16|(t=0x1a85ec53*t&0xffff0000|60499*t&65535)>>>16)*0xb9fe1a85&0xffff0000)>>>16,((t^=r>>>1)>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}}let eP=Object.freeze({map:null,hash:"",transfer:void 0});class eN{#tM=!1;#tj=null;#tA=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,r){let n=this.#tA.get(t);return void 0===n?r:Object.assign(r,n)}getRawValue(t){return this.#tA.get(t)}remove(t){if(this.#tA.delete(t),0===this.#tA.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let t of this.#tA.values())if(t instanceof ew)return;this.onAnnotationEditor(null)}}setValue(t,r){let n=this.#tA.get(t),i=!1;if(void 0!==n)for(let[t,a]of Object.entries(r))n[t]!==a&&(i=!0,n[t]=a);else i=!0,this.#tA.set(t,r);i&&this.#tw(),r instanceof ew&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(r.constructor._type)}has(t){return this.#tA.has(t)}getAll(){return this.#tA.size>0?Z(this.#tA):null}setAll(t){for(let[r,n]of Object.entries(t))this.setValue(r,n)}get size(){return this.#tA.size}#tw(){this.#tM||(this.#tM=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#tM&&(this.#tM=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new eO(this)}get serializable(){if(0===this.#tA.size)return eP;let t=new Map,r=new eS,n=[],i=Object.create(null),a=!1;for(let[n,o]of this.#tA){let s=o instanceof ew?o.serialize(!1,i):o;s&&(t.set(n,s),r.update(`${n}:${JSON.stringify(s)}`),a||=!!s.bitmap)}if(a)for(let r of t.values())r.bitmap&&n.push(r.bitmap);return t.size>0?{map:t,hash:r.hexdigest(),transfer:n}:eP}get editorStats(){let t=null,r=new Map;for(let n of this.#tA.values()){if(!(n instanceof ew))continue;let i=n.telemetryFinalData;if(!i)continue;let{type:a}=i;r.has(a)||r.set(a,Object.getPrototypeOf(n).constructor),t||=Object.create(null);let o=t[a]||=new Map;for(let[t,r]of Object.entries(i)){if("type"===t)continue;let n=o.get(t);n||(n=new Map,o.set(t,n));let i=n.get(r)??0;n.set(r,i+1)}}for(let[n,i]of r)t[n]=i.computeTelemetryFinalData(t[n]);return t}resetModifiedIds(){this.#tj=null}get modifiedIds(){if(this.#tj)return this.#tj;let t=[];for(let r of this.#tA.values())r instanceof ew&&r.annotationElementId&&r.serialize()&&t.push(r.annotationElementId);return this.#tj={ids:new Set(t),hash:t.join(",")}}}class eO extends eN{#tI;constructor(t){super();let{map:r,hash:n,transfer:i}=t.serializable,a=structuredClone(r,i?{transfer:i}:null);this.#tI={map:a,hash:n,transfer:i}}get print(){I("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#tI}get modifiedIds(){return N(this,"modifiedIds",{ids:new Set,hash:""})}}class ex{#tS=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:r=null}){this._document=t,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));let r=this.styleElement.sheet;r.insertRule(t,r.cssRules.length)}clear(){for(let t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#tS.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:r}){if(!(!t||this.#tS.has(t.loadedName))){if(S(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:n,src:i,style:a}=t,o=new FontFace(n,i,a);this.addNativeFontFace(o);try{await o.load(),this.#tS.add(n),r?.(t)}catch{w(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}I("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){let r=t.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(n){throw w(`Failed to load font '${r.family}': '${n}'.`),t.disableFontFace=!0,n}}return}let r=t.createFontFaceRule();if(r){if(this.insertRule(r),this.isSyncFontLoadingSupported)return;await new Promise(r=>{let n=this._queueLoadingCallback(r);this._prepareFontLoadEvent(t,n)})}}get isFontLoadingAPISupported(){return N(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let t=!1;return o?t=!0:"undefined"!=typeof navigator&&"string"==typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)&&(t=!0),N(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){let{loadingRequests:r}=this,n={done:!1,complete:function(){for(S(!n.done,"completeRequest() cannot be called twice."),n.done=!0;r.length>0&&r[0].done;)setTimeout(r.shift().callback,0)},callback:t};return r.push(n),n}get _loadTestFont(){return N(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,r){var n;let i,a;function o(t,r){return t.charCodeAt(r)<<24|t.charCodeAt(r+1)<<16|t.charCodeAt(r+2)<<8|255&t.charCodeAt(r+3)}function s(t,r,n,i){return t.substring(0,r)+i+t.substring(r+n)}let u=this._document.createElement("canvas");u.width=1,u.height=1;let l=u.getContext("2d"),c=0,d=`lt${Date.now()}${this.loadTestFontId++}`,f=this._loadTestFont,m=o(f=s(f,976,d.length,d),16);for(i=0,a=d.length-3;i<a;i+=4)m=m-0x58585858+o(d,i)|0;i<d.length&&(m=m-0x58585858+o(d+"XXX",i)|0),f=s(f,16,4,String.fromCharCode((n=m)>>24&255,n>>16&255,n>>8&255,255&n));let h=`url(data:font/opentype;base64,${btoa(f)});`,p=`@font-face {font-family:"${d}";src:${h}}`;this.insertRule(p);let g=this._document.createElement("div");for(let r of(g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px",[t.loadedName,d])){let t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=r,g.append(t)}this._document.body.append(g),function t(r,n){if(++c>30){w("Load test font never loaded."),n();return}if(l.font="30px "+r,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0)return void n();setTimeout(t.bind(null,r,n))}(d,()=>{g.remove(),r.complete()})}}class eD{constructor(t,{disableFontFace:r=!1,inspectFont:n=null}){for(let r in this.compiledGlyphs=Object.create(null),t)this[r]=t[r];this.disableFontFace=!0===r,this._inspectFont=n}createNativeFontFace(){let t;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){var t;let r;if(!this.data||this.disableFontFace)return null;let n=`url(data:${this.mimetype};base64,${(t=this.data,Uint8Array.prototype.toBase64?t.toBase64():btoa(z(t)))});`;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${n}}`}else r=`@font-face {font-family:"${this.loadedName}";src:${n}}`;return this._inspectFont?.(this,n),r}getPathGenerator(t,r){let n;if(void 0!==this.compiledGlyphs[r])return this.compiledGlyphs[r];try{n=t.get(this.loadedName+"_path_"+r)}catch(t){w(`getPathGenerator - ignoring character: "${t}".`)}if(!Array.isArray(n)||0===n.length)return this.compiledGlyphs[r]=function(t,r){};let i=[];for(let t=0,r=n.length;t<r;)switch(n[t++]){case B.BEZIER_CURVE_TO:{let[r,a,o,s,u,l]=n.slice(t,t+6);i.push(t=>t.bezierCurveTo(r,a,o,s,u,l)),t+=6}break;case B.MOVE_TO:{let[r,a]=n.slice(t,t+2);i.push(t=>t.moveTo(r,a)),t+=2}break;case B.LINE_TO:{let[r,a]=n.slice(t,t+2);i.push(t=>t.lineTo(r,a)),t+=2}break;case B.QUADRATIC_CURVE_TO:{let[r,a,o,s]=n.slice(t,t+4);i.push(t=>t.quadraticCurveTo(r,a,o,s)),t+=4}break;case B.RESTORE:i.push(t=>t.restore());break;case B.SAVE:i.push(t=>t.save());break;case B.SCALE:S(2===i.length,"Scale command is only valid at the third position.");break;case B.TRANSFORM:{let[r,a,o,s,u,l]=n.slice(t,t+6);i.push(t=>t.transform(r,a,o,s,u,l)),t+=6}break;case B.TRANSLATE:{let[r,a]=n.slice(t,t+2);i.push(t=>t.translate(r,a)),t+=2}}return this.compiledGlyphs[r]=function(t,r){i[0](t),i[1](t),t.scale(r,-r);for(let r=2,n=i.length;r<n;r++)i[r](t)}}}class eL{#tP=!1;constructor({enableHWA:t=!1}){this.#tP=t}create(t,r){if(t<=0||r<=0)throw Error("Invalid canvas size");let n=this._createCanvas(t,r);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#tP})}}reset(t,r,n){if(!t.canvas)throw Error("Canvas is not specified");if(r<=0||n<=0)throw Error("Invalid canvas size");t.canvas.width=r,t.canvas.height=n}destroy(t){if(!t.canvas)throw Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,r){I("Abstract method `_createCanvas` called.")}}class eC{constructor({baseUrl:t=null,isCompressed:r=!0}){this.baseUrl=t,this.isCompressed=r}async fetch({name:t}){if(!this.baseUrl)throw Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw Error("CMap name must be specified.");let r=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(r).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${r}`)})}async _fetch(t){I("Abstract method `_fetch` called.")}}class ek extends eC{async _fetch(t){let r=await Q(t,this.isCompressed?"arraybuffer":"text");return r instanceof ArrayBuffer?new Uint8Array(r):W(r)}}class eE{addFilter(t){return"none"}addHCMFilter(t,r){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,r,n,i,a){return"none"}destroy(t=!1){}}class eT{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw Error("Font filename must be specified.");let r=`${this.baseUrl}${t}`;return this._fetch(r).catch(t=>{throw Error(`Unable to load font data at: ${r}`)})}async _fetch(t){I("Abstract method `_fetch` called.")}}class ez extends eT{async _fetch(t){return new Uint8Array(await Q(t,"arraybuffer"))}}if(o){var eW=Promise.withResolvers(),eZ=null;(async()=>{let t,r,n=await import("fs"),i=await import("http");return new Map(Object.entries({fs:n,http:i,https:await import("https"),url:await import("url"),canvas:t,path2d:r}))})().then(t=>{eZ=t,eW.resolve()},t=>{w(`loadPackages: ${t}`),eZ=new Map,eW.resolve()})}class eR{static get promise(){return eW.promise}static get(t){return eZ?.get(t)}}async function eY(t){let r=eR.get("fs");return new Uint8Array(await r.promises.readFile(t))}let e_={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function eG(t,r){if(!r)return;let n=r[2]-r[0],i=r[3]-r[1],a=new Path2D;a.rect(r[0],r[1],n,i),t.clip(a)}class eH{getPattern(){I("Abstract method `getPattern` called.")}}class eF extends eH{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 r;for(let n of("axial"===this._type?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1)),this._colorStops))r.addColorStop(n[0],n[1]);return r}getPattern(t,r,n,i){let a;if(i===e_.STROKE||i===e_.FILL){let o=r.current.getClippedPathBoundingBox(i,el(t))||[0,0,0,0],s=Math.ceil(o[2]-o[0])||1,u=Math.ceil(o[3]-o[1])||1,l=r.cachedCanvases.getCanvas("pattern",s,u),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(-o[0],-o[1]),n=_.transform(n,[1,0,0,1,o[0],o[1]]),c.transform(...r.baseTransform),this.matrix&&c.transform(...this.matrix),eG(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),a=t.createPattern(l.canvas,"no-repeat");let d=new DOMMatrix(n);a.setTransform(d)}else eG(t,this._bbox),a=this._createGradient(t);return a}}function eV(t,r,n,i,a,o,s,u){let l,c,d,f,m,h,p,g,b,y=r.coords,v=r.colors,M=t.data,j=4*t.width;y[n+1]>y[i+1]&&(l=n,n=i,i=l,l=o,o=s,s=l),y[i+1]>y[a+1]&&(l=i,i=a,a=l,l=s,s=u,u=l),y[n+1]>y[i+1]&&(l=n,n=i,i=l,l=o,o=s,s=l);let A=(y[n]+r.offsetX)*r.scaleX,w=(y[n+1]+r.offsetY)*r.scaleY,I=(y[i]+r.offsetX)*r.scaleX,S=(y[i+1]+r.offsetY)*r.scaleY,P=(y[a]+r.offsetX)*r.scaleX,N=(y[a+1]+r.offsetY)*r.scaleY;if(w>=N)return;let O=v[o],x=v[o+1],D=v[o+2],L=v[s],C=v[s+1],k=v[s+2],E=v[u],T=v[u+1],z=v[u+2],W=Math.round(w),Z=Math.round(N);for(let t=W;t<=Z;t++){let r;if(t<S){let r=t<w?0:(w-t)/(w-S);c=A-(A-I)*r,d=O-(O-L)*r,f=x-(x-C)*r,m=D-(D-k)*r}else{let r;c=I-(I-P)*(r=t>N?1:S===N?0:(S-t)/(S-N)),d=L-(L-E)*r,f=C-(C-T)*r,m=k-(k-z)*r}h=A-(A-P)*(r=t<w?0:t>N?1:(w-t)/(w-N)),p=O-(O-E)*r,g=x-(x-T)*r,b=D-(D-z)*r;let n=Math.round(Math.min(c,h)),i=Math.round(Math.max(c,h)),a=j*t+4*n;for(let t=n;t<=i;t++)(r=(c-t)/(c-h))<0?r=0:r>1&&(r=1),M[a++]=d-(d-p)*r|0,M[a++]=f-(f-g)*r|0,M[a++]=m-(m-b)*r|0,M[a++]=255}}class eB extends eH{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,r,n){let i=Math.floor(this._bounds[0]),a=Math.floor(this._bounds[1]),o=Math.ceil(this._bounds[2])-i,s=Math.ceil(this._bounds[3])-a,u=Math.min(Math.ceil(Math.abs(o*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(s*t[1]*1.1)),3e3),c=o/u,d=s/l,f={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-a,scaleX:1/c,scaleY:1/d},m=u+4,h=l+4,p=n.getCanvas("mesh",m,h),g=p.context,b=g.createImageData(u,l);if(r){let t=b.data;for(let n=0,i=t.length;n<i;n+=4)t[n]=r[0],t[n+1]=r[1],t[n+2]=r[2],t[n+3]=255}for(let t of this._figures)!function(t,r,n){let i,a,o=r.coords,s=r.colors;switch(r.type){case"lattice":let u=r.verticesPerRow,l=Math.floor(o.length/u)-1,c=u-1;for(i=0;i<l;i++){let r=i*u;for(let i=0;i<c;i++,r++)eV(t,n,o[r],o[r+1],o[r+u],s[r],s[r+1],s[r+u]),eV(t,n,o[r+u+1],o[r+1],o[r+u],s[r+u+1],s[r+1],s[r+u])}break;case"triangles":for(i=0,a=o.length;i<a;i+=3)eV(t,n,o[i],o[i+1],o[i+2],s[i],s[i+1],s[i+2]);break;default:throw Error("illegal figure")}}(b,t,f);return g.putImageData(b,2,2),{canvas:p.canvas,offsetX:i-2*c,offsetY:a-2*d,scaleX:c,scaleY:d}}getPattern(t,r,n,i){let a;if(eG(t,this._bbox),i===e_.SHADING)a=_.singularValueDecompose2dScale(el(t));else if(a=_.singularValueDecompose2dScale(r.baseTransform),this.matrix){let t=_.singularValueDecompose2dScale(this.matrix);a=[a[0]*t[0],a[1]*t[1]]}let o=this._createMeshCanvas(a,i===e_.SHADING?null:this._background,r.cachedCanvases);return i!==e_.SHADING&&(t.setTransform(...r.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(o.offsetX,o.offsetY),t.scale(o.scaleX,o.scaleY),t.createPattern(o.canvas,"no-repeat")}}class eU extends eH{getPattern(){return"hotpink"}}let eX={COLORED:1,UNCOLORED:2};class eQ{static MAX_PATTERN_SIZE=3e3;constructor(t,r,n,i,a){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=r,this.ctx=n,this.canvasGraphicsFactory=i,this.baseTransform=a}createPatternCanvas(t){let{bbox:r,operatorList:n,paintType:i,tilingType:a,color:o,canvasGraphicsFactory:s}=this,{xstep:u,ystep:l}=this;u=Math.abs(u),l=Math.abs(l),A("TilingType: "+a);let c=r[0],d=r[1],f=r[2],m=r[3],h=f-c,p=m-d,g=_.singularValueDecompose2dScale(this.matrix),b=_.singularValueDecompose2dScale(this.baseTransform),y=g[0]*b[0],v=g[1]*b[1],M=h,j=p,w=!1,I=!1,S=Math.ceil(l*v),P=Math.ceil(p*v);Math.ceil(u*y)>=Math.ceil(h*y)?M=u:w=!0,S>=P?j=l:I=!0;let N=this.getSizeAndScale(M,this.ctx.canvas.width,y),O=this.getSizeAndScale(j,this.ctx.canvas.height,v),x=t.cachedCanvases.getCanvas("pattern",N.size,O.size),D=x.context,L=s.createCanvasGraphics(D);if(L.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(L,i,o),D.translate(-N.scale*c,-O.scale*d),L.transform(N.scale,0,0,O.scale,0,0),D.save(),this.clipBbox(L,c,d,f,m),L.baseTransform=el(L.ctx),L.executeOperatorList(n),L.endDrawing(),D.restore(),w||I){let r=x.canvas;w&&(M=u),I&&(j=l);let n=this.getSizeAndScale(M,this.ctx.canvas.width,y),i=this.getSizeAndScale(j,this.ctx.canvas.height,v),a=n.size,o=i.size,s=t.cachedCanvases.getCanvas("pattern-workaround",a,o),f=s.context,m=w?Math.floor(h/u):0,g=I?Math.floor(p/l):0;for(let t=0;t<=m;t++)for(let n=0;n<=g;n++)f.drawImage(r,a*t,o*n,a,o,0,0,a,o);return{canvas:s.canvas,scaleX:n.scale,scaleY:i.scale,offsetX:c,offsetY:d}}return{canvas:x.canvas,scaleX:N.scale,scaleY:O.scale,offsetX:c,offsetY:d}}getSizeAndScale(t,r,n){let i=Math.max(eQ.MAX_PATTERN_SIZE,r),a=Math.ceil(t*n);return a>=i?a=i:n=a/t,{scale:n,size:a}}clipBbox(t,r,n,i,a){let o=i-r,s=a-n;t.ctx.rect(r,n,o,s),t.current.updateRectMinMax(el(t.ctx),[r,n,i,a]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,r,n){let i=t.ctx,a=t.current;switch(r){case eX.COLORED:let o=this.ctx;i.fillStyle=o.fillStyle,i.strokeStyle=o.strokeStyle,a.fillColor=o.fillStyle,a.strokeColor=o.strokeStyle;break;case eX.UNCOLORED:let s=_.makeHexColor(n[0],n[1],n[2]);i.fillStyle=s,i.strokeStyle=s,a.fillColor=s,a.strokeColor=s;break;default:throw new E(`Unsupported paint type: ${r}`)}}getPattern(t,r,n,i){let a=n;i!==e_.SHADING&&(a=_.transform(a,r.baseTransform),this.matrix&&(a=_.transform(a,this.matrix)));let o=this.createPatternCanvas(r),s=new DOMMatrix(a);s=(s=s.translate(o.offsetX,o.offsetY)).scale(1/o.scaleX,1/o.scaleY);let u=t.createPattern(o.canvas,"repeat");return u.setTransform(s),u}}class eJ{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,r,n){let i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,r,n)):(i=this.canvasFactory.create(r,n),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(let t in this.cache){let r=this.cache[t];this.canvasFactory.destroy(r),delete this.cache[t]}}}function eK(t,r,n,i,a,o,s,u,l,c){let[d,f,m,h,p,g]=el(t);if(0===f&&0===m){let b=Math.round(s*d+p),y=Math.round(u*h+g),v=Math.abs(Math.round((s+l)*d+p)-b)||1,M=Math.abs(Math.round((u+c)*h+g)-y)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(h),b,y),t.drawImage(r,n,i,a,o,0,0,v,M),t.setTransform(d,f,m,h,p,g),[v,M]}if(0===d&&0===h){let b=Math.round(u*m+p),y=Math.round(s*f+g),v=Math.abs(Math.round((u+c)*m+p)-b)||1,M=Math.abs(Math.round((s+l)*f+g)-y)||1;return t.setTransform(0,Math.sign(f),Math.sign(m),0,b,y),t.drawImage(r,n,i,a,o,0,0,M,v),t.setTransform(d,f,m,h,p,g),[M,v]}return t.drawImage(r,n,i,a,o,s,u,l,c),[Math.hypot(d,f)*l,Math.hypot(m,h)*c]}class eq{constructor(t,r){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=s,this.textMatrixScale=1,this.fontMatrix=u,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=h.FILL,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,r])}clone(){let t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,r){this.x=t,this.y=r}updatePathMinMax(t,r,n){[r,n]=_.applyTransform([r,n],t),this.minX=Math.min(this.minX,r),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,r),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,r){let n=_.applyTransform(r,t),i=_.applyTransform(r.slice(2),t),a=_.applyTransform([r[0],r[3]],t),o=_.applyTransform([r[2],r[1]],t);this.minX=Math.min(this.minX,n[0],i[0],a[0],o[0]),this.minY=Math.min(this.minY,n[1],i[1],a[1],o[1]),this.maxX=Math.max(this.maxX,n[0],i[0],a[0],o[0]),this.maxY=Math.max(this.maxY,n[1],i[1],a[1],o[1])}updateScalingPathMinMax(t,r){_.scaleMinMax(t,r),this.minX=Math.min(this.minX,r[0]),this.minY=Math.min(this.minY,r[1]),this.maxX=Math.max(this.maxX,r[2]),this.maxY=Math.max(this.maxY,r[3])}updateCurvePathMinMax(t,r,n,i,a,o,s,u,l,c){let d=_.bezierBoundingBox(r,n,i,a,o,s,u,l,c);c||this.updateRectMinMax(t,d)}getPathBoundingBox(t=e_.FILL,r=null){let n=[this.minX,this.minY,this.maxX,this.maxY];if(t===e_.STROKE){r||I("Stroke bounding box must include transform.");let t=_.singularValueDecompose2dScale(r),i=t[0]*this.lineWidth/2,a=t[1]*this.lineWidth/2;n[0]-=i,n[1]-=a,n[2]+=i,n[3]+=a}return n}updateClipFromPath(){let t=_.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(t=e_.FILL,r=null){return _.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}function e$(t,r){let n,i,a,o;if("undefined"!=typeof ImageData&&r instanceof ImageData)return void t.putImageData(r,0,0);let s=r.height,u=r.width,l=s%16,c=(s-l)/16,d=0===l?c:c+1,f=t.createImageData(u,16),m=0,h,g=r.data,b=f.data;if(r.kind===p.GRAYSCALE_1BPP){let r=g.byteLength,o=new Uint32Array(b.buffer,0,b.byteLength>>2),s=o.length,p=u+7>>3,y=R.isLittleEndian?0xff000000:255;for(n=0;n<d;n++){for(i=0,a=n<c?16:l,h=0;i<a;i++){let t=r-m,n=0,i=t>p?u:8*t-7,a=-8&i,s=0,l=0;for(;n<a;n+=8)l=g[m++],o[h++]=128&l?0xffffffff:y,o[h++]=64&l?0xffffffff:y,o[h++]=32&l?0xffffffff:y,o[h++]=16&l?0xffffffff:y,o[h++]=8&l?0xffffffff:y,o[h++]=4&l?0xffffffff:y,o[h++]=2&l?0xffffffff:y,o[h++]=1&l?0xffffffff:y;for(;n<i;n++)0===s&&(l=g[m++],s=128),o[h++]=l&s?0xffffffff:y,s>>=1}for(;h<s;)o[h++]=0;t.putImageData(f,0,16*n)}}else if(r.kind===p.RGBA_32BPP){for(n=0,i=0,o=16*u*4;n<c;n++)b.set(g.subarray(m,m+o)),m+=o,t.putImageData(f,0,i),i+=16;n<d&&(o=u*l*4,b.set(g.subarray(m,m+o)),t.putImageData(f,0,i))}else if(r.kind===p.RGB_24BPP)for(n=0,o=u*(a=16);n<d;n++){for(n>=c&&(o=u*(a=l)),h=0,i=o;i--;)b[h++]=g[m++],b[h++]=g[m++],b[h++]=g[m++],b[h++]=255;t.putImageData(f,0,16*n)}else throw Error(`bad image kind: ${r.kind}`)}function e0(t,r){if(r.bitmap)return void t.drawImage(r.bitmap,0,0);let n=r.height,i=r.width,a=n%16,o=(n-a)/16,s=0===a?o:o+1,u=t.createImageData(i,16),l=0,c=r.data,d=u.data;for(let r=0;r<s;r++){let n=r<o?16:a;({srcPos:l}=function({src:t,srcPos:r=0,dest:n,width:i,height:a,nonBlackColor:o=0xffffffff,inverseDecode:s=!1}){let u=R.isLittleEndian?0xff000000:255,[l,c]=s?[o,u]:[u,o],d=i>>3,f=7&i,m=t.length;n=new Uint32Array(n.buffer);let h=0;for(let i=0;i<a;i++){for(let i=r+d;r<i;r++){let i=r<m?t[r]:255;n[h++]=128&i?c:l,n[h++]=64&i?c:l,n[h++]=32&i?c:l,n[h++]=16&i?c:l,n[h++]=8&i?c:l,n[h++]=4&i?c:l,n[h++]=2&i?c:l,n[h++]=1&i?c:l}if(0===f)continue;let i=r<m?t[r++]:255;for(let t=0;t<f;t++)n[h++]=i&1<<7-t?c:l}return{srcPos:r,destPos:h}}({src:c,srcPos:l,dest:d,width:i,height:n,nonBlackColor:0})),t.putImageData(u,0,16*r)}}function e1(t,r){for(let n of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==t[n]&&(r[n]=t[n]);void 0!==t.setLineDash&&(r.setLineDash(t.getLineDash()),r.lineDashOffset=t.lineDashOffset)}function e4(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),!o){let{filter:r}=t;"none"!==r&&""!==r&&(t.filter="none")}}function e2(t,r){if(r)return!0;let n=_.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);let i=Math.fround((globalThis.devicePixelRatio||1)*X.PDF_TO_CSS_UNITS);return n[0]<=i&&n[1]<=i}let e3=["butt","round","square"],e5=["miter","round","bevel"],e9={},e6={};class e8{constructor(t,r,n,i,a,{optionalContentConfig:o,markedContentStack:s=null},u,l){this.ctx=t,this.current=new eq(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=r,this.objs=n,this.canvasFactory=i,this.filterFactory=a,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=s||[],this.optionalContentConfig=o,this.cachedCanvases=new eJ(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=u,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,r=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):r}beginDrawing({transform:t,viewport:r,transparency:n=!1,background:i=null}){let a=this.ctx.canvas.width,o=this.ctx.canvas.height,s=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,a,o),this.ctx.fillStyle=s,n){let t=this.cachedCanvases.getCanvas("transparent",a,o);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...el(this.compositeCtx))}this.ctx.save(),e4(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=el(this.ctx)}executeOperatorList(t,r,n,i){let a,o=t.argsArray,s=t.fnArray,u=r||0,l=o.length;if(l===u)return u;let c=l-u>10&&"function"==typeof n,d=c?Date.now()+15:0,f=0,m=this.commonObjs,h=this.objs;for(;;){if(void 0!==i&&u===i.nextBreakPoint)return i.breakIt(u,n),u;if((a=s[u])!==v.dependency)this[a].apply(this,o[u]);else for(let t of o[u]){let r=t.startsWith("g_")?m:h;if(!r.has(t))return r.get(t,n),u}if(++u===l)return u;if(c&&++f>10){if(Date.now()>d)return n(),u;f=0}}}#tN(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){for(let t of(this.#tN(),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())){for(let r of t.values())"undefined"!=typeof HTMLCanvasElement&&r instanceof HTMLCanvasElement&&(r.width=r.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#tO()}#tO(){if(this.pageColors){let t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){let r=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=r}}}_scaleImage(t,r){let n,i,a=t.width??t.displayWidth,o=t.height??t.displayHeight,s=Math.max(Math.hypot(r[0],r[1]),1),u=Math.max(Math.hypot(r[2],r[3]),1),l=a,c=o,d="prescale1";for(;s>2&&l>1||u>2&&c>1;){let r=l,a=c;s>2&&l>1&&(r=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),s/=l/r),u>2&&c>1&&(a=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,u/=c/a),(i=(n=this.cachedCanvases.getCanvas(d,r,a)).context).clearRect(0,0,r,a),i.drawImage(t,0,0,l,c,0,0,r,a),t=n.canvas,l=r,c=a,d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){let r,n,i,a,o=this.ctx,{width:s,height:u}=t,l=this.current.fillColor,c=this.current.patternFill,d=el(o);if((t.bitmap||t.data)&&t.count>1){let a=t.bitmap||t.data.buffer;n=JSON.stringify(c?d:[d.slice(0,4),l]),(r=this._cachedBitmapsMap.get(a))||(r=new Map,this._cachedBitmapsMap.set(a,r));let o=r.get(n);if(o&&!c)return{canvas:o,offsetX:Math.round(Math.min(d[0],d[2])+d[4]),offsetY:Math.round(Math.min(d[1],d[3])+d[5])};i=o}i||e0((a=this.cachedCanvases.getCanvas("maskCanvas",s,u)).context,t);let f=_.transform(d,[1/s,0,0,-1/u,0,0]);f=_.transform(f,[1,0,0,1,0,-u]);let[m,h,p,g]=_.getAxialAlignedBoundingBox([0,0,s,u],f),b=Math.round(p-m)||1,y=Math.round(g-h)||1,v=this.cachedCanvases.getCanvas("fillCanvas",b,y),M=v.context;M.translate(-m,-h),M.transform(...f),!i&&(i=(i=this._scaleImage(a.canvas,ec(M))).img,r&&c&&r.set(n,i)),M.imageSmoothingEnabled=e2(el(M),t.interpolate),eK(M,i,0,0,i.width,i.height,0,0,s,u),M.globalCompositeOperation="source-in";let j=_.transform(ec(M),[1,0,0,1,-m,-h]);return M.fillStyle=c?l.getPattern(o,this,j,e_.FILL):l,M.fillRect(0,0,s,u),r&&!c&&(this.cachedCanvases.delete("fillCanvas"),r.set(n,v.canvas)),{canvas:v.canvas,offsetX:Math.round(m),offsetY:Math.round(h)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=e3[t]}setLineJoin(t){this.ctx.lineJoin=e5[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,r){let n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=r)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let[r,n]of t)switch(r){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error("beginSMaskMode called while already in smask mode");let t=this.ctx.canvas.width,r=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(n,t,r);this.suspendedCtx=this.ctx,this.ctx=i.context;let a=this.ctx;a.setTransform(...el(this.suspendedCtx)),e1(this.suspendedCtx,a);var o=this.suspendedCtx;if(a._removeMirroring)throw Error("Context is already forwarding operations.");a.__originalSave=a.save,a.__originalRestore=a.restore,a.__originalRotate=a.rotate,a.__originalScale=a.scale,a.__originalTranslate=a.translate,a.__originalTransform=a.transform,a.__originalSetTransform=a.setTransform,a.__originalResetTransform=a.resetTransform,a.__originalClip=a.clip,a.__originalMoveTo=a.moveTo,a.__originalLineTo=a.lineTo,a.__originalBezierCurveTo=a.bezierCurveTo,a.__originalRect=a.rect,a.__originalClosePath=a.closePath,a.__originalBeginPath=a.beginPath,a._removeMirroring=()=>{a.save=a.__originalSave,a.restore=a.__originalRestore,a.rotate=a.__originalRotate,a.scale=a.__originalScale,a.translate=a.__originalTranslate,a.transform=a.__originalTransform,a.setTransform=a.__originalSetTransform,a.resetTransform=a.__originalResetTransform,a.clip=a.__originalClip,a.moveTo=a.__originalMoveTo,a.lineTo=a.__originalLineTo,a.bezierCurveTo=a.__originalBezierCurveTo,a.rect=a.__originalRect,a.closePath=a.__originalClosePath,a.beginPath=a.__originalBeginPath,delete a._removeMirroring},a.save=function(){o.save(),this.__originalSave()},a.restore=function(){o.restore(),this.__originalRestore()},a.translate=function(t,r){o.translate(t,r),this.__originalTranslate(t,r)},a.scale=function(t,r){o.scale(t,r),this.__originalScale(t,r)},a.transform=function(t,r,n,i,a,s){o.transform(t,r,n,i,a,s),this.__originalTransform(t,r,n,i,a,s)},a.setTransform=function(t,r,n,i,a,s){o.setTransform(t,r,n,i,a,s),this.__originalSetTransform(t,r,n,i,a,s)},a.resetTransform=function(){o.resetTransform(),this.__originalResetTransform()},a.rotate=function(t){o.rotate(t),this.__originalRotate(t)},a.clip=function(t){o.clip(t),this.__originalClip(t)},a.moveTo=function(t,r){o.moveTo(t,r),this.__originalMoveTo(t,r)},a.lineTo=function(t,r){o.lineTo(t,r),this.__originalLineTo(t,r)},a.bezierCurveTo=function(t,r,n,i,a,s){o.bezierCurveTo(t,r,n,i,a,s),this.__originalBezierCurveTo(t,r,n,i,a,s)},a.rect=function(t,r,n,i){o.rect(t,r,n,i),this.__originalRect(t,r,n,i)},a.closePath=function(){o.closePath(),this.__originalClosePath()},a.beginPath=function(){o.beginPath(),this.__originalBeginPath()},this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),e1(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];let r=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,r,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,r,n,i){let a=i[0],o=i[1],s=i[2]-a,u=i[3]-o;0!==s&&0!==u&&(this.genericComposeSMask(r.context,n,s,u,r.subtype,r.backdrop,r.transferMap,a,o,r.offsetX,r.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(n.canvas,0,0),t.restore())}genericComposeSMask(t,r,n,i,a,o,s,u,l,c,d){let f=t.canvas,m=u-c,h=l-d;if(o){let r=_.makeHexColor(...o);if(m<0||h<0||m+n>f.width||h+i>f.height){let t=this.cachedCanvases.getCanvas("maskExtension",n,i),a=t.context;a.drawImage(f,-m,-h),a.globalCompositeOperation="destination-atop",a.fillStyle=r,a.fillRect(0,0,n,i),a.globalCompositeOperation="source-over",f=t.canvas,m=h=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);let a=new Path2D;a.rect(m,h,n,i),t.clip(a),t.globalCompositeOperation="destination-atop",t.fillStyle=r,t.fillRect(m,h,n,i),t.restore()}}r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0),"Alpha"===a&&s?r.filter=this.filterFactory.addAlphaFilter(s):"Luminosity"===a&&(r.filter=this.filterFactory.addLuminosityFilter(s));let p=new Path2D;p.rect(u,l,n,i),r.clip(p),r.globalCompositeOperation="destination-in",r.drawImage(f,m,h,n,i,u,l,n,i),r.restore()}save(){this.inSMaskMode?(e1(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let 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(),e1(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,r,n,i,a,o){this.ctx.transform(t,r,n,i,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,r,n){let i,a,o=this.ctx,s=this.current,u=s.x,l=s.y,c=el(o),d=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],f=d?n.slice(0):null;for(let n=0,m=0,h=t.length;n<h;n++)switch(0|t[n]){case v.rectangle:u=r[m++],l=r[m++];let h=r[m++],p=r[m++],g=u+h,b=l+p;o.moveTo(u,l),0===h||0===p?o.lineTo(g,b):(o.lineTo(g,l),o.lineTo(g,b),o.lineTo(u,b)),d||s.updateRectMinMax(c,[u,l,g,b]),o.closePath();break;case v.moveTo:u=r[m++],l=r[m++],o.moveTo(u,l),d||s.updatePathMinMax(c,u,l);break;case v.lineTo:u=r[m++],l=r[m++],o.lineTo(u,l),d||s.updatePathMinMax(c,u,l);break;case v.curveTo:i=u,a=l,u=r[m+4],l=r[m+5],o.bezierCurveTo(r[m],r[m+1],r[m+2],r[m+3],u,l),s.updateCurvePathMinMax(c,i,a,r[m],r[m+1],r[m+2],r[m+3],u,l,f),m+=6;break;case v.curveTo2:i=u,a=l,o.bezierCurveTo(u,l,r[m],r[m+1],r[m+2],r[m+3]),s.updateCurvePathMinMax(c,i,a,u,l,r[m],r[m+1],r[m+2],r[m+3],f),u=r[m+2],l=r[m+3],m+=4;break;case v.curveTo3:i=u,a=l,u=r[m+2],l=r[m+3],o.bezierCurveTo(r[m],r[m+1],u,l,u,l),s.updateCurvePathMinMax(c,i,a,r[m],r[m+1],u,l,u,l,f),m+=4;break;case v.closePath:o.closePath()}d&&s.updateScalingPathMinMax(c,f),s.setCurrentPoint(u,l)}closePath(){this.ctx.closePath()}stroke(t=!0){let r=this.ctx,n=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof n&&n?.getPattern?(r.save(),r.strokeStyle=n.getPattern(r,this,ec(r),e_.STROKE),this.rescaleAndStroke(!1),r.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),r.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){let r=this.ctx,n=this.current.fillColor,i=this.current.patternFill,a=!1;i&&(r.save(),r.fillStyle=n.getPattern(r,this,ec(r),e_.FILL),a=!0);let o=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==o&&(this.pendingEOFill?(r.fill("evenodd"),this.pendingEOFill=!1):r.fill()),a&&r.restore(),t&&this.consumePath(o)}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=e9}eoClip(){this.pendingClip=e6}beginText(){this.current.textMatrix=s,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let t=this.pendingTextPaths,r=this.ctx;if(void 0===t)return void r.beginPath();for(let n of(r.save(),r.beginPath(),t))r.setTransform(...n.transform),r.translate(n.x,n.y),n.addToPath(r,n.fontSize);r.restore(),r.clip(),r.beginPath(),delete this.pendingTextPaths}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,r){let n=this.commonObjs.get(t),i=this.current;if(!n)throw Error(`Can't find font for ${t}`);if(i.fontMatrix=n.fontMatrix||u,(0===i.fontMatrix[0]||0===i.fontMatrix[3])&&w("Invalid font matrix for font "+t),r<0?(r=-r,i.fontDirection=-1):i.fontDirection=1,this.current.font=n,this.current.fontSize=r,n.isType3Font)return;let a=n.loadedName||"sans-serif",o=n.systemFontInfo?.css||`"${a}", ${n.fallbackName}`,s="normal";n.black?s="900":n.bold&&(s="bold");let l=n.italic?"italic":"normal",c=r;r<16?c=16:r>100&&(c=100),this.current.fontSizeScale=r/c,this.ctx.font=`${l} ${s} ${c}px ${o}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,r){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,r){this.setLeading(-r),this.moveText(t,r)}setTextMatrix(t,r,n,i,a,o){this.current.textMatrix=[t,r,n,i,a,o],this.current.textMatrixScale=Math.hypot(t,r),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,r,n,i){let a,o=this.ctx,s=this.current,u=s.font,l=s.textRenderingMode,c=s.fontSize/s.fontSizeScale,d=l&h.FILL_STROKE_MASK,f=!!(l&h.ADD_TO_PATH_FLAG),m=s.patternFill&&!u.missingFile;(u.disableFontFace||f||m)&&(a=u.getPathGenerator(this.commonObjs,t)),u.disableFontFace||m?(o.save(),o.translate(r,n),o.beginPath(),a(o,c),i&&o.setTransform(...i),(d===h.FILL||d===h.FILL_STROKE)&&o.fill(),(d===h.STROKE||d===h.FILL_STROKE)&&o.stroke(),o.restore()):((d===h.FILL||d===h.FILL_STROKE)&&o.fillText(t,r,n),(d===h.STROKE||d===h.FILL_STROKE)&&o.strokeText(t,r,n)),f&&(this.pendingTextPaths||=[]).push({transform:el(o),x:r,y:n,fontSize:c,addToPath:a})}get isFontSubpixelAAEnabled(){let{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);let r=t.getImageData(0,0,10,10).data,n=!1;for(let t=3;t<r.length;t+=4)if(r[t]>0&&r[t]<255){n=!0;break}return N(this,"isFontSubpixelAAEnabled",n)}showText(t){let r,n=this.current,i=n.font;if(i.isType3Font)return this.showType3Text(t);let a=n.fontSize;if(0===a)return;let o=this.ctx,s=n.fontSizeScale,u=n.charSpacing,l=n.wordSpacing,c=n.fontDirection,d=n.textHScale*c,f=t.length,m=i.vertical,p=m?1:-1,g=i.defaultVMetrics,b=a*n.fontMatrix[0],y=n.textRenderingMode===h.FILL&&!i.disableFontFace&&!n.patternFill;if(o.save(),o.transform(...n.textMatrix),o.translate(n.x,n.y+n.textRise),c>0?o.scale(d,-1):o.scale(d,1),n.patternFill){o.save();let t=n.fillColor.getPattern(o,this,ec(o),e_.FILL);r=el(o),o.restore(),o.fillStyle=t}let v=n.lineWidth,M=n.textMatrixScale;if(0===M||0===v){let t=n.textRenderingMode&h.FILL_STROKE_MASK;(t===h.STROKE||t===h.FILL_STROKE)&&(v=this.getSinglePixelWidth())}else v/=M;if(1!==s&&(o.scale(s,s),v/=s),o.lineWidth=v,i.isInvalidPDFjsFont){let r=[],i=0;for(let n of t)r.push(n.unicode),i+=n.width;o.fillText(r.join(""),0,0),n.x+=i*b*d,o.restore(),this.compose();return}let j=0,A;for(A=0;A<f;++A){let n,d,f=t[A];if("number"==typeof f){j+=p*f*a/1e3;continue}let h=!1,v=(f.isSpace?l:0)+u,M=f.fontChar,w=f.accent,I=f.width;if(m){let t=f.vmetric||g,r=-(f.vmetric?t[1]:.5*I)*b,i=t[2]*b;I=t?-t[0]:I,n=r/s,d=(j+i)/s}else n=j/s,d=0;if(i.remeasure&&I>0){let t=1e3*o.measureText(M).width/a*s;if(I<t&&this.isFontSubpixelAAEnabled){let r=I/t;h=!0,o.save(),o.scale(r,1),n/=r}else I!==t&&(n+=(I-t)/2e3*a/s)}if(this.contentVisible&&(f.isInFont||i.missingFile)){if(y&&!w)o.fillText(M,n,d);else if(this.paintChar(M,n,d,r),w){let t=n+a*w.offset.x/s,i=d-a*w.offset.y/s;this.paintChar(w.fontChar,t,i,r)}}j+=m?I*b-v*c:I*b+v*c,h&&o.restore()}m?n.y-=j:n.x+=j*d,o.restore(),this.compose()}showType3Text(t){let r,n,i,a,o=this.ctx,s=this.current,l=s.font,c=s.fontSize,d=s.fontDirection,f=l.vertical?1:-1,m=s.charSpacing,p=s.wordSpacing,g=s.textHScale*d,b=s.fontMatrix||u,y=t.length;if(s.textRenderingMode!==h.INVISIBLE&&0!==c){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,o.save(),o.transform(...s.textMatrix),o.translate(s.x,s.y),o.scale(g,d),r=0;r<y;++r){if("number"==typeof(n=t[r])){a=f*n*c/1e3,this.ctx.translate(a,0),s.x+=a*g;continue}let u=(n.isSpace?p:0)+m,d=l.charProcOperatorList[n.operatorListId];if(!d){w(`Type3 character "${n.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=n,this.save(),o.scale(c,c),o.transform(...b),this.executeOperatorList(d),this.restore()),i=_.applyTransform([n.width,0],b)[0]*c+u,o.translate(i,0),s.x+=i*g}o.restore(),this.processingType3=null}}setCharWidth(t,r){}setCharWidthAndBounds(t,r,n,i,a,o){this.ctx.rect(n,i,a-n,o-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let r;if("TilingPattern"===t[0]){let n=t[1],i=this.baseTransform||el(this.ctx);r=new eQ(t,n,this.ctx,{createCanvasGraphics:t=>new e8(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},i)}else r=this._getPattern(t[1],t[2]);return r}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,r,n){this.ctx.strokeStyle=this.current.strokeColor=_.makeHexColor(t,r,n)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(t,r,n){this.ctx.fillStyle=this.current.fillColor=_.makeHexColor(t,r,n),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,r=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=function(t){switch(t[0]){case"RadialAxial":return new eF(t);case"Mesh":return new eB(t);case"Dummy":return new eU}throw Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,n)),r&&(n.matrix=r),n}shadingFill(t){if(!this.contentVisible)return;let r=this.ctx;this.save(),r.fillStyle=this._getPattern(t).getPattern(r,this,ec(r),e_.SHADING);let n=ec(r);if(n){let{width:t,height:i}=r.canvas,[a,o,s,u]=_.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(a,o,s-a,u-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){I("Should not call beginInlineImage")}beginImageData(){I("Should not call beginImageData")}paintFormXObjectBegin(t,r){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=el(this.ctx),r)){let t=r[2]-r[0],n=r[3]-r[1];this.ctx.rect(r[0],r[1],t,n),this.current.updateRectMinMax(el(this.ctx),r),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);let r=this.ctx;t.isolated||A("TODO: Support non-isolated groups."),t.knockout&&w("Knockout groups not supported.");let n=el(r);if(t.matrix&&r.transform(...t.matrix),!t.bbox)throw Error("Bounding box is required.");let i=_.getAxialAlignedBoundingBox(t.bbox,el(r)),a=[0,0,r.canvas.width,r.canvas.height],o=Math.floor((i=_.intersect(i,a)||[0,0,0,0])[0]),s=Math.floor(i[1]),u=Math.max(Math.ceil(i[2])-o,1),l=Math.max(Math.ceil(i[3])-s,1);this.current.startNewPathAndClipBox([0,0,u,l]);let c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);let d=this.cachedCanvases.getCanvas(c,u,l),f=d.context;f.translate(-o,-s),f.transform(...n),t.smask?this.smaskStack.push({canvas:d.canvas,context:f,offsetX:o,offsetY:s,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(r.setTransform(1,0,0,1,0,0),r.translate(o,s),r.save()),e1(r,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;let r=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let t=el(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);let n=_.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],t);this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(t,r,n,i,a){if(this.#tN(),e4(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){let i=r[2]-r[0],o=r[3]-r[1];if(a&&this.annotationCanvasMap){n=n.slice(),n[4]-=r[0],n[5]-=r[1],(r=r.slice())[0]=r[1]=0,r[2]=i,r[3]=o;let[a,s]=_.singularValueDecompose2dScale(el(this.ctx)),{viewportScale:u}=this,l=Math.ceil(i*this.outputScaleX*u),c=Math.ceil(o*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(l,c);let{canvas:d,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(t,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.save(),this.ctx.setTransform(a,0,0,-s,0,o*s),e4(this.ctx)}else e4(this.ctx),this.endPath(),this.ctx.rect(r[0],r[1],i,o),this.ctx.clip(),this.ctx.beginPath()}this.current=new eq(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#tO(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;let r=t.count;(t=this.getObject(t.data,t)).count=r;let n=this.ctx,i=this.processingType3;if(i&&(void 0===i.compiled&&(i.compiled=function(t){let r,n,i,{width:a,height:o}=t;if(a>1e3||o>1e3)return null;let s=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),u=a+1,l=new Uint8Array(u*(o+1)),c=a+7&-8,d=new Uint8Array(c*o),f=0;for(let r of t.data){let t=128;for(;t>0;)d[f++]=r&t?0:255,t>>=1}let m=0;for(0!==d[f=0]&&(l[0]=1,++m),n=1;n<a;n++)d[f]!==d[f+1]&&(l[n]=d[f]?2:1,++m),f++;for(0!==d[f]&&(l[n]=2,++m),r=1;r<o;r++){f=r*c,i=r*u,d[f-c]!==d[f]&&(l[i]=d[f]?1:8,++m);let t=4*!!d[f]+8*!!d[f-c];for(n=1;n<a;n++)s[t=(t>>2)+4*!!d[f+1]+8*!!d[f-c+1]]&&(l[i+n]=s[t],++m),f++;if(d[f-c]!==d[f]&&(l[i+n]=d[f]?2:4,++m),m>1e3)return null}for(f=c*(o-1),i=r*u,0!==d[f]&&(l[i]=8,++m),n=1;n<a;n++)d[f]!==d[f+1]&&(l[i+n]=d[f]?4:8,++m),f++;if(0!==d[f]&&(l[i+n]=4,++m),m>1e3)return null;let h=new Int32Array([0,u,-1,0,-u,0,0,0,1]),p=new Path2D;for(r=0;m&&r<=o;r++){let t=r*u,n=t+a;for(;t<n&&!l[t];)t++;if(t===n)continue;p.moveTo(t%u,r);let i=t,o=l[t];do{let r=h[o];do t+=r;while(!l[t])let n=l[t];5!==n&&10!==n?(o=n,l[t]=0):(o=n&51*o>>4,l[t]&=o>>2|o<<2),p.lineTo(t%u,t/u|0),!l[t]&&--m}while(i!==t)--r}return d=null,l=null,function(t){t.save(),t.scale(1/a,-1/o),t.translate(0,-o),t.fill(p),t.beginPath(),t.restore()}}(t)),i.compiled))return void i.compiled(n);let a=this._createMaskCanvas(t),o=a.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(o,a.offsetX,a.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,r,n=0,i=0,a,o){if(!this.contentVisible)return;t=this.getObject(t.data,t);let s=this.ctx;s.save();let u=el(s);s.transform(r,n,i,a,0,0);let l=this._createMaskCanvas(t);s.setTransform(1,0,0,1,l.offsetX-u[4],l.offsetY-u[5]);for(let t=0,c=o.length;t<c;t+=2){let c=_.transform(u,[r,n,i,a,o[t],o[t+1]]),[d,f]=_.applyTransform([0,0],c);s.drawImage(l.canvas,d,f)}s.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;let r=this.ctx,n=this.current.fillColor,i=this.current.patternFill;for(let a of t){let{data:t,width:o,height:s,transform:u}=a,l=this.cachedCanvases.getCanvas("maskCanvas",o,s),c=l.context;c.save(),e0(c,this.getObject(t,a)),c.globalCompositeOperation="source-in",c.fillStyle=i?n.getPattern(c,this,ec(r),e_.FILL):n,c.fillRect(0,0,o,s),c.restore(),r.save(),r.transform(...u),r.scale(1,-1),eK(r,l.canvas,0,0,o,s,0,-1,1,1),r.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;let r=this.getObject(t);if(!r)return void w("Dependent image isn't ready yet");this.paintInlineImageXObject(r)}paintImageXObjectRepeat(t,r,n,i){if(!this.contentVisible)return;let a=this.getObject(t);if(!a)return void w("Dependent image isn't ready yet");let o=a.width,s=a.height,u=[];for(let t=0,a=i.length;t<a;t+=2)u.push({transform:[r,0,0,n,i[t],i[t+1]],x:0,y:0,w:o,h:s});this.paintInlineImageXObjectGroup(a,u)}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;let{bitmap:r,width:n,height:i}=t,a=this.cachedCanvases.getCanvas("inlineImage",n,i),o=a.context;return o.filter=this.current.transferMaps,o.drawImage(r,0,0),o.filter="none",a.canvas}paintInlineImageXObject(t){let r;if(!this.contentVisible)return;let n=t.width,i=t.height,a=this.ctx;if(this.save(),!o){let{filter:t}=a;"none"!==t&&""!==t&&(a.filter="none")}if(a.scale(1/n,-1/i),t.bitmap)r=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)r=t;else{let a=this.cachedCanvases.getCanvas("inlineImage",n,i).context;e$(a,t),r=this.applyTransferMapsToCanvas(a)}let s=this._scaleImage(r,ec(a));a.imageSmoothingEnabled=e2(el(a),t.interpolate),eK(a,s.img,0,0,s.paintWidth,s.paintHeight,0,-i,n,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,r){let n;if(!this.contentVisible)return;let i=this.ctx;if(t.bitmap)n=t.bitmap;else{let r=t.width,i=t.height,a=this.cachedCanvases.getCanvas("inlineImage",r,i).context;e$(a,t),n=this.applyTransferMapsToCanvas(a)}for(let t of r)i.save(),i.transform(...t.transform),i.scale(1,-1),eK(i,n,t.x,t.y,t.w,t.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,r){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,r){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){let r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);let n=this.ctx;this.pendingClip&&(r||(this.pendingClip===e6?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let t=el(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{let r=Math.abs(t[0]*t[3]-t[2]*t[1]),n=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/r}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){let t,r,{lineWidth:n}=this.current,{a:i,b:a,c:o,d:s}=this.ctx.getTransform();if(0===a&&0===o){let a=Math.abs(i),o=Math.abs(s);if(a===o)if(0===n)t=r=1/a;else{let i=a*n;t=r=i<1?1/i:1}else if(0===n)t=1/a,r=1/o;else{let i=a*n,s=o*n;t=i<1?1/i:1,r=s<1?1/s:1}}else{let u=Math.abs(i*s-a*o),l=Math.hypot(i,a),c=Math.hypot(o,s);if(0===n)t=c/u,r=l/u;else{let i=n*u;t=c>i?c/i:1,r=l>i?l/i:1}}this._cachedScaleForStroking[0]=t,this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}rescaleAndStroke(t){let{ctx:r}=this,{lineWidth:n}=this.current,[i,a]=this.getScaleForStroking();if(r.lineWidth=n||1,1===i&&1===a)return void r.stroke();let o=r.getLineDash();if(t&&r.save(),r.scale(i,a),o.length>0){let t=Math.max(i,a);r.setLineDash(o.map(r=>r/t)),r.lineDashOffset/=t}r.stroke(),t&&r.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(let t in v)void 0!==e8.prototype[t]&&(e8.prototype[v[t]]=e8.prototype[t]);class e7{static #tx=null;static #tD="";static get workerPort(){return this.#tx}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw Error("Invalid `workerPort` type.");this.#tx=t}static get workerSrc(){return this.#tD}static set workerSrc(t){if("string"!=typeof t)throw Error("Invalid `workerSrc` type.");this.#tD=t}}let te={DATA:1,ERROR:2},tt={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function tr(t){switch(!(t instanceof Error||"object"==typeof t&&null!==t)&&I('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new T(t.message);case"MissingPDFException":return new C(t.message);case"PasswordException":return new x(t.message,t.code);case"UnexpectedResponseException":return new k(t.message,t.status);case"UnknownErrorException":return new D(t.message,t.details);default:return new D(t.message,t.toString())}}class tn{#tL=new AbortController;constructor(t,r,n){this.sourceName=t,this.targetName=r,this.comObj=n,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),n.addEventListener("message",this.#tC.bind(this),{signal:this.#tL.signal})}#tC({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#tk(t);if(t.callback){let r=t.callbackId,n=this.callbackCapabilities[r];if(!n)throw Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],t.callback===te.DATA)n.resolve(t.data);else if(t.callback===te.ERROR)n.reject(tr(t.reason));else throw Error("Unexpected callback case");return}let r=this.actionHandler[t.action];if(!r)throw Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){let n=this.sourceName,i=t.sourceName,a=this.comObj;new Promise(function(n){n(r(t.data))}).then(function(r){a.postMessage({sourceName:n,targetName:i,callback:te.DATA,callbackId:t.callbackId,data:r})},function(r){a.postMessage({sourceName:n,targetName:i,callback:te.ERROR,callbackId:t.callbackId,reason:tr(r)})});return}if(t.streamId)return void this.#tE(t);r(t.data)}on(t,r){let n=this.actionHandler;if(n[t])throw Error(`There is already an actionName called "${t}"`);n[t]=r}send(t,r,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},n)}sendWithPromise(t,r,n){let i=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:r},n)}catch(t){a.reject(t)}return a.promise}sendWithStream(t,r,n,i){let a=this.streamId++,o=this.sourceName,s=this.targetName,u=this.comObj;return new ReadableStream({start:n=>{let l=Promise.withResolvers();return this.streamControllers[a]={controller:n,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},u.postMessage({sourceName:o,targetName:s,action:t,streamId:a,data:r,desiredSize:n.desiredSize},i),l.promise},pull:t=>{let r=Promise.withResolvers();return this.streamControllers[a].pullCall=r,u.postMessage({sourceName:o,targetName:s,stream:tt.PULL,streamId:a,desiredSize:t.desiredSize}),r.promise},cancel:t=>{S(t instanceof Error,"cancel must have a valid reason");let r=Promise.withResolvers();return this.streamControllers[a].cancelCall=r,this.streamControllers[a].isClosed=!0,u.postMessage({sourceName:o,targetName:s,stream:tt.CANCEL,streamId:a,reason:tr(t)}),r.promise}},n)}#tE(t){let r=t.streamId,n=this.sourceName,i=t.sourceName,a=this.comObj,o=this,s=this.actionHandler[t.action],u={enqueue(t,o=1,s){if(this.isCancelled)return;let u=this.desiredSize;this.desiredSize-=o,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:n,targetName:i,stream:tt.ENQUEUE,streamId:r,chunk:t},s)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:tt.CLOSE,streamId:r}),delete o.streamSinks[r])},error(t){S(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:tt.ERROR,streamId:r,reason:tr(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[r]=u,new Promise(function(r){r(s(t.data,u))}).then(function(){a.postMessage({sourceName:n,targetName:i,stream:tt.START_COMPLETE,streamId:r,success:!0})},function(t){a.postMessage({sourceName:n,targetName:i,stream:tt.START_COMPLETE,streamId:r,reason:tr(t)})})}#tk(t){let r=t.streamId,n=this.sourceName,i=t.sourceName,a=this.comObj,o=this.streamControllers[r],s=this.streamSinks[r];switch(t.stream){case tt.START_COMPLETE:t.success?o.startCall.resolve():o.startCall.reject(tr(t.reason));break;case tt.PULL_COMPLETE:t.success?o.pullCall.resolve():o.pullCall.reject(tr(t.reason));break;case tt.PULL:if(!s){a.postMessage({sourceName:n,targetName:i,stream:tt.PULL_COMPLETE,streamId:r,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,new Promise(function(t){t(s.onPull?.())}).then(function(){a.postMessage({sourceName:n,targetName:i,stream:tt.PULL_COMPLETE,streamId:r,success:!0})},function(t){a.postMessage({sourceName:n,targetName:i,stream:tt.PULL_COMPLETE,streamId:r,reason:tr(t)})});break;case tt.ENQUEUE:if(S(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(t.chunk);break;case tt.CLOSE:if(S(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),this.#tT(o,r);break;case tt.ERROR:S(o,"error should have stream controller"),o.controller.error(tr(t.reason)),this.#tT(o,r);break;case tt.CANCEL_COMPLETE:t.success?o.cancelCall.resolve():o.cancelCall.reject(tr(t.reason)),this.#tT(o,r);break;case tt.CANCEL:if(!s)break;new Promise(function(r){r(s.onCancel?.(tr(t.reason)))}).then(function(){a.postMessage({sourceName:n,targetName:i,stream:tt.CANCEL_COMPLETE,streamId:r,success:!0})},function(t){a.postMessage({sourceName:n,targetName:i,stream:tt.CANCEL_COMPLETE,streamId:r,reason:tr(t)})}),s.sinkCapability.reject(tr(t.reason)),s.isCancelled=!0,delete this.streamSinks[r];break;default:throw Error("Unexpected stream case")}}async #tT(t,r){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[r]}destroy(){this.#tL?.abort(),this.#tL=null}}class ti{#tz;#tW;constructor({parsedData:t,rawData:r}){this.#tz=t,this.#tW=r}getRaw(){return this.#tW}get(t){return this.#tz.get(t)??null}getAll(){return Z(this.#tz)}has(t){return this.#tz.has(t)}}let ta=Symbol("INTERNAL");class to{#tZ=!1;#tR=!1;#tY=!1;#t_=!0;constructor(t,{name:r,intent:n,usage:i,rbGroups:a}){this.#tZ=!!(t&l.DISPLAY),this.#tR=!!(t&l.PRINT),this.name=r,this.intent=n,this.usage=i,this.rbGroups=a}get visible(){if(this.#tY)return this.#t_;if(!this.#t_)return!1;let{print:t,view:r}=this.usage;return this.#tZ?r?.viewState!=="OFF":!this.#tR||t?.printState!=="OFF"}_setVisible(t,r,n=!1){t!==ta&&I("Internal method `_setVisible` called."),this.#tY=n,this.#t_=r}}class ts{#tG=null;#tH=new Map;#tF=null;#tV=null;constructor(t,r=l.DISPLAY){if(this.renderingIntent=r,this.name=null,this.creator=null,null===t)return;for(let n of(this.name=t.name,this.creator=t.creator,this.#tV=t.order,t.groups))this.#tH.set(n.id,new to(r,n));if("OFF"===t.baseState)for(let t of this.#tH.values())t._setVisible(ta,!1);for(let r of t.on)this.#tH.get(r)._setVisible(ta,!0);for(let r of t.off)this.#tH.get(r)._setVisible(ta,!1);this.#tF=this.getHash()}#tB(t){let r=t.length;if(r<2)return!0;let n=t[0];for(let i=1;i<r;i++){let r,a=t[i];if(Array.isArray(a))r=this.#tB(a);else{if(!this.#tH.has(a))return w(`Optional content group not found: ${a}`),!0;r=this.#tH.get(a).visible}switch(n){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===n}isVisible(t){if(0===this.#tH.size)return!0;if(!t)return A("Optional content group not defined."),!0;if("OCG"===t.type)return this.#tH.has(t.id)?this.#tH.get(t.id).visible:(w(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#tB(t.expression);if(t.policy&&"AnyOn"!==t.policy){if("AllOn"===t.policy){for(let r of t.ids){if(!this.#tH.has(r)){w(`Optional content group not found: ${r}`);break}if(!this.#tH.get(r).visible)return!1}return!0}else if("AnyOff"===t.policy){for(let r of t.ids){if(!this.#tH.has(r))return w(`Optional content group not found: ${r}`),!0;if(!this.#tH.get(r).visible)return!0}return!1}else if("AllOff"===t.policy){for(let r of t.ids){if(!this.#tH.has(r)){w(`Optional content group not found: ${r}`);break}if(this.#tH.get(r).visible)return!1}return!0}}else{for(let r of t.ids){if(!this.#tH.has(r))return w(`Optional content group not found: ${r}`),!0;if(this.#tH.get(r).visible)return!0}return!1}return w(`Unknown optional content policy ${t.policy}.`),!0}return w(`Unknown group type ${t.type}.`),!0}setVisibility(t,r=!0,n=!0){let i=this.#tH.get(t);if(!i)return void w(`Optional content group not found: ${t}`);if(n&&r&&i.rbGroups.length)for(let r of i.rbGroups)for(let n of r)n!==t&&this.#tH.get(n)?._setVisible(ta,!1,!0);i._setVisible(ta,!!r,!0),this.#tG=null}setOCGState({state:t,preserveRB:r}){let n;for(let i of t){switch(i){case"ON":case"OFF":case"Toggle":n=i;continue}let t=this.#tH.get(i);if(t)switch(n){case"ON":this.setVisibility(i,!0,r);break;case"OFF":this.setVisibility(i,!1,r);break;case"Toggle":this.setVisibility(i,!t.visible,r)}}this.#tG=null}get hasInitialVisibility(){return null===this.#tF||this.getHash()===this.#tF}getOrder(){return this.#tH.size?this.#tV?this.#tV.slice():[...this.#tH.keys()]:null}getGroups(){return this.#tH.size>0?Z(this.#tH):null}getGroup(t){return this.#tH.get(t)||null}getHash(){if(null!==this.#tG)return this.#tG;let t=new eS;for(let[r,n]of this.#tH)t.update(`${r}:${n.visible}`);return this.#tG=t.hexdigest()}}class tu{constructor(t,{disableRange:r=!1,disableStream:n=!1}){S(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:i,initialData:a,progressiveDone:o,contentDispositionFilename:s}=t;if(this._queuedChunks=[],this._progressiveDone=o,this._contentDispositionFilename=s,a?.length>0){let t=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!r,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,r)=>{this._onReceiveData({begin:t,chunk:r})}),t.addProgressListener((t,r)=>{this._onProgress({loaded:t,total:r})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:r}){let n=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;void 0===t?this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n):S(this._rangeReaders.some(function(r){return r._begin===t&&(r._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){let r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}getFullReader(){S(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let t=this._queuedChunks;return this._queuedChunks=null,new tl(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;let n=new tc(this,t,r);return this._pdfDataRangeTransport.requestDataRange(t,r),this._rangeReaders.push(n),n}cancelAllRequests(t){for(let r of(this._fullRequestReader?.cancel(t),this._rangeReaders.slice(0)))r.cancel(t);this._pdfDataRangeTransport.abort()}}class tl{constructor(t,r,n=!1,i=null){for(let a of(this._stream=t,this._done=n||!1,this._filename=$(i)?i:null,this._queuedChunks=r||[],this._loaded=0,this._queuedChunks))this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):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};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class tc{constructor(t,r,n){this._stream=t,this._begin=r,this._end=n,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{for(let r of(this._requests.shift().resolve({value:t,done:!1}),this._requests))r.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){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function td(t,r){let n=new Headers;if(!t||!r||"object"!=typeof r)return n;for(let t in r){let i=r[t];void 0!==i&&n.append(t,i)}return n}function tf({responseHeaders:t,isHttp:r,rangeChunkSize:n,disableRange:i}){let a={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(t.get("Content-Length"),10);return Number.isInteger(o)&&(a.suggestedLength=o,o<=2*n||i||!r||"bytes"!==t.get("Accept-Ranges")||"identity"!==(t.get("Content-Encoding")||"identity")||(a.allowRangeRequests=!0)),a}function tm(t){let r=t.get("Content-Disposition");if(r){let t=function(t){let r=!0,n=i("filename\\*","i").exec(t);if(n){let t=s(n=n[1]);return o(t=l(t=u(t=unescape(t))))}if(n=function(t){let r,n=[],a=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=a.exec(t));){let[,t,i,a]=r;if((t=parseInt(t,10))in n){if(0===t)break;continue}n[t]=[i,a]}let o=[];for(let t=0;t<n.length&&t in n;++t){let[r,i]=n[t];i=s(i),r&&(i=unescape(i),0===t&&(i=u(i))),o.push(i)}return o.join("")}(t))return o(l(n));if(n=i("filename","i").exec(t)){let t=s(n=n[1]);return o(t=l(t))}function i(t,r){return RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',r)}function a(t,n){if(t){if(!/^[\x00-\xFF]+$/.test(n))return n;try{let i=new TextDecoder(t,{fatal:!0}),a=W(n);n=i.decode(a),r=!1}catch{}}return n}function o(t){return r&&/[\x80-\xff]/.test(t)&&(t=a("utf-8",t),r&&(t=a("iso-8859-1",t))),t}function s(t){if(t.startsWith('"')){let r=t.slice(1).split('\\"');for(let t=0;t<r.length;++t){let n=r[t].indexOf('"');-1!==n&&(r[t]=r[t].slice(0,n),r.length=t+1),r[t]=r[t].replaceAll(/\\(.)/g,"$1")}t=r.join('"')}return t}function u(t){let r=t.indexOf("'");return -1===r?t:a(t.slice(0,r),t.slice(r+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,r,n,i){if("q"===n||"Q"===n)return a(r,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))}));try{i=atob(i)}catch{}return a(r,i)})}return""}(r);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if($(t))return t}return null}function th(t,r){return 404===t||0===t&&r.startsWith("file:")?new C('Missing PDF "'+r+'".'):new k(`Unexpected server response (${t}) while retrieving PDF "${r}".`,t)}function tp(t){return 200===t||206===t}function tg(t,r,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:r?"include":"same-origin",redirect:"follow"}}function tb(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(w(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class ty{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=td(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return S(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new tv(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;let n=new tM(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){for(let r of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))r.cancel(t)}}class tv{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;let r=t.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange;let n=new Headers(t.headers),i=r.url;fetch(i,tg(n,this._withCredentials,this._abortController)).then(r=>{if(!tp(r.status))throw th(r.status,i);this._reader=r.body.getReader(),this._headersCapability.resolve();let n=r.headers,{allowRangeRequests:a,suggestedLength:o}=tf({responseHeaders:n,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=o||this._contentLength,this._filename=tm(n),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new T("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:tb(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class tM{constructor(t,r,n){this._stream=t,this._reader=null,this._loaded=0;let i=t.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;let a=new Headers(t.headers);a.append("Range",`bytes=${r}-${n-1}`);let o=i.url;fetch(o,tg(a,this._withCredentials,this._abortController)).then(t=>{if(!tp(t.status))throw th(t.status,o);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:t,done:r}=await this._reader.read();return r?{value:t,done:r}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:tb(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class tj{constructor({url:t,httpHeaders:r,withCredentials:n}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=td(this.isHttp,r),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,r,n){let i={begin:t,end:r};for(let t in n)i[t]=n[t];return this.request(i)}requestFull(t){return this.request(t)}request(t){let r=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:r};for(let[t,n]of(r.open("GET",this.url),r.withCredentials=this.withCredentials,this.headers))r.setRequestHeader(t,n);return this.isHttp&&"begin"in t&&"end"in t?(r.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.expectedStatus=206):i.expectedStatus=200,r.responseType="arraybuffer",t.onError&&(r.onerror=function(n){t.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,n),r.onprogress=this.onProgress.bind(this,n),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,r.send(null),n}onProgress(t,r){let n=this.pendingRequests[t];n&&n.onProgress?.(r)}onStateChange(t,r){let n=this.pendingRequests[t];if(!n)return;let i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==i.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===i.status&&this.isHttp)return void n.onError?.(i.status);let a=i.status||200;if((200!==a||206!==n.expectedStatus)&&a!==n.expectedStatus)return void n.onError?.(i.status);let o=function(t){let r=t.response;return"string"!=typeof r?r:W(r).buffer}(i);if(206===a){let t=i.getResponseHeader("Content-Range"),r=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);n.onDone({begin:parseInt(r[1],10),chunk:o})}else o?n.onDone({begin:0,chunk:o}):n.onError?.(i.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){let r=this.pendingRequests[t].xhr;delete this.pendingRequests[t],r.abort()}}class tA{constructor(t){this._source=t,this._manager=new tj(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){let r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return S(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new tw(this._manager,this._source),this._fullRequestReader}getRangeReader(t,r){let n=new tI(this._manager,t,r);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(t){for(let r of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))r.cancel(t)}}class tw{constructor(t,r){this._manager=t;let n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=t.requestFull(n),this._headersCapability=Promise.withResolvers(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.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(){let t=this._fullRequestId,r=new Headers(this._manager.getRequestXhr(t).getAllResponseHeaders().trim().split(/[\r\n]+/).map(t=>{let[r,...n]=t.split(": ");return[r,n.join(": ")]})),{allowRangeRequests:n,suggestedLength:i}=tf({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=tm(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){for(let r of(this._storedError=th(t,this._url),this._headersCapability.reject(this._storedError),this._requests))r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.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};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let r of(this._done=!0,this._headersCapability.reject(t),this._requests))r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class tI{constructor(t,r,n){this._manager=t;let i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(r,n,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){let r=t.chunk;for(let t of(this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){for(let r of(this._storedError=th(t,this._url),this._requests))r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}let tS=/^[a-z][a-z0-9\-+.]+:/i;function tP(t,r,n){return"http:"===t.protocol?eR.get("http").request(t,{headers:r},n):eR.get("https").request(t,{headers:r},n)}class tN{constructor(t){this.source=t,this.url=function(t){return new URL(tS.test(t)?t:eR.get("url").pathToFileURL(t))}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.headers=td(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return S(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new tC(this):new tD(this),this._fullRequestReader}getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;let n=this.isFsUrl?new tk(this,t,r):new tL(this,t,r);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){for(let r of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))r.cancel(t)}}class tO{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;let r=t.source;this._contentLength=r.length,this._loaded=0,this._filename=null,this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream)return void this._error(t);this._readableStream.destroy(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 T("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class tx{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();let r=t.source;this._isStreamingSupported=!r.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream)return void this._error(t);this._readableStream.destroy(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)}}class tD extends tO{constructor(t){super(t);let r=Object.fromEntries(t.headers);this._request=tP(this._url,r,r=>{if(404===r.statusCode){let t=new C(`Missing PDF "${this._url}".`);this._storedError=t,this._headersCapability.reject(t);return}this._headersCapability.resolve(),this._setReadableStream(r);let n=new Headers(this._readableStream.headers),{allowRangeRequests:i,suggestedLength:a}=tf({responseHeaders:n,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=tm(n)}),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class tL extends tx{constructor(t,r,n){super(t);let i=Object.fromEntries(t.headers);i.Range=`bytes=${r}-${n-1}`,this._request=tP(this._url,i,t=>{if(404===t.statusCode){let t=new C(`Missing PDF "${this._url}".`);this._storedError=t;return}this._setReadableStream(t)}),this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class tC extends tO{constructor(t){super(t);let r=eR.get("fs");r.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=new C(`Missing PDF "${this._url}".`)),this._storedError=t,this._headersCapability.reject(t)})}}class tk extends tx{constructor(t,r,n){super(t);let i=eR.get("fs");this._setReadableStream(i.createReadStream(this._url,{start:r,end:n-1}))}}class tE{#tU=Promise.withResolvers();#em=null;#tX=!1;#tQ=!!globalThis.FontInspector?.enabled;#tJ=null;#tK=null;#tq=0;#t$=0;#t0=null;#t1=null;#t4=0;#t2=0;#t3=Object.create(null);#t5=[];#t9=null;#t6=[];#t8=new WeakMap;#t7=null;static #re=new Map;static #rt=new Map;static #rr=new WeakMap;static #rn=null;static #ri=new Set;constructor({textContentSource:t,container:r,viewport:n}){if(t instanceof ReadableStream)this.#t9=t;else if("object"==typeof t)this.#t9=new ReadableStream({start(r){r.enqueue(t),r.close()}});else throw Error('No "textContentSource" parameter specified.');this.#em=this.#t1=r,this.#t2=n.scale*(globalThis.devicePixelRatio||1),this.#t4=n.rotation,this.#tK={div:null,properties:null,ctx:null};let{pageWidth:i,pageHeight:a,pageX:o,pageY:s}=n.rawDims;this.#t7=[1,0,0,-1,-o,s+a],this.#t$=i,this.#tq=a,tE.#ra(),ed(r,n),this.#tU.promise.finally(()=>{tE.#ri.delete(this),this.#tK=null,this.#t3=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:t,isFirefox:r}=R.platform;return N(this,"fontFamilyMap",new Map([["sans-serif",`${t&&r?"Calibri, ":""}sans-serif`],["monospace",`${t&&r?"Lucida Console, ":""}monospace`]]))}render(){let t=()=>{this.#t0.read().then(({value:r,done:n})=>{if(n)return void this.#tU.resolve();this.#tJ??=r.lang,Object.assign(this.#t3,r.styles),this.#ro(r.items),t()},this.#tU.reject)};return this.#t0=this.#t9.getReader(),tE.#ri.add(this),t(),this.#tU.promise}update({viewport:t,onBefore:r=null}){let n=t.scale*(globalThis.devicePixelRatio||1),i=t.rotation;if(i!==this.#t4&&(r?.(),this.#t4=i,ed(this.#t1,{rotation:i})),n!==this.#t2){r?.(),this.#t2=n;let t={div:null,properties:null,ctx:tE.#rs(this.#tJ)};for(let r of this.#t6)t.properties=this.#t8.get(r),t.div=r,this.#ru(t)}}cancel(){let t=new T("TextLayer task cancelled.");this.#t0?.cancel(t).catch(()=>{}),this.#t0=null,this.#tU.reject(t)}get textDivs(){return this.#t6}get textContentItemsStr(){return this.#t5}#ro(t){if(this.#tX)return;this.#tK.ctx??=tE.#rs(this.#tJ);let r=this.#t6,n=this.#t5;for(let i of t){if(r.length>1e5){w("Ignoring additional textDivs for performance reasons."),this.#tX=!0;return}if(void 0===i.str){if("beginMarkedContentProps"===i.type||"beginMarkedContent"===i.type){let t=this.#em;this.#em=document.createElement("span"),this.#em.classList.add("markedContent"),null!==i.id&&this.#em.setAttribute("id",`${i.id}`),t.append(this.#em)}else"endMarkedContent"===i.type&&(this.#em=this.#em.parentNode);continue}n.push(i.str),this.#rl(i)}}#rl(t){let r,n,i=document.createElement("span"),a={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#t6.push(i);let o=_.transform(this.#t7,t.transform),s=Math.atan2(o[1],o[0]),u=this.#t3[t.fontName];u.vertical&&(s+=Math.PI/2);let l=this.#tQ&&u.fontSubstitution||u.fontFamily;l=tE.fontFamilyMap.get(l)||l;let c=Math.hypot(o[2],o[3]),d=c*tE.#rc(l,this.#tJ);0===s?(r=o[4],n=o[5]-d):(r=o[4]+d*Math.sin(s),n=o[5]-d*Math.cos(s));let f="calc(var(--scale-factor)*",m=i.style;this.#em===this.#t1?(m.left=`${(100*r/this.#t$).toFixed(2)}%`,m.top=`${(100*n/this.#tq).toFixed(2)}%`):(m.left=`${f}${r.toFixed(2)}px)`,m.top=`${f}${n.toFixed(2)}px)`),m.fontSize=`${f}${(tE.#rn*c).toFixed(2)}px)`,m.fontFamily=l,a.fontSize=c,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,this.#tQ&&(i.dataset.fontName=u.fontSubstitutionLoadedName||t.fontName),0!==s&&(a.angle=180/Math.PI*s);let h=!1;if(t.str.length>1)h=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){let r=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);r!==n&&Math.max(r,n)/Math.min(r,n)>1.5&&(h=!0)}if(h&&(a.canvasWidth=u.vertical?t.height:t.width),this.#t8.set(i,a),this.#tK.div=i,this.#tK.properties=a,this.#ru(this.#tK),a.hasText&&this.#em.append(i),a.hasEOL){let t=document.createElement("br");t.setAttribute("role","presentation"),this.#em.append(t)}}#ru(t){let{div:r,properties:n,ctx:i}=t,{style:a}=r,o="";if(tE.#rn>1&&(o=`scale(${1/tE.#rn})`),0!==n.canvasWidth&&n.hasText){let{fontFamily:t}=a,{canvasWidth:s,fontSize:u}=n;tE.#rd(i,u*this.#t2,t);let{width:l}=i.measureText(r.textContent);l>0&&(o=`scaleX(${s*this.#t2/l}) ${o}`)}0!==n.angle&&(o=`rotate(${n.angle}deg) ${o}`),o.length>0&&(a.transform=o)}static cleanup(){if(!(this.#ri.size>0)){for(let{canvas:t}of(this.#re.clear(),this.#rt.values()))t.remove();this.#rt.clear()}}static #rs(t=null){let r=this.#rt.get(t||="");if(!r){let n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=t,document.body.append(n),r=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#rt.set(t,r),this.#rr.set(r,{size:0,family:""})}return r}static #rd(t,r,n){let i=this.#rr.get(t);(r!==i.size||n!==i.family)&&(t.font=`${r}px ${n}`,i.size=r,i.family=n)}static #ra(){if(null!==this.#rn)return;let t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#rn=t.getBoundingClientRect().height,t.remove()}static #rc(t,r){let n=this.#re.get(t);if(n)return n;let i=this.#rs(r);i.canvas.width=i.canvas.height=30,this.#rd(i,30,t);let a=i.measureText(""),o=a.fontBoundingBoxAscent,s=Math.abs(a.fontBoundingBoxDescent);if(o){let r=o/(o+s);return this.#re.set(t,r),i.canvas.width=i.canvas.height=0,r}i.strokeStyle="red",i.clearRect(0,0,30,30),i.strokeText("g",0,0);let u=i.getImageData(0,0,30,30).data;s=0;for(let t=u.length-1-3;t>=0;t-=4)if(u[t]>0){s=Math.ceil(t/4/30);break}i.clearRect(0,0,30,30),i.strokeText("A",0,30),u=i.getImageData(0,0,30,30).data,o=0;for(let t=0,r=u.length;t<r;t+=4)if(u[t]>0){o=30-Math.floor(t/4/30);break}i.canvas.width=i.canvas.height=0;let l=o?o/(o+s):.8;return this.#re.set(t,l),l}}class tT{static textContent(t){let r=[],n={items:r,styles:Object.create(null)};return!function t(n){if(!n)return;let i=null,a=n.name;if("#text"===a)i=n.value;else{if(!tT.shouldBuildText(a))return;n?.attributes?.textContent?i=n.attributes.textContent:n.value&&(i=n.value)}if(null!==i&&r.push({str:i}),n.children)for(let r of n.children)t(r)}(t),n}static shouldBuildText(t){return"textarea"!==t&&"input"!==t&&"option"!==t&&"select"!==t}}let tz=o?class extends eL{_createCanvas(t,r){return eR.get("canvas").createCanvas(t,r)}}:class extends eL{constructor({ownerDocument:t=globalThis.document,enableHWA:r=!1}){super({enableHWA:r}),this._document=t}_createCanvas(t,r){let n=this._document.createElement("canvas");return n.width=t,n.height=r,n}},tW=o?class extends eC{async _fetch(t){return eY(t)}}:ek,tZ=o?class extends eE{}:class extends eE{#rf;#rm;#rh;#rp;#rg;#rb;#M=0;constructor({docId:t,ownerDocument:r=globalThis.document}){super(),this.#rp=t,this.#rg=r}get #A(){return this.#rm||=new Map}get #ry(){return this.#rb||=new Map}get #rv(){if(!this.#rh){let t=this.#rg.createElement("div"),{style:r}=t;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;let n=this.#rg.createElementNS(U,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#rh=this.#rg.createElementNS(U,"defs"),t.append(n),n.append(this.#rh),this.#rg.body.append(t)}return this.#rh}#rM(t){if(1===t.length){let r=t[0],n=Array(256);for(let t=0;t<256;t++)n[t]=r[t]/255;let i=n.join(",");return[i,i,i]}let[r,n,i]=t,a=Array(256),o=Array(256),s=Array(256);for(let t=0;t<256;t++)a[t]=r[t]/255,o[t]=n[t]/255,s[t]=i[t]/255;return[a.join(","),o.join(","),s.join(",")]}#rj(t){if(void 0===this.#rf){this.#rf="";let t=this.#rg.URL;t!==this.#rg.baseURI&&(q(t)?w('#createUrl: ignore "data:"-URL for performance reasons.'):this.#rf=t.split("#",1)[0])}return`url(${this.#rf}#${t})`}addFilter(t){if(!t)return"none";let r=this.#A.get(t);if(r)return r;let[n,i,a]=this.#rM(t),o=1===t.length?n:`${n}${i}${a}`;if(r=this.#A.get(o))return this.#A.set(t,r),r;let s=`g_${this.#rp}_transfer_map_${this.#M++}`,u=this.#rj(s);this.#A.set(t,u),this.#A.set(o,u);let l=this.#rA(s);return this.#rw(n,i,a,l),u}addHCMFilter(t,r){let n=`${t}-${r}`,i="base",a=this.#ry.get(i);if(a?.key===n||(a?(a.filter?.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},this.#ry.set(i,a)),!t||!r))return a.url;let o=this.#rI(t);t=_.makeHexColor(...o);let s=this.#rI(r);if(r=_.makeHexColor(...s),this.#rv.style.color="","#000000"===t&&"#ffffff"===r||t===r)return a.url;let u=Array(256);for(let t=0;t<=255;t++){let r=t/255;u[t]=r<=.03928?r/12.92:((r+.055)/1.055)**2.4}let l=u.join(","),c=`g_${this.#rp}_hcm_filter`,d=a.filter=this.#rA(c);this.#rw(l,l,l,d),this.#rS(d);let f=(t,r)=>{let n=o[t]/255,i=s[t]/255,a=Array(r+1);for(let t=0;t<=r;t++)a[t]=n+t/r*(i-n);return a.join(",")};return this.#rw(f(0,5),f(1,5),f(2,5),d),a.url=this.#rj(c),a.url}addAlphaFilter(t){let r=this.#A.get(t);if(r)return r;let[n]=this.#rM([t]),i=`alpha_${n}`;if(r=this.#A.get(i))return this.#A.set(t,r),r;let a=`g_${this.#rp}_alpha_map_${this.#M++}`,o=this.#rj(a);this.#A.set(t,o),this.#A.set(i,o);let s=this.#rA(a);return this.#rP(n,s),o}addLuminosityFilter(t){let r,n,i=this.#A.get(t||"luminosity");if(i)return i;if(t?([r]=this.#rM([t]),n=`luminosity_${r}`):n="luminosity",i=this.#A.get(n))return this.#A.set(t,i),i;let a=`g_${this.#rp}_luminosity_map_${this.#M++}`,o=this.#rj(a);this.#A.set(t,o),this.#A.set(n,o);let s=this.#rA(a);return this.#rN(s),t&&this.#rP(r,s),o}addHighlightHCMFilter(t,r,n,i,a){let o=`${r}-${n}-${i}-${a}`,s=this.#ry.get(t);if(s?.key===o||(s?(s.filter?.remove(),s.key=o,s.url="none",s.filter=null):(s={key:o,url:"none",filter:null},this.#ry.set(t,s)),!r||!n))return s.url;let[u,l]=[r,n].map(this.#rI.bind(this)),c=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[f,m]=[i,a].map(this.#rI.bind(this));d<c&&([c,d,f,m]=[d,c,m,f]),this.#rv.style.color="";let h=(t,r,n)=>{let i=Array(256),a=(d-c)/n,o=t/255,s=(r-t)/(255*n),u=0;for(let t=0;t<=n;t++){let r=Math.round(c+t*a),n=o+t*s;for(let t=u;t<=r;t++)i[t]=n;u=r+1}for(let t=u;t<256;t++)i[t]=i[u-1];return i.join(",")},p=`g_${this.#rp}_hcm_${t}_filter`,g=s.filter=this.#rA(p);return this.#rS(g),this.#rw(h(f[0],m[0],5),h(f[1],m[1],5),h(f[2],m[2],5),g),s.url=this.#rj(p),s.url}destroy(t=!1){t&&0!==this.#ry.size||(this.#rh&&(this.#rh.parentNode.parentNode.remove(),this.#rh=null),this.#rm&&(this.#rm.clear(),this.#rm=null),this.#M=0)}#rN(t){let r=this.#rg.createElementNS(U,"feColorMatrix");r.setAttribute("type","matrix"),r.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(r)}#rS(t){let r=this.#rg.createElementNS(U,"feColorMatrix");r.setAttribute("type","matrix"),r.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(r)}#rA(t){let r=this.#rg.createElementNS(U,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",t),this.#rv.append(r),r}#rO(t,r,n){let i=this.#rg.createElementNS(U,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",n),t.append(i)}#rw(t,r,n,i){let a=this.#rg.createElementNS(U,"feComponentTransfer");i.append(a),this.#rO(a,"feFuncR",t),this.#rO(a,"feFuncG",r),this.#rO(a,"feFuncB",n)}#rP(t,r){let n=this.#rg.createElementNS(U,"feComponentTransfer");r.append(n),this.#rO(n,"feFuncA",t)}#rI(t){return this.#rv.style.color=t,eu(getComputedStyle(this.#rv).getPropertyValue("color"))}},tR=o?class extends eT{async _fetch(t){return eY(t)}}:ez;function tY(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});let r=new tG,{docId:n}=r,i=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(o&&"string"==typeof t)return t}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,a=t.data?function(t){if(o&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw 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 W(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,s=t.httpHeaders||null,u=!0===t.withCredentials,l=t.password??null,c=t.range instanceof tH?t.range:null,d=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536,f=t.worker instanceof tU?t.worker:null,m=t.verbosity,h="string"!=typeof t.docBaseUrl||q(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,g=!1!==t.cMapPacked,b=t.CMapReaderFactory||tW,y="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,v=t.StandardFontDataFactory||tR,M=!0!==t.stopAtErrors,A=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,w=!1!==t.isEvalSupported,I="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!o,S="boolean"==typeof t.isChrome?t.isChrome:!R.platform.isFirefox&&"undefined"!=typeof window&&!!window?.chrome,P=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,N="boolean"==typeof t.disableFontFace?t.disableFontFace:o,O=!0===t.fontExtraProperties,x=!0===t.enableXfa,D=t.ownerDocument||globalThis.document,L=!0===t.disableRange,C=!0===t.disableStream,k=!0===t.disableAutoFetch,E=!0===t.pdfBug,T=t.CanvasFactory||tz,z=t.FilterFactory||tZ,Z=!0===t.enableHWA,Y=c?c.length:t.length??NaN,_="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!o&&!N,G="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:b===ek&&v===ez&&p&&y&&en(p,document.baseURI)&&en(y,document.baseURI);t.canvasFactory&&ea("`canvasFactory`-instance option, please use `CanvasFactory` instead."),t.filterFactory&&ea("`filterFactory`-instance option, please use `FilterFactory` instead."),Number.isInteger(m)&&(j=m);let H={canvasFactory:new T({ownerDocument:D,enableHWA:Z}),filterFactory:new z({docId:n,ownerDocument:D}),cMapReaderFactory:G?null:new b({baseUrl:p,isCompressed:g}),standardFontDataFactory:G?null:new v({baseUrl:y})};if(!f){let t={verbosity:m,port:e7.workerPort};r._worker=f=t.port?tU.fromPort(t):new tU(t)}let F={docId:n,apiVersion:"4.8.69",data:a,password:l,disableAutoFetch:k,rangeChunkSize:d,length:Y,docBaseUrl:h,enableXfa:x,evaluatorOptions:{maxImageSize:A,disableFontFace:N,ignoreErrors:M,isEvalSupported:w,isOffscreenCanvasSupported:I,isChrome:S,canvasMaxAreaInBytes:P,fontExtraProperties:O,useSystemFonts:_,cMapUrl:G?p:null,standardFontDataUrl:G?y:null}},V={disableFontFace:N,fontExtraProperties:O,ownerDocument:D,pdfBug:E,styleElement:null,loadingParams:{disableAutoFetch:k,enableXfa:x}};return f.promise.then(function(){let t;if(r.destroyed)throw Error("Loading aborted");if(f.destroyed)throw Error("Worker was destroyed");let l=f.messageHandler.sendWithPromise("GetDocRequest",F,a?[a.buffer]:null);if(c)t=new tu(c,{disableRange:L,disableStream:C});else if(!a){let r;if(!i)throw Error("getDocument - no `url` parameter provided.");t=new(o?"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&en(i)?ty:tN:en(i)?ty:tA)({url:i,length:Y,httpHeaders:s,withCredentials:u,rangeChunkSize:d,disableRange:L,disableStream:C})}return l.then(i=>{if(r.destroyed)throw Error("Loading aborted");if(f.destroyed)throw Error("Worker was destroyed");let a=new tn(n,i,f.port),o=new tX(a,r,t,V,H);r._transport=o,a.send("Ready",null)})}).catch(r._capability.reject),r}function t_(t){return"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class tG{static #rp=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${tG.#rp++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class tH{constructor(t,r,n=!1,i=null){this.length=t,this.initialData=r,this.progressiveDone=n,this.contentDispositionFilename=i,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,r){for(let n of this._rangeListeners)n(t,r)}onDataProgress(t,r){this._readyCapability.promise.then(()=>{for(let n of this._progressListeners)n(t,r)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(let r of this._progressiveReadListeners)r(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,r){I("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class tF{constructor(t,r){this._pdfInfo=t,this._transport=r}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return N(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({intent:t="display"}={}){let{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(r)}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(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class tV{#rx=null;#rD=!1;constructor(t,r,n,i=!1){this._pageIndex=t,this._pageInfo=r,this._transport=n,this._stats=i?new er:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new tJ,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({scale:t,rotation:r=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:a=!1}={}){return new J({viewBox:this.view,scale:t,rotation:r,offsetX:n,offsetY:i,dontFlip:a})}getAnnotations({intent:t="display"}={}){let{renderingIntent:r}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,r)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return N(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:r,intent:n="display",annotationMode:i=c.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:u=null,pageColors:d=null,printAnnotationStorage:f=null,isEditing:m=!1}){this._stats?.time("Overall");let h=this._transport.getRenderingIntent(n,i,f,m),{renderingIntent:p,cacheKey:g}=h;this.#rD=!1,this.#rL(),s||=this._transport.getOptionalContentConfig(p);let b=this._intentStates.get(g);b||(b=Object.create(null),this._intentStates.set(g,b)),b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);let y=!!(p&l.PRINT);b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(h));let v=t=>{b.renderTasks.delete(M),(this._maybeCleanupAfterRender||y)&&(this.#rD=!0),this.#rC(!y),t?(M.capability.reject(t),this._abortOperatorList({intentState:b,reason:t instanceof Error?t:Error(t)})):M.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},M=new tq({callback:v,params:{canvasContext:t,viewport:r,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:d});(b.renderTasks||=new Set).add(M);let j=M.task;return Promise.all([b.displayReadyCapability.promise,s]).then(([t,r])=>{if(this.destroyed)return void v();if(this._stats?.time("Rendering"),!(r.renderingIntent&p))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");M.initializeGraphics({transparency:t,optionalContentConfig:r}),M.operatorListChanged()}).catch(v),j}getOperatorList({intent:t="display",annotationMode:r=c.ENABLE,printAnnotationStorage:n=null,isEditing:i=!1}={}){let a,o=this._transport.getRenderingIntent(t,r,n,i,!0),s=this._intentStates.get(o.cacheKey);return s||(s=Object.create(null),this._intentStates.set(o.cacheKey,s)),s.opListReadCapability||((a=Object.create(null)).operatorListChanged=function(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(a))},s.opListReadCapability=Promise.withResolvers(),(s.renderTasks||=new Set).add(a),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(o)),s.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===r},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>tT.textContent(t));let r=this.streamTextContent(t);return new Promise(function(t,n){let i=r.getReader(),a={items:[],styles:Object.create(null),lang:null};!function r(){i.read().then(function({value:n,done:i}){if(i)return void t(a);a.lang??=n.lang,Object.assign(a.styles,n.styles),a.items.push(...n.items),r()},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let t=[];for(let r of this._intentStates.values())if(this._abortOperatorList({intentState:r,reason:Error("Page was destroyed."),force:!0}),!r.opListReadCapability)for(let n of r.renderTasks)t.push(n.completed),n.cancel();return this.objs.clear(),this.#rD=!1,this.#rL(),Promise.all(t)}cleanup(t=!1){this.#rD=!0;let r=this.#rC(!1);return t&&r&&(this._stats&&=new er),r}#rC(t=!1){if(this.#rL(),!this.#rD||this.destroyed)return!1;if(t)return this.#rx=setTimeout(()=>{this.#rx=null,this.#rC(!1)},5e3),!1;for(let{renderTasks:t,operatorList:r}of this._intentStates.values())if(t.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#rD=!1,!0}#rL(){this.#rx&&(clearTimeout(this.#rx),this.#rx=null)}_startRenderPage(t,r){let n=this._intentStates.get(r);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(t))}_renderPageChunk(t,r){for(let n=0,i=t.length;n<i;n++)r.operatorList.fnArray.push(t.fnArray[n]),r.operatorList.argsArray.push(t.argsArray[n]);for(let n of(r.operatorList.lastChunk=t.lastChunk,r.operatorList.separateAnnots=t.separateAnnots,r.renderTasks))n.operatorListChanged();t.lastChunk&&this.#rC(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:r,annotationStorageSerializable:n,modifiedIds:i}){let{map:a,transfer:o}=n,s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:r,annotationStorage:a,modifiedIds:i},o).getReader(),u=this._intentStates.get(r);u.streamReader=s;let l=()=>{s.read().then(({value:t,done:r})=>{if(r){u.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(t,u),l())},t=>{if(u.streamReader=null,!this._transport.destroyed){if(u.operatorList){for(let t of(u.operatorList.lastChunk=!0,u.renderTasks))t.operatorListChanged();this.#rC(!0)}if(u.displayReadyCapability)u.displayReadyCapability.reject(t);else if(u.opListReadCapability)u.opListReadCapability.reject(t);else throw t}})};l()}_abortOperatorList({intentState:t,reason:r,force:n=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(t.renderTasks.size>0)return;if(r instanceof K){let n=100;r.extraDelay>0&&r.extraDelay<1e3&&(n+=r.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:r,force:!0})},n);return}}if(t.streamReader.cancel(new T(r.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(let[r,n]of this._intentStates)if(n===t){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}}class tB{#rk=new Map;#rE=Promise.resolve();postMessage(t,r){let n={data:structuredClone(t,r?{transfer:r}:null)};this.#rE.then(()=>{for(let[t]of this.#rk)t.call(this,n)})}addEventListener(t,r,n=null){let i=null;if(n?.signal instanceof AbortSignal){let{signal:a}=n;if(a.aborted)return void w("LoopbackPort - cannot use an `aborted` signal.");let o=()=>this.removeEventListener(t,r);i=()=>a.removeEventListener("abort",o),a.addEventListener("abort",o)}this.#rk.set(r,i)}removeEventListener(t,r){let n=this.#rk.get(r);n?.(),this.#rk.delete(r)}terminate(){for(let[,t]of this.#rk)t?.();this.#rk.clear()}}class tU{static #rT=0;static #rz=!1;static #rW;static{o&&(this.#rz=!0,e7.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,r)=>{let n;try{if(!(n=new URL(t)).origin||"null"===n.origin)return!1}catch{return!1}let i=new URL(r,n);return n.origin===i.origin},this._createCDNWrapper=t=>{let r=`await import("${t}");`;return URL.createObjectURL(new Blob([r],{type:"text/javascript"}))}}constructor({name:t=null,port:r=null,verbosity:n=j}={}){if(this.name=t,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,r){if(tU.#rW?.has(r))throw Error("Cannot use more than one PDFWorker per port.");(tU.#rW||=new WeakMap).set(r,this),this._initializeFromPort(r);return}this._initialize()}get promise(){return o?Promise.all([eR.promise,this._readyCapability.promise]):this._readyCapability.promise}#rZ(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new tn("main","worker",t),this._messageHandler.on("ready",function(){}),this.#rZ()}_initialize(){if(tU.#rz||tU.#rR)return void this._setupFakeWorker();let{workerSrc:t}=tU;try{tU._isSameOrigin(window.location.href,t)||(t=tU._createCDNWrapper(new URL(t,window.location).href));let r=new Worker(t,{type:"module"}),n=new tn("main","worker",r),i=()=>{a.abort(),n.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},a=new AbortController;r.addEventListener("error",()=>{this._webWorker||i()},{signal:a.signal}),n.on("test",t=>{if(a.abort(),this.destroyed||!t)return void i();this._messageHandler=n,this._port=r,this._webWorker=r,this.#rZ()}),n.on("ready",t=>{if(a.abort(),this.destroyed)return void i();try{o()}catch{this._setupFakeWorker()}});let o=()=>{let t=new Uint8Array;n.send("test",t,[t.buffer])};o();return}catch{A("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){tU.#rz||(w("Setting up fake worker."),tU.#rz=!0),tU._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this._readyCapability.reject(Error("Worker was destroyed"));let r=new tB;this._port=r;let n=`fake${tU.#rT++}`,i=new tn(n+"_worker",n,r);t.setup(i,r),this._messageHandler=new tn(n,n+"_worker",r),this.#rZ()}).catch(t=>{this._readyCapability.reject(Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),tU.#rW?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw Error("PDFWorker.fromPort - invalid method signature.");let r=this.#rW?.get(t.port);if(r){if(r._pendingDestroy)throw Error(`PDFWorker.fromPort - the worker is being destroyed.
593
593
  Please remember to await \`PDFDocumentLoadingTask.destroy()\`-calls.`);return r}return new tU(t)}static get workerSrc(){if(e7.workerSrc)return e7.workerSrc;throw Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get #rR(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return N(this,"_setupFakeWorkerGlobal",(async()=>this.#rR?this.#rR:(await import(this.workerSrc)).WorkerMessageHandler)())}}class tX{#rY=new Map;#r_=new Map;#rG=new Map;#rH=new Map;#rF=null;constructor(t,r,n,i,a){this.messageHandler=t,this.loadingTask=r,this.commonObjs=new tJ,this.fontLoader=new ex({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#rV(t,r=null){let n=this.#rY.get(t);if(n)return n;let i=this.messageHandler.sendWithPromise(t,r);return this.#rY.set(t,i),i}get annotationStorage(){return N(this,"annotationStorage",new eN)}getRenderingIntent(t,r=c.ENABLE,n=null,i=!1,a=!1){let o=l.DISPLAY,s=eP;switch(t){case"any":o=l.ANY;break;case"display":break;case"print":o=l.PRINT;break;default:w(`getRenderingIntent - invalid intent: ${t}`)}let u=o&l.PRINT&&n instanceof eO?n:this.annotationStorage;switch(r){case c.DISABLE:o+=l.ANNOTATIONS_DISABLE;break;case c.ENABLE:break;case c.ENABLE_FORMS:o+=l.ANNOTATIONS_FORMS;break;case c.ENABLE_STORAGE:o+=l.ANNOTATIONS_STORAGE,s=u.serializable;break;default:w(`getRenderingIntent - invalid annotationMode: ${r}`)}i&&(o+=l.IS_EDITING),a&&(o+=l.OPLIST);let{ids:d,hash:f}=u.modifiedIds,m=[o,s.hash,f];return{renderingIntent:o,cacheKey:m.join("_"),annotationStorageSerializable:s,modifiedIds:d}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#rF?.reject(Error("Worker was destroyed during onPassword callback"));let t=[];for(let r of this.#r_.values())t.push(r._destroy());this.#r_.clear(),this.#rG.clear(),this.#rH.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let r=this.messageHandler.sendWithPromise("Terminate",null);return t.push(r),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#rY.clear(),this.filterFactory.destroy(),tE.cleanup(),this._networkStream?.cancelAllRequests(new T("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:t,loadingTask:r}=this;t.on("GetReader",(t,r)=>{S(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},r.onPull=()=>{this._fullReader.read().then(function({value:t,done:n}){if(n)return void r.close();S(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t])}).catch(t=>{r.error(t)})},r.onCancel=t=>{this._fullReader.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",async t=>{await this._fullReader.headersReady;let{isStreamingSupported:n,isRangeSupported:i,contentLength:a}=this._fullReader;return n&&i||(this._lastProgress&&r.onProgress?.(this._lastProgress),this._fullReader.onProgress=t=>{r.onProgress?.({loaded:t.loaded,total:t.total})}),{isStreamingSupported:n,isRangeSupported:i,contentLength:a}}),t.on("GetRangeReader",(t,r)=>{S(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let n=this._networkStream.getRangeReader(t.begin,t.end);if(!n)return void r.close();r.onPull=()=>{n.read().then(function({value:t,done:n}){if(n)return void r.close();S(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t])}).catch(t=>{r.error(t)})},r.onCancel=t=>{n.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,r._capability.resolve(new tF(t,this))}),t.on("DocException",function(t){let n;switch(t.name){case"PasswordException":n=new x(t.message,t.code);break;case"InvalidPDFException":n=new L(t.message);break;case"MissingPDFException":n=new C(t.message);break;case"UnexpectedResponseException":n=new k(t.message,t.status);break;case"UnknownErrorException":n=new D(t.message,t.details);break;default:I("DocException - expected a valid Error.")}r._capability.reject(n)}),t.on("PasswordRequest",t=>{if(this.#rF=Promise.withResolvers(),r.onPassword)try{r.onPassword(t=>{t instanceof Error?this.#rF.reject(t):this.#rF.resolve({password:t})},t.code)}catch(t){this.#rF.reject(t)}else this.#rF.reject(new x(t.message,t.code));return this.#rF.promise}),t.on("DataLoaded",t=>{r.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{this.destroyed||this.#r_.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",([r,n,i])=>{if(this.destroyed||this.commonObjs.has(r))return null;switch(n){case"Font":let{disableFontFace:a,fontExtraProperties:o,pdfBug:s}=this._params;if("error"in i){let t=i.error;w(`Error during font loading: ${t}`),this.commonObjs.resolve(r,t);break}let u=new eD(i,{disableFontFace:a,inspectFont:s&&globalThis.FontInspector?.enabled?(t,r)=>globalThis.FontInspector.fontAdded(t,r):null});this.fontLoader.bind(u).catch(()=>t.sendWithPromise("FontFallback",{id:r})).finally(()=>{!o&&u.data&&(u.data=null),this.commonObjs.resolve(r,u)});break;case"CopyLocalImage":let{imageRef:l}=i;for(let t of(S(l,"The imageRef must be defined."),this.#r_.values()))for(let[,n]of t.objs)if(n?.ref===l){if(!n.dataLen)return null;return this.commonObjs.resolve(r,structuredClone(n)),n.dataLen}break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,i);break;default:throw Error(`Got unknown common object type ${n}`)}return null}),t.on("obj",([t,r,n,i])=>{if(this.destroyed)return;let a=this.#r_.get(r);if(!a.objs.has(t)){if(0===a._intentStates.size)return void i?.bitmap?.close();switch(n){case"Image":a.objs.resolve(t,i),i?.dataLen>1e7&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(t,i);break;default:throw Error(`Got unknown object type ${n}`)}}}),t.on("DocProgress",t=>{this.destroyed||r.onProgress?.({loaded:t.loaded,total:t.total})}),t.on("FetchBuiltInCMap",async t=>{if(this.destroyed)throw Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(t)}),t.on("FetchStandardFontData",async t=>{if(this.destroyed)throw Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&w("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:t,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(Error("Invalid page request."));let r=t-1,n=this.#rG.get(r);if(n)return n;let i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(n=>{if(this.destroyed)throw Error("Transport destroyed");n.refStr&&this.#rH.set(n.refStr,t);let i=new tV(r,n,this,this._params.pdfBug);return this.#r_.set(r,i),i});return this.#rG.set(r,i),i}getPageIndex(t){return t_(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(Error("Invalid pageIndex request."))}getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}getFieldObjects(){return this.#rV("GetFieldObjects")}hasJSActions(){return this.#rV("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#rV("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#rV("GetOptionalContentConfig").then(r=>new ts(r,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let t="GetMetadata",r=this.#rY.get(t);if(r)return r;let n=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new ti(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#rY.set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){for(let t of(await this.messageHandler.sendWithPromise("Cleanup",null),this.#r_.values()))if(!t.cleanup())throw Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#rY.clear(),this.filterFactory.destroy(!0),tE.cleanup()}}cachedPageNumber(t){if(!t_(t))return null;let r=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#rH.get(r)??null}}let tQ=Symbol("INITIAL_DATA");class tJ{#rB=Object.create(null);#rU(t){return this.#rB[t]||={...Promise.withResolvers(),data:tQ}}get(t,r=null){if(r){let n=this.#rU(t);return n.promise.then(()=>r(n.data)),null}let n=this.#rB[t];if(!n||n.data===tQ)throw Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){let r=this.#rB[t];return!!r&&r.data!==tQ}resolve(t,r=null){let n=this.#rU(t);n.data=r,n.resolve()}clear(){for(let t in this.#rB){let{data:r}=this.#rB[t];r?.bitmap?.close()}this.#rB=Object.create(null)}*[Symbol.iterator](){for(let t in this.#rB){let{data:r}=this.#rB[t];r!==tQ&&(yield[t,r])}}}class tK{#rX=null;constructor(t){this.#rX=t,this.onContinue=null}get promise(){return this.#rX.capability.promise}cancel(t=0){this.#rX.cancel(null,t)}get separateAnnots(){let{separateAnnots:t}=this.#rX.operatorList;if(!t)return!1;let{annotationCanvasMap:r}=this.#rX;return t.form||t.canvas&&r?.size>0}}class tq{#rQ=null;static #rJ=new WeakSet;constructor({callback:t,params:r,objs:n,commonObjs:i,annotationCanvasMap:a,operatorList:o,pageIndex:s,canvasFactory:u,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:f=null}){this.callback=t,this.params=r,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=s,this.canvasFactory=u,this.filterFactory=l,this._pdfBug=d,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new tK(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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:r}){if(this.cancelled)return;if(this._canvas){if(tq.#rJ.has(this._canvas))throw Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");tq.#rJ.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:n,viewport:i,transform:a,background:o}=this.params;this.gfx=new e8(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:i,transparency:t,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,r=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#rQ&&(window.cancelAnimationFrame(this.#rQ),this.#rQ=null),tq.#rJ.delete(this._canvas),this.callback(t||new K(`Rendering cancelled, page ${this._pageIndex+1}`,r))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#rQ=window.requestAnimationFrame(()=>{this.#rQ=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(),tq.#rJ.delete(this._canvas),this.callback())))}}let t$="4.8.69",t0="3634dab10";function t1(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function t4(t){return Math.max(0,Math.min(255,255*t))}class t2{static CMYK_G([t,r,n,i]){return["G",1-Math.min(1,.3*t+.59*n+.11*r+i)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=t4(t),t,t]}static G_HTML([t]){let r=t1(t);return`#${r}${r}${r}`}static RGB_G([t,r,n]){return["G",.3*t+.59*r+.11*n]}static RGB_rgb(t){return t.map(t4)}static RGB_HTML(t){return`#${t.map(t1).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,r,n,i]){return["RGB",1-Math.min(1,t+i),1-Math.min(1,n+i),1-Math.min(1,r+i)]}static CMYK_rgb([t,r,n,i]){return[t4(1-Math.min(1,t+i)),t4(1-Math.min(1,n+i)),t4(1-Math.min(1,r+i))]}static CMYK_HTML(t){let r=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(r)}static RGB_CMYK([t,r,n]){let i=1-t,a=1-r,o=1-n,s=Math.min(i,a,o);return["CMYK",i,a,o,s]}}class t3{create(t,r,n=!1){if(t<=0||r<=0)throw Error("Invalid SVG dimensions");let i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${t}px`),i.setAttribute("height",`${r}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${r}`),i}createElement(t){if("string"!=typeof t)throw Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){I("Abstract method `_createSVG` called.")}}class t5 extends t3{_createSVG(t){return document.createElementNS(U,t)}}class t9{static setupStorage(t,r,n,i,a){let o=i.getValue(r,{value:null});switch(n.name){case"textarea":if(null!==o.value&&(t.textContent=o.value),"print"===a)break;t.addEventListener("input",t=>{i.setValue(r,{value:t.target.value})});break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(o.value===n.attributes.xfaOn?t.setAttribute("checked",!0):o.value===n.attributes.xfaOff&&t.removeAttribute("checked"),"print"===a)break;t.addEventListener("change",t=>{i.setValue(r,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==o.value&&t.setAttribute("value",o.value),"print"===a)break;t.addEventListener("input",t=>{i.setValue(r,{value:t.target.value})})}break;case"select":if(null!==o.value)for(let r of(t.setAttribute("value",o.value),n.children))r.attributes.value===o.value?r.attributes.selected=!0:r.attributes.hasOwnProperty("selected")&&delete r.attributes.selected;t.addEventListener("input",t=>{let n=t.target.options,a=-1===n.selectedIndex?"":n[n.selectedIndex].value;i.setValue(r,{value:a})})}}static setAttributes({html:t,element:r,storage:n=null,intent:i,linkService:a}){let{attributes:o}=r,s=t instanceof HTMLAnchorElement;for(let[r,n]of("radio"===o.type&&(o.name=`${o.name}-${i}`),Object.entries(o)))if(null!=n)switch(r){case"class":n.length&&t.setAttribute(r,n.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",n);break;case"style":Object.assign(t.style,n);break;case"textContent":t.textContent=n;break;default:s&&("href"===r||"newWindow"===r)||t.setAttribute(r,n)}s&&a.addLinkAttributes(t,o.href,o.newWindow),n&&o.dataId&&this.setupStorage(t,o.dataId,r,n)}static render(t){let r=t.annotationStorage,n=t.linkService,i=t.xfaHtml,a=t.intent||"display",o=document.createElement(i.name);i.attributes&&this.setAttributes({html:o,element:i,intent:a,linkService:n});let s="richText"!==a,u=t.div;if(u.append(o),t.viewport){let r=`matrix(${t.viewport.transform.join(",")})`;u.style.transform=r}s&&u.setAttribute("class","xfaLayer xfaFont");let l=[];if(0===i.children.length){if(i.value){let t=document.createTextNode(i.value);o.append(t),s&&tT.shouldBuildText(i.name)&&l.push(t)}return{textDivs:l}}let c=[[i,-1,o]];for(;c.length>0;){let[t,i,o]=c.at(-1);if(i+1===t.children.length){c.pop();continue}let u=t.children[++c.at(-1)[1]];if(null===u)continue;let{name:d}=u;if("#text"===d){let t=document.createTextNode(u.value);l.push(t),o.append(t);continue}let f=u?.attributes?.xmlns?document.createElementNS(u.attributes.xmlns,d):document.createElement(d);if(o.append(f),u.attributes&&this.setAttributes({html:f,element:u,storage:r,intent:a,linkService:n}),u.children?.length>0)c.push([u,-1,f]);else if(u.value){let t=document.createTextNode(u.value);s&&tT.shouldBuildText(d)&&l.push(t),f.append(t)}}for(let t of u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){let r=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=r,t.div.hidden=!1}}let t6=new WeakSet;function t8(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class t7{static create(t){switch(t.data.annotationType){case g.LINK:return new rt(t);case g.TEXT:return new rr(t);case g.WIDGET:switch(t.data.fieldType){case"Tx":return new ri(t);case"Btn":if(t.data.radioButton)return new rs(t);if(t.data.checkBox)return new ro(t);return new ru(t);case"Ch":return new rl(t);case"Sig":return new ra(t)}return new rn(t);case g.POPUP:return new rc(t);case g.FREETEXT:return new rf(t);case g.LINE:return new rm(t);case g.SQUARE:return new rh(t);case g.CIRCLE:return new rp(t);case g.POLYLINE:return new rg(t);case g.CARET:return new ry(t);case g.INK:return new rv(t);case g.POLYGON:return new rb(t);case g.HIGHLIGHT:return new rM(t);case g.UNDERLINE:return new rj(t);case g.SQUIGGLY:return new rA(t);case g.STRIKEOUT:return new rw(t);case g.STAMP:return new rI(t);case g.FILEATTACHMENT:return new rS(t);default:return new re(t)}}}class re{#rK=null;#rq=!1;#r$=null;constructor(t,{isRenderable:r=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=r,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,r&&(this.container=this._createContainer(n)),i&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:r,richText:n}){return!!(t?.str||r?.str||n?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return re._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#rK||={rect:this.data.rect.slice(0)};let{rect:r}=t;r&&this.#r0(r),this.#r$?.popup.updateEdited(t)}resetEdited(){this.#rK&&(this.#r0(this.#rK.rect),this.#r$?.popup.resetEdited(),this.#rK=null)}#r0(t){let{container:{style:r},data:{rect:n,rotation:i},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:o,pageX:s,pageY:u}}}}=this;n?.splice(0,4,...t);let{width:l,height:c}=t8(t);r.left=`${100*(t[0]-s)/a}%`,r.top=`${100*(o-t[3]+u)/o}%`,0===i?(r.width=`${100*l/a}%`,r.height=`${100*c/o}%`):this.setRotation(i)}_createContainer(t){let{data:r,parent:{page:n,viewport:i}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",r.id),this instanceof rn||(a.tabIndex=1e3);let{style:o}=a;if(o.zIndex=this.parent.zIndex++,r.alternativeText&&(a.title=r.alternativeText),r.noRotate&&a.classList.add("norotate"),!r.rect||this instanceof rc){let{rotation:t}=r;return r.hasOwnCanvas||0===t||this.setRotation(t,a),a}let{width:s,height:u}=t8(r.rect);if(!t&&r.borderStyle.width>0){o.borderWidth=`${r.borderStyle.width}px`;let t=r.borderStyle.horizontalCornerRadius,n=r.borderStyle.verticalCornerRadius;switch(t>0||n>0?o.borderRadius=`calc(${t}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`:this instanceof rs&&(o.borderRadius=`calc(${s}px * var(--scale-factor)) / calc(${u}px * var(--scale-factor))`),r.borderStyle.style){case b.SOLID:o.borderStyle="solid";break;case b.DASHED:o.borderStyle="dashed";break;case b.BEVELED:w("Unimplemented border style: beveled");break;case b.INSET:w("Unimplemented border style: inset");break;case b.UNDERLINE:o.borderBottomStyle="solid"}let i=r.borderColor||null;i?(this.#rq=!0,o.borderColor=_.makeHexColor(0|i[0],0|i[1],0|i[2])):o.borderWidth=0}let l=_.normalizeRect([r.rect[0],n.view[3]-r.rect[1]+n.view[1],r.rect[2],n.view[3]-r.rect[3]+n.view[1]]),{pageWidth:c,pageHeight:d,pageX:f,pageY:m}=i.rawDims;o.left=`${100*(l[0]-f)/c}%`,o.top=`${100*(l[1]-m)/d}%`;let{rotation:h}=r;return r.hasOwnCanvas||0===h?(o.width=`${100*s/c}%`,o.height=`${100*u/d}%`):this.setRotation(h,a),a}setRotation(t,r=this.container){let n,i;if(!this.data.rect)return;let{pageWidth:a,pageHeight:o}=this.parent.viewport.rawDims,{width:s,height:u}=t8(this.data.rect);t%180==0?(n=100*s/a,i=100*u/o):(n=100*u/a,i=100*s/o),r.style.width=`${n}%`,r.style.height=`${i}%`,r.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){let t=(t,r,n)=>{let i=n.detail[t],a=i[0],o=i.slice(1);n.target.style[r]=t2[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:t2[`${a}_rgb`](o)})};return N(this,"_commonActions",{display:t=>{let{display:r}=t.detail,n=r%2==1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===r||2===r})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:r}=t.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},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:r=>{t("bgColor","backgroundColor",r)},fillColor:r=>{t("fillColor","backgroundColor",r)},fgColor:r=>{t("fgColor","color",r)},textColor:r=>{t("textColor","color",r)},borderColor:r=>{t("borderColor","borderColor",r)},strokeColor:r=>{t("strokeColor","borderColor",r)},rotation:t=>{let r=t.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(t,r){let n=this._commonActions;for(let i of Object.keys(r.detail)){let a=t[i]||n[i];a?.(r)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;let r=this.annotationStorage.getRawValue(this.data.id);if(!r)return;let n=this._commonActions;for(let[i,a]of Object.entries(r)){let o=n[i];o&&(o({detail:{[i]:a},target:t}),delete r[i])}}_createQuadrilaterals(){let t;if(!this.container)return;let{quadPoints:r}=this.data;if(!r)return;let[n,i,a,o]=this.data.rect.map(t=>Math.fround(t));if(8===r.length){let[t,s,u,l]=r.subarray(2,6);if(a===t&&o===s&&n===u&&i===l)return}let{style:s}=this.container;if(this.#rq){let{borderColor:r,borderWidth:n}=s;s.borderWidth=0,t=["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="${r}" stroke-width="${n}">`],this.container.classList.add("hasBorder")}let u=a-n,l=o-i,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);let f=c.createElement("defs");d.append(f);let m=c.createElement("clipPath"),h=`clippath_${this.data.id}`;m.setAttribute("id",h),m.setAttribute("clipPathUnits","objectBoundingBox"),f.append(m);for(let i=2,a=r.length;i<a;i+=8){let a=r[i],s=r[i+1],d=r[i+2],f=r[i+3],h=c.createElement("rect"),p=(d-n)/u,g=(o-s)/l,b=(a-d)/u,y=(s-f)/l;h.setAttribute("x",p),h.setAttribute("y",g),h.setAttribute("width",b),h.setAttribute("height",y),m.append(h),t?.push(`<rect vector-effect="non-scaling-stroke" x="${p}" y="${g}" width="${b}" height="${y}"/>`)}this.#rq&&(t.push("</g></svg>')"),s.backgroundImage=t.join("")),this.container.append(d),this.container.style.clipPath=`url(#${h})`}_createPopup(){let{data:t}=this,r=this.#r$=new rc({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(r.render())}render(){I("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,r=null){let n=[];if(this._fieldObjects){let i=this._fieldObjects[t];if(i)for(let{page:t,id:a,exportValues:o}of i){if(-1===t||a===r)continue;let i="string"==typeof o?o:null,s=document.querySelector(`[data-element-id="${a}"]`);if(s&&!t6.has(s)){w(`_getElementsByName - element not allowed: ${a}`);continue}n.push({id:a,exportValue:i,domElement:s})}return n}for(let i of document.getElementsByName(t)){let{exportValue:t}=i,a=i.getAttribute("data-element-id");a!==r&&t6.has(i)&&n.push({id:a,exportValue:t,domElement:i})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(let r of t)r.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:t,data:{id:r}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:r})})}}class rt extends re{constructor(t,r=null){super(t,{isRenderable:!0,ignoreBorder:!!r?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){let{data:t,linkService:r}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let i=!1;return t.url?(r.addLinkAttributes(n,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(n,t.action),i=!0):t.attachment?(this.#r1(n,t.attachment,t.attachmentDest),i=!0):t.setOCGState?(this.#r4(n,t.setOCGState),i=!0):t.dest?(this._bindLink(n,t.dest),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),i=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(n,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(n),this.container}#r2(){this.container.setAttribute("data-internal-link","")}_bindLink(t,r){t.href=this.linkService.getDestinationHash(r),t.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||""===r)&&this.#r2()}_bindNamedAction(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(r),!1),this.#r2()}#r1(t,r,n=null){t.href=this.linkService.getAnchorUrl(""),r.description&&(t.title=r.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(r.content,r.filename,n),!1),this.#r2()}#r4(t,r){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(r),!1),this.#r2()}_bindJSAction(t,r){t.href=this.linkService.getAnchorUrl("");let n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let i of Object.keys(r.actions)){let a=n.get(i);a&&(t[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:i}}),!1))}t.onclick||(t.onclick=()=>!1),this.#r2()}_bindResetFormAction(t,r){let n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),this.#r2(),!this._fieldObjects){w('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(t.onclick=()=>!1);return}t.onclick=()=>{n?.();let{fields:t,refs:i,include:a}=r,o=[];if(0!==t.length||0!==i.length){let r=new Set(i);for(let n of t)for(let{id:t}of this._fieldObjects[n]||[])r.add(t);for(let t of Object.values(this._fieldObjects))for(let n of t)r.has(n.id)===a&&o.push(n)}else for(let t of Object.values(this._fieldObjects))o.push(...t);let s=this.annotationStorage,u=[];for(let t of o){let{id:r}=t;switch(u.push(r),t.type){case"text":{let n=t.defaultValue||"";s.setValue(r,{value:n});break}case"checkbox":case"radiobutton":{let n=t.defaultValue===t.exportValues;s.setValue(r,{value:n});break}case"combobox":case"listbox":{let n=t.defaultValue||"";s.setValue(r,{value:n});break}default:continue}let n=document.querySelector(`[data-element-id="${r}"]`);if(n){if(!t6.has(n)){w(`_bindResetFormAction - element not allowed: ${r}`);continue}n.dispatchEvent(new Event("resetform"))}}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}}),!1}}}class rr extends re{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let 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 rn extends re{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return R.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,r,n,i,a){n.includes("mouse")?t.addEventListener(n,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(n,t=>{if("blur"===n){if(!r.focused||!t.relatedTarget)return;r.focused=!1}else if("focus"===n){if(r.focused)return;r.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(t)}})})}_setEventListeners(t,r,n,i){for(let[a,o]of n)("Action"===o||this.data.actions?.[o])&&(("Focus"===o||"Blur"===o)&&(r||={focused:!1}),this._setEventListener(t,r,a,o,i),"Focus"!==o||this.data.actions?.Blur?"Blur"!==o||this.data.actions?.Focus||this._setEventListener(t,r,"focus","Focus",null):this._setEventListener(t,r,"blur","Blur",null))}_setBackgroundColor(t){let r=this.data.backgroundColor||null;t.style.backgroundColor=null===r?"transparent":_.makeHexColor(r[0],r[1],r[2])}_setTextStyle(t){let r,{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,a=t.style,o=t=>Math.round(10*t)/10;if(this.data.multiLine){let t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),n=Math.round(t/(1.35*i))||1;r=Math.min(i,o(t/n/1.35))}else r=Math.min(i,o(Math.abs(this.data.rect[3]-this.data.rect[1]-2)/1.35));a.fontSize=`calc(${r}px * var(--scale-factor))`,a.color=_.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(a.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,r){r?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",r)}}class ri extends rn{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,r,n,i){let a=this.annotationStorage;for(let o of this._getElementsByName(t.name,t.id))o.domElement&&(o.domElement[r]=n),a.setValue(o.id,{[i]:n})}render(){let t=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){let i=t.getValue(r,{value:this.data.fieldValue}),a=i.value||"",o=t.getValue(r,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let s=i.formattedValue||this.data.textContent?.join(`
594
594
  `)||null;s&&this.data.comb&&(s=s.replaceAll(/\s+/g,""));let u={userValue:a,formattedValue:s,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((n=document.createElement("textarea")).textContent=s??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):((n=document.createElement("input")).type="text",n.setAttribute("value",s??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),t6.add(n),n.setAttribute("data-element-id",r),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=1e3,this._setRequired(n,this.data.required),o&&(n.maxLength=o),n.addEventListener("input",i=>{t.setValue(r,{value:i.target.value}),this.setPropertyOnSiblings(n,"value",i.target.value,"value"),u.formattedValue=null}),n.addEventListener("resetform",t=>{let r=this.data.defaultFieldValue??"";n.value=u.userValue=r,u.formattedValue=null});let l=t=>{let{formattedValue:r}=u;null!=r&&(t.target.value=r),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",t=>{if(u.focused)return;let{target:r}=t;u.userValue&&(r.value=u.userValue),u.lastCommittedValue=r.value,u.commitKey=1,this.data.actions?.Focus||(u.focused=!0)}),n.addEventListener("updatefromsandbox",n=>{this.showElementAndHideCanvas(n.target),this._dispatchEventFromSandbox({value(n){u.userValue=n.detail.value??"",t.setValue(r,{value:u.userValue.toString()}),n.target.value=u.userValue},formattedValue(n){let{formattedValue:i}=n.detail;u.formattedValue=i,null!=i&&n.target!==document.activeElement&&(n.target.value=i),t.setValue(r,{formattedValue:i})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:n=>{let{charLimit:i}=n.detail,{target:a}=n;if(0===i)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",i);let o=u.userValue;o&&!(o.length<=i)&&(a.value=u.userValue=o=o.slice(0,i),t.setValue(r,{value:o}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:o,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}}))}},n)}),n.addEventListener("keydown",t=>{u.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(u.commitKey=3):n=2,-1===n)return;let{value:i}=t.target;u.lastCommittedValue!==i&&(u.lastCommittedValue=i,u.userValue=i,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:i,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});let i=l;l=null,n.addEventListener("blur",t=>{if(!u.focused||!t.relatedTarget)return;this.data.actions?.Blur||(u.focused=!1);let{value:n}=t.target;u.userValue=n,u.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:n,willCommit:!0,commitKey:u.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),i(t)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",t=>{u.lastCommittedValue=null;let{data:n,target:i}=t,{value:a,selectionStart:o,selectionEnd:s}=i,l=o,c=s;switch(t.inputType){case"deleteWordBackward":{let t=a.substring(0,o).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{let t=a.substring(o).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":o===s&&(l-=1);break;case"deleteContentForward":o===s&&(c+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:a,change:n||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(n,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(l&&n.addEventListener("blur",l),this.data.comb){let t=(this.data.rect[2]-this.data.rect[0])/o;n.classList.add("comb"),n.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else(n=document.createElement("div")).textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ra extends rn{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class ro extends rn{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let t=this.annotationStorage,r=this.data,n=r.id,i=t.getValue(n,{value:r.exportValue===r.fieldValue}).value;"string"==typeof i&&(i="Off"!==i,t.setValue(n,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let a=document.createElement("input");return t6.add(a),a.setAttribute("data-element-id",n),a.disabled=r.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=r.fieldName,i&&a.setAttribute("checked",!0),a.setAttribute("exportValue",r.exportValue),a.tabIndex=1e3,a.addEventListener("change",i=>{let{name:a,checked:o}=i.target;for(let i of this._getElementsByName(a,n)){let n=o&&i.exportValue===r.exportValue;i.domElement&&(i.domElement.checked=n),t.setValue(i.id,{value:n})}t.setValue(n,{value:o})}),a.addEventListener("resetform",t=>{let n=r.defaultFieldValue||"Off";t.target.checked=n===r.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({value(r){r.target.checked="Off"!==r.detail.value,t.setValue(n,{value:r.target.checked})}},r)}),this._setEventListeners(a,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(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class rs extends rn{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let t=this.annotationStorage,r=this.data,n=r.id,i=t.getValue(n,{value:r.fieldValue===r.buttonValue}).value;if("string"==typeof i&&(i=i!==r.buttonValue,t.setValue(n,{value:i})),i)for(let i of this._getElementsByName(r.fieldName,n))t.setValue(i.id,{value:!1});let a=document.createElement("input");if(t6.add(a),a.setAttribute("data-element-id",n),a.disabled=r.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=r.fieldName,i&&a.setAttribute("checked",!0),a.tabIndex=1e3,a.addEventListener("change",r=>{let{name:i,checked:a}=r.target;for(let r of this._getElementsByName(i,n))t.setValue(r.id,{value:!1});t.setValue(n,{value:a})}),a.addEventListener("resetform",t=>{let n=r.defaultFieldValue;t.target.checked=null!=n&&n===r.buttonValue}),this.enableScripting&&this.hasJSActions){let i=r.buttonValue;a.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({value:r=>{let a=i===r.detail.value;for(let i of this._getElementsByName(r.target.name)){let r=a&&i.id===n;i.domElement&&(i.domElement.checked=r),t.setValue(i.id,{value:r})}}},r)}),this._setEventListeners(a,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(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class ru extends rt{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){let t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");let r=t.lastChild;return this.enableScripting&&this.hasJSActions&&r&&(this._setDefaultPropertiesFromJS(r),r.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class rl extends rn{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let t=this.annotationStorage,r=this.data.id,n=t.getValue(r,{value:this.data.fieldValue}),i=document.createElement("select");t6.add(i),i.setAttribute("data-element-id",r),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=1e3;let a=this.data.combo&&this.data.options.length>0;for(let t of(!this.data.combo&&(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",t=>{let r=this.data.defaultFieldValue;for(let t of i.options)t.selected=t.value===r}),this.data.options)){let r=document.createElement("option");r.textContent=t.displayValue,r.value=t.exportValue,n.value.includes(t.exportValue)&&(r.setAttribute("selected",!0),a=!1),i.append(r)}let o=null;if(a){let t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),i.prepend(t),o=()=>{t.remove(),i.removeEventListener("input",o),o=null},i.addEventListener("input",o)}let s=t=>{let r=t?"value":"textContent",{options:n,multiple:a}=i;return a?Array.prototype.filter.call(n,t=>t.selected).map(t=>t[r]):-1===n.selectedIndex?null:n[n.selectedIndex][r]},u=s(!1),l=t=>{let r=t.target.options;return Array.prototype.map.call(r,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({value(n){o?.();let a=n.detail.value,l=new Set(Array.isArray(a)?a:[a]);for(let t of i.options)t.selected=l.has(t.value);t.setValue(r,{value:s(!0)}),u=s(!1)},multipleSelection(t){i.multiple=!0},remove(n){let a=i.options,o=n.detail.remove;a[o].selected=!1,i.remove(o),a.length>0&&-1===Array.prototype.findIndex.call(a,t=>t.selected)&&(a[0].selected=!0),t.setValue(r,{value:s(!0),items:l(n)}),u=s(!1)},clear(n){for(;0!==i.length;)i.remove(0);t.setValue(r,{value:null,items:[]}),u=s(!1)},insert(n){let{index:a,displayValue:o,exportValue:c}=n.detail.insert,d=i.children[a],f=document.createElement("option");f.textContent=o,f.value=c,d?d.before(f):i.append(f),t.setValue(r,{value:s(!0),items:l(n)}),u=s(!1)},items(n){let{items:a}=n.detail;for(;0!==i.length;)i.remove(0);for(let t of a){let{displayValue:r,exportValue:n}=t,a=document.createElement("option");a.textContent=r,a.value=n,i.append(a)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(r,{value:s(!0),items:l(n)}),u=s(!1)},indices(n){let i=new Set(n.detail.indices);for(let t of n.target.options)t.selected=i.has(t.index);t.setValue(r,{value:s(!0)}),u=s(!1)},editable(t){t.target.disabled=!t.detail.editable}},n)}),i.addEventListener("input",n=>{let i=s(!0),a=s(!1);t.setValue(r,{value:i}),n.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:u,change:a,changeEx:i,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,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)):i.addEventListener("input",function(n){t.setValue(r,{value:s(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class rc extends re{constructor(t){let{data:r,elements:n}=t;super(t,{isRenderable:re._hasPopupData(r)}),this.elements=n,this.popup=null}render(){this.container.classList.add("popupAnnotation");let t=this.popup=new rd({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}),r=[];for(let n of this.elements)n.popup=t,n.container.ariaHasPopup="dialog",r.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(t=>`${V}${t}`).join(",")),this.container}}class rd{#r3=this.#r5.bind(this);#r9=this.#r6.bind(this);#r8=this.#r7.bind(this);#ne=this.#nt.bind(this);#nr=null;#em=null;#nn=null;#ni=null;#na=null;#no=null;#ns=null;#nu=!1;#nl=null;#N=null;#nc=null;#nd=null;#nf=null;#rK=null;#nm=!1;constructor({container:t,color:r,elements:n,titleObj:i,modificationDate:a,contentsObj:o,richText:s,parent:u,rect:l,parentRect:c,open:d}){for(let d of(this.#em=t,this.#nf=i,this.#nn=o,this.#nd=s,this.#no=u,this.#nr=r,this.#nc=l,this.#ns=c,this.#na=n,this.#ni=eo.toDateObject(a),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup()),this.trigger))d.addEventListener("click",this.#ne),d.addEventListener("mouseenter",this.#r8),d.addEventListener("mouseleave",this.#r9),d.classList.add("popupTriggerArea");for(let t of n)t.container?.addEventListener("keydown",this.#r3);this.#em.hidden=!0,d&&this.#nt()}render(){if(this.#nl)return;let t=this.#nl=document.createElement("div");if(t.className="popup",this.#nr){let r=t.style.outlineColor=_.makeHexColor(...this.#nr);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`:t.style.backgroundColor=_.makeHexColor(...this.#nr.map(t=>Math.floor(.7*(255-t)+t)))}let r=document.createElement("span");r.className="header";let n=document.createElement("h1");if(r.append(n),{dir:n.dir,str:n.textContent}=this.#nf,t.append(r),this.#ni){let t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#ni.valueOf()})),r.append(t)}let i=this.#nh;if(i)t9.render({xfaHtml:i,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{let r=this._formatContents(this.#nn);t.append(r)}this.#em.append(t)}get #nh(){let t=this.#nd,r=this.#nn;return t?.str&&(!r?.str||r.str===t.str)&&this.#nd.html||null}get #np(){return this.#nh?.attributes?.style?.fontSize||0}get #ng(){return this.#nh?.attributes?.style?.color||null}#nb(t){let r=[],n={style:{color:this.#ng,fontSize:this.#np?`calc(${this.#np}px * var(--scale-factor))`:""}};for(let i of t.split(`